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

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

Issue 377123002: Revert of Divorce PaintInvalidationState from LayoutState (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix conflict Created 6 years, 5 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/RenderBlockFlow.cpp » ('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 32175d5e795d124659372246731a642a8e3fe8c3..4dc625a006d76555ae5979d23a8a9f9715abb689 100644
--- a/Source/core/rendering/RenderBlock.cpp
+++ b/Source/core/rendering/RenderBlock.cpp
@@ -362,21 +362,19 @@ void RenderBlock::styleDidChange(StyleDifference diff, const RenderStyle* oldSty
ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->addRenderObject(this);
}
-void RenderBlock::invalidateTreeAfterLayout(const PaintInvalidationState& paintInvalidationState)
+void RenderBlock::invalidateTreeAfterLayout(const RenderLayerModelObject& invalidationContainer)
{
// Note, we don't want to early out here using shouldCheckForInvalidationAfterLayout as
// we have to make sure we go through any positioned objects as they won't be seen in
// the normal tree walk.
if (shouldCheckForPaintInvalidationAfterLayout())
- RenderBox::invalidateTreeAfterLayout(paintInvalidationState);
+ RenderBox::invalidateTreeAfterLayout(invalidationContainer);
- // Take care of positioned objects. This is required as PaintInvalidationState keeps a single clip rect.
+ // 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();
- bool establishesNewPaintInvalidationContainer = isPaintInvalidationContainer();
- const RenderLayerModelObject& newPaintInvalidationContainer = *adjustCompositedContainerForSpecialAncestors(establishesNewPaintInvalidationContainer ? this : &paintInvalidationState.paintInvalidationContainer());
- PaintInvalidationState childPaintInvalidationState(paintInvalidationState, *this, newPaintInvalidationContainer);
+ LayoutState state(*this, isTableRow() ? LayoutSize() : locationOffset());
for (TrackedRendererListHashSet::iterator it = positionedObjects->begin(); it != end; ++it) {
RenderBox* box = *it;
@@ -384,33 +382,22 @@ void RenderBlock::invalidateTreeAfterLayout(const PaintInvalidationState& paintI
// so we can't pass our own repaint container along.
const RenderLayerModelObject& repaintContainerForChild = *box->containerForPaintInvalidation();
- // If it's a new paint invalidation container, we won't have properly accumulated the offset into the
- // PaintInvalidationState.
- // FIXME: Teach PaintInvalidationState to handle this case. crbug.com/371485
- if (&repaintContainerForChild != newPaintInvalidationContainer) {
- ForceHorriblySlowRectMapping slowRectMapping(&childPaintInvalidationState);
- PaintInvalidationState disabledPaintInvalidationState(childPaintInvalidationState, *this, repaintContainerForChild);
- box->invalidateTreeAfterLayout(disabledPaintInvalidationState);
- continue;
- }
-
// If the positioned renderer is absolutely positioned and it is inside
- // a relatively positioned inline element, we need to account for
- // the inline elements position in PaintInvalidationState.
+ // a relatively positioend inline element, we need to account for
+ // the inline elements position in LayoutState.
if (box->style()->position() == AbsolutePosition) {
RenderObject* container = box->container(&repaintContainerForChild, 0);
if (container->isRelPositioned() && container->isRenderInline()) {
- // FIXME: We should be able to use PaintInvalidationState for this.
- // Currently, we will place absolutely positioned elements inside
+ // 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
- ForceHorriblySlowRectMapping slowRectMapping(&childPaintInvalidationState);
- PaintInvalidationState disabledPaintInvalidationState(childPaintInvalidationState, *this, repaintContainerForChild);
- box->invalidateTreeAfterLayout(disabledPaintInvalidationState);
+ ForceHorriblySlowRectMapping slowRectMapping(*this);
+ box->invalidateTreeAfterLayout(repaintContainerForChild);
continue;
}
}
- box->invalidateTreeAfterLayout(childPaintInvalidationState);
+ box->invalidateTreeAfterLayout(repaintContainerForChild);
}
}
}
@@ -4024,6 +4011,8 @@ void RenderBlock::updateFirstLetterStyle(RenderObject* firstLetterBlock, RenderO
RenderStyle* pseudoStyle = styleForFirstLetter(firstLetterBlock, firstLetterContainer);
ASSERT(firstLetter->isFloating() || firstLetter->isInline());
+ ForceHorriblySlowRectMapping slowRectMapping(*this);
+
if (RenderStyle::stylePropagationDiff(firstLetter->style(), pseudoStyle) == Reattach) {
// The first-letter renderer needs to be replaced. Create a new renderer of the right type.
RenderBoxModelObject* newFirstLetter;
@@ -4204,6 +4193,10 @@ void RenderBlock::updateFirstLetter()
if (!currChild->isText() || currChild->isBR() || toRenderText(currChild)->isWordBreak())
return;
+ // Our layout state is not valid for the repaints we are going to trigger by
+ // adding and removing children of firstLetterContainer.
+ ForceHorriblySlowRectMapping slowRectMapping(*this);
+
createFirstLetterRenderer(firstLetterBlock, currChild, length);
}
@@ -4462,9 +4455,9 @@ void RenderBlock::absoluteQuads(Vector<FloatQuad>& quads, bool* wasFixed) const
}
}
-LayoutRect RenderBlock::rectWithOutlineForPaintInvalidation(const RenderLayerModelObject* paintInvalidationContainer, LayoutUnit outlineWidth, const PaintInvalidationState* paintInvalidationState) const
+LayoutRect RenderBlock::rectWithOutlineForPaintInvalidation(const RenderLayerModelObject* paintInvalidationContainer, LayoutUnit outlineWidth) const
{
- LayoutRect r(RenderBox::rectWithOutlineForPaintInvalidation(paintInvalidationContainer, outlineWidth, paintInvalidationState));
+ LayoutRect r(RenderBox::rectWithOutlineForPaintInvalidation(paintInvalidationContainer, outlineWidth));
if (isAnonymousBlockContinuation())
r.inflateY(collapsedMarginBefore()); // FIXME: This is wrong for block-flows that are horizontal.
return r;
« no previous file with comments | « Source/core/rendering/RenderBlock.h ('k') | Source/core/rendering/RenderBlockFlow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698