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

Unified Diff: Source/core/dom/Attr.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/css/resolver/StyleResolverState.cpp ('k') | Source/core/dom/CDATASection.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 bf990a3aa22f46677fe0ffb861c39a491175c871..0930c00d9896faf5fd5c1fb42a5343cee83191c8 100644
--- a/Source/core/dom/Attr.cpp
+++ b/Source/core/dom/Attr.cpp
@@ -38,7 +38,7 @@ namespace WebCore {
using namespace HTMLNames;
Attr::Attr(Element* element, const QualifiedName& name)
- : ContainerNode(element->document())
+ : ContainerNode(&element->document())
, m_element(element)
, m_name(name)
, m_ignoreChildrenChanged(0)
@@ -80,7 +80,7 @@ void Attr::createTextChild()
{
ASSERT(refCount());
if (!value().isEmpty()) {
- RefPtr<Text> textNode = document()->createTextNode(value().string());
+ RefPtr<Text> textNode = document().createTextNode(value().string());
// This does everything appendChild() would do in this situation (assuming m_ignoreChildrenChanged was set),
// but much more efficiently.
@@ -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();
}
@@ -182,7 +182,7 @@ void Attr::childrenChanged(bool, Node*, Node*, int)
bool Attr::isId() const
{
- return qualifiedName().matches(document()->idAttributeName());
+ return qualifiedName().matches(document().idAttributeName());
}
const AtomicString& Attr::value() const
« no previous file with comments | « Source/core/css/resolver/StyleResolverState.cpp ('k') | Source/core/dom/CDATASection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698