Title: [289812] trunk
Revision
289812
Author
[email protected]
Date
2022-02-15 07:20:03 -0800 (Tue, 15 Feb 2022)

Log Message

[Forms] Make sure the element's dirty checkedness flag is set to true when setting checked
https://bugs.webkit.org/show_bug.cgi?id=236497

Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

Update the test expectations as the tests are now passing.
* web-platform-tests/html/semantics/forms/the-input-element/cloning-steps-expected.txt:

Source/WebCore:

As per spec
https://html.spec.whatwg.org/multipage/input.html#the-input-element%3Aconcept-node-clone-ext,
"The checked IDL attribute allows scripts to manipulate the checkedness of an input element.
... on setting, it must set the element's checkedness to the new value and set the element's
dirty checkedness flag to true." This CL is to make sure this flag is set to true.

* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::setChecked):

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (289811 => 289812)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2022-02-15 15:10:58 UTC (rev 289811)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2022-02-15 15:20:03 UTC (rev 289812)
@@ -1,3 +1,13 @@
+2022-02-15  Ziran Sun  <[email protected]>
+
+        [Forms] Make sure the element's dirty checkedness flag is set to true when setting checked
+        https://bugs.webkit.org/show_bug.cgi?id=236497
+
+        Reviewed by Chris Dumez.
+
+        Update the test expectations as the tests are now passing.
+        * web-platform-tests/html/semantics/forms/the-input-element/cloning-steps-expected.txt:
+
 2022-02-14  Antti Koivisto  <[email protected]>
 
         [CSS Container Queries] Support range operators in size queries

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/cloning-steps-expected.txt (289811 => 289812)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/cloning-steps-expected.txt	2022-02-15 15:10:58 UTC (rev 289811)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/cloning-steps-expected.txt	2022-02-15 15:20:03 UTC (rev 289812)
@@ -2,47 +2,47 @@
 PASS input element's value should be cloned
 PASS input element's dirty value flag should be cloned, so setAttribute doesn't affect the cloned input's value
 PASS input[type=button] element's checkedness should be cloned
-FAIL input[type=button] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness assert_equals: expected false but got true
+PASS input[type=button] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness
 PASS input[type=checkbox] element's checkedness should be cloned
-FAIL input[type=checkbox] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness assert_equals: expected false but got true
+PASS input[type=checkbox] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness
 PASS input[type=color] element's checkedness should be cloned
-FAIL input[type=color] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness assert_equals: expected false but got true
+PASS input[type=color] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness
 PASS input[type=date] element's checkedness should be cloned
-FAIL input[type=date] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness assert_equals: expected false but got true
+PASS input[type=date] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness
 PASS input[type=datetime-local] element's checkedness should be cloned
-FAIL input[type=datetime-local] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness assert_equals: expected false but got true
+PASS input[type=datetime-local] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness
 PASS input[type=email] element's checkedness should be cloned
-FAIL input[type=email] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness assert_equals: expected false but got true
+PASS input[type=email] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness
 PASS input[type=file] element's checkedness should be cloned
-FAIL input[type=file] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness assert_equals: expected false but got true
+PASS input[type=file] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness
 PASS input[type=hidden] element's checkedness should be cloned
-FAIL input[type=hidden] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness assert_equals: expected false but got true
+PASS input[type=hidden] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness
 PASS input[type=image] element's checkedness should be cloned
-FAIL input[type=image] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness assert_equals: expected false but got true
+PASS input[type=image] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness
 PASS input[type=month] element's checkedness should be cloned
-FAIL input[type=month] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness assert_equals: expected false but got true
+PASS input[type=month] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness
 PASS input[type=number] element's checkedness should be cloned
-FAIL input[type=number] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness assert_equals: expected false but got true
+PASS input[type=number] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness
 PASS input[type=password] element's checkedness should be cloned
-FAIL input[type=password] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness assert_equals: expected false but got true
+PASS input[type=password] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness
 PASS input[type=radio] element's checkedness should be cloned
-FAIL input[type=radio] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness assert_equals: expected false but got true
+PASS input[type=radio] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness
 PASS input[type=range] element's checkedness should be cloned
-FAIL input[type=range] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness assert_equals: expected false but got true
+PASS input[type=range] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness
 PASS input[type=reset] element's checkedness should be cloned
-FAIL input[type=reset] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness assert_equals: expected false but got true
+PASS input[type=reset] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness
 PASS input[type=search] element's checkedness should be cloned
-FAIL input[type=search] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness assert_equals: expected false but got true
+PASS input[type=search] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness
 PASS input[type=submit] element's checkedness should be cloned
-FAIL input[type=submit] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness assert_equals: expected false but got true
+PASS input[type=submit] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness
 PASS input[type=tel] element's checkedness should be cloned
-FAIL input[type=tel] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness assert_equals: expected false but got true
+PASS input[type=tel] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness
 PASS input[type=text] element's checkedness should be cloned
-FAIL input[type=text] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness assert_equals: expected false but got true
+PASS input[type=text] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness
 PASS input[type=time] element's checkedness should be cloned
-FAIL input[type=time] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness assert_equals: expected false but got true
+PASS input[type=time] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness
 PASS input[type=url] element's checkedness should be cloned
-FAIL input[type=url] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness assert_equals: expected false but got true
+PASS input[type=url] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness
 PASS input[type=week] element's checkedness should be cloned
-FAIL input[type=week] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness assert_equals: expected false but got true
+PASS input[type=week] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness
 

Modified: trunk/Source/WebCore/ChangeLog (289811 => 289812)


--- trunk/Source/WebCore/ChangeLog	2022-02-15 15:10:58 UTC (rev 289811)
+++ trunk/Source/WebCore/ChangeLog	2022-02-15 15:20:03 UTC (rev 289812)
@@ -1,3 +1,19 @@
+2022-02-15  Ziran Sun  <[email protected]>
+
+        [Forms] Make sure the element's dirty checkedness flag is set to true when setting checked
+        https://bugs.webkit.org/show_bug.cgi?id=236497
+
+        Reviewed by Chris Dumez.
+
+        As per spec
+        https://html.spec.whatwg.org/multipage/input.html#the-input-element%3Aconcept-node-clone-ext,
+        "The checked IDL attribute allows scripts to manipulate the checkedness of an input element. 
+        ... on setting, it must set the element's checkedness to the new value and set the element's
+        dirty checkedness flag to true." This CL is to make sure this flag is set to true.
+
+        * html/HTMLInputElement.cpp:
+        (WebCore::HTMLInputElement::setChecked):
+
 2022-02-15  Martin Robinson  <[email protected]>
 
         Scrolling while focusing an element should take into account scroll margin

Modified: trunk/Source/WebCore/html/HTMLInputElement.cpp (289811 => 289812)


--- trunk/Source/WebCore/html/HTMLInputElement.cpp	2022-02-15 15:10:58 UTC (rev 289811)
+++ trunk/Source/WebCore/html/HTMLInputElement.cpp	2022-02-15 15:20:03 UTC (rev 289812)
@@ -978,6 +978,7 @@
 
 void HTMLInputElement::setChecked(bool isChecked)
 {
+    m_dirtyCheckednessFlag = true;
     if (checked() == isChecked)
         return;
 
@@ -985,7 +986,6 @@
 
     Style::PseudoClassChangeInvalidation checkedInvalidation(*this, CSSSelector::PseudoClassChecked, isChecked);
 
-    m_dirtyCheckednessFlag = true;
     m_isChecked = isChecked;
 
     if (RadioButtonGroups* buttons = radioButtonGroups())
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to