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

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

Issue 2078343005: Fix positioning of CSS reference clips in composited layers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add virtual expectation Created 4 years, 6 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/PaintLayerPainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp b/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
index 610ebac791a7511490c842273c41b3b8ba33125d..a2bafc6f2adafa3fd6f91c1eb6efe6e485715521 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
@@ -160,8 +160,13 @@ public:
}
m_resourceClipper = toLayoutSVGResourceClipper(toLayoutSVGResourceContainer(element->layoutObject()));
+ // When SVG applies the clip and the coordinate system is "user space on use", we must explicitly pass in
+ // the layer offset to have the clip paint in the correct location. When the coordinate system is
+ // "object bounding box" the offset is already accounted for in the rootRelativeBounds.
+ FloatPoint layerPositionOffset = m_resourceClipper->clipPathUnits() == SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE ?
+ FloatPoint(offsetFromRoot) : FloatPoint();
if (!SVGClipPainter(*m_resourceClipper).prepareEffect(*paintLayer.layoutObject(), FloatRect(rootRelativeBounds),
- FloatRect(rootRelativeBounds), context, m_clipperState)) {
+ FloatRect(rootRelativeBounds), layerPositionOffset, context, m_clipperState)) {
// No need to post-apply the clipper if this failed.
m_resourceClipper = 0;
}

Powered by Google App Engine
This is Rietveld 408576698