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

Unified Diff: Source/core/accessibility/AXRenderObject.cpp

Issue 295513003: add 'slow' prefix to RenderObject's firstChild() / lastChild() methods (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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 | Source/core/dom/ContainerNode.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/accessibility/AXRenderObject.cpp
diff --git a/Source/core/accessibility/AXRenderObject.cpp b/Source/core/accessibility/AXRenderObject.cpp
index 99c6da4e3462700679dc08c776b92211f511c083..41a7288f69c7e8b7506bab7e36ab90310f210a70 100644
--- a/Source/core/accessibility/AXRenderObject.cpp
+++ b/Source/core/accessibility/AXRenderObject.cpp
@@ -77,14 +77,14 @@ namespace WebCore {
using namespace HTMLNames;
-static inline RenderObject* firstChildInContinuation(RenderObject* renderer)
+static inline RenderObject* firstChildInContinuation(const RenderInline& renderer)
{
- RenderObject* r = toRenderInline(renderer)->continuation();
+ RenderBoxModelObject* r = renderer.continuation();
while (r) {
if (r->isRenderBlock())
return r;
- if (RenderObject* child = r->firstChild())
+ if (RenderObject* child = r->slowFirstChild())
return child;
r = toRenderInline(r)->continuation();
}
@@ -106,10 +106,10 @@ static inline bool isInlineWithContinuation(RenderObject* object)
static inline RenderObject* firstChildConsideringContinuation(RenderObject* renderer)
{
- RenderObject* firstChild = renderer->firstChild();
+ RenderObject* firstChild = renderer->slowFirstChild();
if (!firstChild && isInlineWithContinuation(renderer))
- firstChild = firstChildInContinuation(renderer);
+ firstChild = firstChildInContinuation(toRenderInline(*renderer));
return firstChild;
}
@@ -150,7 +150,8 @@ static inline RenderObject* endOfContinuations(RenderObject* renderer)
static inline bool lastChildHasContinuation(RenderObject* renderer)
{
- return renderer->lastChild() && isInlineWithContinuation(renderer->lastChild());
+ RenderObject* lastChild = renderer->slowLastChild();
+ return lastChild && isInlineWithContinuation(lastChild);
}
static RenderBoxModelObject* nextContinuation(RenderObject* renderer)
@@ -1381,9 +1382,9 @@ AXObject* AXRenderObject::nextSibling() const
} else if (m_renderer->isAnonymousBlock() && lastChildHasContinuation(m_renderer)) {
// 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.
- RenderObject* lastParent = endOfContinuations(m_renderer->lastChild())->parent();
+ RenderObject* lastParent = endOfContinuations(toRenderBlock(m_renderer)->lastChild())->parent();
while (lastChildHasContinuation(lastParent))
- lastParent = endOfContinuations(lastParent->lastChild())->parent();
+ lastParent = endOfContinuations(lastParent->slowLastChild())->parent();
nextSibling = lastParent->nextSibling();
} else if (RenderObject* ns = m_renderer->nextSibling()) {
// Case 3: node has an actual next sibling
@@ -1961,7 +1962,7 @@ RenderObject* AXRenderObject::renderParentObject() const
// Case 2: node's parent is an inline which is some node's continuation; parent is
// the earliest node in the continuation chain.
parent = startOfConts;
- } else if (parent && (firstChild = parent->firstChild()) && firstChild->node()) {
+ } else if (parent && (firstChild = parent->slowFirstChild()) && firstChild->node()) {
// Case 3: The first sibling is the beginning of a continuation chain. Find the origin of that continuation.
// Get the node's renderer and follow that continuation chain until the first child is found.
RenderObject* nodeRenderFirstChild = firstChild->node()->renderer();
@@ -1972,9 +1973,10 @@ RenderObject* AXRenderObject::renderParentObject() const
break;
}
}
- if (firstChild == parent->firstChild())
+ RenderObject* newFirstChild = parent->slowFirstChild();
+ if (firstChild == newFirstChild)
break;
- firstChild = parent->firstChild();
+ firstChild = newFirstChild;
if (!firstChild->node())
break;
nodeRenderFirstChild = firstChild->node()->renderer();
« no previous file with comments | « no previous file | Source/core/dom/ContainerNode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698