Title: [127637] branches/chromium/1229
Revision
127637
Author
[email protected]
Date
2012-09-05 12:52:52 -0700 (Wed, 05 Sep 2012)

Log Message

Merge 126657
BUG=143604
Review URL: https://chromiumcodereview.appspot.com/10911109

Modified Paths

Added Paths

Diff

Copied: branches/chromium/1229/LayoutTests/svg/custom/system-language-crash-expected.txt (from rev 126657, trunk/LayoutTests/svg/custom/system-language-crash-expected.txt) (0 => 127637)


--- branches/chromium/1229/LayoutTests/svg/custom/system-language-crash-expected.txt	                        (rev 0)
+++ branches/chromium/1229/LayoutTests/svg/custom/system-language-crash-expected.txt	2012-09-05 19:52:52 UTC (rev 127637)
@@ -0,0 +1,2 @@
+PASS: did not crash.
+

Copied: branches/chromium/1229/LayoutTests/svg/custom/system-language-crash.html (from rev 126657, trunk/LayoutTests/svg/custom/system-language-crash.html) (0 => 127637)


--- branches/chromium/1229/LayoutTests/svg/custom/system-language-crash.html	                        (rev 0)
+++ branches/chromium/1229/LayoutTests/svg/custom/system-language-crash.html	2012-09-05 19:52:52 UTC (rev 127637)
@@ -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: branches/chromium/1229/Source/WebCore/svg/SVGTests.cpp (127636 => 127637)


--- branches/chromium/1229/Source/WebCore/svg/SVGTests.cpp	2012-09-05 19:47:34 UTC (rev 127636)
+++ branches/chromium/1229/Source/WebCore/svg/SVGTests.cpp	2012-09-05 19:52:52 UTC (rev 127637)
@@ -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
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to