Index: Source/core/svg/SVGUseElement.cpp |
diff --git a/Source/core/svg/SVGUseElement.cpp b/Source/core/svg/SVGUseElement.cpp |
index a2c37c420baa2fc9c50090e75232be2dd0da28cf..9c2590890f53f82535da077bbd915e9228178d7a 100644 |
--- a/Source/core/svg/SVGUseElement.cpp |
+++ b/Source/core/svg/SVGUseElement.cpp |
@@ -71,7 +71,7 @@ BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGUseElement) |
REGISTER_PARENT_ANIMATED_PROPERTIES(SVGGraphicsElement) |
END_REGISTER_ANIMATED_PROPERTIES |
-inline SVGUseElement::SVGUseElement(const QualifiedName& tagName, Document* document, bool wasInsertedByParser) |
+inline SVGUseElement::SVGUseElement(const QualifiedName& tagName, Document& document, bool wasInsertedByParser) |
: SVGGraphicsElement(tagName, document) |
, m_x(LengthModeWidth) |
, m_y(LengthModeHeight) |
@@ -88,7 +88,7 @@ inline SVGUseElement::SVGUseElement(const QualifiedName& tagName, Document* docu |
registerAnimatedPropertiesForSVGUseElement(); |
} |
-PassRefPtr<SVGUseElement> SVGUseElement::create(const QualifiedName& tagName, Document* document, bool wasInsertedByParser) |
+PassRefPtr<SVGUseElement> SVGUseElement::create(const QualifiedName& tagName, Document& document, bool wasInsertedByParser) |
{ |
// Always build a #shadow-root for SVGUseElement. |
RefPtr<SVGUseElement> use = adoptRef(new SVGUseElement(tagName, document, wasInsertedByParser)); |
@@ -721,7 +721,7 @@ void SVGUseElement::expandUseElementsInShadowTree(Node* element) |
// Don't ASSERT(target) here, it may be "pending", too. |
// Setup sub-shadow tree root node |
- RefPtr<SVGGElement> cloneParent = SVGGElement::create(SVGNames::gTag, referencedDocument()); |
+ RefPtr<SVGGElement> cloneParent = SVGGElement::create(SVGNames::gTag, *referencedDocument()); |
use->cloneChildNodes(cloneParent.get()); |
// Spec: In the generated content, the 'use' will be replaced by 'g', where all attributes from the |
@@ -768,7 +768,8 @@ void SVGUseElement::expandSymbolElementsInShadowTree(Node* element) |
// height are provided on the 'use' element, then these attributes will be transferred to |
// the generated 'svg'. If attributes width and/or height are not specified, the generated |
// 'svg' element will use values of 100% for these attributes. |
- RefPtr<SVGSVGElement> svgElement = SVGSVGElement::create(SVGNames::svgTag, referencedDocument()); |
+ ASSERT(referencedDocument()); |
+ RefPtr<SVGSVGElement> svgElement = SVGSVGElement::create(SVGNames::svgTag, *referencedDocument()); |
// Transfer all data (attributes, etc.) from <symbol> to the new <svg> element. |
svgElement->cloneDataFromElement(*toElement(element)); |