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

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..e930cd1356ed109846e8e93dcf94c7f71f7426e5 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::applyOverflowClipAndScrollOffsetForPaintInvalidationIfNeeded(LayoutRect& rect) const
{
ASSERT(hasLayer());
ASSERT(hasOverflowClip());
@@ -951,23 +951,19 @@ void LayoutBox::applyCachedScrollOffsetForPaintInvalidation(LayoutRect& paintRec
else
offset.setWidth(-offset.width());
}
- paintRect.move(offset);
-}
+ rect.move(offset);
-void LayoutBox::applyCachedClipAndScrollOffsetForPaintInvalidation(LayoutRect& paintRect) const
-{
- ASSERT(hasLayer());
- ASSERT(hasOverflowClip());
+ if (isPaintInvalidationContainer())
szager1 2015/12/18 18:49:21 This doesn't work for the IntersectionObserver use
Xianzhu 2015/12/18 19:30:51 Oh I didn't notice that this patch is to fix a rec
+ return;
- applyCachedScrollOffsetForPaintInvalidation(paintRect);
- flipForWritingMode(paintRect);
+ flipForWritingMode(rect);
// size() is inaccurate if we're in the middle of a layout of this LayoutBox, so use the
// layer's size instead. Even if the layer's size is wrong, the layer itself will issue paint invalidations
// anyway if its size does change.
LayoutRect clipRect(LayoutPoint(), LayoutSize(layer()->size()));
- paintRect = intersection(paintRect, clipRect);
- flipForWritingMode(paintRect);
+ rect = intersection(rect, clipRect);
+ flipForWritingMode(rect);
}
void LayoutBox::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const
@@ -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)->applyOverflowClipAndScrollOffsetForPaintInvalidationIfNeeded(rect);
if (rect.isEmpty())
return;
}
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.h ('k') | third_party/WebKit/Source/core/layout/LayoutInline.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698