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

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

Issue 2241663002: Take CSS Clip and contain: paint into account when computing visual rects. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: none Created 4 years, 4 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 38b038675cbb64788c7cefe6ccfa91911c56cc40..b5849eaeddc545a90a7b02f88aa2b1a15113a331 100644
--- a/third_party/WebKit/Source/core/layout/PaintInvalidationState.cpp
+++ b/third_party/WebKit/Source/core/layout/PaintInvalidationState.cpp
@@ -307,7 +307,7 @@ void PaintInvalidationState::updateForNormalChildren()
m_paintOffset -= toLayoutBox(m_currentObject).locationOffset();
}
- if (!m_currentObject.hasOverflowClip())
+ if (!m_currentObject.hasClipRelatedProperty())
return;
const LayoutBox& box = toLayoutBox(m_currentObject);
@@ -317,8 +317,9 @@ void PaintInvalidationState::updateForNormalChildren()
if (box == m_paintInvalidationContainer && box.scrollsOverflow()) {
ASSERT(!m_clipped); // The box establishes paint invalidation container, so no m_clipped inherited.
} else {
- addClipRectRelativeToPaintOffset(box.overflowClipRect(LayoutPoint()));
- m_paintOffset -= box.scrolledContentOffset();
+ addClipRectRelativeToPaintOffset(box.clippingRect());
Xianzhu 2016/08/12 17:07:57 The original code won't apply clip on descendant a
chrishtr 2016/08/12 17:56:24 Added one here and in LayoutBox.
+ if (box.hasOverflowClip())
+ m_paintOffset -= box.scrolledContentOffset();
}
// FIXME: <http://bugs.webkit.org/show_bug.cgi?id=13443> Apply control clip if present.

Powered by Google App Engine
This is Rietveld 408576698