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

Unified Diff: Source/core/svg/SVGUseElement.cpp

Issue 23685007: Have SVGURIReference API deal with Document references, not pointers (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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/svg/SVGURIReference.cpp ('k') | Source/core/svg/animation/SVGSMILElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGUseElement.cpp
diff --git a/Source/core/svg/SVGUseElement.cpp b/Source/core/svg/SVGUseElement.cpp
index 591430b60866d54885bf7b5fb13fae586daaa4cd..a2c37c420baa2fc9c50090e75232be2dd0da28cf 100644
--- a/Source/core/svg/SVGUseElement.cpp
+++ b/Source/core/svg/SVGUseElement.cpp
@@ -189,7 +189,7 @@ void SVGUseElement::removedFrom(ContainerNode* rootParent)
Document* SVGUseElement::referencedDocument() const
{
- if (!isExternalURIReference(hrefCurrentValue(), &document()))
+ if (!isExternalURIReference(hrefCurrentValue(), document()))
return &document();
return externalDocument();
}
@@ -230,7 +230,7 @@ void SVGUseElement::svgAttributeChanged(const QualifiedName& attrName)
return;
if (SVGURIReference::isKnownAttribute(attrName)) {
- bool isExternalReference = isExternalURIReference(hrefCurrentValue(), &document());
+ bool isExternalReference = isExternalURIReference(hrefCurrentValue(), document());
if (isExternalReference) {
KURL url = document().completeURL(hrefCurrentValue());
if (url.hasFragmentIdentifier()) {
@@ -406,7 +406,7 @@ void SVGUseElement::buildPendingResource()
return;
String id;
- Element* target = SVGURIReference::targetElementFromIRIString(hrefCurrentValue(), &document(), &id, externalDocument());
+ Element* target = SVGURIReference::targetElementFromIRIString(hrefCurrentValue(), document(), &id, externalDocument());
if (!target || !target->inDocument()) {
// If we can't find the target of an external element, just give up.
// We can't observe if the target somewhen enters the external document, nor should we do it.
@@ -640,7 +640,8 @@ void SVGUseElement::buildInstanceTree(SVGElement* target, SVGElementInstance* ta
bool SVGUseElement::hasCycleUseReferencing(SVGUseElement* use, SVGElementInstance* targetInstance, SVGElement*& newTarget)
{
- Element* targetElement = SVGURIReference::targetElementFromIRIString(use->hrefCurrentValue(), referencedDocument());
+ ASSERT(referencedDocument());
+ Element* targetElement = SVGURIReference::targetElementFromIRIString(use->hrefCurrentValue(), *referencedDocument());
newTarget = 0;
if (targetElement && targetElement->isSVGElement())
newTarget = toSVGElement(targetElement);
@@ -712,7 +713,8 @@ void SVGUseElement::expandUseElementsInShadowTree(Node* element)
SVGUseElement* use = toSVGUseElement(element);
ASSERT(!use->resourceIsStillLoading());
- Element* targetElement = SVGURIReference::targetElementFromIRIString(use->hrefCurrentValue(), referencedDocument());
+ ASSERT(referencedDocument());
+ Element* targetElement = SVGURIReference::targetElementFromIRIString(use->hrefCurrentValue(), *referencedDocument());
SVGElement* target = 0;
if (targetElement && targetElement->isSVGElement())
target = toSVGElement(targetElement);
« no previous file with comments | « Source/core/svg/SVGURIReference.cpp ('k') | Source/core/svg/animation/SVGSMILElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698