Skip to content

Implement :valid :invalid pseudo classes#26729

Merged
mrobinson merged 1 commit intoservo:masterfrom
tipowol:fix-10781
Jul 21, 2023
Merged

Implement :valid :invalid pseudo classes#26729
mrobinson merged 1 commit intoservo:masterfrom
tipowol:fix-10781

Conversation

@tipowol
Copy link
Copy Markdown
Contributor

@tipowol tipowol commented Jun 1, 2020

This pull request implements :valid :invalid pseudo classes. Radio button support is currently missing due to concerns about performance. I am willing to discuss how to implement it efficiently.


@highfive
Copy link
Copy Markdown

highfive commented Jun 1, 2020

Heads up! This PR modifies the following files:

  • @asajeffrey: components/script/dom/element.rs, components/script/dom/htmlfieldsetelement.rs, components/script/dom/htmltextareaelement.rs, components/script/dom/validitystate.rs, components/script/dom/htmloptgroupelement.rs and 6 more
  • @KiChjang: components/script/dom/element.rs, components/script/dom/htmlfieldsetelement.rs, components/script/dom/htmltextareaelement.rs, components/script/dom/validitystate.rs, components/script/dom/htmloptgroupelement.rs and 6 more
  • @emilio: components/style/servo/selector_parser.rs

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Jun 1, 2020
@jdm
Copy link
Copy Markdown
Member

jdm commented Jun 9, 2020

r? @Manishearth

@highfive highfive assigned Manishearth and unassigned SimonSapin Jun 9, 2020
Copy link
Copy Markdown
Member

@Manishearth Manishearth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, minor issue and then r=me

self.update_validity_state(ValidationFlags::CUSTOM_ERROR);
}

pub fn update_validity_state(&self, update_flags: ValidationFlags) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please document this function

@bors-servo
Copy link
Copy Markdown
Contributor

