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

Side by Side Diff: third_party/WebKit/Source/core/dom/IntersectionObservation.cpp

Issue 1813383002: Move all fast-path paint invalidation mapping into PaintInvalidationState (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Disable fast-path/slow-path comparison because of saturated operations of LayoutUnit 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/dom/IntersectionObservation.h" 5 #include "core/dom/IntersectionObservation.h"
6 6
7 #include "core/dom/ElementRareData.h" 7 #include "core/dom/ElementRareData.h"
8 #include "core/dom/IntersectionObserver.h" 8 #include "core/dom/IntersectionObserver.h"
9 #include "core/frame/FrameView.h" 9 #include "core/frame/FrameView.h"
10 #include "core/layout/LayoutBox.h" 10 #include "core/layout/LayoutBox.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 } 64 }
65 65
66 void IntersectionObservation::clipToRoot(IntersectionGeometry& geometry) const 66 void IntersectionObservation::clipToRoot(IntersectionGeometry& geometry) const
67 { 67 {
68 // Map and clip rect into root element coordinates. 68 // Map and clip rect into root element coordinates.
69 // TODO(szager): the writing mode flipping needs a test. 69 // TODO(szager): the writing mode flipping needs a test.
70 ASSERT(m_target); 70 ASSERT(m_target);
71 LayoutObject* rootLayoutObject = m_observer->rootLayoutObject(); 71 LayoutObject* rootLayoutObject = m_observer->rootLayoutObject();
72 LayoutObject* targetLayoutObject = target()->layoutObject(); 72 LayoutObject* targetLayoutObject = target()->layoutObject();
73 73
74 geometry.doesIntersect = targetLayoutObject->mapToVisibleRectInAncestorSpace (toLayoutBoxModelObject(rootLayoutObject), geometry.intersectionRect, nullptr, E dgeInclusive); 74 geometry.doesIntersect = targetLayoutObject->mapToVisibleRectInAncestorSpace (toLayoutBoxModelObject(rootLayoutObject), geometry.intersectionRect, EdgeInclus ive);
75 if (!geometry.doesIntersect) 75 if (!geometry.doesIntersect)
76 return; 76 return;
77 LayoutRect rootClipRect(geometry.rootRect); 77 LayoutRect rootClipRect(geometry.rootRect);
78 toLayoutBox(rootLayoutObject)->flipForWritingMode(rootClipRect); 78 toLayoutBox(rootLayoutObject)->flipForWritingMode(rootClipRect);
79 geometry.doesIntersect &= geometry.intersectionRect.inclusiveIntersect(rootC lipRect); 79 geometry.doesIntersect &= geometry.intersectionRect.inclusiveIntersect(rootC lipRect);
80 } 80 }
81 81
82 static void mapRectUpToDocument(LayoutRect& rect, const LayoutObject& layoutObje ct, const Document& document) 82 static void mapRectUpToDocument(LayoutRect& rect, const LayoutObject& layoutObje ct, const Document& document)
83 { 83 {
84 FloatQuad mappedQuad = layoutObject.localToAbsoluteQuad( 84 FloatQuad mappedQuad = layoutObject.localToAbsoluteQuad(
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 m_observer.clear(); 242 m_observer.clear();
243 } 243 }
244 244
245 DEFINE_TRACE(IntersectionObservation) 245 DEFINE_TRACE(IntersectionObservation)
246 { 246 {
247 visitor->trace(m_observer); 247 visitor->trace(m_observer);
248 visitor->trace(m_target); 248 visitor->trace(m_target);
249 } 249 }
250 250
251 } // namespace blink 251 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698