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

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

Issue 2343673003: SVG root viewport clip in paint property tree (Closed)
Patch Set: - 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/PaintInvalidator.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintInvalidator.cpp b/third_party/WebKit/Source/core/paint/PaintInvalidator.cpp
index d30a142cd29bc6525cb085b8b325e6d151538602..c4254a8d90a97b66aae2cfe310f83c63a119a312 100644
--- a/third_party/WebKit/Source/core/paint/PaintInvalidator.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintInvalidator.cpp
@@ -20,12 +20,20 @@
namespace blink {
-static void slowMapToVisualRectInAncestorSpace(const LayoutObject& object, const LayoutBoxModelObject& ancestor, LayoutRect& rect)
+static LayoutRect slowMapToVisualRectInAncestorSpace(const LayoutObject& object, const LayoutBoxModelObject& ancestor, const FloatRect& rect)
{
+ if (object.isSVG() && !object.isSVGRoot()) {
+ LayoutRect result;
+ SVGLayoutSupport::mapToVisualRectInAncestorSpace(object, &ancestor, rect, result);
+ return result;
+ }
+
+ LayoutRect result(rect);
if (object.isLayoutView())
- toLayoutView(object).mapToVisualRectInAncestorSpace(&ancestor, rect, InputIsInFrameCoordinates, DefaultVisualRectFlags);
+ toLayoutView(object).mapToVisualRectInAncestorSpace(&ancestor, result, InputIsInFrameCoordinates, DefaultVisualRectFlags);
else
- object.mapToVisualRectInAncestorSpace(&ancestor, rect);
+ object.mapToVisualRectInAncestorSpace(&ancestor, result);
+ return result;
}
// TODO(wangxianzhu): Combine this into PaintInvalidator::mapLocalRectToPaintInvalidationBacking() when removing PaintInvalidationState.
@@ -41,8 +49,7 @@ static LayoutRect mapLocalRectToPaintInvalidationBacking(GeometryMapper& geometr
LayoutRect result;
if (context.forcedSubtreeInvalidationFlags & PaintInvalidatorContext::ForcedSubtreeSlowPathRect) {
- result = LayoutRect(rect);
- slowMapToVisualRectInAncestorSpace(object, *context.paintInvalidationContainer, result);
+ result = slowMapToVisualRectInAncestorSpace(object, *context.paintInvalidationContainer, rect);
} else if (object == context.paintInvalidationContainer) {
result = LayoutRect(rect);
} else {
« no previous file with comments | « third_party/WebKit/Source/core/paint/BoxClipper.cpp ('k') | third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698