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

Unified Diff: Source/core/rendering/svg/SVGResources.cpp

Issue 23819007: Have Node::document() return a reference instead of a pointer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 4 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
« no previous file with comments | « Source/core/rendering/svg/SVGRenderingContext.cpp ('k') | Source/core/rendering/svg/SVGResourcesCache.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/svg/SVGResources.cpp
diff --git a/Source/core/rendering/svg/SVGResources.cpp b/Source/core/rendering/svg/SVGResources.cpp
index 3fd84a8231a88969567f624fb865819b7d2dd1a6..2f399f2c1a0c75e6f896b341d83f359fa0a0c3e3 100644
--- a/Source/core/rendering/svg/SVGResources.cpp
+++ b/Source/core/rendering/svg/SVGResources.cpp
@@ -151,7 +151,7 @@ static inline String targetReferenceFromResource(SVGElement* element)
else
ASSERT_NOT_REACHED();
- return SVGURIReference::fragmentIdentifierFromIRIString(target, element->document());
+ return SVGURIReference::fragmentIdentifierFromIRIString(target, &element->document());
}
static inline RenderSVGResourceContainer* paintingResourceFromSVGPaint(Document* document, const SVGPaint::SVGPaintType& paintType, const String& paintUri, AtomicString& id, bool& hasPendingResource)
@@ -192,10 +192,9 @@ bool SVGResources::buildResources(const RenderObject* object, const SVGRenderSty
if (!element)
return false;
- Document* document = object->document();
- ASSERT(document);
+ Document& document = object->document();
- SVGDocumentExtensions* extensions = document->accessSVGExtensions();
+ SVGDocumentExtensions* extensions = document.accessSVGExtensions();
ASSERT(extensions);
const AtomicString& tagName = element->localName();
@@ -206,7 +205,7 @@ bool SVGResources::buildResources(const RenderObject* object, const SVGRenderSty
if (clipperFilterMaskerTags().contains(tagName)) {
if (style->hasClipper()) {
AtomicString id(style->clipperResource());
- if (setClipper(getRenderSVGResourceById<RenderSVGResourceClipper>(document, id)))
+ if (setClipper(getRenderSVGResourceById<RenderSVGResourceClipper>(&document, id)))
foundResources = true;
else
registerPendingResource(extensions, id, element);
@@ -214,7 +213,7 @@ bool SVGResources::buildResources(const RenderObject* object, const SVGRenderSty
if (style->hasFilter()) {
AtomicString id(style->filterResource());
- if (setFilter(getRenderSVGResourceById<RenderSVGResourceFilter>(document, id)))
+ if (setFilter(getRenderSVGResourceById<RenderSVGResourceFilter>(&document, id)))
foundResources = true;
else
registerPendingResource(extensions, id, element);
@@ -222,7 +221,7 @@ bool SVGResources::buildResources(const RenderObject* object, const SVGRenderSty
if (style->hasMasker()) {
AtomicString id(style->maskerResource());
- if (setMasker(getRenderSVGResourceById<RenderSVGResourceMasker>(document, id)))
+ if (setMasker(getRenderSVGResourceById<RenderSVGResourceMasker>(&document, id)))
foundResources = true;
else
registerPendingResource(extensions, id, element);
@@ -231,19 +230,19 @@ bool SVGResources::buildResources(const RenderObject* object, const SVGRenderSty
if (markerTags().contains(tagName) && style->hasMarkers()) {
AtomicString markerStartId(style->markerStartResource());
- if (setMarkerStart(getRenderSVGResourceById<RenderSVGResourceMarker>(document, markerStartId)))
+ if (setMarkerStart(getRenderSVGResourceById<RenderSVGResourceMarker>(&document, markerStartId)))
foundResources = true;
else
registerPendingResource(extensions, markerStartId, element);
AtomicString markerMidId(style->markerMidResource());
- if (setMarkerMid(getRenderSVGResourceById<RenderSVGResourceMarker>(document, markerMidId)))
+ if (setMarkerMid(getRenderSVGResourceById<RenderSVGResourceMarker>(&document, markerMidId)))
foundResources = true;
else
registerPendingResource(extensions, markerMidId, element);
AtomicString markerEndId(style->markerEndResource());
- if (setMarkerEnd(getRenderSVGResourceById<RenderSVGResourceMarker>(document, markerEndId)))
+ if (setMarkerEnd(getRenderSVGResourceById<RenderSVGResourceMarker>(&document, markerEndId)))
foundResources = true;
else
registerPendingResource(extensions, markerEndId, element);
@@ -253,7 +252,7 @@ bool SVGResources::buildResources(const RenderObject* object, const SVGRenderSty
if (style->hasFill()) {
bool hasPendingResource = false;
AtomicString id;
- if (setFill(paintingResourceFromSVGPaint(document, style->fillPaintType(), style->fillPaintUri(), id, hasPendingResource)))
+ if (setFill(paintingResourceFromSVGPaint(&document, style->fillPaintType(), style->fillPaintUri(), id, hasPendingResource)))
foundResources = true;
else if (hasPendingResource)
registerPendingResource(extensions, id, element);
@@ -262,7 +261,7 @@ bool SVGResources::buildResources(const RenderObject* object, const SVGRenderSty
if (style->hasStroke()) {
bool hasPendingResource = false;
AtomicString id;
- if (setStroke(paintingResourceFromSVGPaint(document, style->strokePaintType(), style->strokePaintUri(), id, hasPendingResource)))
+ if (setStroke(paintingResourceFromSVGPaint(&document, style->strokePaintType(), style->strokePaintUri(), id, hasPendingResource)))
foundResources = true;
else if (hasPendingResource)
registerPendingResource(extensions, id, element);
@@ -271,7 +270,7 @@ bool SVGResources::buildResources(const RenderObject* object, const SVGRenderSty
if (chainableResourceTags().contains(tagName)) {
AtomicString id(targetReferenceFromResource(element));
- if (setLinkedResource(getRenderSVGResourceContainerById(document, id)))
+ if (setLinkedResource(getRenderSVGResourceContainerById(&document, id)))
foundResources = true;
else
registerPendingResource(extensions, id, element);
« no previous file with comments | « Source/core/rendering/svg/SVGRenderingContext.cpp ('k') | Source/core/rendering/svg/SVGResourcesCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698