OLD | NEW |
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 23 matching lines...) Expand all Loading... |
34 #include "platform/RuntimeEnabledFeatures.h" | 34 #include "platform/RuntimeEnabledFeatures.h" |
35 #include "platform/heap/Handle.h" | 35 #include "platform/heap/Handle.h" |
36 #include "platform/scroll/ScrollableArea.h" | 36 #include "platform/scroll/ScrollableArea.h" |
37 #include "wtf/OwnPtr.h" | 37 #include "wtf/OwnPtr.h" |
38 | 38 |
39 namespace blink { | 39 namespace blink { |
40 | 40 |
41 class DeprecatedPaintLayerCompositor; | 41 class DeprecatedPaintLayerCompositor; |
42 class LayoutQuote; | 42 class LayoutQuote; |
43 | 43 |
| 44 using IntersectionObserverTargetMap = HashMap<LayoutObject*, FloatRect>; |
| 45 |
44 // LayoutView is the root of the layout tree and the Document's LayoutObject. | 46 // LayoutView is the root of the layout tree and the Document's LayoutObject. |
45 // | 47 // |
46 // It corresponds to the CSS concept of 'initial containing block' (or ICB). | 48 // It corresponds to the CSS concept of 'initial containing block' (or ICB). |
47 // http://www.w3.org/TR/CSS2/visudet.html#containing-block-details | 49 // http://www.w3.org/TR/CSS2/visudet.html#containing-block-details |
48 // | 50 // |
49 // Its dimensions match that of the layout viewport. This viewport is used to | 51 // Its dimensions match that of the layout viewport. This viewport is used to |
50 // size elements, in particular fixed positioned elements. | 52 // size elements, in particular fixed positioned elements. |
51 // LayoutView is always at position (0,0) relative to the document (and so isn't | 53 // LayoutView is always at position (0,0) relative to the document (and so isn't |
52 // necessarily in view). | 54 // necessarily in view). |
53 // See | 55 // See |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 void pushLayoutState(LayoutState& layoutState) { m_layoutState = &layoutStat
e; } | 193 void pushLayoutState(LayoutState& layoutState) { m_layoutState = &layoutStat
e; } |
192 void popLayoutState() { ASSERT(m_layoutState); m_layoutState = m_layoutState
->next(); } | 194 void popLayoutState() { ASSERT(m_layoutState); m_layoutState = m_layoutState
->next(); } |
193 void invalidateTreeIfNeeded(PaintInvalidationState&) final; | 195 void invalidateTreeIfNeeded(PaintInvalidationState&) final; |
194 | 196 |
195 LayoutRect visualOverflowRect() const override; | 197 LayoutRect visualOverflowRect() const override; |
196 | 198 |
197 // Invalidates paint for the entire view, including composited descendants,
but not including child frames. | 199 // Invalidates paint for the entire view, including composited descendants,
but not including child frames. |
198 // It is very likely you do not want to call this method. | 200 // It is very likely you do not want to call this method. |
199 void setShouldDoFullPaintInvalidationForViewAndAllDescendants(); | 201 void setShouldDoFullPaintInvalidationForViewAndAllDescendants(); |
200 | 202 |
| 203 void addIntersectionObserverTarget(LayoutObject*); |
| 204 void removeIntersectionObserverTarget(LayoutObject*); |
| 205 void computeIntersectionObservations(const FloatRect&); |
| 206 |
201 private: | 207 private: |
202 void mapLocalToContainer(const LayoutBoxModelObject* paintInvalidationContai
ner, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool* wasFixed =
nullptr, const PaintInvalidationState* = nullptr) const override; | 208 void mapLocalToContainer(const LayoutBoxModelObject* paintInvalidationContai
ner, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool* wasFixed =
nullptr, const PaintInvalidationState* = nullptr) const override; |
203 | 209 |
204 const LayoutObject* pushMappingToContainer(const LayoutBoxModelObject* ances
torToStopAt, LayoutGeometryMap&) const override; | 210 const LayoutObject* pushMappingToContainer(const LayoutBoxModelObject* ances
torToStopAt, LayoutGeometryMap&) const override; |
205 void mapAbsoluteToLocalPoint(MapCoordinatesFlags, TransformState&) const ove
rride; | 211 void mapAbsoluteToLocalPoint(MapCoordinatesFlags, TransformState&) const ove
rride; |
206 void computeSelfHitTestRects(Vector<LayoutRect>&, const LayoutPoint& layerOf
fset) const override; | 212 void computeSelfHitTestRects(Vector<LayoutRect>&, const LayoutPoint& layerOf
fset) const override; |
207 | 213 |
208 void layoutContent(); | 214 void layoutContent(); |
209 #if ENABLE(ASSERT) | 215 #if ENABLE(ASSERT) |
210 void checkLayoutState(); | 216 void checkLayoutState(); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 | 259 |
254 OwnPtr<DeprecatedPaintLayerCompositor> m_compositor; | 260 OwnPtr<DeprecatedPaintLayerCompositor> m_compositor; |
255 RefPtr<IntervalArena> m_intervalArena; | 261 RefPtr<IntervalArena> m_intervalArena; |
256 | 262 |
257 LayoutQuote* m_layoutQuoteHead; | 263 LayoutQuote* m_layoutQuoteHead; |
258 unsigned m_layoutCounterCount; | 264 unsigned m_layoutCounterCount; |
259 | 265 |
260 unsigned m_hitTestCount; | 266 unsigned m_hitTestCount; |
261 unsigned m_hitTestCacheHits; | 267 unsigned m_hitTestCacheHits; |
262 OwnPtrWillBePersistent<HitTestCache> m_hitTestCache; | 268 OwnPtrWillBePersistent<HitTestCache> m_hitTestCache; |
| 269 |
| 270 IntersectionObserverTargetMap m_intersectionObserverTargets; |
263 }; | 271 }; |
264 | 272 |
265 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutView, isLayoutView()); | 273 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutView, isLayoutView()); |
266 | 274 |
267 // Suspends the PaintInvalidationState cached offset and clipRect optimization.
Used under transforms | 275 // Suspends the PaintInvalidationState cached offset and clipRect optimization.
Used under transforms |
268 // that cannot be represented by PaintInvalidationState (common in SVG) and when
paint invalidation | 276 // that cannot be represented by PaintInvalidationState (common in SVG) and when
paint invalidation |
269 // containers don't follow the common tree-walk algorithm (e.g. when an absolute
positioned descendant | 277 // containers don't follow the common tree-walk algorithm (e.g. when an absolute
positioned descendant |
270 // is nested under a relatively positioned inline-block child). | 278 // is nested under a relatively positioned inline-block child). |
271 class ForceHorriblySlowRectMapping { | 279 class ForceHorriblySlowRectMapping { |
272 STACK_ALLOCATED(); | 280 STACK_ALLOCATED(); |
(...skipping 13 matching lines...) Expand all Loading... |
286 m_paintInvalidationState->m_cachedOffsetsEnabled = true; | 294 m_paintInvalidationState->m_cachedOffsetsEnabled = true; |
287 } | 295 } |
288 private: | 296 private: |
289 const PaintInvalidationState* m_paintInvalidationState; | 297 const PaintInvalidationState* m_paintInvalidationState; |
290 bool m_didDisable; | 298 bool m_didDisable; |
291 }; | 299 }; |
292 | 300 |
293 } // namespace blink | 301 } // namespace blink |
294 | 302 |
295 #endif // LayoutView_h | 303 #endif // LayoutView_h |
OLD | NEW |