Title: [126339] branches/chromium/1180
- Revision
- 126339
- Author
- [email protected]
- Date
- 2012-08-22 12:40:02 -0700 (Wed, 22 Aug 2012)
Log Message
Merge 124282 - REGRESSION(r120979): Node list returned by getElementsByTagNameNS isn't invalidated when children changes
https://bugs.webkit.org/show_bug.cgi?id=92705
BUG=139646
Review URL: https://chromiumcodereview.appspot.com/10871021
Modified Paths
Added Paths
Diff
Copied: branches/chromium/1180/LayoutTests/fast/dom/NodeList/nodelist-namespace-invalidation-expected.txt (from rev 124282, trunk/LayoutTests/fast/dom/NodeList/nodelist-namespace-invalidation-expected.txt) (0 => 126339)
--- branches/chromium/1180/LayoutTests/fast/dom/NodeList/nodelist-namespace-invalidation-expected.txt (rev 0)
+++ branches/chromium/1180/LayoutTests/fast/dom/NodeList/nodelist-namespace-invalidation-expected.txt 2012-08-22 19:40:02 UTC (rev 126339)
@@ -0,0 +1,10 @@
+This tests that node lists returned by getElementsByTagNameNS are invalidated upon child node changes.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS appendImageWithId('firstImage'); nodeList = container.getElementsByTagNameNS(namespace, 'img'); nodeList.item(0).id is 'firstImage'
+PASS nodeList.length is 1
+PASS appendImageWithId('secondImage'); container.removeChild(container.firstChild); nodeList.item(0).id is 'secondImage'
+PASS nodeList.length is 1
+
Copied: branches/chromium/1180/LayoutTests/fast/dom/NodeList/nodelist-namespace-invalidation.html (from rev 124282, trunk/LayoutTests/fast/dom/NodeList/nodelist-namespace-invalidation.html) (0 => 126339)
--- branches/chromium/1180/LayoutTests/fast/dom/NodeList/nodelist-namespace-invalidation.html (rev 0)
+++ branches/chromium/1180/LayoutTests/fast/dom/NodeList/nodelist-namespace-invalidation.html 2012-08-22 19:40:02 UTC (rev 126339)
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script src=""
+<script>
+
+description("This tests that node lists returned by getElementsByTagNameNS are invalidated upon child node changes.");
+
+var container = document.createElement('div');
+
+function appendImageWithId(id) {
+ container.appendChild(document.createElement('img'));
+ container.lastChild.id = id;
+}
+
+var nodeList;
+var namespace = document.body.namespaceURI;
+shouldBe("appendImageWithId('firstImage'); nodeList = container.getElementsByTagNameNS(namespace, 'img'); nodeList.item(0).id", "'firstImage'");
+shouldBe("nodeList.length", "1");
+shouldBe("appendImageWithId('secondImage'); container.removeChild(container.firstChild); nodeList.item(0).id", "'secondImage'");
+shouldBe("nodeList.length", "1");
+
+</script>
+</body>
+</html>
Modified: branches/chromium/1180/Source/WebCore/dom/Node.cpp (126338 => 126339)
--- branches/chromium/1180/Source/WebCore/dom/Node.cpp 2012-08-22 19:38:45 UTC (rev 126338)
+++ branches/chromium/1180/Source/WebCore/dom/Node.cpp 2012-08-22 19:40:02 UTC (rev 126339)
@@ -2258,7 +2258,7 @@
it->second->invalidateCache();
}
- if (!attrName)
+ if (attrName)
return;
TagNodeListCacheNS::iterator tagCacheEnd = m_tagNodeListCacheNS.end();
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes