Chromium Code Reviews| 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..d5146e11e4d921aa0015af1fdc4bb6e40051ac04 100644 |
| --- a/third_party/WebKit/Source/core/svg/SVGUseElement.cpp |
| +++ b/third_party/WebKit/Source/core/svg/SVGUseElement.cpp |
| @@ -478,6 +478,21 @@ static bool isDirectReference(const SVGElement& element) |
| || isSVGTextElement(element); |
| } |
| +bool SVGUseElement::isVisibleGraphicsElementForClipping() |
| +{ |
| + Node* n = userAgentShadowRoot()->firstChild(); |
|
fs
2016/04/19 10:17:27
This should probably just be using targetGraphicsE
hyunjunekim2
2016/04/27 12:18:40
Merged this function. But occurred to console erro
fs
2016/04/27 14:14:39
Personally I'd be fine with just removing this rep
hyunjunekim2
2016/04/29 12:59:08
Done. Remove it.
|
| + if (!n || !n->isSVGElement()) |
| + return false; |
| + |
| + SVGElement& element = toSVGElement(*n); |
| + |
| + const ComputedStyle* style = element.layoutObject() ? element.layoutObject()->style() : nullptr; |
| + if (style && style->visibility() != VISIBLE) |
| + return false; |
| + |
| + return true; |
| +} |
| + |
| void SVGUseElement::toClipPath(Path& path) const |
| { |
| ASSERT(path.isEmpty()); |
| @@ -487,6 +502,10 @@ void SVGUseElement::toClipPath(Path& path) const |
| if (!element || !element->layoutObject()) |
| return; |
| + const ComputedStyle* style = element->layoutObject() ? element->layoutObject()->style() : nullptr; |
|
fs
2016/04/19 10:17:27
element->layoutObject() has already been null-chec
hyunjunekim2
2016/04/27 12:18:40
Done.
|
| + if (style && style->visibility() != VISIBLE) |
|
fs
2016/04/19 10:17:27
This should be: !style || style->visibility() != V
hyunjunekim2
2016/04/27 12:18:40
Done.
|
| + return; |
| + |
| if (element->isSVGGeometryElement()) { |
| toSVGGeometryElement(*element).toClipPath(path); |
| // FIXME: Avoid manual resolution of x/y here. Its potentially harmful. |