| Index: third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp
|
| diff --git a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp
|
| index b903dbe5ca502038f08d48e03dd118bf05bb148d..09cd4e7ebaab6cfc6f4b1a826d7f83d3cb9034fd 100644
|
| --- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp
|
| +++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp
|
| @@ -98,7 +98,7 @@ void updateFrameViewScroll(
|
| }
|
| }
|
|
|
| -void PaintPropertyTreeBuilder::updateProperties(
|
| +TreeStructureChange PaintPropertyTreeBuilder::updateProperties(
|
| FrameView& frameView,
|
| PaintPropertyTreeBuilderContext& context) {
|
| if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) {
|
| @@ -112,7 +112,7 @@ void PaintPropertyTreeBuilder::updateProperties(
|
| context.absolutePosition = context.current;
|
| context.containerForAbsolutePosition = nullptr;
|
| context.fixedPosition = context.current;
|
| - return;
|
| + return StructureNotChanged;
|
| }
|
|
|
| #if DCHECK_IS_ON()
|
| @@ -191,11 +191,17 @@ void PaintPropertyTreeBuilder::updateProperties(
|
| new PropertyTreeState(context.current.transform, context.current.clip,
|
| context.currentEffect, context.current.scroll));
|
| frameView.setTotalPropertyTreeStateForContents(std::move(contentsState));
|
| +
|
| + // TODO(pdr): Do not return StructureChanged when the FrameView update does
|
| + // not actually cause a property tree node to be created/removed.
|
| + return frameView.needsPaintPropertyUpdate() ? StructureChanged
|
| + : StructureNotChanged;
|
| }
|
|
|
| void PaintPropertyTreeBuilder::updatePaintOffsetTranslation(
|
| const LayoutObject& object,
|
| - PaintPropertyTreeBuilderContext& context) {
|
| + PaintPropertyTreeBuilderContext& context,
|
| + bool& treeStructureChanged) {
|
| bool usesPaintOffsetTranslation = false;
|
| if (RuntimeEnabledFeatures::rootLayerScrollingEnabled() &&
|
| object.isLayoutView()) {
|
| @@ -223,17 +229,19 @@ void PaintPropertyTreeBuilder::updatePaintOffsetTranslation(
|
|
|
| if (object.needsPaintPropertyUpdate()) {
|
| if (usesPaintOffsetTranslation) {
|
| - object.getMutableForPainting()
|
| - .ensurePaintProperties()
|
| - .updatePaintOffsetTranslation(
|
| - context.current.transform,
|
| - TransformationMatrix().translate(roundedPaintOffset.x(),
|
| - roundedPaintOffset.y()),
|
| - FloatPoint3D(), context.current.shouldFlattenInheritedTransform,
|
| - context.current.renderingContextID);
|
| + treeStructureChanged |=
|
| + object.getMutableForPainting()
|
| + .ensurePaintProperties()
|
| + .updatePaintOffsetTranslation(
|
| + context.current.transform,
|
| + TransformationMatrix().translate(roundedPaintOffset.x(),
|
| + roundedPaintOffset.y()),
|
| + FloatPoint3D(),
|
| + context.current.shouldFlattenInheritedTransform,
|
| + context.current.renderingContextID);
|
| } else {
|
| if (auto* properties = object.getMutableForPainting().paintProperties())
|
| - properties->clearPaintOffsetTranslation();
|
| + treeStructureChanged |= properties->clearPaintOffsetTranslation();
|
| }
|
| }
|
|
|
| @@ -262,13 +270,14 @@ static FloatPoint3D transformOrigin(const LayoutBox& box) {
|
|
|
| // SVG does not use the general transform update of |updateTransform|, instead
|
| // creating a transform node for SVG-specific transforms without 3D.
|
| -void PaintPropertyTreeBuilder::updateTransformForNonRootSVG(
|
| +TreeStructureChange PaintPropertyTreeBuilder::updateTransformForNonRootSVG(
|
| const LayoutObject& object,
|
| PaintPropertyTreeBuilderContext& context) {
|
| DCHECK(object.isSVG() && !object.isSVGRoot());
|
| // SVG does not use paint offset internally.
|
| DCHECK(context.current.paintOffset == LayoutPoint());
|
|
|
| + bool treeStructureChanged = false;
|
| if (object.needsPaintPropertyUpdate()) {
|
| const AffineTransform& transform = object.localToSVGParentTransform();
|
| // TODO(pdr): Check for the presence of a transform instead of the value.
|
| @@ -277,12 +286,14 @@ void PaintPropertyTreeBuilder::updateTransformForNonRootSVG(
|
| // identity matrix.
|
| if (!transform.isIdentity()) {
|
| // The origin is included in the local transform, so leave origin empty.
|
| - object.getMutableForPainting().ensurePaintProperties().updateTransform(
|
| - context.current.transform, TransformationMatrix(transform),
|
| - FloatPoint3D());
|
| + treeStructureChanged |=
|
| + object.getMutableForPainting()
|
| + .ensurePaintProperties()
|
| + .updateTransform(context.current.transform,
|
| + TransformationMatrix(transform), FloatPoint3D());
|
| } else {
|
| if (auto* properties = object.getMutableForPainting().paintProperties())
|
| - properties->clearTransform();
|
| + treeStructureChanged |= properties->clearTransform();
|
| }
|
| }
|
|
|
| @@ -291,16 +302,16 @@ void PaintPropertyTreeBuilder::updateTransformForNonRootSVG(
|
| context.current.shouldFlattenInheritedTransform = false;
|
| context.current.renderingContextID = 0;
|
| }
|
| + return static_cast<TreeStructureChange>(treeStructureChanged);
|
| }
|
|
|
| -void PaintPropertyTreeBuilder::updateTransform(
|
| +TreeStructureChange PaintPropertyTreeBuilder::updateTransform(
|
| const LayoutObject& object,
|
| PaintPropertyTreeBuilderContext& context) {
|
| - if (object.isSVG() && !object.isSVGRoot()) {
|
| - updateTransformForNonRootSVG(object, context);
|
| - return;
|
| - }
|
| + if (object.isSVG() && !object.isSVGRoot())
|
| + return updateTransformForNonRootSVG(object, context);
|
|
|
| + bool treeStructureChanged = false;
|
| if (object.needsPaintPropertyUpdate()) {
|
| const ComputedStyle& style = object.styleRef();
|
| if (object.isBox() && (style.hasTransform() || style.preserves3D())) {
|
| @@ -319,13 +330,16 @@ void PaintPropertyTreeBuilder::updateTransform(
|
| if (style.preserves3D() && !renderingContextID)
|
| renderingContextID = PtrHash<const LayoutObject>::hash(&object);
|
|
|
| - object.getMutableForPainting().ensurePaintProperties().updateTransform(
|
| - context.current.transform, matrix,
|
| - transformOrigin(toLayoutBox(object)),
|
| - context.current.shouldFlattenInheritedTransform, renderingContextID);
|
| + treeStructureChanged |=
|
| + object.getMutableForPainting()
|
| + .ensurePaintProperties()
|
| + .updateTransform(context.current.transform, matrix,
|
| + transformOrigin(toLayoutBox(object)),
|
| + context.current.shouldFlattenInheritedTransform,
|
| + renderingContextID);
|
| } else {
|
| if (auto* properties = object.getMutableForPainting().paintProperties())
|
| - properties->clearTransform();
|
| + treeStructureChanged |= properties->clearTransform();
|
| }
|
| }
|
|
|
| @@ -341,19 +355,20 @@ void PaintPropertyTreeBuilder::updateTransform(
|
| context.current.shouldFlattenInheritedTransform = true;
|
| }
|
| }
|
| + return static_cast<TreeStructureChange>(treeStructureChanged);
|
| }
|
|
|
| -void PaintPropertyTreeBuilder::updateEffect(
|
| +TreeStructureChange PaintPropertyTreeBuilder::updateEffect(
|
| const LayoutObject& object,
|
| PaintPropertyTreeBuilderContext& context) {
|
| + bool treeStructureChanged = false;
|
| const ComputedStyle& style = object.styleRef();
|
| -
|
| if (!style.isStackingContext()) {
|
| if (object.needsPaintPropertyUpdate()) {
|
| if (auto* properties = object.getMutableForPainting().paintProperties())
|
| - properties->clearEffect();
|
| + treeStructureChanged |= properties->clearEffect();
|
| }
|
| - return;
|
| + return static_cast<TreeStructureChange>(treeStructureChanged);
|
| }
|
|
|
| // TODO(trchen): Can't omit effect node if we have 3D children.
|
| @@ -402,12 +417,13 @@ void PaintPropertyTreeBuilder::updateEffect(
|
| }
|
|
|
| if (effectNodeNeeded) {
|
| - object.getMutableForPainting().ensurePaintProperties().updateEffect(
|
| - context.currentEffect, context.current.transform, outputClip,
|
| - std::move(filter), opacity);
|
| + treeStructureChanged |=
|
| + object.getMutableForPainting().ensurePaintProperties().updateEffect(
|
| + context.currentEffect, context.current.transform, outputClip,
|
| + std::move(filter), opacity);
|
| } else {
|
| if (auto* properties = object.getMutableForPainting().paintProperties())
|
| - properties->clearEffect();
|
| + treeStructureChanged |= properties->clearEffect();
|
| }
|
| }
|
|
|
| @@ -420,11 +436,13 @@ void PaintPropertyTreeBuilder::updateEffect(
|
| context.current.clip = context.absolutePosition.clip =
|
| context.fixedPosition.clip = expansionHint;
|
| }
|
| + return static_cast<TreeStructureChange>(treeStructureChanged);
|
| }
|
|
|
| -void PaintPropertyTreeBuilder::updateCssClip(
|
| +TreeStructureChange PaintPropertyTreeBuilder::updateCssClip(
|
| const LayoutObject& object,
|
| PaintPropertyTreeBuilderContext& context) {
|
| + bool treeStructureChanged = false;
|
| if (object.needsPaintPropertyUpdate()) {
|
| if (object.hasClip()) {
|
| // Create clip node for descendants that are not fixed position.
|
| @@ -434,31 +452,34 @@ void PaintPropertyTreeBuilder::updateCssClip(
|
| DCHECK(object.canContainAbsolutePositionObjects());
|
| LayoutRect clipRect =
|
| toLayoutBox(object).clipRect(context.current.paintOffset);
|
| - object.getMutableForPainting().ensurePaintProperties().updateCssClip(
|
| - context.current.clip, context.current.transform,
|
| - FloatRoundedRect(FloatRect(clipRect)));
|
| + treeStructureChanged |=
|
| + object.getMutableForPainting().ensurePaintProperties().updateCssClip(
|
| + context.current.clip, context.current.transform,
|
| + FloatRoundedRect(FloatRect(clipRect)));
|
| } else {
|
| if (auto* properties = object.getMutableForPainting().paintProperties())
|
| - properties->clearCssClip();
|
| + treeStructureChanged |= properties->clearCssClip();
|
| }
|
| }
|
|
|
| const auto* properties = object.paintProperties();
|
| if (properties && properties->cssClip())
|
| context.current.clip = properties->cssClip();
|
| + return static_cast<TreeStructureChange>(treeStructureChanged);
|
| }
|
|
|
| -void PaintPropertyTreeBuilder::updateLocalBorderBoxContext(
|
| +TreeStructureChange PaintPropertyTreeBuilder::updateLocalBorderBoxContext(
|
| const LayoutObject& object,
|
| PaintPropertyTreeBuilderContext& context) {
|
| if (!object.needsPaintPropertyUpdate())
|
| - return;
|
| + return StructureNotChanged;
|
|
|
| + bool treeStructureChanged = false;
|
| // Avoid adding an ObjectPaintProperties for non-boxes to save memory, since
|
| // we don't need them at the moment.
|
| if (!object.isBox() && !object.hasLayer()) {
|
| if (auto* properties = object.getMutableForPainting().paintProperties())
|
| - properties->clearLocalBorderBoxProperties();
|
| + treeStructureChanged |= properties->clearLocalBorderBoxProperties();
|
| } else {
|
| std::unique_ptr<ObjectPaintProperties::PropertyTreeStateWithOffset>
|
| borderBoxContext =
|
| @@ -467,19 +488,22 @@ void PaintPropertyTreeBuilder::updateLocalBorderBoxContext(
|
| PropertyTreeState(context.current.transform,
|
| context.current.clip, context.currentEffect,
|
| context.current.scroll)));
|
| - object.getMutableForPainting()
|
| - .ensurePaintProperties()
|
| - .setLocalBorderBoxProperties(std::move(borderBoxContext));
|
| + treeStructureChanged |=
|
| + object.getMutableForPainting()
|
| + .ensurePaintProperties()
|
| + .setLocalBorderBoxProperties(std::move(borderBoxContext));
|
| }
|
| + return static_cast<TreeStructureChange>(treeStructureChanged);
|
| }
|
|
|
| // TODO(trchen): Remove this once we bake the paint offset into frameRect.
|
| -void PaintPropertyTreeBuilder::updateScrollbarPaintOffset(
|
| +TreeStructureChange PaintPropertyTreeBuilder::updateScrollbarPaintOffset(
|
| const LayoutObject& object,
|
| const PaintPropertyTreeBuilderContext& context) {
|
| if (!object.needsPaintPropertyUpdate())
|
| - return;
|
| + return StructureNotChanged;
|
|
|
| + bool treeStructureChanged = false;
|
| bool needsScrollbarPaintOffset = false;
|
| IntPoint roundedPaintOffset = roundedIntPoint(context.current.paintOffset);
|
| if (roundedPaintOffset != IntPoint() && object.isBoxModelObject()) {
|
| @@ -487,10 +511,11 @@ void PaintPropertyTreeBuilder::updateScrollbarPaintOffset(
|
| if (area->horizontalScrollbar() || area->verticalScrollbar()) {
|
| auto paintOffset = TransformationMatrix().translate(
|
| roundedPaintOffset.x(), roundedPaintOffset.y());
|
| - object.getMutableForPainting()
|
| - .ensurePaintProperties()
|
| - .updateScrollbarPaintOffset(context.current.transform, paintOffset,
|
| - FloatPoint3D());
|
| + treeStructureChanged |=
|
| + object.getMutableForPainting()
|
| + .ensurePaintProperties()
|
| + .updateScrollbarPaintOffset(context.current.transform,
|
| + paintOffset, FloatPoint3D());
|
| needsScrollbarPaintOffset = true;
|
| }
|
| }
|
| @@ -498,15 +523,17 @@ void PaintPropertyTreeBuilder::updateScrollbarPaintOffset(
|
|
|
| auto* properties = object.getMutableForPainting().paintProperties();
|
| if (!needsScrollbarPaintOffset && properties)
|
| - properties->clearScrollbarPaintOffset();
|
| + treeStructureChanged |= properties->clearScrollbarPaintOffset();
|
| + return static_cast<TreeStructureChange>(treeStructureChanged);
|
| }
|
|
|
| -void PaintPropertyTreeBuilder::updateOverflowClip(
|
| +TreeStructureChange PaintPropertyTreeBuilder::updateOverflowClip(
|
| const LayoutObject& object,
|
| PaintPropertyTreeBuilderContext& context) {
|
| if (!object.isBox())
|
| - return;
|
| + return StructureNotChanged;
|
|
|
| + bool treeStructureChanged = false;
|
| if (object.needsPaintPropertyUpdate()) {
|
| const LayoutBox& box = toLayoutBox(object);
|
| // The <input> elements can't have contents thus CSS overflow property
|
| @@ -524,34 +551,38 @@ void PaintPropertyTreeBuilder::updateOverflowClip(
|
| box.overflowClipRect(context.current.paintOffset)));
|
| } else {
|
| if (auto* properties = object.getMutableForPainting().paintProperties()) {
|
| - properties->clearInnerBorderRadiusClip();
|
| - properties->clearOverflowClip();
|
| + treeStructureChanged |= properties->clearInnerBorderRadiusClip();
|
| + treeStructureChanged |= properties->clearOverflowClip();
|
| }
|
| - return;
|
| + return static_cast<TreeStructureChange>(treeStructureChanged);
|
| }
|
|
|
| const auto* currentClip = context.current.clip;
|
| if (box.styleRef().hasBorderRadius()) {
|
| auto innerBorder = box.styleRef().getRoundedInnerBorderFor(
|
| LayoutRect(context.current.paintOffset, box.size()));
|
| - object.getMutableForPainting()
|
| - .ensurePaintProperties()
|
| - .updateInnerBorderRadiusClip(context.current.clip,
|
| - context.current.transform, innerBorder);
|
| + treeStructureChanged |=
|
| + object.getMutableForPainting()
|
| + .ensurePaintProperties()
|
| + .updateInnerBorderRadiusClip(
|
| + context.current.clip, context.current.transform, innerBorder);
|
| currentClip = object.paintProperties()->innerBorderRadiusClip();
|
| } else if (auto* properties =
|
| object.getMutableForPainting().paintProperties()) {
|
| - properties->clearInnerBorderRadiusClip();
|
| + treeStructureChanged |= properties->clearInnerBorderRadiusClip();
|
| }
|
|
|
| - object.getMutableForPainting().ensurePaintProperties().updateOverflowClip(
|
| - currentClip, context.current.transform,
|
| - FloatRoundedRect(FloatRect(clipRect)));
|
| + treeStructureChanged |=
|
| + object.getMutableForPainting()
|
| + .ensurePaintProperties()
|
| + .updateOverflowClip(currentClip, context.current.transform,
|
| + FloatRoundedRect(FloatRect(clipRect)));
|
| }
|
|
|
| const auto* properties = object.paintProperties();
|
| if (properties && properties->overflowClip())
|
| context.current.clip = properties->overflowClip();
|
| + return static_cast<TreeStructureChange>(treeStructureChanged);
|
| }
|
|
|
| static FloatPoint perspectiveOrigin(const LayoutBox& box) {
|
| @@ -562,9 +593,10 @@ static FloatPoint perspectiveOrigin(const LayoutBox& box) {
|
| floatValueForLength(style.perspectiveOriginY(), borderBoxSize.height()));
|
| }
|
|
|
| -void PaintPropertyTreeBuilder::updatePerspective(
|
| +TreeStructureChange PaintPropertyTreeBuilder::updatePerspective(
|
| const LayoutObject& object,
|
| PaintPropertyTreeBuilderContext& context) {
|
| + bool treeStructureChanged = false;
|
| if (object.needsPaintPropertyUpdate()) {
|
| const ComputedStyle& style = object.styleRef();
|
| if (object.isBox() && style.hasPerspective()) {
|
| @@ -575,13 +607,16 @@ void PaintPropertyTreeBuilder::updatePerspective(
|
| TransformationMatrix().applyPerspective(style.perspective());
|
| FloatPoint3D origin = perspectiveOrigin(toLayoutBox(object)) +
|
| toLayoutSize(context.current.paintOffset);
|
| - object.getMutableForPainting().ensurePaintProperties().updatePerspective(
|
| - context.current.transform, matrix, origin,
|
| - context.current.shouldFlattenInheritedTransform,
|
| - context.current.renderingContextID);
|
| + treeStructureChanged |=
|
| + object.getMutableForPainting()
|
| + .ensurePaintProperties()
|
| + .updatePerspective(
|
| + context.current.transform, matrix, origin,
|
| + context.current.shouldFlattenInheritedTransform,
|
| + context.current.renderingContextID);
|
| } else {
|
| if (auto* properties = object.getMutableForPainting().paintProperties())
|
| - properties->clearPerspective();
|
| + treeStructureChanged |= properties->clearPerspective();
|
| }
|
| }
|
|
|
| @@ -590,26 +625,30 @@ void PaintPropertyTreeBuilder::updatePerspective(
|
| context.current.transform = properties->perspective();
|
| context.current.shouldFlattenInheritedTransform = false;
|
| }
|
| + return static_cast<TreeStructureChange>(treeStructureChanged);
|
| }
|
|
|
| -void PaintPropertyTreeBuilder::updateSvgLocalToBorderBoxTransform(
|
| +TreeStructureChange
|
| +PaintPropertyTreeBuilder::updateSvgLocalToBorderBoxTransform(
|
| const LayoutObject& object,
|
| PaintPropertyTreeBuilderContext& context) {
|
| if (!object.isSVGRoot())
|
| - return;
|
| + return StructureNotChanged;
|
|
|
| + bool treeStructureChanged = false;
|
| if (object.needsPaintPropertyUpdate()) {
|
| AffineTransform transformToBorderBox =
|
| SVGRootPainter(toLayoutSVGRoot(object))
|
| .transformToPixelSnappedBorderBox(context.current.paintOffset);
|
| if (!transformToBorderBox.isIdentity()) {
|
| - object.getMutableForPainting()
|
| - .ensurePaintProperties()
|
| - .updateSvgLocalToBorderBoxTransform(
|
| - context.current.transform, transformToBorderBox, FloatPoint3D());
|
| + treeStructureChanged |= object.getMutableForPainting()
|
| + .ensurePaintProperties()
|
| + .updateSvgLocalToBorderBoxTransform(
|
| + context.current.transform,
|
| + transformToBorderBox, FloatPoint3D());
|
| } else {
|
| if (auto* properties = object.getMutableForPainting().paintProperties())
|
| - properties->clearSvgLocalToBorderBoxTransform();
|
| + treeStructureChanged |= properties->clearSvgLocalToBorderBoxTransform();
|
| }
|
| }
|
|
|
| @@ -622,11 +661,14 @@ void PaintPropertyTreeBuilder::updateSvgLocalToBorderBoxTransform(
|
| // The paint offset is included in |transformToBorderBox| so SVG does not need
|
| // to handle paint offset internally.
|
| context.current.paintOffset = LayoutPoint();
|
| +
|
| + return static_cast<TreeStructureChange>(treeStructureChanged);
|
| }
|
|
|
| -void PaintPropertyTreeBuilder::updateScrollAndScrollTranslation(
|
| +TreeStructureChange PaintPropertyTreeBuilder::updateScrollAndScrollTranslation(
|
| const LayoutObject& object,
|
| PaintPropertyTreeBuilderContext& context) {
|
| + bool treeStructureChanged = false;
|
| if (object.needsPaintPropertyUpdate()) {
|
| if (object.hasOverflowClip()) {
|
| const LayoutBox& box = toLayoutBox(object);
|
| @@ -635,12 +677,13 @@ void PaintPropertyTreeBuilder::updateScrollAndScrollTranslation(
|
| if (!scrollOffset.isZero() || scrollableArea->scrollsOverflow()) {
|
| TransformationMatrix matrix = TransformationMatrix().translate(
|
| -scrollOffset.width(), -scrollOffset.height());
|
| - object.getMutableForPainting()
|
| - .ensurePaintProperties()
|
| - .updateScrollTranslation(
|
| - context.current.transform, matrix, FloatPoint3D(),
|
| - context.current.shouldFlattenInheritedTransform,
|
| - context.current.renderingContextID);
|
| + treeStructureChanged |=
|
| + object.getMutableForPainting()
|
| + .ensurePaintProperties()
|
| + .updateScrollTranslation(
|
| + context.current.transform, matrix, FloatPoint3D(),
|
| + context.current.shouldFlattenInheritedTransform,
|
| + context.current.renderingContextID);
|
|
|
| IntSize scrollClip = scrollableArea->visibleContentRect().size();
|
| IntSize scrollBounds = scrollableArea->contentsSize();
|
| @@ -662,18 +705,19 @@ void PaintPropertyTreeBuilder::updateScrollAndScrollTranslation(
|
| reasons |=
|
| MainThreadScrollingReason::kHasBackgroundAttachmentFixedObjects;
|
| }
|
| - object.getMutableForPainting().ensurePaintProperties().updateScroll(
|
| - context.current.scroll,
|
| - object.paintProperties()->scrollTranslation(), scrollClip,
|
| - scrollBounds, userScrollableHorizontal, userScrollableVertical,
|
| - reasons);
|
| + treeStructureChanged |=
|
| + object.getMutableForPainting().ensurePaintProperties().updateScroll(
|
| + context.current.scroll,
|
| + object.paintProperties()->scrollTranslation(), scrollClip,
|
| + scrollBounds, userScrollableHorizontal, userScrollableVertical,
|
| + reasons);
|
| } else {
|
| // Ensure pre-existing properties are cleared when there is no
|
| // scrolling.
|
| auto* properties = object.getMutableForPainting().paintProperties();
|
| if (properties) {
|
| - properties->clearScrollTranslation();
|
| - properties->clearScroll();
|
| + treeStructureChanged |= properties->clearScrollTranslation();
|
| + treeStructureChanged |= properties->clearScroll();
|
| }
|
| }
|
| }
|
| @@ -684,9 +728,10 @@ void PaintPropertyTreeBuilder::updateScrollAndScrollTranslation(
|
| context.current.scroll = object.paintProperties()->scroll();
|
| context.current.shouldFlattenInheritedTransform = false;
|
| }
|
| + return static_cast<TreeStructureChange>(treeStructureChanged);
|
| }
|
|
|
| -void PaintPropertyTreeBuilder::updateOutOfFlowContext(
|
| +TreeStructureChange PaintPropertyTreeBuilder::updateOutOfFlowContext(
|
| const LayoutObject& object,
|
| PaintPropertyTreeBuilderContext& context) {
|
| if (object.canContainAbsolutePositionObjects()) {
|
| @@ -694,6 +739,7 @@ void PaintPropertyTreeBuilder::updateOutOfFlowContext(
|
| context.containerForAbsolutePosition = &object;
|
| }
|
|
|
| + bool treeStructureChanged = false;
|
| if (object.isLayoutView()) {
|
| if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) {
|
| const auto* initialFixedTransform = context.fixedPosition.transform;
|
| @@ -723,9 +769,10 @@ void PaintPropertyTreeBuilder::updateOutOfFlowContext(
|
| context.fixedPosition.clip = cssClip;
|
| } else {
|
| if (object.needsPaintPropertyUpdate()) {
|
| - object.getMutableForPainting()
|
| - .ensurePaintProperties()
|
| - .updateCssClipFixedPosition(context.fixedPosition.clip,
|
| + treeStructureChanged |= object.getMutableForPainting()
|
| + .ensurePaintProperties()
|
| + .updateCssClipFixedPosition(
|
| + context.fixedPosition.clip,
|
| const_cast<TransformPaintPropertyNode*>(
|
| cssClip->localTransformSpace()),
|
| cssClip->clipRect());
|
| @@ -733,14 +780,15 @@ void PaintPropertyTreeBuilder::updateOutOfFlowContext(
|
| const auto* properties = object.paintProperties();
|
| if (properties && properties->cssClipFixedPosition())
|
| context.fixedPosition.clip = properties->cssClipFixedPosition();
|
| - return;
|
| + return static_cast<TreeStructureChange>(treeStructureChanged);
|
| }
|
| }
|
|
|
| if (object.needsPaintPropertyUpdate()) {
|
| if (auto* properties = object.getMutableForPainting().paintProperties())
|
| - properties->clearCssClipFixedPosition();
|
| + treeStructureChanged |= properties->clearCssClipFixedPosition();
|
| }
|
| + return static_cast<TreeStructureChange>(treeStructureChanged);
|
| }
|
|
|
| // Override ContainingBlockContext based on the properties of a containing block
|
| @@ -860,11 +908,11 @@ static void deriveBorderBoxFromContainerContext(
|
| }
|
| }
|
|
|
| -void PaintPropertyTreeBuilder::updatePropertiesForSelf(
|
| +TreeStructureChange PaintPropertyTreeBuilder::updatePropertiesForSelf(
|
| const LayoutObject& object,
|
| PaintPropertyTreeBuilderContext& context) {
|
| if (!object.isBoxModelObject() && !object.isSVG())
|
| - return;
|
| + return StructureNotChanged;
|
|
|
| #if DCHECK_IS_ON()
|
| FindObjectPropertiesNeedingUpdateScope checkNeedsUpdateScope(object);
|
| @@ -872,29 +920,33 @@ void PaintPropertyTreeBuilder::updatePropertiesForSelf(
|
|
|
| deriveBorderBoxFromContainerContext(object, context);
|
|
|
| - updatePaintOffsetTranslation(object, context);
|
| - updateTransform(object, context);
|
| - updateEffect(object, context);
|
| - updateCssClip(object, context);
|
| - updateLocalBorderBoxContext(object, context);
|
| - updateScrollbarPaintOffset(object, context);
|
| + bool treeStructureChanged = false;
|
| + updatePaintOffsetTranslation(object, context, treeStructureChanged);
|
| + treeStructureChanged |= updateTransform(object, context);
|
| + treeStructureChanged |= updateEffect(object, context);
|
| + treeStructureChanged |= updateCssClip(object, context);
|
| + treeStructureChanged |= updateLocalBorderBoxContext(object, context);
|
| + treeStructureChanged |= updateScrollbarPaintOffset(object, context);
|
| + return static_cast<TreeStructureChange>(treeStructureChanged);
|
| }
|
|
|
| -void PaintPropertyTreeBuilder::updatePropertiesForChildren(
|
| +TreeStructureChange PaintPropertyTreeBuilder::updatePropertiesForChildren(
|
| const LayoutObject& object,
|
| PaintPropertyTreeBuilderContext& context) {
|
| if (!object.isBoxModelObject() && !object.isSVG())
|
| - return;
|
| + return StructureNotChanged;
|
|
|
| #if DCHECK_IS_ON()
|
| FindObjectPropertiesNeedingUpdateScope checkNeedsUpdateScope(object);
|
| #endif
|
|
|
| - updateOverflowClip(object, context);
|
| - updatePerspective(object, context);
|
| - updateSvgLocalToBorderBoxTransform(object, context);
|
| - updateScrollAndScrollTranslation(object, context);
|
| - updateOutOfFlowContext(object, context);
|
| + bool treeStructureChanged = false;
|
| + treeStructureChanged |= updateOverflowClip(object, context);
|
| + treeStructureChanged |= updatePerspective(object, context);
|
| + treeStructureChanged |= updateSvgLocalToBorderBoxTransform(object, context);
|
| + treeStructureChanged |= updateScrollAndScrollTranslation(object, context);
|
| + treeStructureChanged |= updateOutOfFlowContext(object, context);
|
| + return static_cast<TreeStructureChange>(treeStructureChanged);
|
| }
|
|
|
| } // namespace blink
|
|
|