| 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 f57b66166d4eb51fe2e352176ad8449a072603d3..4f81a90069a60b63e3b7dc6c593c59ff9f6155e2 100644
|
| --- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp
|
| +++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp
|
| @@ -28,12 +28,14 @@ void PaintPropertyTreeBuilder::buildTreeRootNodes(FrameView& rootFrame, PaintPro
|
| rootFrame.setRootTransform(TransformPaintPropertyNode::create(nullptr, TransformationMatrix(), FloatPoint3D()));
|
| rootFrame.setRootClip(ClipPaintPropertyNode::create(nullptr, rootFrame.rootTransform(), FloatRoundedRect(LayoutRect::infiniteIntRect())));
|
| rootFrame.setRootEffect(EffectPaintPropertyNode::create(nullptr, 1.0));
|
| + rootFrame.setRootScroll(ScrollPaintPropertyNode::create(nullptr, rootFrame.rootTransform(), FloatSize(), FloatSize(), false, false));
|
| } else {
|
| DCHECK(rootFrame.rootClip() && !rootFrame.rootClip()->parent());
|
| DCHECK(rootFrame.rootEffect() && !rootFrame.rootEffect()->parent());
|
| }
|
|
|
| context.current.transform = context.absolutePosition.transform = context.fixedPosition.transform = rootFrame.rootTransform();
|
| + context.current.scroll = rootFrame.rootScroll();
|
| context.current.clip = context.absolutePosition.clip = context.fixedPosition.clip = rootFrame.rootClip();
|
| context.currentEffect = rootFrame.rootEffect();
|
| }
|
| @@ -51,6 +53,8 @@ void PaintPropertyTreeBuilder::buildTreeNodes(FrameView& frameView, PaintPropert
|
| frameView.y() + layoutView->location().y() + context.current.paintOffset.y());
|
| context.current.transform = layoutView->getMutableForPainting().ensureObjectPaintProperties().createOrUpdatePaintOffsetTranslation(
|
| context.current.transform, frameTranslate, FloatPoint3D());
|
| + context.current.scroll = layoutView->getMutableForPainting().ensureObjectPaintProperties().createOrUpdateScroll(
|
| + context.current.scroll, context.current.transform, FloatSize(), FloatSize(), false, false);
|
| context.current.paintOffset = LayoutPoint();
|
| context.current.renderingContextID = 0;
|
| context.current.shouldFlattenInheritedTransform = true;
|
| @@ -81,12 +85,23 @@ void PaintPropertyTreeBuilder::buildTreeNodes(FrameView& frameView, PaintPropert
|
| else
|
| frameView.setScrollTranslation(TransformPaintPropertyNode::create(frameView.preTranslation(), frameScroll, FloatPoint3D()));
|
|
|
| + // TODO(pdr): Set these values properly.
|
| + FloatSize scrollClip;
|
| + FloatSize scrollBounds;
|
| + bool userScrollableHorizontal = false;
|
| + bool userScrollableVertical = false;
|
| + if (ScrollPaintPropertyNode* existingScroll = frameView.scroll())
|
| + existingScroll->update(context.current.scroll, frameView.scrollTranslation(), scrollClip, scrollBounds, userScrollableHorizontal, userScrollableVertical);
|
| + else
|
| + frameView.setScroll(ScrollPaintPropertyNode::create(context.current.scroll, frameView.scrollTranslation(), scrollClip, scrollBounds, userScrollableHorizontal, userScrollableVertical));
|
| +
|
| // Initialize the context for current, absolute and fixed position cases.
|
| // They are the same, except that scroll translation does not apply to
|
| // fixed position descendants.
|
| context.current.transform = frameView.scrollTranslation();
|
| context.current.paintOffset = LayoutPoint();
|
| context.current.clip = frameView.contentClip();
|
| + context.current.scroll = frameView.scroll();
|
| context.current.renderingContextID = 0;
|
| context.current.shouldFlattenInheritedTransform = true;
|
| context.absolutePosition = context.current;
|
| @@ -237,6 +252,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);
|
| + borderBoxContext->scroll = context.current.scroll;
|
|
|
| if (!context.current.clip) {
|
| DCHECK(object.isLayoutView());
|
| @@ -354,7 +370,7 @@ void PaintPropertyTreeBuilder::updateSvgLocalToBorderBoxTransform(const LayoutOb
|
| context.current.renderingContextID = 0;
|
| }
|
|
|
| -void PaintPropertyTreeBuilder::updateScrollTranslation(const LayoutObject& object, PaintPropertyTreeBuilderContext& context)
|
| +void PaintPropertyTreeBuilder::updateScrollAndScrollTranslation(const LayoutObject& object, PaintPropertyTreeBuilderContext& context)
|
| {
|
| if (object.isBoxModelObject() && object.hasOverflowClip()) {
|
| PaintLayer* layer = toLayoutBoxModelObject(object).layer();
|
| @@ -365,13 +381,25 @@ void PaintPropertyTreeBuilder::updateScrollTranslation(const LayoutObject& objec
|
| 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);
|
| +
|
| + // TODO(pdr): Set these values properly.
|
| + FloatSize scrollClip;
|
| + FloatSize scrollBounds;
|
| + bool userScrollableHorizontal = false;
|
| + bool userScrollableVertical = false;
|
| + context.current.scroll = object.getMutableForPainting().ensureObjectPaintProperties().createOrUpdateScroll(
|
| + context.current.scroll, context.current.transform, scrollClip, scrollBounds, userScrollableHorizontal, userScrollableVertical);
|
| +
|
| context.current.shouldFlattenInheritedTransform = false;
|
| return;
|
| }
|
| }
|
|
|
| - if (ObjectPaintProperties* properties = object.getMutableForPainting().objectPaintProperties())
|
| + // TODO(pdr): Ensure non-scrollable objects get a scroll node that doesn't scroll.
|
| + if (ObjectPaintProperties* properties = object.getMutableForPainting().objectPaintProperties()) {
|
| properties->clearScrollTranslation();
|
| + properties->clearScroll();
|
| + }
|
| }
|
|
|
| void PaintPropertyTreeBuilder::updateOutOfFlowContext(const LayoutObject& object, PaintPropertyTreeBuilderContext& context)
|
| @@ -485,7 +513,7 @@ void PaintPropertyTreeBuilder::buildTreeNodesForChildren(const LayoutObject& obj
|
| updateOverflowClip(object, context);
|
| updatePerspective(object, context);
|
| updateSvgLocalToBorderBoxTransform(object, context);
|
| - updateScrollTranslation(object, context);
|
| + updateScrollAndScrollTranslation(object, context);
|
| updateOutOfFlowContext(object, context);
|
| }
|
|
|
|
|