diff options
author | Steve Block <steveblock@google.com> | 2009-10-08 17:19:54 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2009-10-20 00:41:58 +0100 |
commit | 231d4e3152a9c27a73b6ac7badbe6be673aa3ddf (patch) | |
tree | a6c7e2d6cd7bfa7011cc39abbb436142d7a4a7c8 /WebCore/dom/Attr.cpp | |
parent | e196732677050bd463301566a68a643b6d14b907 (diff) | |
download | external_webkit-231d4e3152a9c27a73b6ac7badbe6be673aa3ddf.zip external_webkit-231d4e3152a9c27a73b6ac7badbe6be673aa3ddf.tar.gz external_webkit-231d4e3152a9c27a73b6ac7badbe6be673aa3ddf.tar.bz2 |
Merge webkit.org at R49305 : Automatic merge by git.
Change-Id: I8968561bc1bfd72b8923b7118d3728579c6dbcc7
Diffstat (limited to 'WebCore/dom/Attr.cpp')
-rw-r--r-- | WebCore/dom/Attr.cpp | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/WebCore/dom/Attr.cpp b/WebCore/dom/Attr.cpp index 435c1af..aa5916b 100644 --- a/WebCore/dom/Attr.cpp +++ b/WebCore/dom/Attr.cpp @@ -3,7 +3,7 @@ * (C) 1999 Antti Koivisto (koivisto@kde.org) * (C) 2001 Peter Kelly (pmk@post.com) * (C) 2001 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. + * Copyright (C) 2004, 2005, 2006, 2007, 2009 Apple Inc. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -30,10 +30,10 @@ namespace WebCore { -Attr::Attr(Element* element, Document* docPtr, PassRefPtr<Attribute> a) - : ContainerNode(docPtr) +inline Attr::Attr(Element* element, Document* document, PassRefPtr<Attribute> attribute) + : ContainerNode(document) , m_element(element) - , m_attribute(a) + , m_attribute(attribute) , m_ignoreChildrenChanged(0) , m_specified(true) { @@ -41,6 +41,13 @@ Attr::Attr(Element* element, Document* docPtr, PassRefPtr<Attribute> a) m_attribute->m_impl = this; } +PassRefPtr<Attr> Attr::create(Element* element, Document* document, PassRefPtr<Attribute> attribute) +{ + RefPtr<Attr> attr = adoptRef(new Attr(element, document, attribute)); + attr->createTextChild(); + return attr.release(); +} + Attr::~Attr() { ASSERT(m_attribute->attr() == this); @@ -86,14 +93,14 @@ const AtomicString& Attr::prefix() const return m_attribute->prefix(); } -void Attr::setPrefix(const AtomicString &_prefix, ExceptionCode& ec) +void Attr::setPrefix(const AtomicString& prefix, ExceptionCode& ec) { ec = 0; - checkSetPrefix(_prefix, ec); + checkSetPrefix(prefix, ec); if (ec) return; - m_attribute->setPrefix(_prefix); + m_attribute->setPrefix(prefix); } String Attr::nodeValue() const @@ -101,11 +108,11 @@ String Attr::nodeValue() const return value(); } -void Attr::setValue(const String& v, ExceptionCode&) +void Attr::setValue(const AtomicString& value, ExceptionCode&) { m_ignoreChildrenChanged++; removeChildren(); - m_attribute->setValue(v.impl()); + m_attribute->setValue(value); createTextChild(); m_ignoreChildrenChanged--; @@ -120,7 +127,7 @@ void Attr::setNodeValue(const String& v, ExceptionCode& ec) PassRefPtr<Node> Attr::cloneNode(bool /*deep*/) { - RefPtr<Attr> clone = new Attr(0, document(), m_attribute->clone()); + RefPtr<Attr> clone = adoptRef(new Attr(0, document(), m_attribute->clone())); cloneChildNodes(clone.get()); return clone.release(); } |