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

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

Issue 1973023002: Revert of Don't include contents visual overflow into paint invalidation rect (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/LayoutBox.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.cpp b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
index 1c53e242afe9626ce12102110c7ebfb19724f557..fd658ee88f2d7ee6a3e5ef4cd4dca1f38e2dfaac 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
@@ -1981,10 +1981,14 @@
LayoutRect LayoutBox::localOverflowRectForPaintInvalidation() const
{
- if (style()->visibility() != VISIBLE)
- return LayoutRect();
-
- return selfVisualOverflowRect();
+ if (style()->visibility() != VISIBLE) {
+ PaintLayer* layer = enclosingLayer();
+ layer->updateDescendantDependentFlags();
+ if (layer->subtreeIsInvisible())
+ return LayoutRect();
+ }
+
+ return visualOverflowRect();
}
void LayoutBox::inflateVisualRectForReflectionAndFilterUnderContainer(LayoutRect& rect, const LayoutObject& container, const LayoutBoxModelObject* ancestorToStopAt) const
@@ -4444,7 +4448,8 @@
return borderBoxRect();
if (hasOverflowClip())
return m_overflow->selfVisualOverflowRect();
- return unionRect(m_overflow->selfVisualOverflowRect(), m_overflow->contentsVisualOverflowRect());
+ // TODO(wangxianzhu): We should use normal unionRect() which ignores empty rects.
+ return unionRectEvenIfEmpty(m_overflow->selfVisualOverflowRect(), m_overflow->contentsVisualOverflowRect());
}
LayoutUnit LayoutBox::offsetLeft() const

Powered by Google App Engine
This is Rietveld 408576698