Index: Source/core/frame/FrameView.cpp |
diff --git a/Source/core/frame/FrameView.cpp b/Source/core/frame/FrameView.cpp |
index e4635d9f6241e3ebe2688d4f991e65c383eaba5e..cbcf6e38a466efee450c3744bb561a0db35f7acd 100644 |
--- a/Source/core/frame/FrameView.cpp |
+++ b/Source/core/frame/FrameView.cpp |
@@ -1116,6 +1116,28 @@ void FrameView::invalidateTreeIfNeeded(PaintInvalidationState& paintInvalidation |
m_doFullPaintInvalidation = false; |
lifecycle().advanceTo(DocumentLifecycle::PaintInvalidationClean); |
+ |
+ if (RuntimeEnabledFeatures::intersectionObserverEnabled()) { |
+ computeIntersectionObservations(paintInvalidationState); |
+ } |
+} |
+ |
+void FrameView::computeIntersectionObservations(PaintInvalidationState& paintInvalidationState) |
+{ |
+ ASSERT(layoutView()); |
+ |
+ if (FrameView* parent = parentFrameView()) { |
ojan
2015/09/21 03:49:09
Does this handle clipping correctly if you have mu
|
+ m_clippedBounds = IntRect(frameRect().location(), paintInvalidationState.clipRect().pixelSnappedSize()); |
+ m_clippedBounds = parent->contentsToRootFrame(m_clippedBounds); |
+ m_clippedBounds.intersect(parent->contentsToRootFrame(parent->m_clippedBounds)); |
+ if (!m_clippedBounds.isEmpty()) { |
ojan
2015/09/21 03:49:09
Nit: no curlies
MikeB
2015/09/24 19:04:04
Done.
|
+ m_clippedBounds = rootFrameToContents(m_clippedBounds); |
+ } |
+ } else { |
+ m_clippedBounds = pixelSnappedIntRect(paintInvalidationState.clipRect()); |
+ } |
+ |
+ layoutView()->computeIntersectionObservations(FloatRect(m_clippedBounds)); |
} |
DocumentLifecycle& FrameView::lifecycle() const |