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

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

Issue 23886003: Have HTMLElements / SVGElements constructors take a Document reference in argument (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Another Android build fix 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/SVGUseElement.h ('k') | Source/core/svg/SVGVKernElement.h » ('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 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));
« no previous file with comments | « Source/core/svg/SVGUseElement.h ('k') | Source/core/svg/SVGVKernElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698