Title: [109054] trunk
- Revision
- 109054
- Author
- ad...@chromium.org
- Date
- 2012-02-27 17:51:32 -0800 (Mon, 27 Feb 2012)
Log Message
Always notify subtree of removal in ContainerNode::removeChildren
https://bugs.webkit.org/show_bug.cgi?id=79316
Reviewed by Ryosuke Niwa.
Source/WebCore:
In the inDocument case, Node::removedFromDocument is called.
In the out-of-document case, call ContainerNode::removedFromTree to ensure,
e.g., form-associated elements are properly disconnected.
Test: fast/forms/form-associated-element-removal.html
* dom/ContainerNode.cpp:
(WebCore::ContainerNode::removeChildren):
LayoutTests:
* fast/forms/form-associated-element-removal-expected.txt: Added.
* fast/forms/form-associated-element-removal.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (109053 => 109054)
--- trunk/LayoutTests/ChangeLog 2012-02-28 01:47:58 UTC (rev 109053)
+++ trunk/LayoutTests/ChangeLog 2012-02-28 01:51:32 UTC (rev 109054)
@@ -1,3 +1,13 @@
+2012-02-27 Adam Klein <ad...@chromium.org>
+
+ Always notify subtree of removal in ContainerNode::removeChildren
+ https://bugs.webkit.org/show_bug.cgi?id=79316
+
+ Reviewed by Ryosuke Niwa.
+
+ * fast/forms/form-associated-element-removal-expected.txt: Added.
+ * fast/forms/form-associated-element-removal.html: Added.
+
2012-02-27 Adrienne Walker <e...@google.com>
[chromium] Unreviewed gardening, mark another svg test as flaky crasher
Added: trunk/LayoutTests/fast/forms/form-associated-element-removal-expected.txt (0 => 109054)
--- trunk/LayoutTests/fast/forms/form-associated-element-removal-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/forms/form-associated-element-removal-expected.txt 2012-02-28 01:51:32 UTC (rev 109054)
@@ -0,0 +1,11 @@
+Removing all children of a form should disassociate any form controls in that subtree
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS input.form is null
+PASS form.elements.length is 0
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/fast/forms/form-associated-element-removal.html (0 => 109054)
--- trunk/LayoutTests/fast/forms/form-associated-element-removal.html (rev 0)
+++ trunk/LayoutTests/fast/forms/form-associated-element-removal.html 2012-02-28 01:51:32 UTC (rev 109054)
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<script src=""
+<script>
+description("Removing all children of a form should disassociate any form controls in that subtree");
+var form = document.createElement('form');
+var input = document.createElement('input');
+form.appendChild(input);
+form.innerHTML = '';
+shouldBeNull("input.form");
+shouldBe("form.elements.length", "0");
+</script>
+<script src=""
Modified: trunk/Source/WebCore/ChangeLog (109053 => 109054)
--- trunk/Source/WebCore/ChangeLog 2012-02-28 01:47:58 UTC (rev 109053)
+++ trunk/Source/WebCore/ChangeLog 2012-02-28 01:51:32 UTC (rev 109054)
@@ -1,3 +1,19 @@
+2012-02-27 Adam Klein <ad...@chromium.org>
+
+ Always notify subtree of removal in ContainerNode::removeChildren
+ https://bugs.webkit.org/show_bug.cgi?id=79316
+
+ Reviewed by Ryosuke Niwa.
+
+ In the inDocument case, Node::removedFromDocument is called.
+ In the out-of-document case, call ContainerNode::removedFromTree to ensure,
+ e.g., form-associated elements are properly disconnected.
+
+ Test: fast/forms/form-associated-element-removal.html
+
+ * dom/ContainerNode.cpp:
+ (WebCore::ContainerNode::removeChildren):
+
2012-02-27 Adam Barth <aba...@webkit.org>
Repair license blocks for files created during modularization
Modified: trunk/Source/WebCore/dom/ContainerNode.cpp (109053 => 109054)
--- trunk/Source/WebCore/dom/ContainerNode.cpp 2012-02-28 01:47:58 UTC (rev 109053)
+++ trunk/Source/WebCore/dom/ContainerNode.cpp 2012-02-28 01:51:32 UTC (rev 109054)
@@ -582,9 +582,8 @@
Node* removedChild = removedChildren[i].get();
if (removedChild->inDocument())
removedChild->removedFromDocument();
- // removeChild() calls removedFromTree(true) if the child was not in the
- // document. There is no explanation for this discrepancy between removeChild()
- // and its optimized version removeChildren().
+ else if (removedChild->isContainerNode())
+ toContainerNode(removedChild)->removedFromTree(true);
}
dispatchSubtreeModifiedEvent();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes