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

Unified Diff: Source/core/dom/Attr.cpp

Issue 23567024: Have Attr constructor take a Document / Element reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix try bot failures 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/dom/Attr.h ('k') | Source/core/dom/Document.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Attr.cpp
diff --git a/Source/core/dom/Attr.cpp b/Source/core/dom/Attr.cpp
index e95f8caccf713ff267fbe5606190543d2d7dcd99..0d20c05a43f440b6aed7bf8616e12d0708ca5563 100644
--- a/Source/core/dom/Attr.cpp
+++ b/Source/core/dom/Attr.cpp
@@ -37,9 +37,9 @@ namespace WebCore {
using namespace HTMLNames;
-Attr::Attr(Element* element, const QualifiedName& name)
- : ContainerNode(&element->document())
- , m_element(element)
+Attr::Attr(Element& element, const QualifiedName& name)
+ : ContainerNode(&element.document())
+ , m_element(&element)
, m_name(name)
, m_ignoreChildrenChanged(0)
, m_specified(true)
@@ -47,8 +47,8 @@ Attr::Attr(Element* element, const QualifiedName& name)
ScriptWrappable::init(this);
}
-Attr::Attr(Document* document, const QualifiedName& name, const AtomicString& standaloneValue)
- : ContainerNode(document)
+Attr::Attr(Document& document, const QualifiedName& name, const AtomicString& standaloneValue)
+ : ContainerNode(&document)
, m_element(0)
, m_name(name)
, m_standaloneValue(standaloneValue)
@@ -58,14 +58,14 @@ Attr::Attr(Document* document, const QualifiedName& name, const AtomicString& st
ScriptWrappable::init(this);
}
-PassRefPtr<Attr> Attr::create(Element* element, const QualifiedName& name)
+PassRefPtr<Attr> Attr::create(Element& element, const QualifiedName& name)
{
RefPtr<Attr> attr = adoptRef(new Attr(element, name));
attr->createTextChild();
return attr.release();
}
-PassRefPtr<Attr> Attr::create(Document* document, const QualifiedName& name, const AtomicString& value)
+PassRefPtr<Attr> Attr::create(Document& document, const QualifiedName& name, const AtomicString& value)
{
RefPtr<Attr> attr = adoptRef(new Attr(document, name, value));
attr->createTextChild();
@@ -143,7 +143,7 @@ void Attr::setNodeValue(const String& v)
PassRefPtr<Node> Attr::cloneNode(bool /*deep*/)
{
- RefPtr<Attr> clone = adoptRef(new Attr(&document(), qualifiedName(), value()));
+ RefPtr<Attr> clone = adoptRef(new Attr(document(), qualifiedName(), value()));
cloneChildNodes(clone.get());
return clone.release();
}
« no previous file with comments | « Source/core/dom/Attr.h ('k') | Source/core/dom/Document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698