☔ The latest upstream changes (presumably #26902) made this pull request unmergeable. Please resolve the merge conflicts.

@highfive highfive added the S-needs-rebase There are merge conflict errors. label Jun 15, 2020
@jdm jdm added S-needs-code-changes Changes have not yet been made that were requested by a reviewer. and removed S-awaiting-review There is new code that needs to be reviewed. labels Jun 15, 2020
bors-servo added a commit that referenced this pull request Jul 2, 2020
Implement HTMLFormElement.requestSubmit()

<!-- Please describe your changes on the following line: -->
This PR contains an implementation of [HTMLFormElement.requestSubmit()](https://html.spec.whatwg.org/multipage/forms.html#dom-form-requestsubmit)

This is literally my first hundred lines of Rust code, so if I crossed a few sacred lines here and there, please go easy on me :)

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #23417

<!-- Either: -->
- [x] [WPT tests](https://github.com/servo/servo/blob/master/tests/wpt/web-platform-tests/html/semantics/forms/the-form-element/form-requestsubmit.html) for these changes
There are two tests that still fail because we don't support `:invalid` CSS selector (see #10781). I verified that they pass if you change them to not use `:invalid`. Should be unlocked by #26729.

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
bors-servo added a commit that referenced this pull request Jul 2, 2020
Implement HTMLFormElement.requestSubmit()

<!-- Please describe your changes on the following line: -->
This PR contains an implementation of [HTMLFormElement.requestSubmit()](https://html.spec.whatwg.org/multipage/forms.html#dom-form-requestsubmit)

This is literally my first hundred lines of Rust code, so if I crossed a few sacred lines here and there, please go easy on me :)

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #23417

<!-- Either: -->
- [x] [WPT tests](https://github.com/servo/servo/blob/master/tests/wpt/web-platform-tests/html/semantics/forms/the-form-element/form-requestsubmit.html) for these changes
There are two tests that still fail because we don't support `:invalid` CSS selector (see #10781). I verified that they pass if you change them to not use `:invalid`. Should be unlocked by #26729.

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
@mrobinson
Copy link
Copy Markdown
Member

This was basically ready to go, so I've rebased it and done a bit of cleanup, including adding the documentation that was requested above. Here's the diff with the rebased version:

Diff from simple rebase:
diff --git a/components/script/dom/htmlbuttonelement.rs b/components/script/dom/htmlbuttonelement.rs
index b341b15361..14f5d6abca 100755
--- a/components/script/dom/htmlbuttonelement.rs
+++ b/components/script/dom/htmlbuttonelement.rs
@@ -243,7 +243,7 @@ impl VirtualMethods for HTMLButtonElement {
                 }
                 el.update_sequentially_focusable_status();
                 self.validity_state()
-                    .update_validity_state(ValidationFlags::all());
+                    .perform_validation_and_update(ValidationFlags::all());
             },
             &local_name!("type") => match mutation {
                 AttributeMutation::Set(_) => {
@@ -254,7 +254,7 @@ impl VirtualMethods for HTMLButtonElement {
                     };
                     self.button_type.set(value);
                     self.validity_state()
-                        .update_validity_state(ValidationFlags::all());
+                        .perform_validation_and_update(ValidationFlags::all());
                 },
                 AttributeMutation::Removed => {
                     self.button_type.set(ButtonType::Submit);
@@ -263,7 +263,7 @@ impl VirtualMethods for HTMLButtonElement {
             &local_name!("form") => {
                 self.form_attribute_mutated(mutation);
                 self.validity_state()
-                    .update_validity_state(ValidationFlags::empty());
+                    .perform_validation_and_update(ValidationFlags::empty());
             },
             _ => {},
         }
diff --git a/components/script/dom/htmlformelement.rs b/components/script/dom/htmlformelement.rs
index 78448f8f49..7594026046 100644
--- a/components/script/dom/htmlformelement.rs
+++ b/components/script/dom/htmlformelement.rs
@@ -1059,7 +1059,7 @@ impl HTMLFormElement {
                     };
                     validatable
                         .validity_state()
-                        .update_validity_state(ValidationFlags::all());
+                        .perform_validation_and_update(ValidationFlags::all());
                     if !validatable.is_instance_validatable() {
                         None
                     } else if validatable.validity_state().invalid_flags().is_empty() {
diff --git a/components/script/dom/htmlinputelement.rs b/components/script/dom/htmlinputelement.rs
index 1173f050ec..f0e16612c9 100755
--- a/components/script/dom/htmlinputelement.rs
+++ b/components/script/dom/htmlinputelement.rs
@@ -1297,7 +1297,7 @@ impl HTMLInputElementMethods for HTMLInputElement {
         }
 
         self.validity_state()
-            .update_validity_state(ValidationFlags::all());
+            .perform_validation_and_update(ValidationFlags::all());
         self.upcast::<Node>().dirty(NodeDamage::OtherNodeDamage);
         Ok(())
     }
@@ -2473,7 +2473,7 @@ impl VirtualMethods for HTMLInputElement {
         }
 
         self.validity_state()
-            .update_validity_state(ValidationFlags::all());
+            .perform_validation_and_update(ValidationFlags::all());
     }
 
     fn parse_plain_attribute(&self, name: &LocalName, value: DOMString) -> AttrValue {
@@ -2502,7 +2502,7 @@ impl VirtualMethods for HTMLInputElement {
             .check_ancestors_disabled_state_for_form_control();
 
         self.validity_state()
-            .update_validity_state(ValidationFlags::all());
+            .perform_validation_and_update(ValidationFlags::all());
     }
 
     fn unbind_from_tree(&self, context: &UnbindContext) {
@@ -2520,7 +2520,7 @@ impl VirtualMethods for HTMLInputElement {
         }
 
         self.validity_state()
-            .update_validity_state(ValidationFlags::all());
+            .perform_validation_and_update(ValidationFlags::all());
     }
 
     // This represents behavior for which the UIEvents spec and the
@@ -2622,7 +2622,7 @@ impl VirtualMethods for HTMLInputElement {
         }
 
         self.validity_state()
-            .update_validity_state(ValidationFlags::all());
+            .perform_validation_and_update(ValidationFlags::all());
     }
 
     // https://html.spec.whatwg.org/multipage/#the-input-element%3Aconcept-node-clone-ext
@@ -2644,7 +2644,7 @@ impl VirtualMethods for HTMLInputElement {
             .borrow_mut()
             .set_content(self.textinput.borrow().get_content());
         elem.validity_state()
-            .update_validity_state(ValidationFlags::all());
+            .perform_validation_and_update(ValidationFlags::all());
     }
 }
 
diff --git a/components/script/dom/htmloptgroupelement.rs b/components/script/dom/htmloptgroupelement.rs
index 13e34beb22..0f737bcd52 100644
--- a/components/script/dom/htmloptgroupelement.rs
+++ b/components/script/dom/htmloptgroupelement.rs
@@ -66,7 +66,7 @@ impl HTMLOptGroupElement {
         {
             select
                 .validity_state()
-                .update_validity_state(ValidationFlags::all());
+                .perform_validation_and_update(ValidationFlags::all());
         }
     }
 }
@@ -140,7 +140,7 @@ impl VirtualMethods for HTMLOptGroupElement {
         {
             select
                 .validity_state()
-                .update_validity_state(ValidationFlags::all());
+                .perform_validation_and_update(ValidationFlags::all());
         }
     }
 }
