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

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

Issue 1817693002: Support edge-inclusive intersections in mapToVisibleRectInAncestorSpace (Closed) Base URL: https://chromium.googlesource.com/chromium/src@intersection-observer-idle-callback
Patch Set: more tests Created 4 years, 9 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 ca464ab93c3cb9394109bdd14c06d0e99660266c..99a0553035363847acb9e7e6d75e1239fbc9e54e 100644
--- a/third_party/WebKit/Source/core/layout/PaintInvalidationState.cpp
+++ b/third_party/WebKit/Source/core/layout/PaintInvalidationState.cpp
@@ -156,14 +156,14 @@ void PaintInvalidationState::updatePaintOffsetAndClipForChildren()
// FIXME: <http://bugs.webkit.org/show_bug.cgi?id=13443> Apply control clip if present.
}
-void PaintInvalidationState::mapObjectRectToAncestor(const LayoutObject& object, const LayoutBoxModelObject* ancestor, LayoutRect& rect) const
+bool PaintInvalidationState::mapObjectRectToAncestor(const LayoutObject& object, const LayoutBoxModelObject* ancestor, LayoutRect& rect, VisibleRectFlags visibleRectFlags) const
{
ASSERT(canMapToAncestor(ancestor));
if (ancestor == &object) {
if (object.isBox() && object.styleRef().isFlippedBlocksWritingMode())
toLayoutBox(object).flipForWritingMode(rect);
- return;
+ return true;
}
if (object.hasLayer()) {
@@ -179,8 +179,13 @@ void PaintInvalidationState::mapObjectRectToAncestor(const LayoutObject& object,
rect.move(m_paintOffset);
- if (m_clipped)
+ if (m_clipped) {
+ if (visibleRectFlags & EdgeInclusive)
+ return rect.inclusiveIntersect(m_clipRect);
rect.intersect(m_clipRect);
+ }
+
+ return !rect.isEmpty();
}
void PaintInvalidationState::addClipRectRelativeToPaintOffset(const LayoutSize& clipSize)

Powered by Google App Engine
This is Rietveld 408576698