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

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

Issue 2554743002: Avoid double paint offset of SVGForeignObject visual rect (Closed)
Patch Set: Rebaseline bugzilla-5669.html Created 4 years 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
« no previous file with comments | « third_party/WebKit/LayoutTests/platform/win/virtual/spinvalidation/paint/invalidation/bugzilla-5699-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/paint/PaintInvalidator.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintInvalidator.cpp b/third_party/WebKit/Source/core/paint/PaintInvalidator.cpp
index 9982e8a03fa82f724ad7bf3b25c33e0bfe9c0ef2..16d3f4c0419858cce1c81f34b2bdf2e41ddb3c06 100644
--- a/third_party/WebKit/Source/core/paint/PaintInvalidator.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintInvalidator.cpp
@@ -71,7 +71,10 @@ static LayoutRect mapLocalRectToPaintInvalidationBacking(
if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
// In SPv2, visual rects are in the space of their local transform node.
- rect.moveBy(FloatPoint(context.treeBuilderContext.current.paintOffset));
+ // For SVG, the input rect is in local SVG coordinates in which paint
+ // offset doesn't apply.
+ if (!object.isSVG() || object.isSVGRoot())
+ rect.moveBy(FloatPoint(context.treeBuilderContext.current.paintOffset));
// Use enclosingIntRect to ensure the final visual rect will cover the
// rect in source coordinates no matter if the painting will use pixel
// snapping.
@@ -86,8 +89,10 @@ static LayoutRect mapLocalRectToPaintInvalidationBacking(
} else if (object == context.paintInvalidationContainer) {
result = LayoutRect(rect);
} else {
- rect.moveBy(FloatPoint(context.treeBuilderContext.current.paintOffset));
- if ((!object.isSVG() || object.isSVGRoot()) && !rect.isEmpty()) {
+ // For non-root SVG, the input rect is in local SVG coordinates in which
+ // paint offset doesn't apply.
+ if (!object.isSVG() || object.isSVGRoot()) {
+ rect.moveBy(FloatPoint(context.treeBuilderContext.current.paintOffset));
// Use enclosingIntRect to ensure the final visual rect will cover the
// rect in source coordinates no matter if the painting will use pixel
// snapping.
« no previous file with comments | « third_party/WebKit/LayoutTests/platform/win/virtual/spinvalidation/paint/invalidation/bugzilla-5699-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698