diff --git a/components/script/dom/htmloptionelement.rs b/components/script/dom/htmloptionelement.rs
index 94ee83b646..d11b221f0d 100644
--- a/components/script/dom/htmloptionelement.rs
+++ b/components/script/dom/htmloptionelement.rs
@@ -180,7 +180,7 @@ impl HTMLOptionElement {
         {
             select
                 .validity_state()
-                .update_validity_state(ValidationFlags::all());
+                .perform_validation_and_update(ValidationFlags::all());
         }
     }
 }
@@ -356,7 +356,7 @@ impl VirtualMethods for HTMLOptionElement {
         {
             select
                 .validity_state()
-                .update_validity_state(ValidationFlags::all());
+                .perform_validation_and_update(ValidationFlags::all());
             select.ask_for_reset();
         }
 
diff --git a/components/script/dom/htmlselectelement.rs b/components/script/dom/htmlselectelement.rs
index 267c8feeb1..0cfda5bfaa 100755
--- a/components/script/dom/htmlselectelement.rs
+++ b/components/script/dom/htmlselectelement.rs
@@ -349,7 +349,7 @@ impl HTMLSelectElementMethods for HTMLSelectElement {
         }
 
         self.validity_state()
-            .update_validity_state(ValidationFlags::VALUE_MISSING);
+            .perform_validation_and_update(ValidationFlags::VALUE_MISSING);
     }
 
     // https://html.spec.whatwg.org/multipage/#dom-select-selectedindex
