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

Unified Diff: third_party/WebKit/Source/core/layout/PaintInvalidationState.cpp

Issue 1786513002: Fix paint invalidation of paintInvalidationContainer itself (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
Index: third_party/WebKit/Source/core/layout/PaintInvalidationState.cpp
diff --git a/third_party/WebKit/Source/core/layout/PaintInvalidationState.cpp b/third_party/WebKit/Source/core/layout/PaintInvalidationState.cpp
index 018a76906d959c9a896be92f945e21a412535901..7ddbe084eec9ffa5b0c7b11d7d7a46a66a4259c0 100644
--- a/third_party/WebKit/Source/core/layout/PaintInvalidationState.cpp
+++ b/third_party/WebKit/Source/core/layout/PaintInvalidationState.cpp
@@ -73,12 +73,12 @@ PaintInvalidationState::PaintInvalidationState(PaintInvalidationState& next, Lay
if (layoutObject.isOutOfFlowPositioned() && !fixed) {
if (LayoutObject* container = layoutObject.container()) {
- if (container->style()->hasInFlowPosition() && container->isLayoutInline())
+ if (container->isInFlowPositioned() && container->isLayoutInline())
m_paintOffset += toLayoutInline(container)->offsetForInFlowPositionedInline(toLayoutBox(layoutObject));
}
}
- if (layoutObject.style()->hasInFlowPosition() && layoutObject.hasLayer())
+ if (layoutObject.isInFlowPositioned() && layoutObject.hasLayer())
m_paintOffset += layoutObject.layer()->offsetForInFlowPosition();
}
@@ -117,6 +117,33 @@ PaintInvalidationState::PaintInvalidationState(PaintInvalidationState& next, con
m_svgTransform = AffineTransform(next.svgTransform() * layoutObject.localToParentTransform());
}
+void PaintInvalidationState::mapObjectRectToAncestor(const LayoutObject& object, const LayoutBoxModelObject* ancestor, LayoutRect& rect) const
+{
+ ASSERT(canMapToAncestor(ancestor));
+
+ if (ancestor == &object) {
+ if (object.isBox() && object.styleRef().isFlippedBlocksWritingMode())
+ toLayoutBox(object).flipForWritingMode(rect);
+ return;
+ }
+
+ if (object.hasLayer()) {
+ if (const TransformationMatrix* transform = toLayoutBoxModelObject(object).layer()->transform())
+ rect = LayoutRect(transform->mapRect(pixelSnappedIntRect(rect)));
+
+ if (object.isInFlowPositioned())
+ rect.move(toLayoutBoxModelObject(object).layer()->offsetForInFlowPosition());
+ }
+
+ if (object.isBox())
+ rect.moveBy(toLayoutBox(object).location());
+
+ rect.move(m_paintOffset);
+
+ if (m_clipped)
+ rect.intersect(m_clipRect);
+}
+
void PaintInvalidationState::addClipRectRelativeToPaintOffset(const LayoutSize& clipSize)
{
LayoutRect clipRect(toPoint(m_paintOffset), clipSize);

Powered by Google App Engine
This is Rietveld 408576698