| 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 669e7c1553be867de3774da5748084f3189f824a..1b0a030a6a8468ee4f72d196f7671e2948ecf896 100644
|
| --- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp
|
| +++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp
|
| @@ -377,7 +377,7 @@ void PaintPropertyTreeBuilder::updateOverflowClip(const LayoutObject& object, Pa
|
| LayoutRect clipRect;
|
| if (box.hasControlClip()) {
|
| clipRect = box.controlClipRect(context.current.paintOffset);
|
| - } else if (box.hasOverflowClip() || (box.isSVGRoot() && toLayoutSVGRoot(box).shouldApplyViewportClip())) {
|
| + } else if (box.hasOverflowClip()) {
|
| clipRect = box.overflowClipRect(context.current.paintOffset);
|
| } else {
|
| if (ObjectPaintProperties* properties = object.getMutableForPainting().objectPaintProperties())
|
| @@ -398,6 +398,25 @@ void PaintPropertyTreeBuilder::updateOverflowClip(const LayoutObject& object, Pa
|
| context.current.clip, context.current.transform, FloatRoundedRect(FloatRect(clipRect)));
|
| }
|
|
|
| +void PaintPropertyTreeBuilder::updateSvgRootViewportClip(const LayoutObject& object, PaintPropertyTreeBuilderContext& context)
|
| +{
|
| + if (!object.isBox())
|
| + return;
|
| + const LayoutBox& box = toLayoutBox(object);
|
| +
|
| + LayoutRect clipRect;
|
| + if (box.isSVGRoot() && toLayoutSVGRoot(box).shouldApplyViewportClip()) {
|
| + clipRect = box.overflowClipRect(context.current.paintOffset);
|
| + } else {
|
| + if (ObjectPaintProperties* properties = object.getMutableForPainting().objectPaintProperties())
|
| + properties->clearSvgRootViewportClip();
|
| + return;
|
| + }
|
| +
|
| + context.current.clip = object.getMutableForPainting().ensureObjectPaintProperties().createOrUpdateSvgRootViewportClip(
|
| + context.current.clip, context.current.transform, FloatRoundedRect(FloatRect(clipRect)));
|
| +}
|
| +
|
| static FloatPoint perspectiveOrigin(const LayoutBox& box)
|
| {
|
| const ComputedStyle& style = box.styleRef();
|
| @@ -590,6 +609,7 @@ void PaintPropertyTreeBuilder::buildTreeNodesForChildren(const LayoutObject& obj
|
| return;
|
|
|
| updateOverflowClip(object, context);
|
| + updateSvgRootViewportClip(object, context);
|
| updatePerspective(object, context);
|
| updateSvgLocalToBorderBoxTransform(object, context);
|
| updateScrollAndScrollTranslation(object, context);
|
|
|