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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <pre id=p1></pre>
8 <pre id=p1></pre>
9 <pre id=p1></pre>
10 <script>
11 description("Invalidation of cached id-name collections must not crash.");
12
13 if (window.testRunner)
14 testRunner.dumpAsText();
15
16 var is = window["p1"];
17 var div = document.createElement('div');
18 document.body.appendChild(div);
19 div.appendChild(is[is.length - 2]);
20 // Invalidate the underlying cache.
21 is.namedItem("p1").remove();
22 // Out of bounds index, updates the collection length.
23 is.item(13);
24 // Remove parent of collection member; must invalidate cached length.
25 div.remove();
26 // Force re-caching.
27 is.namedItem("p1");
28 </script>
29 </body>
30 </html>
OLDNEW
« 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