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

Unified Diff: Source/core/frame/FrameView.cpp

Issue 1330633003: Intersection Observer first draft Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix segfault on null input. Created 5 years, 3 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: 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

Powered by Google App Engine
This is Rietveld 408576698