@@ -419,7 +419,7 @@ impl VirtualMethods for HTMLSelectElement {
         match attr.local_name() {
             &local_name!("required") => {
                 self.validity_state()
-                    .update_validity_state(ValidationFlags::VALUE_MISSING);
+                    .perform_validation_and_update(ValidationFlags::VALUE_MISSING);
             },
             &local_name!("disabled") => {
                 let el = self.upcast::<Element>();
@@ -436,7 +436,7 @@ impl VirtualMethods for HTMLSelectElement {
                 }
 
                 self.validity_state()
-                    .update_validity_state(ValidationFlags::VALUE_MISSING);
+                    .perform_validation_and_update(ValidationFlags::VALUE_MISSING);
             },
             &local_name!("form") => {
                 self.form_attribute_mutated(mutation);
diff --git a/components/script/dom/htmltextareaelement.rs b/components/script/dom/htmltextareaelement.rs
index e316edd97b..db21db49b1 100755
--- a/components/script/dom/htmltextareaelement.rs
+++ b/components/script/dom/htmltextareaelement.rs
@@ -342,7 +342,7 @@ impl HTMLTextAreaElementMethods for HTMLTextAreaElement {
         }
 
         self.validity_state()
-            .update_validity_state(ValidationFlags::all());
+            .perform_validation_and_update(ValidationFlags::all());
         self.upcast::<Node>().dirty(NodeDamage::OtherNodeDamage);
     }
 
@@ -539,7 +539,7 @@ impl VirtualMethods for HTMLTextAreaElement {
         }
 
         self.validity_state()
-            .update_validity_state(ValidationFlags::all());
+            .perform_validation_and_update(ValidationFlags::all());
     }
 
     fn bind_to_tree(&self, context: &BindContext) {
@@ -551,7 +551,7 @@ impl VirtualMethods for HTMLTextAreaElement {
             .check_ancestors_disabled_state_for_form_control();
 
         self.validity_state()
-            .update_validity_state(ValidationFlags::all());
+            .perform_validation_and_update(ValidationFlags::all());
     }
 
     fn parse_plain_attribute(&self, name: &LocalName, value: DOMString) -> AttrValue {
@@ -586,7 +586,7 @@ impl VirtualMethods for HTMLTextAreaElement {
         }
 
         self.validity_state()
-            .update_validity_state(ValidationFlags::all());
+            .perform_validation_and_update(ValidationFlags::all());
     }
 
     // The cloning steps for textarea elements must propagate the raw value
@@ -607,7 +607,7 @@ impl VirtualMethods for HTMLTextAreaElement {
             textinput.set_content(self.textinput.borrow().get_content());
         }
         el.validity_state()
-            .update_validity_state(ValidationFlags::all());
+            .perform_validation_and_update(ValidationFlags::all());
     }
 
     fn children_changed(&self, mutation: &ChildrenMutation) {
@@ -680,7 +680,7 @@ impl VirtualMethods for HTMLTextAreaElement {
         }
 
         self.validity_state()
-            .update_validity_state(ValidationFlags::all());
+            .perform_validation_and_update(ValidationFlags::all());
     }
 
     fn pop(&self) {
diff --git a/components/script/dom/validitystate.rs b/components/script/dom/validitystate.rs
index 732a98c39c..2af3843c20 100755
--- a/components/script/dom/validitystate.rs
+++ b/components/script/dom/validitystate.rs
@@ -96,15 +96,15 @@ impl ValidityState {
     // https://html.spec.whatwg.org/multipage/#custom-validity-error-message
     pub fn set_custom_error_message(&self, error: DOMString) {
         *self.custom_error_message.borrow_mut() = error;
-        self.perform_validation(ValidationFlags::CUSTOM_ERROR);
+        self.perform_validation_and_update(ValidationFlags::CUSTOM_ERROR);
     }
 
     /// Given a set of [ValidationFlags], recalculate their value by performing
-    /// validation on this [ValidityStates]'s associated element. If a [custom
-    /// error](https://html.spec.whatwg.org/multipage/#suffering-from-a-custom-error)
-    /// is encountered during validation that will be added to this state's set
-    /// of flags.
-    pub fn perform_validation(&self, update_flags: ValidationFlags) {
+    /// validation on this [ValidityState]'s associated element. Additionally,
+    /// if [ValidationFlags::CUSTOM_ERROR] is in `update_flags` and a custom
+    /// error has been set on this [ValidityState], the state will be updated
+    /// to reflect the existance of a custom error.
+    pub fn perform_validation_and_update(&self, update_flags: ValidationFlags) {
         let mut invalid_flags = self.invalid_flags.get();
         invalid_flags.remove(update_flags);
 
@@ -114,10 +114,10 @@ impl ValidityState {
         }
 
         // https://html.spec.whatwg.org/multipage/#suffering-from-a-custom-error
-        if update_flags.contains(ValidationFlags::CUSTOM_ERROR) {
-            if !self.custom_error_message().is_empty() {
-                invalid_flags.insert(ValidationFlags::CUSTOM_ERROR);
-            }
+        if update_flags.contains(ValidationFlags::CUSTOM_ERROR) &&
+            !self.custom_error_message().is_empty()
+        {
+            invalid_flags.insert(ValidationFlags::CUSTOM_ERROR);
         }
 
         self.invalid_flags.set(invalid_flags);
diff --git a/tests/wpt/meta-legacy-layout/html/semantics/forms/constraints/input-pattern-dynamic-value.html.ini b/tests/wpt/meta-legacy-layout/html/semantics/forms/constraints/input-pattern-dynamic-value.html.ini
deleted file mode 100644
index 6d133b8ec6..0000000000
--- a/tests/wpt/meta-legacy-layout/html/semantics/forms/constraints/input-pattern-dynamic-value.html.ini
+++ /dev/null
@@ -1,4 +0,0 @@
-[input-pattern-dynamic-value.html]
-  [input validation is updated after pattern attribute change]
-    expected: FAIL
-
diff --git a/tests/wpt/meta-legacy-layout/html/semantics/forms/constraints/radio-valueMissing.html.ini b/tests/wpt/meta-legacy-layout/html/semantics/forms/constraints/radio-valueMissing.html.ini
new file mode 100644
index 0000000000..056a42422d
--- /dev/null
+++ b/tests/wpt/meta-legacy-layout/html/semantics/forms/constraints/radio-valueMissing.html.ini
@@ -0,0 +1,3 @@
+[radio-valueMissing.html]
+  [One of the radios is required and another one is checked]
+    expected: FAIL
diff --git a/tests/wpt/meta-legacy-layout/html/semantics/forms/form-submission-0/form-submit-iframe-then-location-navigate.html.ini b/tests/wpt/meta-legacy-layout/html/semantics/forms/form-submission-0/form-submit-iframe-then-location-navigate.html.ini
deleted file mode 100644
index 74e9d711ff..0000000000
--- a/tests/wpt/meta-legacy-layout/html/semantics/forms/form-submission-0/form-submit-iframe-then-location-navigate.html.ini
+++ /dev/null
@@ -1,4 +0,0 @@
-[form-submit-iframe-then-location-navigate.html]
-  expected: TIMEOUT
-  [Verifies that location navigations take precedence when following form submissions.]
-    expected: TIMEOUT
diff --git a/tests/wpt/meta-legacy-layout/html/semantics/forms/form-submission-0/text-plain.window.js.ini b/tests/wpt/meta-legacy-layout/html/semantics/forms/form-submission-0/text-plain.window.js.ini
index 2ed4e05524..b095623783 100644
--- a/tests/wpt/meta-legacy-layout/html/semantics/forms/form-submission-0/text-plain.window.js.ini
+++ b/tests/wpt/meta-legacy-layout/html/semantics/forms/form-submission-0/text-plain.window.js.ini
@@ -5,9 +5,6 @@
   [text/plain: Basic File test (normal form)]
     expected: FAIL
 
-  [text/plain: 0x00 in name (normal form)]
-    expected: FAIL
-
   [text/plain: 0x00 in value (normal form)]
     expected: FAIL
 
diff --git a/tests/wpt/meta-legacy-layout/html/semantics/forms/the-fieldset-element/fieldset-intrinsic-size.html.ini b/tests/wpt/meta-legacy-layout/html/semantics/forms/the-fieldset-element/fieldset-intrinsic-size.html.ini
index a0e9a63e84..9c19e44bb7 100644
--- a/tests/wpt/meta-legacy-layout/html/semantics/forms/the-fieldset-element/fieldset-intrinsic-size.html.ini
+++ b/tests/wpt/meta-legacy-layout/html/semantics/forms/the-fieldset-element/fieldset-intrinsic-size.html.ini
@@ -1,3 +1,6 @@
 [fieldset-intrinsic-size.html]
-  [min-content content-box]
+  [max-content content-box]
+    expected: FAIL
+
+  [max-content border-box]
     expected: FAIL
diff --git a/tests/wpt/meta-legacy-layout/html/semantics/forms/the-form-element/form-requestsubmit.html.ini b/tests/wpt/meta-legacy-layout/html/semantics/forms/the-form-element/form-requestsubmit.html.ini
deleted file mode 100644
index 4f05392b2e..0000000000
--- a/tests/wpt/meta-legacy-layout/html/semantics/forms/the-form-element/form-requestsubmit.html.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[form-requestsubmit.html]
-  [The value of the submitter should be appended, and form* attributes of the submitter should be handled.]
-    expected: FAIL
-
-  [requestSubmit() should trigger interactive form validation]
-    expected: FAIL
diff --git a/tests/wpt/meta-legacy-layout/html/semantics/forms/the-input-element/pattern_attribute.html.ini b/tests/wpt/meta-legacy-layout/html/semantics/forms/the-input-element/pattern_attribute.html.ini
index 23bcf08fd4..55a105a7c6 100644
--- a/tests/wpt/meta-legacy-layout/html/semantics/forms/the-input-element/pattern_attribute.html.ini
+++ b/tests/wpt/meta-legacy-layout/html/semantics/forms/the-input-element/pattern_attribute.html.ini
@@ -2,18 +2,6 @@
   [pattern attribute support on input element]
     expected: FAIL
 
-  [basic <input pattern> support]
-    expected: FAIL
-
-  [<input pattern> is Unicode code point-aware]
-    expected: FAIL
-
-  [<input pattern> supports Unicode property escape syntax]
-    expected: FAIL
-
-  [<input pattern> supports Unicode property escape syntax for properties of strings]
-    expected: FAIL
-
   [<input pattern> supports set difference syntax]
     expected: FAIL
 
diff --git a/tests/wpt/meta-legacy-layout/html/semantics/forms/the-input-element/radio.html.ini b/tests/wpt/meta-legacy-layout/html/semantics/forms/the-input-element/radio.html.ini
new file mode 100644
index 0000000000..e6320078ac
--- /dev/null
+++ b/tests/wpt/meta-legacy-layout/html/semantics/forms/the-input-element/radio.html.ini
@@ -0,0 +1,3 @@
+[radio.html]
+  [Radio buttons in an orphan tree should make a group]
+    expected: FAIL
diff --git a/tests/wpt/meta-legacy-layout/html/semantics/forms/the-output-element/output-validity.html.ini b/tests/wpt/meta-legacy-layout/html/semantics/forms/the-output-element/output-validity.html.ini
deleted file mode 100644
index 28d4f01369..0000000000
--- a/tests/wpt/meta-legacy-layout/html/semantics/forms/the-output-element/output-validity.html.ini
+++ /dev/null
@@ -1,3 +0,0 @@
-[output-validity.html]
-  [:valid and :invalid pseudo-class on output element]
-    expected: FAIL
diff --git a/tests/wpt/meta-legacy-layout/html/semantics/forms/the-select-element/select-validity.html.ini b/tests/wpt/meta-legacy-layout/html/semantics/forms/the-select-element/select-validity.html.ini
new file mode 100644
index 0000000000..348da577e8
--- /dev/null
+++ b/tests/wpt/meta-legacy-layout/html/semantics/forms/the-select-element/select-validity.html.ini
@@ -0,0 +1,3 @@
+[select-validity.html]
+  [Remove and add back the placeholder label option]
+    expected: FAIL

@mrobinson
Copy link
Copy Markdown
Member

@bors-servo try=wpt

@bors-servo
Copy link
Copy Markdown
Contributor

⌛ Trying commit a4cd0c7 with merge 05559b4...

bors-servo added a commit that referenced this pull request Jul 21, 2023
Implement :valid :invalid pseudo classes

<!-- Please describe your changes on the following line: -->
This pull request implements :valid :invalid pseudo classes. Radio button support is currently missing due to concerns about performance. I am willing to discuss how to implement it efficiently.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #10781
- [X] There are tests for these changes
@github-actions
Copy link
Copy Markdown

Test results for linux-wpt-layout-2013 from try job (#5620735309):

Flaky unexpected result (18)
  • OK /_mozilla/mozilla/task_queue_throttling.any.html (#22519)
    • FAIL [expected PASS] subtest: Throttling the performance timeline task queue. assert_true: expected true got false
  • TIMEOUT [expected OK] /_webgl/conformance/glsl/misc/shader-uniform-packing-restrictions.html (#28103)
    • NOTRUN [expected PASS] subtest: Overall test
  • TIMEOUT [expected OK] /_webgl/conformance/glsl/misc/shader-with-non-reserved-words.html (#16216)
    • NOTRUN [expected PASS] subtest: Overall test
  • TIMEOUT [expected OK] /_webgl/conformance/uniforms/out-of-bounds-uniform-array-access.html (#26225)
    • NOTRUN [expected PASS] subtest: Overall test
  • OK /css/CSS2/linebox/inline-negative-margin-001.html (#23862)
    • PASS [expected FAIL] subtest: [data-expected-height] 1
    • PASS [expected FAIL] subtest: [data-expected-height] 2
    • FAIL [expected PASS] subtest: [data-expected-height] 4 assert_equals:
      <div class="w4" data-expected-height="10">123 <span style="margin-left: -4ch">123 </span></div>
      height expected 10 but got 20
  • TIMEOUT [expected PASS] /css/css-variables/variable-reference-27.html
  • OK /html/browsers/browsing-the-web/navigating-across-documents/empty-iframe-load-event.html (#29066)
    • FAIL [expected PASS] subtest: Check execution order from nested timeout assert_equals: Expected nested setTimeout to run second expected true but got false
    • FAIL [expected PASS] subtest: Check execution order on load handler assert_equals: Expected onload to run first expected false but got true
  • OK /html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/load-pageshow-events-iframe-contentWindow.html (#28681)
    • FAIL [expected PASS] subtest: load & pageshow events do not fire on contentWindow of <iframe> element created with src='' assert_unreached: load should not be fired Reached unreachable code
    • FAIL [expected PASS] subtest: load & pageshow events do not fire on contentWindow of <iframe> element created with src='about:blank' assert_unreached: load should not be fired Reached unreachable code
  • OK /html/browsers/browsing-the-web/navigating-across-documents/navigate-to-unparseable-url.html (#29050)
    • PASS [expected FAIL] subtest: <a> tag navigate fails for unparseable URLs
  • OK /html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/a-click.html (#28697)
    • PASS [expected FAIL] subtest: aElement.click() before the load event must NOT replace
  • FAIL [expected TIMEOUT] /html/canvas/element/manual/drawing-text-to-the-canvas/canvas.2d.disconnected.html (#29224)
  • TIMEOUT [expected OK] /html/interaction/focus/the-autofocus-attribute/document-with-fragment-top.html (#28259)
    • TIMEOUT [expected FAIL] subtest: Autofocus elements in top-level browsing context's documents with "top" fragments should work. Test timed out
  • TIMEOUT [expected OK] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-3.html (#24066)
    • NOTRUN [expected FAIL] subtest: Check that popups from a sandboxed iframe do not escape the sandbox
  • TIMEOUT [expected OK] /html/webappapis/dynamic-markup-insertion/opening-the-input-stream/remove-initial-about-blankness.window.html (#28684)
    • TIMEOUT [expected FAIL] subtest: Double-check: without document.open(), Window reuse indeed happens Test timed out
  • TIMEOUT /html/webappapis/scripting/events/compile-event-handler-settings-objects.html (#24246)
    • TIMEOUT [expected FAIL] subtest: The entry settings object while executing the compiled callback via Web IDL's invoke must be that of the node document Test timed out
  • TIMEOUT [expected OK] /html/webappapis/scripting/processing-model-2/integration-with-the-javascript-job-queue/promise-job-entry-different-function-realm.html (#25805)
    • TIMEOUT [expected FAIL] subtest: Fulfillment handler on fulfilled promise Test timed out
  • OK [expected TIMEOUT] /webmessaging/with-ports/017.html (#24486)
    • PASS [expected TIMEOUT] subtest: origin of the script that invoked the method, about:blank
  • OK [expected TIMEOUT] /webstorage/localstorage-about-blank-3P-iframe-opens-3P-window.partitioned.tentative.html (#29053)
    • PASS [expected TIMEOUT] subtest: StorageKey: test 3P about:blank window opened from a 3P iframe
Stable unexpected results that are known to be intermittent (21)
Stable unexpected results (3)
  • OK /dom/nodes/Element-closest.html
    • PASS [expected FAIL] subtest: Element.closest with context node 'test11' and selector ':invalid'
  • OK /html/semantics/forms/the-fieldset-element/fieldset-intrinsic-size.html
    • FAIL [expected PASS] subtest: min-content content-box assert_equals: expected 187.79999999999998 but got 187.8
    • PASS [expected FAIL] subtest: max-content content-box
    • PASS [expected FAIL] subtest: max-content border-box
  • OK /html/semantics/selectors/pseudo-classes/valid-invalid-fieldset-disconnected.html
    • PASS [expected FAIL] subtest: <input> element becomes invalid inside disconnected <fieldset>
    • PASS [expected FAIL] subtest: <select> element becomes valid inside disconnected <fieldset>

@mrobinson mrobinson enabled auto-merge July 21, 2023 10:20
@mrobinson mrobinson added this pull request to the merge queue Jul 21, 2023
Merged via the queue into servo:master with commit 5f2c6c0 Jul 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-needs-code-changes Changes have not yet been made that were requested by a reviewer. S-needs-rebase There are merge conflict errors.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement the :valid and :invalid pseudo-classes

7 participants