Implement form-associated custom elements and their ElementInternals (#31980)

* FACEs work, setFormValue test is awful so now has _mozilla backup

* 1. Impl Validatable in ElementInternals instead of HTMLElement. 2. Reuse the code in Validatable trait. 3. The form associated custom element is not a customized built-in element.

* add some comments

* support readonly attribute and complete barred from constraint validation

* Addressed the code review comments

* Updated the legacy-layout results

* Fixed the WPT failures in ElementInternals-validation.html

* Addressed the code review comments

* Review suggestions

* Fixed silly mistakes and update the test result outside elementinternals

* update the test results

---------

Co-authored-by: Patrick Shaughnessy <pshaughn@comcast.net>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
cathiechen 2024-04-11 15:17:11 +02:00 committed by GitHub
parent 2eb959a159
commit 4e4a4c0a28
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
67 changed files with 1641 additions and 619 deletions

View file

@ -1,3 +0,0 @@
[ElementInternals-NotSupportedError.html]
[Form-related operations and attributes should throw NotSupportedErrors for non-form-associated custom elements.]
expected: FAIL

View file

@ -1,2 +0,0 @@
[ElementInternals-form.html]
expected: ERROR

View file

@ -1,10 +0,0 @@
[ElementInternals-labels.html]
expected: ERROR
[LABEL association]
expected: FAIL
[LABEL click]
expected: FAIL
[ElementInternals.labels should throw NotSupportedError if the target element is not a form-associated custom element]
expected: FAIL

View file

@ -1,2 +0,0 @@
[ElementInternals-setFormValue-nullish-value.html]
expected: ERROR

View file

@ -1,5 +1,4 @@
[ElementInternals-setFormValue.html]
expected: ERROR
[Newline normalization - \\n\\r in value]
expected: FAIL
@ -221,6 +220,3 @@
[Newline normalization - \\n\\r in FormData filename (formdata)]
expected: FAIL
[ElementInternals.setFormValue() should throw NotSupportedError if the target element is not a form-associated custom element]
expected: FAIL

View file

@ -1,37 +1,6 @@
[ElementInternals-validation.html]
expected: ERROR
[willValidate]
expected: FAIL
[willValidate after upgrade]
expected: FAIL
[willValidate should throw NotSupportedError if the target element is not a form-associated custom element]
expected: FAIL
[validity and setValidity()]
expected: FAIL
["anchor" argument of setValidity()]
expected: FAIL
[checkValidity() should throw NotSupportedError if the target element is not a form-associated custom element]
expected: FAIL
[checkValidity()]
expected: FAIL
[reportValidity() should throw NotSupportedError if the target element is not a form-associated custom element]
expected: FAIL
[reportValidity()]
expected: FAIL
[Custom control affects validation at the owner form]
expected: FAIL
[Custom control affects :valid :invalid for FORM and FIELDSET]
expected: FAIL
[willValidate after upgrade (document.createElement)]
expected: FAIL

View file

@ -1,3 +0,0 @@
[fieldset-elements.html]
[Form associated custom elements should work with fieldset.elements]
expected: FAIL

View file

@ -1,3 +0,0 @@
[focusability.html]
[Focusability of form-associated custom elements]
expected: FAIL

View file

@ -1,2 +1,3 @@
[form-associated-callback.html]
expected: ERROR
[Updating "id" attribute of form element]
expected: FAIL

View file

@ -1,28 +1,3 @@
[form-disabled-callback.html]
expected: ERROR
[Adding/removing disabled content attribute]
expected: FAIL
[Relationship with FIELDSET]
expected: FAIL
[A disabled form-associated custom element should not submit an entry for it]
expected: FAIL
[Disabled attribute affects focus-capability]
expected: FAIL
[Upgrading an element with disabled content attribute]
expected: FAIL
[Toggling "disabled" attribute on a custom element inside disabled <fieldset> does not trigger a callback]
expected: FAIL
[Toggling "disabled" attribute on a <fieldset> does not trigger a callback on disabled custom element descendant]
expected: FAIL
[Callback triggered during a clone/append operation, with disabled state provided by ancestor]
expected: FAIL
[Callback triggered during a clone operation, with disabled state provided by ancestor]
expected: FAIL

View file

@ -1,9 +0,0 @@
[form-elements-namedItem.html]
[Form associated custom elements should work with document.forms.elements.namedItem()]
expected: FAIL
[Form associated custom elements should work with document.forms.elements.namedItem() after upgrading]
expected: FAIL
[Form associated custom elements should work with document.forms.elements.namedItem() after updating the name attribute]
expected: FAIL

View file

@ -1,9 +0,0 @@
[form-reset-callback.html]
[form.reset() should trigger formResetCallback]
expected: FAIL
[form.reset(): formResetCallback is called after reset of the last built-in form control and before the next statement.]
expected: FAIL
[Clicking a reset button invokes formResetCallback in a microtask]
expected: FAIL