Title: [200009] releases/WebKitGTK/webkit-2.12
Revision
200009
Author
[email protected]
Date
2016-04-25 06:49:50 -0700 (Mon, 25 Apr 2016)

Log Message

Merge r199607 - ASSERT when loading github.com
https://bugs.webkit.org/show_bug.cgi?id=156604
<rdar://problem/19890634>

Reviewed by Darin Adler.

Source/WebCore:

HTMLFormControlElement::m_isValid is a cache of the results of the valid() function.
When cloning the node, we were preserving each individual item, but not the state
of the cache. Therefore, the cache and the attributes didn't agree with each other.

Test: fast/forms/checkValidity-cloneNode-crash.html

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

LayoutTests:

* fast/forms/checkValidity-cloneNode-crash-expected.txt: Added.
* fast/forms/checkValidity-cloneNode-crash.html: Added.

Modified Paths

Added Paths

Diff

Modified: releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog (200008 => 200009)


--- releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog	2016-04-25 13:42:08 UTC (rev 200008)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog	2016-04-25 13:49:50 UTC (rev 200009)
@@ -1,3 +1,14 @@
+2016-04-15  Myles C. Maxfield  <[email protected]>
+
+        ASSERT when loading github.com
+        https://bugs.webkit.org/show_bug.cgi?id=156604
+        <rdar://problem/19890634>
+
+        Reviewed by Darin Adler.
+
+        * fast/forms/checkValidity-cloneNode-crash-expected.txt: Added.
+        * fast/forms/checkValidity-cloneNode-crash.html: Added.
+
 2016-04-15  Brent Fulgham  <[email protected]>
 
         Remove support for X-Frame-Options in `<meta>`

Added: releases/WebKitGTK/webkit-2.12/LayoutTests/fast/forms/checkValidity-cloneNode-crash-expected.txt (0 => 200009)


--- releases/WebKitGTK/webkit-2.12/LayoutTests/fast/forms/checkValidity-cloneNode-crash-expected.txt	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/fast/forms/checkValidity-cloneNode-crash-expected.txt	2016-04-25 13:49:50 UTC (rev 200009)
@@ -0,0 +1,17 @@
+This test makes sure that calling checkValidity() on a cloned node does not crash a Debug build. The test passes if there is no crash (and if you don't see any 'FAIL's)
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS element.checkValidity() is true
+PASS element2.checkValidity() is true
+PASS element.checkValidity() is true
+PASS element2.checkValidity() is true
+PASS element.checkValidity() is true
+PASS element2.checkValidity() is false
+PASS element.checkValidity() is true
+PASS element2.checkValidity() is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: releases/WebKitGTK/webkit-2.12/LayoutTests/fast/forms/checkValidity-cloneNode-crash.html (0 => 200009)


--- releases/WebKitGTK/webkit-2.12/LayoutTests/fast/forms/checkValidity-cloneNode-crash.html	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/fast/forms/checkValidity-cloneNode-crash.html	2016-04-25 13:49:50 UTC (rev 200009)
@@ -0,0 +1,60 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<script>
+description("This test makes sure that calling checkValidity() on a cloned node does not crash a Debug build. The test passes if there is no crash (and if you don't see any 'FAIL's)");
+
+var element;
+var element2;
+
+function checkInputElement() {
+    element = document.createElement("input");
+    element.required = true;
+    element.value = "hi"
+    shouldBeTrue("element.checkValidity()");
+    element2 = element.cloneNode();
+    shouldBeTrue("element2.checkValidity()");
+}
+
+function checkDeepSelect() {
+    element = document.createElement("select")
+    element.innerHTML =   "<option>Volvo</option><option>Saab</option><option>Opel</option>";
+    element.required=true;
+    shouldBeTrue("element.checkValidity()");
+    element2 = element.cloneNode(true);
+    shouldBeTrue("element2.checkValidity()");
+}
+
+function checkShallowSelect() {
+    element = document.createElement("select")
+    element.innerHTML =   "<option>Volvo</option><option>Saab</option><option>Opel</option>";
+    element.required = true;
+    shouldBeTrue("element.checkValidity()");
+    element2 = element.cloneNode();
+    shouldBeFalse("element2.checkValidity()");
+}
+
+function checkTextArea() {
+    element = document.createElement("textarea")
+    element.required = true;
+    element.checkValidity();
+    element.value = "a";
+    shouldBeTrue("element.checkValidity()");
+    element2 = element.cloneNode();
+    // https://bugs.webkit.org/show_bug.cgi?id=156637 will fix this bug.
+    // shouldBeTrue("element2.checkValidity()");
+    element2.value = element.value;
+    shouldBeTrue("element2.checkValidity()");
+}
+
+checkInputElement();
+checkDeepSelect();
+checkShallowSelect();
+checkTextArea();
+</script>
+<script src=""
+</body>
+</html>

Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog (200008 => 200009)


--- releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog	2016-04-25 13:42:08 UTC (rev 200008)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog	2016-04-25 13:49:50 UTC (rev 200009)
@@ -1,3 +1,20 @@
+2016-04-15  Myles C. Maxfield  <[email protected]>
+
+        ASSERT when loading github.com
+        https://bugs.webkit.org/show_bug.cgi?id=156604
+        <rdar://problem/19890634>
+
+        Reviewed by Darin Adler.
+
+        HTMLFormControlElement::m_isValid is a cache of the results of the valid() function.
+        When cloning the node, we were preserving each individual item, but not the state
+        of the cache. Therefore, the cache and the attributes didn't agree with each other.
+
+        Test: fast/forms/checkValidity-cloneNode-crash.html
+
+        * html/HTMLInputElement.cpp:
+        (WebCore::HTMLInputElement::copyNonAttributePropertiesFromElement):
+
 2016-04-15  Brent Fulgham  <[email protected]>
 
         Remove support for X-Frame-Options in `<meta>`

Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/html/HTMLInputElement.cpp (200008 => 200009)


--- releases/WebKitGTK/webkit-2.12/Source/WebCore/html/HTMLInputElement.cpp	2016-04-25 13:42:08 UTC (rev 200008)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/html/HTMLInputElement.cpp	2016-04-25 13:49:50 UTC (rev 200009)
@@ -923,6 +923,7 @@
 
     HTMLTextFormControlElement::copyNonAttributePropertiesFromElement(source);
 
+    updateValidity();
     setFormControlValueMatchesRenderer(false);
     m_inputType->updateInnerTextValue();
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to