Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(265)

Unified Diff: third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp

Issue 2368043002: [SPv2] Separate SVG root viewport clip from overflow clip. (Closed)
Patch Set: none Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);

Powered by Google App Engine
This is Rietveld 408576698