sideshowbarker
6237824d99
Tests: Add a bunch of input-element tests (tests only, no code)
...
Importing these tests now because they are for input-element types that
have requirements related to the constraint-validation API — which we’ve
been implementing recently.
This commit only imports tests, without any changes to our code.
2025-05-06 09:46:49 +01:00
Hikmat Jafarli
bd9d489370
LibWeb: Re-evaluate the style block when the type attribute changes
Package the js repl as a binary artifact / build-and-package (arm64, macos-15, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (x86_64, ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
CI / Lagom (arm64, Sanitizer_CI, false, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (x86_64, Fuzzers_CI, false, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, false, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, true, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
2025-04-29 01:01:02 +02:00
Glenn Skrzypczak
d4076ec9fa
LibWeb/HTML: Signal a type change
...
Type changes are now signaled to radio buttons. This causes other radio
buttons in the group to be unchecked if the input element is a checked
radio button after the type change.
2025-04-23 07:20:02 +01:00
Glenn Skrzypczak
5f75558646
LibWeb/HTML: Correctly reset selection on type change
...
The selection now gets reset to the beginning of the control if the
type changes from an unselectable type to a selectable type.
2025-04-23 07:20:02 +01:00
Glenn Skrzypczak
9c758e5f65
LibWeb/HTML: Correctly parse milliseconds in time inputs
...
This commit brings the way we parse time inputs closer to the spec by
no longer ignoring milliseconds in time strings.
2025-04-19 07:09:36 -04:00
Glenn Skrzypczak
c0cbd439a2
LibWeb/HTML: Dispatch command events
...
Command events are now dispatched when buttons are activated. The
special commands for popovers and dialogs are also implemented.
2025-04-18 12:09:57 +01:00
Glenn Skrzypczak
cce7d8c0fb
LibWeb/HTML: Implement CommandEvent class
...
This implements the `CommandEvent` class.
2025-04-18 12:09:57 +01:00
Glenn Skrzypczak
ffe0b05abd
LibWeb/HTML: Add the commandForElement attribute to the button element
...
This commit adds the commandForElement attribute to the
button element. Executing commands is not implemented yet.
2025-04-18 12:09:57 +01:00
Glenn Skrzypczak
b2db07f002
LibWeb/HTML: Add the command attribute to the button element
...
This commit adds the getter and setter for the command attribute to the
button element. Executing commands is not implemented yet.
2025-04-18 12:09:57 +01:00
sideshowbarker
cfc1fd7305
LibWeb: Handle “default step”/“step scale factor” for more input types
...
This change adds “default step” and “step scale factor” handling for all
remaining HTMLInputElement input types for which the spec defines such
and that we didn’t yet have handling for.
2025-04-14 09:43:16 +01:00
Tim Ledbetter
e1f6a170d5
LibWeb: Invalidate style when media content attribute changes
...
Previously, we would only invalidate style when setting the `media` IDL
attribute; changing the attribute via `setAttribute()` and
`removeAttribute()` had no immediate effect.
2025-03-22 17:03:56 +01:00
Shannon Booth
894c51e8e7
LibWeb/HTML: Handle missing second component in datetime-local
...
We were previously not checking for EOF which meant we were not
handling seconds being missing in the time component.
2025-03-18 15:05:02 -04:00
Shannon Booth
a457ebeec5
LibWeb/HTML: Implement 'convert string to number' for datetime-local
2025-03-18 15:05:02 -04:00
sideshowbarker
4def3fe567
LibWeb: Implement string->number for type=datetime-local input elements
2025-03-10 10:34:01 +00:00
Tim Ledbetter
6178557a07
LibWeb: Implement the HTMLInputElement.list attribute
...
This returns the `HTMLDataListElement` pointed to by the `list`
content attribute.
2025-03-09 15:10:55 +00:00
sideshowbarker
cf1425d09e
LibWeb: Implement “suffering from overflow/underflow” for inputs
...
This change implements the requirements for the “suffering from an
overflow” and “suffering from an underflow” algorithms for
HTMLInputElement constraint validation.
2025-03-07 08:32:18 +00:00
Shannon Booth
21d26c5c3e
LibWeb/HTML: Implement valueAsNumber for 'time' input type
2025-03-06 09:01:18 -05:00
sideshowbarker
13f9670f20
LibWeb: Fix “step base” computation for HTMLInputElement
...
This change fixes a bug in our implementation of the “step base”
algorithm at https://html.spec.whatwg.org/#concept-input-min-zero . We
were using the “value” IDL/DOM attribute in a particular step, where the
spec instead actually requires using the “value” content attribute.
2025-03-06 09:00:22 -05:00
sideshowbarker
7df9e00650
LibWeb: Implement HTMLInputElement type=email constraint validation
...
This change implements HTMLInputElement type=email constraint validation
in conformance with the current spec requirements (which happens to also
produce behavior that’s interoperable with other existing engines).
2025-03-05 13:20:08 +00:00
sideshowbarker
38197916c3
LibWeb: Implement HTMLInputElement type=url constraint validation
...
This change implements HTMLInputElement type=url constraint validation
in such a way as to match the behavior in other existing engines (which
is, however, very different from what the spec currently requires).
2025-03-04 19:15:40 +00:00
Andreas Kling
6606eecce5
LibWeb: Invalidate style (and rule cache) on MediaList changes
...
This makes dynamic changes to a style sheet's media attribute actually
take effect immediately.
2025-03-04 19:07:40 +01:00
sideshowbarker
8b0f6cb876
LibWeb: Implement “convert a string to a number” for type=time inputs
2025-03-04 12:33:09 +00:00
sideshowbarker
d14856e3c5
LibWeb: Implement “suffering from a step mismatch” constraint validation
2025-03-04 08:21:51 +00:00
Tim Ledbetter
6aeb3e8839
LibWeb: Fire error event if HTMLTrackElement src is empty on load
...
Previously, we would hang while waiting for the track to load.
2025-03-01 08:24:59 -05:00
Tim Ledbetter
3fd1538191
LibWeb: Implement the HTMLInputElement pattern attribute
2025-02-27 21:46:08 +01:00
Gingeh
591c6b0f68
LibWeb: Update button/input activation behaviour to match spec
2025-02-27 12:42:57 +00:00
Tim Ledbetter
d114f13029
LibWeb/SVG: Respect script element type attribute
...
Previously, scripts would run regardless of the value of this attribute.
2025-02-26 16:08:35 +01:00
sideshowbarker
db7aa68340
LibWeb: Implement checkValidity() for HTMLSelectElement
...
This change adds an implementation of the checkValidity() method for
HTMLSelectElement.
2025-02-26 14:07:39 +00:00
Shannon Booth
9585c6c0c7
LibWeb/HTML: Implement valueAsNumber for 'date' input type
CI / Lagom (arm64, Sanitizer_CI, false, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (x86_64, Fuzzers_CI, false, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, false, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, true, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
2025-02-26 11:49:35 +01:00
devgianlu
b8f234719d
LibWeb: Support autocomplete attribute on form elements
...
Implement proper support for the `autocomplete` attribute in `input`,
`select` and `textarea` elements.
2025-02-26 07:01:14 +00:00
sideshowbarker
2d7080ecb3
LibWeb: Flip on checkValidity() for HTMLTextAreaElement
...
This is a simple change that just un-stubs our implementation of the
checkValidity() method for HTMLTextAreaElement.
2025-02-26 06:52:53 +00:00
sideshowbarker
e79319ad85
LibWeb: Implement the form-control willValidate property
...
This change — part of the HTML constraint-validation API (aka
“client-side form validation”) — implements the willValidate IDL/DOM
attribute/property for all form controls that support it.
2025-02-26 05:45:06 +00:00
sideshowbarker
7da5869b14
LibWeb: Implement HTMLInputElement::suffering_from_being_missing
...
This change implements all required “suffering from being missing”
constraints https://html.spec.whatwg.org/#suffering-from-being-missing
for HTMLInputElement.
2025-02-26 04:13:31 +00:00
Shannon Booth
6e257897f6
LibWeb/HTML: Implement <input> element valueAsNumber for 'week'
...
CI / Lagom (x86_64, Fuzzers_CI, false, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, false, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, true, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (arm64, Sanitizer_CI, false, macos-15, macOS, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
One point to note is that I am not entirely sure what the result
of the pre-existing valueAsNumber test should be for this strange
case which does not lie exactly on a week/day boundary. Chrome
gives a negative timestamp, which seems more wrong than the result
we give, and neither gecko or WebKit appear to support the 'week'
type. So I'm considering this result acceptable for now, and this
may be something that will need more WPT tests added in the future.
2025-02-22 19:09:41 +00:00
Shannon Booth
6c2ad49ed2
LibWeb/HTML: Implement <input> element valueAsNumber for 'month'
2025-02-22 19:09:41 +00:00
Shannon Booth
ea880ec8b5
Tests/LibWeb: Import <input> valueAsNumber WPT test
...
This speculatively includes the changes for the not-yet merged wpt#50592
merge request.
2025-02-22 19:09:41 +00:00
Sam Atkins
ff1ef07160
LibWeb/HTML: Update HTMLButtonElement.type to match spec changes
...
CI / Lagom (x86_64, Sanitizer_CI, false, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (x86_64, Fuzzers_CI, false, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (arm64, Sanitizer_CI, false, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, true, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
Corresponds to part of https://github.com/whatwg/html/pull/9841 and then
https://github.com/whatwg/html/pull/11047
Adding `Auto` as a type state feels a little odd, as it's not an actual
type allowed in HTML. However, it's the default state when the value is
missing or invalid, which works out the same, as long as we never
serialize "auto", which we don't.
2025-02-22 14:59:39 +00:00
Tim Ledbetter
08b5cae199
LibWeb: Don't prepare script when src attribute is removed
2025-02-22 10:14:57 +01:00
Psychpsyo
96bb250a4a
LibWeb: Import setCustomValidity related tests
2025-02-18 10:17:06 -07:00
Psychpsyo
a8004a77bb
LibWeb: Implement setCustomValidity IDL attribute
2025-02-18 10:17:06 -07:00
Psychpsyo
83c4e22247
LibWeb: Implement validity IDL attribute
2025-02-18 06:37:11 +00:00
Psychpsyo
14e354bc29
LibWeb: Implement playbackRate
2025-02-10 11:38:02 +00:00
Psychpsyo
bad7324307
LibWeb: Implement CSS validity pseudo-classes
2025-02-05 12:38:55 +00:00
Tim Ledbetter
3d20587911
LibWeb: Fetch source file when HTMLTrackElement src attribute changes
...
This commit begins to implement the track processing model. When the
`src` attribute is updated, we now fetch the given source file.
Currently, we always fire an `error` event once fetching is completed,
as we don't support processing the fetched data.
2025-01-15 20:59:18 +01:00
Shannon Booth
7b637b1eee
LibWeb/HTML: Only use maxlength <input> attribute when applicable
2025-01-15 11:41:39 +01:00
Tim Ledbetter
5b6f2bb23a
LibWeb: Set dirty checkedness flag when setting checked IDL attribute
...
This matches the behavior of other browsers, which always set the dirty
checkedness flag when setting checkedness, except when setting the
`checked` content attribute.
2025-01-11 11:13:32 +01:00
Tim Ledbetter
62ecff0b40
LibWeb: Report exceptions that occur during microtask callback
2024-12-19 15:25:08 +00:00
Tim Ledbetter
022141647a
LibWeb: Implement PopoverInvokerElement attribute change steps
...
PopoverInvokerElement's explicitly set attr-element should be set to
null whenever the value of the `popovertarget` content attribute is
changed.
2024-12-14 12:11:28 -08:00
sideshowbarker
583ca6af89
LibWeb: Implement <input type=checkbox switch> experimentally
...
In conformance with the requirements of the spec PR at
https://github.com/whatwg/html/pull/9546 , this change adds support for
the “switch” attribute for type=checkbox “input” elements — which is
shipping in Safari (since Safari 17.4). This change also implements
support for exposing it to AT users with role=switch.
2024-12-13 11:31:27 +00:00
Luke Warlow
fcf6cc27f2
LibWeb: Implement popover beforetoggle and toggle events
2024-12-12 15:10:33 -07:00