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

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

Issue 1839973003: If the <use> is hidden and the child of it is visible, should clip the non-resource (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/LayoutSVGResourceClipper.cpp
diff --git a/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceClipper.cpp b/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceClipper.cpp
index 01734e2a85d7ed7c39ebf1c170a2c1dcbaf86fc0..dad021b275770b2dd7d12e049cdeb9d208add84d 100644
--- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceClipper.cpp
+++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceClipper.cpp
@@ -86,7 +86,7 @@ bool LayoutSVGResourceClipper::calculateClipContentPathIfNeeded()
continue;
const ComputedStyle* style = childLayoutObject->style();
- if (!style || style->display() == NONE || style->visibility() != VISIBLE)
+ if (!style || style->display() == NONE || (style->visibility() != VISIBLE && !isSVGUseElement(*childElement)))
continue;
// Current shape in clip-path gets clipped too. Fallback to masking.
@@ -177,12 +177,12 @@ PassRefPtr<const SkPicture> LayoutSVGResourceClipper::createContentPicture()
continue;
const ComputedStyle* style = layoutObject->style();
- if (!style || style->display() == NONE || style->visibility() != VISIBLE)
+ if (!style || style->display() == NONE || (style->visibility() != VISIBLE && !isSVGUseElement(*childElement)))
continue;
bool isUseElement = isSVGUseElement(*childElement);
if (isUseElement) {
- const SVGGraphicsElement* clippingElement = toSVGUseElement(*childElement).targetGraphicsElementForClipping();
+ const SVGGraphicsElement* clippingElement = toSVGUseElement(*childElement).visibleTargetGraphicsElementForClipping();
if (!clippingElement)
continue;
@@ -221,8 +221,11 @@ void LayoutSVGResourceClipper::calculateClipContentPaintInvalidationRect()
if (!layoutObject->isSVGShape() && !layoutObject->isSVGText() && !isSVGUseElement(*childElement))
continue;
const ComputedStyle* style = layoutObject->style();
- if (!style || style->display() == NONE || style->visibility() != VISIBLE)
+ if (!style || style->display() == NONE || (style->visibility() != VISIBLE && !isSVGUseElement(*childElement)))
continue;
+ if (isSVGUseElement(*childElement) && !toSVGUseElement(*childElement).visibleTargetGraphicsElementForClipping())
+ continue;
+
m_clipBoundaries.unite(layoutObject->localToSVGParentTransform().mapRect(layoutObject->paintInvalidationRectInLocalSVGCoordinates()));
}
m_clipBoundaries = toSVGClipPathElement(element())->calculateAnimatedLocalTransform().mapRect(m_clipBoundaries);

Powered by Google App Engine
This is Rietveld 408576698