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

Unified Diff: third_party/WebKit/Source/core/layout/svg/LayoutSVGRoot.cpp

Issue 1852183002: Don't apply svg viewport clip when mapping a LayoutSVGRoot's own rect (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CORE_EXPORT LayoutSVGRoot Created 4 years, 8 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/layout/svg/LayoutSVGRoot.cpp
diff --git a/third_party/WebKit/Source/core/layout/svg/LayoutSVGRoot.cpp b/third_party/WebKit/Source/core/layout/svg/LayoutSVGRoot.cpp
index 56a45268dae10e6f7d407036bc008aafb5f0229b..7e6a83c8d26259c90bb7bb975d7e491cda094184 100644
--- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGRoot.cpp
+++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGRoot.cpp
@@ -324,8 +324,7 @@ LayoutRect LayoutSVGRoot::localOverflowRectForPaintInvalidation() const
// This is an open-coded aggregate of SVGLayoutSupport::localOverflowRectForPaintInvalidation,
// and LayoutReplaced::localOverflowRectForPaintInvalidation.
// The reason for this is to optimize/minimize the paint invalidation rect when the box is not "decorated"
- // (does not have background/border/etc.)
- // TODO(wangxianzhu): Verify if the optimization is still needed.
+ // (does not have background/border/etc., see LayoutSVGRootTest.OverflowRectMappingWithViewportClipWithoutBorder).
// Return early for any cases where we don't actually paint.
if (style()->visibility() != VISIBLE && !enclosingLayer()->hasVisibleContent())
@@ -351,26 +350,6 @@ LayoutRect LayoutSVGRoot::localOverflowRectForPaintInvalidation() const
return LayoutRect(enclosingIntRect(paintInvalidationRect));
}
-bool LayoutSVGRoot::mapToVisualRectInAncestorSpace(const LayoutBoxModelObject* ancestor, LayoutRect& rect, VisualRectFlags visualRectFlags) const
-{
- // Note that we don't apply the border-box transform here - it's assumed
- // that whoever called us has done that already.
-
- // Apply initial viewport clip
- // TODO(crbug.com/597813): We should not apply clip on LayoutSVGRoot's own rect. This clip should
- // be applied in children's mapToVisualRectInAncestorSpace().
- if (shouldApplyViewportClip()) {
- if (visualRectFlags & EdgeInclusive) {
- if (!rect.inclusiveIntersect(LayoutRect(pixelSnappedBorderBoxRect())))
- return false;
- } else {
- rect.intersect(LayoutRect(pixelSnappedBorderBoxRect()));
- }
- }
-
- return LayoutReplaced::mapToVisualRectInAncestorSpace(ancestor, rect, visualRectFlags);
-}
-
// This method expects local CSS box coordinates.
// Callers with local SVG viewport coordinates should first apply the localToBorderBoxTransform
// to convert from SVG viewport coordinates to local CSS box coordinates.

Powered by Google App Engine
This is Rietveld 408576698