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

Unified Diff: third_party/WebKit/LayoutTests/accessibility/insert-adjacent-html-causes-crash.xhtml

Issue 1550113003: Fix crash when cached parent of AXLayoutObject is stale. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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/accessibility/insert-adjacent-html-causes-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/accessibility/insert-adjacent-html-causes-crash.xhtml
diff --git a/third_party/WebKit/LayoutTests/accessibility/insert-adjacent-html-causes-crash.xhtml b/third_party/WebKit/LayoutTests/accessibility/insert-adjacent-html-causes-crash.xhtml
new file mode 100644
index 0000000000000000000000000000000000000000..793ea7d1b2dc886076eedd630a785a85a0574529
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/accessibility/insert-adjacent-html-causes-crash.xhtml
@@ -0,0 +1,26 @@
+<!-- This document must be xhtml for the crash to occur -->
+<li xmlns="http://www.w3.org/1999/xhtml">
+ <h1 id="x">x<h1></h1></h1>
+ <script><![CDATA[
+ if (testRunner)
+ testRunner.dumpAsText();
+
+ // Calling accessibleElementById on a nonexistant id has the side effect
+ // of creating an accessibility object for every node in the tree.
+ if (accessibilityController)
+ accessibilityController.accessibleElementById('dummy');
+
+ // Calling insertAdjacentHTML causes the cached parent of an
+ // AXLayoutObject to be invalid after the next layout.
+ x=document.getElementById("x");
+ x.insertAdjacentHTML("beforebegin", "text");
+
+ // Force layout.
+ x.offsetTop;
+
+ // Explore the accessibility tree again, triggering the crash if
+ // the cached parent isn't updated correctly.
+ if (accessibilityController)
+ accessibilityController.accessibleElementById('dummy');
+ ]]></script>
+</li>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/accessibility/insert-adjacent-html-causes-crash-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698