Index: third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.h |
diff --git a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.h b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.h |
index 118763fc8dd13dd5435b6930927c4b941c62e3c0..16f07086d7c79ffe1a76b6eefae797928862a7c9 100644 |
--- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.h |
+++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.h |
@@ -20,27 +20,23 @@ class LayoutObject; |
// It's responsible for bookkeeping tree state in other order, for example, the most recent |
// position container seen. |
struct PaintPropertyTreeBuilderContext { |
- PaintPropertyTreeBuilderContext() |
- : currentTransform(nullptr) |
- , currentClip(nullptr) |
- , transformForAbsolutePosition(nullptr) |
- , containerForAbsolutePosition(nullptr) |
- , clipForAbsolutePosition(nullptr) |
- , transformForFixedPosition(nullptr) |
- , clipForFixedPosition(nullptr) |
- , currentEffect(nullptr) { } |
+ // State that propagates on the containing block chain (and so is adjusted |
+ // when an absolute or fixed position object is encountered). |
+ struct ContainingBlockContext { |
+ // The combination of a transform and paint offset describes a linear space. |
+ // When a layout object recur to its children, the main context is expected to refer |
+ // the object's border box, then the callee will derive its own border box by translating |
+ // the space with its own layout location. |
+ TransformPaintPropertyNode* transform = nullptr; |
+ LayoutPoint paintOffset; |
+ // The clip node describes the accumulated raster clip for the current subtree. |
+ // Note that the computed raster region in canvas space for a clip node is independent from |
+ // the transform and paint offset above. Also the actual raster region may be affected |
+ // by layerization and occlusion tracking. |
+ ClipPaintPropertyNode* clip = nullptr; |
+ }; |
- // The combination of a transform and paint offset describes a linear space. |
- // When a layout object recur to its children, the main context is expected to refer |
- // the object's border box, then the callee will derive its own border box by translating |
- // the space with its own layout location. |
- TransformPaintPropertyNode* currentTransform; |
- LayoutPoint paintOffset; |
- // The clip node describes the accumulated raster clip for the current subtree. |
- // Note that the computed raster region in canvas space for a clip node is independent from |
- // the transform and paint offset above. Also the actual raster region may be affected |
- // by layerization and occlusion tracking. |
- ClipPaintPropertyNode* currentClip; |
+ ContainingBlockContext current; |
// Separate context for out-of-flow positioned and fixed positioned elements are needed |
// because they don't use DOM parent as their containing block. |
@@ -49,19 +45,15 @@ struct PaintPropertyTreeBuilderContext { |
// positioned descendants. |
// Overflow clips are also inherited by containing block tree instead of DOM tree, thus they |
// are included in the additional context too. |
- TransformPaintPropertyNode* transformForAbsolutePosition; |
- LayoutPoint paintOffsetForAbsolutePosition; |
- const LayoutObject* containerForAbsolutePosition; |
- ClipPaintPropertyNode* clipForAbsolutePosition; |
+ ContainingBlockContext absolutePosition; |
+ const LayoutObject* containerForAbsolutePosition = nullptr; |
- TransformPaintPropertyNode* transformForFixedPosition; |
- LayoutPoint paintOffsetForFixedPosition; |
- ClipPaintPropertyNode* clipForFixedPosition; |
+ ContainingBlockContext fixedPosition; |
// The effect hierarchy is applied by the stacking context tree. It is guaranteed that every |
// DOM descendant is also a stacking context descendant. Therefore, we don't need extra |
// bookkeeping for effect nodes and can generate the effect tree from a DOM-order traversal. |
- EffectPaintPropertyNode* currentEffect; |
+ EffectPaintPropertyNode* currentEffect = nullptr; |
}; |
// Creates paint property tree nodes for special things in the layout tree. |