| 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 1a2ac756ebe0ce1ecfac18df0090bdcd735442e3..9465793b2b222d0d51632ed09ff735198ff863c9 100644
|
| --- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp
|
| +++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp
|
| @@ -21,6 +21,10 @@ namespace blink {
|
|
|
| void PaintPropertyTreeBuilder::buildTreeRootNodes(FrameView& rootFrame, PaintPropertyTreeBuilderContext& context)
|
| {
|
| + Settings* settings = rootFrame.frame().settings();
|
| + if (settings && settings->rootLayerScrolls())
|
| + return;
|
| +
|
| if (!rootFrame.rootTransform() || rootFrame.rootTransform()->parent()) {
|
| rootFrame.setRootTransform(TransformPaintPropertyNode::create(nullptr, TransformationMatrix(), FloatPoint3D()));
|
| rootFrame.setRootClip(ClipPaintPropertyNode::create(nullptr, rootFrame.rootTransform(), FloatRoundedRect(LayoutRect::infiniteIntRect())));
|
| @@ -37,9 +41,32 @@ void PaintPropertyTreeBuilder::buildTreeRootNodes(FrameView& rootFrame, PaintPro
|
|
|
| void PaintPropertyTreeBuilder::buildTreeNodes(FrameView& frameView, PaintPropertyTreeBuilderContext& context)
|
| {
|
| - // TODO(pdr): Creating paint properties for FrameView here will not be
|
| - // needed once settings()->rootLayerScrolls() is enabled.
|
| - // TODO(pdr): Make this conditional on the rootLayerScrolls setting.
|
| + Settings* settings = frameView.frame().settings();
|
| + if (settings && settings->rootLayerScrolls()) {
|
| + LayoutView* layoutView = frameView.layoutView();
|
| + if (!layoutView)
|
| + return;
|
| +
|
| + if (!context.currentEffect) {
|
| + DCHECK(frameView.frame().isLocalRoot());
|
| + context.currentEffect = layoutView->getMutableForPainting().ensureObjectPaintProperties().createOrUpdateEffect(nullptr, 1.0);
|
| + }
|
| +
|
| + TransformationMatrix frameTranslate;
|
| + frameTranslate.translate(
|
| + frameView.x() + layoutView->location().x() + context.current.paintOffset.x(),
|
| + frameView.y() + layoutView->location().y() + context.current.paintOffset.y());
|
| + context.current.transform = layoutView->getMutableForPainting().ensureObjectPaintProperties().createOrUpdatePaintOffsetTranslation(
|
| + context.current.transform, frameTranslate, FloatPoint3D());
|
| + context.current.paintOffset = LayoutPoint();
|
| + context.current.clip = nullptr; // This will get set in updateOverflowClip().
|
| + context.current.renderingContextID = 0;
|
| + context.current.shouldFlattenInheritedTransform = true;
|
| + context.absolutePosition = context.current;
|
| + context.containerForAbsolutePosition = nullptr; // This will get set in updateOutOfFlowContext().
|
| + context.fixedPosition = context.current;
|
| + return;
|
| + }
|
|
|
| TransformationMatrix frameTranslate;
|
| frameTranslate.translate(frameView.x() + context.current.paintOffset.x(), frameView.y() + context.current.paintOffset.y());
|
| @@ -98,6 +125,9 @@ void PaintPropertyTreeBuilder::updatePaintOffsetTranslation(const LayoutObject&
|
| }
|
| }
|
|
|
| + if (object.isLayoutView())
|
| + return;
|
| +
|
| if (ObjectPaintProperties* properties = object.getMutableForPainting().objectPaintProperties())
|
| properties->clearPaintOffsetTranslation();
|
| }
|
| @@ -169,6 +199,9 @@ void PaintPropertyTreeBuilder::updateTransform(const LayoutObject& object, Paint
|
|
|
| void PaintPropertyTreeBuilder::updateEffect(const LayoutObject& object, PaintPropertyTreeBuilderContext& context)
|
| {
|
| + if (object.isLayoutView())
|
| + return;
|
| +
|
| if (!object.styleRef().hasOpacity()) {
|
| if (ObjectPaintProperties* properties = object.getMutableForPainting().objectPaintProperties())
|
| properties->clearEffect();
|
| @@ -207,6 +240,7 @@ void PaintPropertyTreeBuilder::updateLocalBorderBoxContext(const LayoutObject& o
|
| wrapUnique(new ObjectPaintProperties::LocalBorderBoxProperties);
|
| borderBoxContext->paintOffset = context.current.paintOffset;
|
| borderBoxContext->propertyTreeState = PropertyTreeState(context.current.transform, context.current.clip, context.currentEffect);
|
| +
|
| object.getMutableForPainting().ensureObjectPaintProperties().setLocalBorderBoxProperties(std::move(borderBoxContext));
|
| }
|
|
|
| @@ -321,7 +355,14 @@ void PaintPropertyTreeBuilder::updateScrollTranslation(const LayoutObject& objec
|
| DCHECK(layer);
|
| DoubleSize scrollOffset = layer->getScrollableArea()->scrollOffset();
|
|
|
| - if (!scrollOffset.isZero() || layer->scrollsOverflow()) {
|
| + if (object.isLayoutView()) {
|
| + Settings* settings = object.document().settings();
|
| + if (settings && settings->rootLayerScrolls()) {
|
| + context.current.transform = object.getMutableForPainting().ensureObjectPaintProperties().createOrUpdateScrollTranslation(context.current.transform, TransformationMatrix().translate(-scrollOffset.width(), -scrollOffset.height()), FloatPoint3D());
|
| + context.current.shouldFlattenInheritedTransform = false;
|
| + return;
|
| + }
|
| + } else if (!scrollOffset.isZero() || layer->scrollsOverflow()) {
|
| TransformationMatrix matrix = TransformationMatrix().translate(-scrollOffset.width(), -scrollOffset.height());
|
| context.current.transform = object.getMutableForPainting().ensureObjectPaintProperties().createOrUpdateScrollTranslation(
|
| context.current.transform, matrix, FloatPoint3D(), context.current.shouldFlattenInheritedTransform, context.current.renderingContextID);
|
| @@ -341,9 +382,15 @@ void PaintPropertyTreeBuilder::updateOutOfFlowContext(const LayoutObject& object
|
| context.containerForAbsolutePosition = &object;
|
| }
|
|
|
| - // TODO(pdr): Remove the !object.isLayoutView() condition when removing FrameView
|
| - // paint properties for rootLayerScrolls.
|
| - if (!object.isLayoutView() && object.canContainFixedPositionObjects()) {
|
| + if (object.isLayoutView()) {
|
| + Settings* settings = object.document().settings();
|
| + if (settings && settings->rootLayerScrolls()) {
|
| + context.fixedPosition = context.current;
|
| + const TransformPaintPropertyNode* transform = object.objectPaintProperties()->paintOffsetTranslation();
|
| + DCHECK(transform);
|
| + context.fixedPosition.transform = transform;
|
| + }
|
| + } else if (object.canContainFixedPositionObjects()) {
|
| context.fixedPosition = context.current;
|
| } else if (object.getMutableForPainting().objectPaintProperties() && object.objectPaintProperties()->cssClip()) {
|
| // CSS clip applies to all descendants, even if this object is not a containing block
|
|
|