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

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

Issue 2554743002: Avoid double paint offset of SVGForeignObject visual rect (Closed)
Patch Set: - 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/TestExpectations ('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..838b9b293994ebd7a20c7f474ad2c0f9ccde1439 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()) {
Xianzhu 2016/12/06 18:35:26 !rect.isEmpty() is removed to be consistent with t
+ // 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/TestExpectations ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698