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

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 04b7164865fc72da904eeb527218892f4025010c..43dddd801c25a8668412524560343c7968f95973 100644
--- a/third_party/WebKit/Source/core/layout/PaintInvalidationState.cpp
+++ b/third_party/WebKit/Source/core/layout/PaintInvalidationState.cpp
@@ -309,7 +309,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);
@@ -319,8 +319,11 @@ 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();
+ // This won't work fully correctly for fixed-position elements, who should receive CSS clip but for whom the current object
+ // is not in the containing block chain.
+ addClipRectRelativeToPaintOffset(box.clippingRect());
+ if (box.hasOverflowClip())
+ m_paintOffset -= box.scrolledContentOffset();
}
// FIXME: <http://bugs.webkit.org/show_bug.cgi?id=13443> Apply control clip if present.
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutObject.h ('k') | third_party/WebKit/Source/core/layout/VisualRectMappingTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698