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; |
} |