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

Unified Diff: LayoutTests/accessibility/adopt-node-causes-crash.html

Issue 539603002: adoptNode wasn't clearing the accessibility cache. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add doctype, get rid of <html>, <head>, <body> Created 6 years, 3 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 | LayoutTests/accessibility/adopt-node-causes-crash-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/accessibility/adopt-node-causes-crash.html
diff --git a/LayoutTests/accessibility/adopt-node-causes-crash.html b/LayoutTests/accessibility/adopt-node-causes-crash.html
new file mode 100644
index 0000000000000000000000000000000000000000..f052b04293e804cb7259fe2fd16f1200d48d7a07
--- /dev/null
+++ b/LayoutTests/accessibility/adopt-node-causes-crash.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<script src="../resources/js-test.js"></script>
+
+<!-- Nodes inside a canvas get an AXNodeObject, not an AXRenderObject. -->
+<canvas>
+ <div id=node2></div>
+</canvas>
+
+<script>
+ description("Ensure that if we have an AXNodeObject with a raw pointer to a Node, the accessible object gets correctly detached if we adopt the node into a new document.");
+
+ // This triggers an asynchronous accessibility notification.
+ document.getElementById("node2").setAttribute("aria-label", "Label");
+
+ // Adopt the node into a new document, then garbage-collect it.
+ // Make sure the notification doesn't try to access the invalid node.
+ document.implementation.createDocument("", null).adoptNode(node2);
+ gc();
+</script>
« no previous file with comments | « no previous file | LayoutTests/accessibility/adopt-node-causes-crash-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698