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

Unified Diff: Source/core/rendering/RenderBlock.cpp

Issue 264183002: RAL: Eliminate n^2 walk to find repaint containers (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: One more simple rebaseline... 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/RenderBlock.h ('k') | Source/core/rendering/RenderBox.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderBlock.cpp
diff --git a/Source/core/rendering/RenderBlock.cpp b/Source/core/rendering/RenderBlock.cpp
index 42a94250ded7cba0f6f0ceca5bf900c3a6666e4f..25c4d2a6ee51a933700af5e15b0dabfed9b9ada1 100644
--- a/Source/core/rendering/RenderBlock.cpp
+++ b/Source/core/rendering/RenderBlock.cpp
@@ -360,37 +360,40 @@ void RenderBlock::styleDidChange(StyleDifference diff, const RenderStyle* oldSty
ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->addRenderObject(this);
}
-void RenderBlock::repaintTreeAfterLayout()
+void RenderBlock::repaintTreeAfterLayout(const RenderLayerModelObject& repaintContainer)
{
if (!shouldCheckForInvalidationAfterLayout())
return;
- RenderBox::repaintTreeAfterLayout();
+ RenderBox::repaintTreeAfterLayout(repaintContainer);
// Take care of positioned objects. This is required as LayoutState keeps a single clip rect.
if (TrackedRendererListHashSet* positionedObjects = this->positionedObjects()) {
TrackedRendererListHashSet::iterator end = positionedObjects->end();
LayoutStateMaintainer statePusher(*this, isTableRow() ? LayoutSize() : locationOffset());
-
for (TrackedRendererListHashSet::iterator it = positionedObjects->begin(); it != end; ++it) {
- RenderBox* obj = *it;
+ RenderBox* box = *it;
+
+ // One of the renderers we're skipping over here may be the child's repaint container,
+ // so we can't pass our own repaint container along.
+ const RenderLayerModelObject& repaintContainerForChild = *box->containerForRepaint();
// If the positioned renderer is absolutely positioned and it is inside
// a relatively positioend inline element, we need to account for
// the inline elements position in LayoutState.
- if (obj->style()->position() == AbsolutePosition) {
- RenderObject* o = obj->container(obj->containerForRepaint(), 0);
- if (o->isInFlowPositioned() && o->isRenderInline()) {
+ if (box->style()->position() == AbsolutePosition) {
+ RenderObject* container = box->container(&repaintContainerForChild, 0);
+ if (container->isInFlowPositioned() && container->isRenderInline()) {
// FIXME: We should be able to use layout-state for this.
// Currently, we will place absolutly positioned elements inside
// relatively positioned inline blocks in the wrong location. crbug.com/371485
LayoutStateDisabler disable(*this);
- obj->repaintTreeAfterLayout();
+ box->repaintTreeAfterLayout(repaintContainerForChild);
continue;
}
}
- obj->repaintTreeAfterLayout();
+ box->repaintTreeAfterLayout(repaintContainerForChild);
}
}
}
« no previous file with comments | « Source/core/rendering/RenderBlock.h ('k') | Source/core/rendering/RenderBox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698