Title: [132830] branches/chromium/1271

Diff

Copied: branches/chromium/1271/LayoutTests/fast/forms/textarea/textarea-autofocus-removal-while-focusing-with-style-expected.txt (from rev 131709, trunk/LayoutTests/fast/forms/textarea/textarea-autofocus-removal-while-focusing-with-style-expected.txt) (0 => 132830)


--- branches/chromium/1271/LayoutTests/fast/forms/textarea/textarea-autofocus-removal-while-focusing-with-style-expected.txt	                        (rev 0)
+++ branches/chromium/1271/LayoutTests/fast/forms/textarea/textarea-autofocus-removal-while-focusing-with-style-expected.txt	2012-10-29 18:44:34 UTC (rev 132830)
@@ -0,0 +1 @@
+PASS unless crash.

Copied: branches/chromium/1271/LayoutTests/fast/forms/textarea/textarea-autofocus-removal-while-focusing-with-style.html (from rev 131709, trunk/LayoutTests/fast/forms/textarea/textarea-autofocus-removal-while-focusing-with-style.html) (0 => 132830)


--- branches/chromium/1271/LayoutTests/fast/forms/textarea/textarea-autofocus-removal-while-focusing-with-style.html	                        (rev 0)
+++ branches/chromium/1271/LayoutTests/fast/forms/textarea/textarea-autofocus-removal-while-focusing-with-style.html	2012-10-29 18:44:34 UTC (rev 132830)
@@ -0,0 +1,20 @@
+<head>
+<style> </style>
+</head>
+<body>
+<script>
+testRunner.dumpAsText();
+testRunner.waitUntilDone();
+var docElement = document.documentElement;
+textArea = document.createElement("textarea");
+textArea.setAttribute("autofocus", "");
+textArea.appendChild(document.head);
+textArea.addEventListener("DOMFocusIn", function () { docElement.innerHTML = ""; }, false);
+docElement.appendChild(textArea);
+document.implementation.createDocument("http://www.w3.org/1999/xhtml", "html", null).adoptNode(textArea);
+window.setTimeout(function() {
+    document.body.innerHTML = "PASS unless crash.";
+    testRunner.notifyDone();
+}, 0);
+</script>
+</body>

Modified: branches/chromium/1271/Source/WebCore/dom/ContainerNodeAlgorithms.cpp (132829 => 132830)


--- branches/chromium/1271/Source/WebCore/dom/ContainerNodeAlgorithms.cpp	2012-10-29 18:22:57 UTC (rev 132829)
+++ branches/chromium/1271/Source/WebCore/dom/ContainerNodeAlgorithms.cpp	2012-10-29 18:44:34 UTC (rev 132830)
@@ -48,8 +48,10 @@
 
     if (ElementShadow* shadow = toElement(node)->shadow()) {
         ShadowRootVector roots(shadow);
-        for (size_t i = 0; i < roots.size(); ++i)
-            notifyNodeInsertedIntoDocument(roots[i].get());
+        for (size_t i = 0; i < roots.size(); ++i) {
+            if (node->inDocument() && roots[i]->host() == node)
+                notifyNodeInsertedIntoDocument(roots[i].get());
+        }
     }
 }
 
@@ -83,8 +85,10 @@
 
     if (ElementShadow* shadow = toElement(node)->shadow()) {
         ShadowRootVector roots(shadow);
-        for (size_t i = 0; i < roots.size(); ++i)
-            notifyNodeRemovedFromDocument(roots[i].get());
+        for (size_t i = 0; i < roots.size(); ++i) {
+            if (!node->inDocument() && roots[i]->host() == node)
+                notifyNodeRemovedFromDocument(roots[i].get());
+        }
     }
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to