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

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

Issue 1540443003: Fix LayoutObject::mapToVisibleRectInContainerSpace() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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/LayoutBox.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.cpp b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
index ecd1d337cc680caf1db759335e61594a0e0cb092..a65fb4a8784e6187eccf8035da022855f568df1b 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
@@ -939,7 +939,7 @@ IntSize LayoutBox::scrolledContentOffset() const
return flooredIntSize(layer()->scrollableArea()->scrollOffset());
}
-void LayoutBox::applyCachedScrollOffsetForPaintInvalidation(LayoutRect& paintRect) const
+void LayoutBox::applyCachedClipAndScrollOffsetForPaintInvalidationIfNeeded(const LayoutBoxModelObject* paintInvalidationContainer, LayoutRect& paintRect) const
{
ASSERT(hasLayer());
ASSERT(hasOverflowClip());
@@ -952,14 +952,10 @@ void LayoutBox::applyCachedScrollOffsetForPaintInvalidation(LayoutRect& paintRec
offset.setWidth(-offset.width());
}
paintRect.move(offset);
-}
-void LayoutBox::applyCachedClipAndScrollOffsetForPaintInvalidation(LayoutRect& paintRect) const
-{
- ASSERT(hasLayer());
- ASSERT(hasOverflowClip());
+ if (paintInvalidationContainer == this)
+ return;
- applyCachedScrollOffsetForPaintInvalidation(paintRect);
flipForWritingMode(paintRect);
// size() is inaccurate if we're in the middle of a layout of this LayoutBox, so use the
@@ -1956,11 +1952,7 @@ void LayoutBox::mapToVisibleRectInContainerSpace(const LayoutBoxModelObject* pai
// its controlClipRect will be wrong. For overflow clip we use the values cached by the layer.
rect.setLocation(topLeft);
if (o->hasOverflowClip()) {
- LayoutBox* containerBox = toLayoutBox(o);
- if (o == paintInvalidationContainer)
- containerBox->applyCachedScrollOffsetForPaintInvalidation(rect);
- else
- containerBox->applyCachedClipAndScrollOffsetForPaintInvalidation(rect);
+ toLayoutBox(o)->applyCachedClipAndScrollOffsetForPaintInvalidationIfNeeded(paintInvalidationContainer, rect);
if (rect.isEmpty())
return;
}

Powered by Google App Engine
This is Rietveld 408576698