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

Unified Diff: Source/core/rendering/RenderBox.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 | « Source/core/rendering/RenderBox.h ('k') | Source/core/rendering/RenderBoxModelObject.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderBox.cpp
diff --git a/Source/core/rendering/RenderBox.cpp b/Source/core/rendering/RenderBox.cpp
index 2e451c543c83df43738c0207d08f829fe8f6b6ec..eebdb043f95a38d38b6ff920c4d5ee4d6eb0c017 100644
--- a/Source/core/rendering/RenderBox.cpp
+++ b/Source/core/rendering/RenderBox.cpp
@@ -191,7 +191,7 @@ void RenderBox::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle
parent()->setChildNeedsLayout();
}
- if (RenderBlock::hasPercentHeightContainerMap() && firstChild()
+ if (RenderBlock::hasPercentHeightContainerMap() && slowFirstChild()
&& oldHorizontalWritingMode != isHorizontalWritingMode())
RenderBlock::clearPercentHeightDescendantsFrom(this);
@@ -297,7 +297,7 @@ void RenderBox::updateFromStyle()
if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled() && (boxHasOverflowClip != hasOverflowClip())) {
// FIXME: This shouldn't be required if we tracked the visual overflow
// generated by positioned children or self painting layers. crbug.com/345403
- for (RenderObject* child = firstChild(); child; child = child->nextSibling())
+ for (RenderObject* child = slowFirstChild(); child; child = child->nextSibling())
child->setShouldDoFullRepaintIfSelfPaintingLayer(true);
}
@@ -311,7 +311,7 @@ void RenderBox::layout()
{
ASSERT(needsLayout());
- RenderObject* child = firstChild();
+ RenderObject* child = slowFirstChild();
if (!child) {
clearNeedsLayout();
return;
@@ -1049,7 +1049,7 @@ bool RenderBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result
LayoutPoint adjustedLocation = accumulatedOffset + location();
// Check kids first.
- for (RenderObject* child = lastChild(); child; child = child->previousSibling()) {
+ for (RenderObject* child = slowLastChild(); child; child = child->previousSibling()) {
if (!child->hasLayer() && child->nodeAtPoint(request, result, locationInContainer, adjustedLocation, action)) {
updateHitTestResult(result, locationInContainer.point() - toLayoutSize(adjustedLocation));
return true;
@@ -1077,7 +1077,7 @@ void RenderBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
// default implementation. Just pass paint through to the children
PaintInfo childInfo(paintInfo);
childInfo.updatePaintingRootForChildren(this);
- for (RenderObject* child = firstChild(); child; child = child->nextSibling())
+ for (RenderObject* child = slowFirstChild(); child; child = child->nextSibling())
child->paint(childInfo, adjustedPaintOffset);
}
@@ -1285,7 +1285,7 @@ bool RenderBox::foregroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect, u
{
if (!maxDepthToTest)
return false;
- for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
+ for (RenderObject* child = slowFirstChild(); child; child = child->nextSibling()) {
if (!child->isBox())
continue;
RenderBox* childBox = toRenderBox(child);
@@ -2141,12 +2141,12 @@ static float getMaxWidthListMarker(const RenderBox* renderer)
ASSERT(renderer->style()->textAutosizingMultiplier() != 1);
#endif
float maxWidth = 0;
- for (RenderObject* child = renderer->firstChild(); child; child = child->nextSibling()) {
+ for (RenderObject* child = renderer->slowFirstChild(); child; child = child->nextSibling()) {
if (!child->isListItem())
continue;
RenderBox* listItem = toRenderBox(child);
- for (RenderObject* itemChild = listItem->firstChild(); itemChild; itemChild = itemChild->nextSibling()) {
+ for (RenderObject* itemChild = listItem->slowFirstChild(); itemChild; itemChild = itemChild->nextSibling()) {
if (!itemChild->isListMarker())
continue;
RenderBox* itemMarker = toRenderBox(itemChild);
@@ -4019,7 +4019,8 @@ LayoutRect RenderBox::localCaretRect(InlineBox* box, int caretOffset, LayoutUnit
PositionWithAffinity RenderBox::positionForPoint(const LayoutPoint& point)
{
// no children...return this render object's element, if there is one, and offset 0
- if (!firstChild())
+ RenderObject* firstChild = slowFirstChild();
+ if (!firstChild)
return createPositionWithAffinity(nonPseudoNode() ? firstPositionInOrBeforeNode(nonPseudoNode()) : Position());
if (isTable() && nonPseudoNode()) {
@@ -4040,8 +4041,8 @@ PositionWithAffinity RenderBox::positionForPoint(const LayoutPoint& point)
if (isTableRow())
adjustedPoint.moveBy(location());
- for (RenderObject* renderObject = firstChild(); renderObject; renderObject = renderObject->nextSibling()) {
- if ((!renderObject->firstChild() && !renderObject->isInline() && !renderObject->isRenderBlockFlow() )
+ for (RenderObject* renderObject = firstChild; renderObject; renderObject = renderObject->nextSibling()) {
+ if ((!renderObject->slowFirstChild() && !renderObject->isInline() && !renderObject->isRenderBlockFlow() )
|| renderObject->style()->visibility() != VISIBLE)
continue;
@@ -4128,7 +4129,7 @@ void RenderBox::markForPaginationRelayoutIfNeeded(SubtreeLayoutScope& layoutScop
ASSERT(!needsLayout());
// If fragmentation height has changed, we need to lay out. No need to enter the renderer if it
// is childless, though.
- if (view()->layoutState()->pageLogicalHeightChanged() && firstChild())
+ if (view()->layoutState()->pageLogicalHeightChanged() && slowFirstChild())
layoutScope.setChildNeedsLayout(this);
}
@@ -4644,7 +4645,7 @@ RenderObject* RenderBox::splitAnonymousBoxesAroundChild(RenderObject* beforeChil
while (beforeChild->parent() != this) {
RenderBox* boxToSplit = toRenderBox(beforeChild->parent());
- if (boxToSplit->firstChild() != beforeChild && boxToSplit->isAnonymous()) {
+ if (boxToSplit->slowFirstChild() != beforeChild && boxToSplit->isAnonymous()) {
didSplitParentAnonymousBoxes = true;
// We have to split the parent box into two boxes and move children
« no previous file with comments | « Source/core/rendering/RenderBox.h ('k') | Source/core/rendering/RenderBoxModelObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698