Title: [145938] branches/safari-536.30-branch

Diff

Modified: branches/safari-536.30-branch/LayoutTests/ChangeLog (145937 => 145938)


--- branches/safari-536.30-branch/LayoutTests/ChangeLog	2013-03-15 21:13:46 UTC (rev 145937)
+++ branches/safari-536.30-branch/LayoutTests/ChangeLog	2013-03-15 21:16:48 UTC (rev 145938)
@@ -1,5 +1,19 @@
 2013-03-15  Lucas Forschler  <[email protected]>
 
+        Merge r131709
+
+    2012-10-18  MORITA Hajime  <[email protected]>
+
+            Assertion failure at TreeScopeAdopter::moveNodeToNewDocument()
+            https://bugs.webkit.org/show_bug.cgi?id=99510
+
+            Reviewed by Kent Tamura.
+
+            * fast/forms/textarea/textarea-autofocus-removal-while-focusing-with-style-expected.txt: Added.
+            * fast/forms/textarea/textarea-autofocus-removal-while-focusing-with-style.html: Added.
+
+2013-03-15  Lucas Forschler  <[email protected]>
+
         Merge r130999
 
     2012-10-10  Stephen Chenney  <[email protected]>

Added: branches/safari-536.30-branch/LayoutTests/fast/forms/textarea/textarea-autofocus-removal-while-focusing-with-style-expected.txt (0 => 145938)


--- branches/safari-536.30-branch/LayoutTests/fast/forms/textarea/textarea-autofocus-removal-while-focusing-with-style-expected.txt	                        (rev 0)
+++ branches/safari-536.30-branch/LayoutTests/fast/forms/textarea/textarea-autofocus-removal-while-focusing-with-style-expected.txt	2013-03-15 21:16:48 UTC (rev 145938)
@@ -0,0 +1 @@
+PASS unless crash.
\ No newline at end of file

Added: branches/safari-536.30-branch/LayoutTests/fast/forms/textarea/textarea-autofocus-removal-while-focusing-with-style.html (0 => 145938)


--- branches/safari-536.30-branch/LayoutTests/fast/forms/textarea/textarea-autofocus-removal-while-focusing-with-style.html	                        (rev 0)
+++ branches/safari-536.30-branch/LayoutTests/fast/forms/textarea/textarea-autofocus-removal-while-focusing-with-style.html	2013-03-15 21:16:48 UTC (rev 145938)
@@ -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>
\ No newline at end of file

Modified: branches/safari-536.30-branch/Source/WebCore/ChangeLog (145937 => 145938)


--- branches/safari-536.30-branch/Source/WebCore/ChangeLog	2013-03-15 21:13:46 UTC (rev 145937)
+++ branches/safari-536.30-branch/Source/WebCore/ChangeLog	2013-03-15 21:16:48 UTC (rev 145938)
@@ -1,5 +1,25 @@
 2013-03-15  Lucas Forschler  <[email protected]>
 
+        Merge r131709
+
+    2012-10-18  MORITA Hajime  <[email protected]>
+
+            Assertion failure at TreeScopeAdopter::moveNodeToNewDocument()
+            https://bugs.webkit.org/show_bug.cgi?id=99510
+
+            Reviewed by Kent Tamura.
+
+            Shadow DOM notification call didn't have checks for mutation detection.
+            This change adds such checks.
+
+            Test: fast/forms/textarea/textarea-autofocus-removal-while-focusing-with-style.html
+
+            * dom/ContainerNodeAlgorithms.cpp:
+            (WebCore::ChildNodeInsertionNotifier::notifyDescendantInsertedIntoDocument):
+            (WebCore::ChildNodeRemovalNotifier::notifyDescendantRemovedFromDocument):
+
+2013-03-15  Lucas Forschler  <[email protected]>
+
         Merge r130999
 
     2012-10-10  Stephen Chenney  <[email protected]>

Modified: branches/safari-536.30-branch/Source/WebCore/dom/ContainerNodeAlgorithms.cpp (145937 => 145938)


--- branches/safari-536.30-branch/Source/WebCore/dom/ContainerNodeAlgorithms.cpp	2013-03-15 21:13:46 UTC (rev 145937)
+++ branches/safari-536.30-branch/Source/WebCore/dom/ContainerNodeAlgorithms.cpp	2013-03-15 21:16:48 UTC (rev 145938)
@@ -49,8 +49,10 @@
 
     if (ShadowTree* tree = toElement(node)->shadowTree()) {
         ShadowRootVector roots(tree);
-        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());
+        }
     }
 }
 
@@ -90,8 +92,10 @@
 
     if (ShadowTree* tree = toElement(node)->shadowTree()) {
         ShadowRootVector roots(tree);
-        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]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to