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

Side by Side Diff: Source/core/layout/LayoutView.h

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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2006 Apple Computer, Inc. 3 * Copyright (C) 2006 Apple Computer, Inc.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 25 matching lines...) Expand all
36 #include "platform/RuntimeEnabledFeatures.h" 36 #include "platform/RuntimeEnabledFeatures.h"
37 #include "platform/heap/Handle.h" 37 #include "platform/heap/Handle.h"
38 #include "platform/scroll/ScrollableArea.h" 38 #include "platform/scroll/ScrollableArea.h"
39 #include "wtf/OwnPtr.h" 39 #include "wtf/OwnPtr.h"
40 40
41 namespace blink { 41 namespace blink {
42 42
43 class DeprecatedPaintLayerCompositor; 43 class DeprecatedPaintLayerCompositor;
44 class LayoutQuote; 44 class LayoutQuote;
45 45
46 using IntersectionObserverTargetMap = HashMap<LayoutObject*, FloatRect>;
47
46 // The root of the layout tree, corresponding to the CSS initial containing bloc k. 48 // The root of the layout tree, corresponding to the CSS initial containing bloc k.
47 // It's dimensions match that of the logical viewport (which may be different fr om 49 // It's dimensions match that of the logical viewport (which may be different fr om
48 // the visible viewport in fixed-layout mode), and it is always at position (0,0 ) 50 // the visible viewport in fixed-layout mode), and it is always at position (0,0 )
49 // relative to the document (and so isn't necessarily in view). 51 // relative to the document (and so isn't necessarily in view).
50 class CORE_EXPORT LayoutView final : public LayoutBlockFlow { 52 class CORE_EXPORT LayoutView final : public LayoutBlockFlow {
51 public: 53 public:
52 explicit LayoutView(Document*); 54 explicit LayoutView(Document*);
53 ~LayoutView() override; 55 ~LayoutView() override;
54 void willBeDestroyed() override; 56 void willBeDestroyed() override;
55 57
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 void pushLayoutState(LayoutState& layoutState) { m_layoutState = &layoutStat e; } 184 void pushLayoutState(LayoutState& layoutState) { m_layoutState = &layoutStat e; }
183 void popLayoutState() { ASSERT(m_layoutState); m_layoutState = m_layoutState ->next(); } 185 void popLayoutState() { ASSERT(m_layoutState); m_layoutState = m_layoutState ->next(); }
184 void invalidateTreeIfNeeded(PaintInvalidationState&) final; 186 void invalidateTreeIfNeeded(PaintInvalidationState&) final;
185 187
186 LayoutRect visualOverflowRect() const override; 188 LayoutRect visualOverflowRect() const override;
187 189
188 // Invalidates paint for the entire view, including composited descendants, but not including child frames. 190 // Invalidates paint for the entire view, including composited descendants, but not including child frames.
189 // It is very likely you do not want to call this method. 191 // It is very likely you do not want to call this method.
190 void setShouldDoFullPaintInvalidationForViewAndAllDescendants(); 192 void setShouldDoFullPaintInvalidationForViewAndAllDescendants();
191 193
194 void addIntersectionObserverTarget(LayoutObject*);
195 void removeIntersectionObserverTarget(LayoutObject*);
196 void computeIntersectionObservations(const FloatRect&);
197
192 private: 198 private:
193 void mapLocalToContainer(const LayoutBoxModelObject* paintInvalidationContai ner, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool* wasFixed = nullptr, const PaintInvalidationState* = nullptr) const override; 199 void mapLocalToContainer(const LayoutBoxModelObject* paintInvalidationContai ner, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool* wasFixed = nullptr, const PaintInvalidationState* = nullptr) const override;
194 200
195 template <typename Strategy> 201 template <typename Strategy>
196 void commitPendingSelectionAlgorithm(); 202 void commitPendingSelectionAlgorithm();
197 203
198 const LayoutObject* pushMappingToContainer(const LayoutBoxModelObject* ances torToStopAt, LayoutGeometryMap&) const override; 204 const LayoutObject* pushMappingToContainer(const LayoutBoxModelObject* ances torToStopAt, LayoutGeometryMap&) const override;
199 void mapAbsoluteToLocalPoint(MapCoordinatesFlags, TransformState&) const ove rride; 205 void mapAbsoluteToLocalPoint(MapCoordinatesFlags, TransformState&) const ove rride;
200 void computeSelfHitTestRects(Vector<LayoutRect>&, const LayoutPoint& layerOf fset) const override; 206 void computeSelfHitTestRects(Vector<LayoutRect>&, const LayoutPoint& layerOf fset) const override;
201 207
(...skipping 25 matching lines...) Expand all
227 RefPtr<IntervalArena> m_intervalArena; 233 RefPtr<IntervalArena> m_intervalArena;
228 234
229 LayoutQuote* m_layoutQuoteHead; 235 LayoutQuote* m_layoutQuoteHead;
230 unsigned m_layoutCounterCount; 236 unsigned m_layoutCounterCount;
231 237
232 unsigned m_hitTestCount; 238 unsigned m_hitTestCount;
233 unsigned m_hitTestCacheHits; 239 unsigned m_hitTestCacheHits;
234 OwnPtrWillBePersistent<HitTestCache> m_hitTestCache; 240 OwnPtrWillBePersistent<HitTestCache> m_hitTestCache;
235 241
236 OwnPtrWillBePersistent<PendingSelection> m_pendingSelection; 242 OwnPtrWillBePersistent<PendingSelection> m_pendingSelection;
243
244 IntersectionObserverTargetMap m_intersectionObserverTargets;
237 }; 245 };
238 246
239 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutView, isLayoutView()); 247 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutView, isLayoutView());
240 248
241 // Suspends the PaintInvalidationState cached offset and clipRect optimization. Used under transforms 249 // Suspends the PaintInvalidationState cached offset and clipRect optimization. Used under transforms
242 // that cannot be represented by PaintInvalidationState (common in SVG) and when paint invalidation 250 // that cannot be represented by PaintInvalidationState (common in SVG) and when paint invalidation
243 // containers don't follow the common tree-walk algorithm (e.g. when an absolute positioned descendant 251 // containers don't follow the common tree-walk algorithm (e.g. when an absolute positioned descendant
244 // is nested under a relatively positioned inline-block child). 252 // is nested under a relatively positioned inline-block child).
245 class ForceHorriblySlowRectMapping { 253 class ForceHorriblySlowRectMapping {
246 STACK_ALLOCATED(); 254 STACK_ALLOCATED();
(...skipping 13 matching lines...) Expand all
260 m_paintInvalidationState->m_cachedOffsetsEnabled = true; 268 m_paintInvalidationState->m_cachedOffsetsEnabled = true;
261 } 269 }
262 private: 270 private:
263 const PaintInvalidationState* m_paintInvalidationState; 271 const PaintInvalidationState* m_paintInvalidationState;
264 bool m_didDisable; 272 bool m_didDisable;
265 }; 273 };
266 274
267 } // namespace blink 275 } // namespace blink
268 276
269 #endif // LayoutView_h 277 #endif // LayoutView_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698