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

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

Issue 2705163008: Cleanup the SVGTreeScopeResources interface (Closed)
Patch Set: Rebase Created 3 years, 10 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/SVGResources.cpp
diff --git a/third_party/WebKit/Source/core/layout/svg/SVGResources.cpp b/third_party/WebKit/Source/core/layout/svg/SVGResources.cpp
index 18af003d4469bdcfa292252c11d1e8625f0c0c49..f33e7b81e96a0415194e0135a7bae17f4233b110 100644
--- a/third_party/WebKit/Source/core/layout/svg/SVGResources.cpp
+++ b/third_party/WebKit/Source/core/layout/svg/SVGResources.cpp
@@ -181,13 +181,12 @@ std::unique_ptr<SVGResources> SVGResources::buildResources(
ASSERT(node);
SECURITY_DCHECK(node->isSVGElement());
- SVGElement* element = toSVGElement(node);
- ASSERT(element);
+ SVGElement& element = toSVGElement(*node);
- const AtomicString& tagName = element->localName();
+ const AtomicString& tagName = element.localName();
ASSERT(!tagName.isNull());
- TreeScope& treeScope = element->treeScopeForIdResolution();
+ TreeScope& treeScope = element.treeScopeForIdResolution();
SVGTreeScopeResources& treeScopeResources =
treeScope.ensureSVGTreeScopedResources();
@@ -235,7 +234,7 @@ std::unique_ptr<SVGResources> SVGResources::buildResources(
}
}
- if (style.hasMarkers() && supportsMarkers(*element)) {
+ if (style.hasMarkers() && supportsMarkers(element)) {
const AtomicString& markerStartId = style.markerStartResource();
if (!ensureResources(resources).setMarkerStart(
getLayoutSVGResourceById<LayoutSVGResourceMarker>(
@@ -278,7 +277,7 @@ std::unique_ptr<SVGResources> SVGResources::buildResources(
}
if (chainableResourceTags().contains(tagName)) {
- AtomicString id = targetReferenceFromResource(*element);
+ AtomicString id = targetReferenceFromResource(element);
if (!ensureResources(resources).setLinkedResource(
treeScopeResources.resourceById(id)))
treeScopeResources.addPendingResource(id, element);

Powered by Google App Engine
This is Rietveld 408576698