Title: [126657] trunk
Revision
126657
Author
fmal...@chromium.org
Date
2012-08-24 17:06:39 -0700 (Fri, 24 Aug 2012)

Log Message

ASSERTION FAILED: !attached() in WebCore::Node::attach()
https://bugs.webkit.org/show_bug.cgi?id=94650

Reviewed by Abhishek Arya.

Source/WebCore:

Prevent SVGTests::handleAttributeChange() from attaching elements with detached parents.

Test: svg/custom/system-language-crash.html

* svg/SVGTests.cpp:
(WebCore::SVGTests::handleAttributeChange):

LayoutTests:

* svg/custom/system-language-crash-expected.txt: Added.
* svg/custom/system-language-crash.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (126656 => 126657)


--- trunk/LayoutTests/ChangeLog	2012-08-24 23:58:43 UTC (rev 126656)
+++ trunk/LayoutTests/ChangeLog	2012-08-25 00:06:39 UTC (rev 126657)
@@ -1,3 +1,13 @@
+2012-08-24  Florin Malita  <fmal...@chromium.org>
+
+        ASSERTION FAILED: !attached() in WebCore::Node::attach()
+        https://bugs.webkit.org/show_bug.cgi?id=94650
+
+        Reviewed by Abhishek Arya.
+
+        * svg/custom/system-language-crash-expected.txt: Added.
+        * svg/custom/system-language-crash.html: Added.
+
 2012-08-24  Glenn Adams  <gl...@skynav.com>
 
         CSSStyleDeclaration.cssText should not contain extraneous whitespace in final delimiter

Added: trunk/LayoutTests/svg/custom/system-language-crash-expected.txt (0 => 126657)


--- trunk/LayoutTests/svg/custom/system-language-crash-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/svg/custom/system-language-crash-expected.txt	2012-08-25 00:06:39 UTC (rev 126657)
@@ -0,0 +1,2 @@
+PASS: did not crash.
+

Added: trunk/LayoutTests/svg/custom/system-language-crash.html (0 => 126657)


--- trunk/LayoutTests/svg/custom/system-language-crash.html	                        (rev 0)
+++ trunk/LayoutTests/svg/custom/system-language-crash.html	2012-08-25 00:06:39 UTC (rev 126657)
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+<body _onload_="runTest()">
+  <!-- Test for https://bugs.webkit.org/show_bug.cgi?id=94650 -->
+  <div>PASS: did not crash.</div>
+  <svg id="svg" xmlns="http://www.w3.org/2000/svg">
+    <text id="text"></text>
+  </svg>
+
+  <script>
+    if (window.testRunner)
+      testRunner.dumpAsText();
+
+    function runTest() {
+      document.getElementById('svg').systemLanguage.initialize("X");
+      document.getElementById('text').systemLanguage.clear();
+    }
+  </script>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (126656 => 126657)


--- trunk/Source/WebCore/ChangeLog	2012-08-24 23:58:43 UTC (rev 126656)
+++ trunk/Source/WebCore/ChangeLog	2012-08-25 00:06:39 UTC (rev 126657)
@@ -1,3 +1,17 @@
+2012-08-24  Florin Malita  <fmal...@chromium.org>
+
+        ASSERTION FAILED: !attached() in WebCore::Node::attach()
+        https://bugs.webkit.org/show_bug.cgi?id=94650
+
+        Reviewed by Abhishek Arya.
+
+        Prevent SVGTests::handleAttributeChange() from attaching elements with detached parents.
+
+        Test: svg/custom/system-language-crash.html
+
+        * svg/SVGTests.cpp:
+        (WebCore::SVGTests::handleAttributeChange):
+
 2012-08-24  Glenn Adams  <gl...@skynav.com>
 
         CSSStyleDeclaration.cssText should not contain extraneous whitespace in final delimiter

Modified: trunk/Source/WebCore/svg/SVGTests.cpp (126656 => 126657)


--- trunk/Source/WebCore/svg/SVGTests.cpp	2012-08-24 23:58:43 UTC (rev 126656)
+++ trunk/Source/WebCore/svg/SVGTests.cpp	2012-08-25 00:06:39 UTC (rev 126657)
@@ -155,11 +155,14 @@
         return false;
     if (!targetElement->inDocument())
         return true;
+
     bool valid = targetElement->isValid();
-    if (valid && !targetElement->attached())
+    bool attached = targetElement->attached();
+    if (valid && !attached && targetElement->parentNode()->attached())
         targetElement->attach();
-    if (!valid && targetElement->attached())
+    else if (!valid && attached)
         targetElement->detach();
+
     return true;
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to