Index: third_party/WebKit/Source/core/svg/SVGUseElement.cpp |
diff --git a/third_party/WebKit/Source/core/svg/SVGUseElement.cpp b/third_party/WebKit/Source/core/svg/SVGUseElement.cpp |
index 195d5f7d130ff011e876479e8236841c07a110b3..3f5c2f49bad809c4ccd303985faa0f4a234fc0f1 100644 |
--- a/third_party/WebKit/Source/core/svg/SVGUseElement.cpp |
+++ b/third_party/WebKit/Source/core/svg/SVGUseElement.cpp |
@@ -482,7 +482,7 @@ void SVGUseElement::toClipPath(Path& path) const |
{ |
ASSERT(path.isEmpty()); |
- const SVGGraphicsElement* element = targetGraphicsElementForClipping(); |
+ const SVGGraphicsElement* element = visibleTargetGraphicsElementForClipping(); |
if (!element || !element->layoutObject()) |
fs
2016/04/27 14:14:40
You should move the second part of this condition
hyunjunekim2
2016/04/29 12:59:09
Done. Moved to visibleTargetGraphicsElementForClip
|
return; |
@@ -496,7 +496,7 @@ void SVGUseElement::toClipPath(Path& path) const |
} |
} |
-SVGGraphicsElement* SVGUseElement::targetGraphicsElementForClipping() const |
+SVGGraphicsElement* SVGUseElement::visibleTargetGraphicsElementForClipping() const |
{ |
Node* n = userAgentShadowRoot()->firstChild(); |
if (!n || !n->isSVGElement()) |
@@ -507,6 +507,10 @@ SVGGraphicsElement* SVGUseElement::targetGraphicsElementForClipping() const |
if (!element.isSVGGraphicsElement()) |
return nullptr; |
+ const ComputedStyle* style = element.layoutObject() ? element.layoutObject()->style() : nullptr; |
+ if (!style || style->visibility() != VISIBLE) |
+ return nullptr; |
+ |
// Spec: "If a <use> element is a child of a clipPath element, it must directly |
// reference <path>, <text> or basic shapes elements. Indirect references are an |
// error and the clipPath element must be ignored." |