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

Unified Diff: third_party/WebKit/Source/core/dom/IntersectionObservation.cpp

Issue 1814553003: IntersectionObserver: use border box rect for unclipped root. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@intersection-observer-idle-callback
Patch Set: rebase Created 4 years, 8 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
« no previous file with comments | « third_party/WebKit/LayoutTests/intersection-observer/unclipped-root-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/IntersectionObservation.cpp
diff --git a/third_party/WebKit/Source/core/dom/IntersectionObservation.cpp b/third_party/WebKit/Source/core/dom/IntersectionObservation.cpp
index 9222e00bfd13e2c773ae8b8f5c9e5084bd8ffc2a..3ecc33a06cf37b147278116d2405c2a978276fee 100644
--- a/third_party/WebKit/Source/core/dom/IntersectionObservation.cpp
+++ b/third_party/WebKit/Source/core/dom/IntersectionObservation.cpp
@@ -55,8 +55,7 @@ void IntersectionObservation::initializeRootRect(LayoutRect& rect) const
LayoutObject* rootLayoutObject = m_observer->rootLayoutObject();
if (rootLayoutObject->isLayoutView())
rect = LayoutRect(toLayoutView(rootLayoutObject)->frameView()->visibleContentRect());
- // TODO(szager): Obey the spec -- use content box for a scrolling element, border box otherwise.
- else if (rootLayoutObject->isBox())
+ else if (rootLayoutObject->isBox() && rootLayoutObject->hasOverflowClip())
rect = LayoutRect(toLayoutBox(rootLayoutObject)->contentBoxRect());
else
rect = LayoutRect(toLayoutBoxModelObject(rootLayoutObject)->borderBoundingBox());
« no previous file with comments | « third_party/WebKit/LayoutTests/intersection-observer/unclipped-root-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698