Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Unified Diff: third_party/WebKit/LayoutTests/fast/dom/HTMLCollection/HTMLCollection-namedItem-invalidate-no-crash.html

Issue 1674273004: Do not re-register cached id-name HTMLCollection at same invalidation type (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added test Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/dom/HTMLCollection/HTMLCollection-namedItem-invalidate-no-crash-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/dom/HTMLCollection/HTMLCollection-namedItem-invalidate-no-crash.html
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLCollection/HTMLCollection-namedItem-invalidate-no-crash.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLCollection/HTMLCollection-namedItem-invalidate-no-crash.html
new file mode 100644
index 0000000000000000000000000000000000000000..5f3e8c9580933b0b2fd23573b1feb6193bbead76
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLCollection/HTMLCollection-namedItem-invalidate-no-crash.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../../resources/js-test.js"></script>
+</head>
+<body>
+<pre id=p1></pre>
+<pre id=p1></pre>
+<pre id=p1></pre>
+<script>
+description("Invalidation of cached id-name collections must not crash.");
+
+if (window.testRunner)
+ testRunner.dumpAsText();
+
+var is = window["p1"];
+var div = document.createElement('div');
+document.body.appendChild(div);
+div.appendChild(is[is.length - 2]);
+// Invalidate the underlying cache.
+is.namedItem("p1").remove();
+// Out of bounds index, updates the collection length.
+is.item(13);
+// Remove parent of collection member; must invalidate cached length.
+div.remove();
+// Force re-caching.
+is.namedItem("p1");
+</script>
+</body>
+</html>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/dom/HTMLCollection/HTMLCollection-namedItem-invalidate-no-crash-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698