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

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

Issue 1330633003: Intersection Observer first draft Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Lost newline in merge 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: third_party/WebKit/Source/core/frame/FrameView.cpp
diff --git a/third_party/WebKit/Source/core/frame/FrameView.cpp b/third_party/WebKit/Source/core/frame/FrameView.cpp
index d27feb25d9efcfc466580789bf8518fade265c11..c1e3d78b6464b94998f9c19fa9735bae22faf166 100644
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -1089,6 +1089,27 @@ 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()) {
+ 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())
+ m_clippedBounds = rootFrameToContents(m_clippedBounds);
+ } else {
+ m_clippedBounds = pixelSnappedIntRect(paintInvalidationState.clipRect());
+ }
+
+ layoutView()->computeIntersectionObservations(FloatRect(m_clippedBounds));
}
DocumentLifecycle& FrameView::lifecycle() const
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.h ('k') | third_party/WebKit/Source/core/layout/LayoutObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698