Index: third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceMasker.cpp |
diff --git a/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceMasker.cpp b/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceMasker.cpp |
index 68e53aa320edce2fb1537b220e743badb47b7d1a..54da89b6fe19e755b59d29f9dc1d09bf2a215a01 100644 |
--- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceMasker.cpp |
+++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceMasker.cpp |
@@ -85,17 +85,11 @@ sk_sp<const SkPicture> LayoutSVGResourceMasker::createContentPicture( |
: ColorFilterNone; |
pictureBuilder.context().setColorFilter(maskContentFilter); |
- for (SVGElement* childElement = Traversal<SVGElement>::firstChild(*element()); |
- childElement; |
- childElement = Traversal<SVGElement>::nextSibling(*childElement)) { |
- LayoutObject* layoutObject = childElement->layoutObject(); |
- if (!layoutObject) |
+ for (const SVGElement& childElement : |
+ Traversal<SVGElement>::childrenOf(*element())) { |
+ const LayoutObject* layoutObject = childElement.layoutObject(); |
+ if (!layoutObject || layoutObject->styleRef().display() == EDisplay::None) |
continue; |
- const ComputedStyle* style = layoutObject->style(); |
- if (!style || style->display() == EDisplay::None || |
- style->visibility() != EVisibility::Visible) |
- continue; |
- |
SVGPaintContext::paintSubtree(pictureBuilder.context(), layoutObject); |
} |
@@ -104,15 +98,10 @@ sk_sp<const SkPicture> LayoutSVGResourceMasker::createContentPicture( |
} |
void LayoutSVGResourceMasker::calculateMaskContentVisualRect() { |
- for (SVGElement* childElement = Traversal<SVGElement>::firstChild(*element()); |
- childElement; |
- childElement = Traversal<SVGElement>::nextSibling(*childElement)) { |
- LayoutObject* layoutObject = childElement->layoutObject(); |
- if (!layoutObject) |
- continue; |
- const ComputedStyle* style = layoutObject->style(); |
- if (!style || style->display() == EDisplay::None || |
- style->visibility() != EVisibility::Visible) |
+ for (const SVGElement& childElement : |
+ Traversal<SVGElement>::childrenOf(*element())) { |
+ const LayoutObject* layoutObject = childElement.layoutObject(); |
+ if (!layoutObject || layoutObject->styleRef().display() == EDisplay::None) |
continue; |
m_maskContentBoundaries.unite( |
layoutObject->localToSVGParentTransform().mapRect( |