Title: [95993] branches/chromium/835
- Revision
- 95993
- Author
- [email protected]
- Date
- 2011-09-26 14:32:02 -0700 (Mon, 26 Sep 2011)
Log Message
Merge 94864 - Source/WebCore: Assert being hit in AccessibilityRenderObject::addChildren()
BUG=84885
Review URL: http://codereview.chromium.org/8036039
Modified Paths
Added Paths
Diff
Copied: branches/chromium/835/LayoutTests/accessibility/adjacent-continuations-cause-assertion-failure.html (from rev 94864, trunk/LayoutTests/accessibility/adjacent-continuations-cause-assertion-failure.html) (0 => 95993)
--- branches/chromium/835/LayoutTests/accessibility/adjacent-continuations-cause-assertion-failure.html (rev 0)
+++ branches/chromium/835/LayoutTests/accessibility/adjacent-continuations-cause-assertion-failure.html 2011-09-26 21:32:02 UTC (rev 95993)
@@ -0,0 +1,55 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href=""
+<script>
+ var successfullyParsed = false;
+
+ function buildAccessibilityTree(accessibilityObject, indent) {
+ var str = "";
+ for (var i = 0; i < indent; i++)
+ str += " ";
+ str += accessibilityObject.role;
+ str += " " + accessibilityObject.stringValue;
+ str += "\n";
+ document.getElementById("tree").innerText += str;
+
+ if (accessibilityObject.stringValue.indexOf('End of test') >= 0)
+ return false;
+
+ var count = accessibilityObject.childrenCount;
+ for (var i = 0; i < count; ++i) {
+ if (!buildAccessibilityTree(accessibilityObject.childAtIndex(i), indent + 1))
+ return false;
+ }
+
+ return true;
+ }
+</script>
+<script src=""
+</head>
+<body>
+
+<span><div></div></span><span>x<div>y</div>z</span>
+
+<div>End of test</div>
+
+<p id="description"></p>
+<pre id="tree"></pre>
+<div id="console"></div>
+
+<script>
+ description("Make sure that a debug assert is not triggered when constructing the accessibility tree for this page.");
+
+ if (window.accessibilityController) {
+ // Build the accessibility tree up until 'End of test' is encountered.
+ document.body.focus();
+ buildAccessibilityTree(accessibilityController.focusedElement, 0);
+ }
+
+ successfullyParsed = true;
+</script>
+
+<script src=""
+</body>
+</html>
Copied: branches/chromium/835/LayoutTests/platform/mac/accessibility/adjacent-continuations-cause-assertion-failure-expected.txt (from rev 94864, trunk/LayoutTests/platform/mac/accessibility/adjacent-continuations-cause-assertion-failure-expected.txt) (0 => 95993)
--- branches/chromium/835/LayoutTests/platform/mac/accessibility/adjacent-continuations-cause-assertion-failure-expected.txt (rev 0)
+++ branches/chromium/835/LayoutTests/platform/mac/accessibility/adjacent-continuations-cause-assertion-failure-expected.txt 2011-09-26 21:32:02 UTC (rev 95993)
@@ -0,0 +1,20 @@
+x
+y
+z
+End of test
+Make sure that a debug assert is not triggered when constructing the accessibility tree for this page.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+AXRole: AXWebArea AXValue:
+ AXRole: AXStaticText AXValue: x
+ AXRole: AXGroup AXValue:
+ AXRole: AXStaticText AXValue: y
+ AXRole: AXStaticText AXValue: z
+ AXRole: AXGroup AXValue:
+ AXRole: AXStaticText AXValue: End of test
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Modified: branches/chromium/835/Source/WebCore/accessibility/AccessibilityRenderObject.cpp (95992 => 95993)
--- branches/chromium/835/Source/WebCore/accessibility/AccessibilityRenderObject.cpp 2011-09-26 21:24:48 UTC (rev 95992)
+++ branches/chromium/835/Source/WebCore/accessibility/AccessibilityRenderObject.cpp 2011-09-26 21:32:02 UTC (rev 95993)
@@ -304,8 +304,12 @@
// Case 2: Anonymous block parent of the end of a continuation - skip all the way to before
// the parent of the start, since everything in between will be linked up via the continuation.
- else if (m_renderer->isAnonymousBlock() && firstChildIsInlineContinuation(m_renderer))
- previousSibling = startOfContinuations(m_renderer->firstChild())->parent()->previousSibling();
+ else if (m_renderer->isAnonymousBlock() && firstChildIsInlineContinuation(m_renderer)) {
+ RenderObject* firstParent = startOfContinuations(m_renderer->firstChild())->parent();
+ while (firstChildIsInlineContinuation(firstParent))
+ firstParent = startOfContinuations(firstParent->firstChild())->parent();
+ previousSibling = firstParent->previousSibling();
+ }
// Case 3: The node has an actual previous sibling
else if (RenderObject* ps = m_renderer->previousSibling())
@@ -342,8 +346,12 @@
// Case 2: Anonymous block parent of the start of a continuation - skip all the way to
// after the parent of the end, since everything in between will be linked up via the continuation.
- else if (m_renderer->isAnonymousBlock() && lastChildHasContinuation(m_renderer))
- nextSibling = endOfContinuations(m_renderer->lastChild())->parent()->nextSibling();
+ else if (m_renderer->isAnonymousBlock() && lastChildHasContinuation(m_renderer)) {
+ RenderObject* lastParent = endOfContinuations(m_renderer->lastChild())->parent();
+ while (lastChildHasContinuation(lastParent))
+ lastParent = endOfContinuations(lastParent->lastChild())->parent();
+ nextSibling = lastParent->nextSibling();
+ }
// Case 3: node has an actual next sibling
else if (RenderObject* ns = m_renderer->nextSibling())
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes