summaryrefslogtreecommitdiffstats
path: root/chromium/third_party/WebKit/Source/core/dom/Attr.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/WebKit/Source/core/dom/Attr.h')
-rw-r--r--chromium/third_party/WebKit/Source/core/dom/Attr.h40
1 files changed, 22 insertions, 18 deletions
diff --git a/chromium/third_party/WebKit/Source/core/dom/Attr.h b/chromium/third_party/WebKit/Source/core/dom/Attr.h
index 40d812b3997..b6b2b4d362c 100644
--- a/chromium/third_party/WebKit/Source/core/dom/Attr.h
+++ b/chromium/third_party/WebKit/Source/core/dom/Attr.h
@@ -30,9 +30,7 @@
namespace WebCore {
-class CSSStyleDeclaration;
class ExceptionState;
-class MutableStylePropertySet;
// Attr can have Text children
// therefore it has to be a fullblown Node. The plan
@@ -42,30 +40,30 @@ class MutableStylePropertySet;
class Attr FINAL : public ContainerNode {
public:
- static PassRefPtr<Attr> create(Element&, const QualifiedName&);
- static PassRefPtr<Attr> create(Document&, const QualifiedName&, const AtomicString& value);
+ static PassRefPtrWillBeRawPtr<Attr> create(Element&, const QualifiedName&);
+ static PassRefPtrWillBeRawPtr<Attr> create(Document&, const QualifiedName&, const AtomicString& value);
virtual ~Attr();
- String name() const { return qualifiedName().toString(); }
+ String name() const { return m_name.toString(); }
bool specified() const { return true; }
Element* ownerElement() const { return m_element; }
const AtomicString& value() const;
- void setValue(const AtomicString&, ExceptionState&);
void setValue(const AtomicString&);
- const QualifiedName& qualifiedName() const { return m_name; }
+ const AtomicString& valueForBindings() const;
+ void setValueForBindings(const AtomicString&);
- bool isId() const;
+ const QualifiedName qualifiedName() const;
- void attachToElement(Element*);
+ void attachToElement(Element*, const AtomicString&);
void detachFromElementWithValue(const AtomicString&);
virtual const AtomicString& localName() const OVERRIDE { return m_name.localName(); }
virtual const AtomicString& namespaceURI() const OVERRIDE { return m_name.namespaceURI(); }
- virtual const AtomicString& prefix() const OVERRIDE { return m_name.prefix(); }
+ const AtomicString& prefix() const { return m_name.prefix(); }
- virtual void setPrefix(const AtomicString&, ExceptionState&) OVERRIDE;
+ virtual void trace(Visitor*) OVERRIDE;
private:
Attr(Element&, const QualifiedName&);
@@ -73,25 +71,31 @@ private:
void createTextChild();
+ void setValueInternal(const AtomicString&);
+
virtual String nodeName() const OVERRIDE { return name(); }
virtual NodeType nodeType() const OVERRIDE { return ATTRIBUTE_NODE; }
virtual String nodeValue() const OVERRIDE { return value(); }
- virtual void setNodeValue(const String&);
- virtual PassRefPtr<Node> cloneNode(bool deep = true);
+ virtual void setNodeValue(const String&) OVERRIDE;
+ virtual PassRefPtrWillBeRawPtr<Node> cloneNode(bool deep = true) OVERRIDE;
- virtual bool isAttributeNode() const { return true; }
- virtual bool childTypeAllowed(NodeType) const;
+ virtual bool isAttributeNode() const OVERRIDE { return true; }
+ virtual bool childTypeAllowed(NodeType) const OVERRIDE;
- virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
+ virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0) OVERRIDE;
Attribute& elementAttribute();
// Attr wraps either an element/name, or a name/value pair (when it's a standalone Node.)
// Note that m_name is always set, but m_element/m_standaloneValue may be null.
- Element* m_element;
+ RawPtrWillBeMember<Element> m_element;
QualifiedName m_name;
- AtomicString m_standaloneValue;
+ // Holds the value if it is a standalone Node, or the local name of the
+ // attribute it is attached to on an Element. The latter may (letter case)
+ // differ from m_name's local name. As these two modes are non-overlapping,
+ // use a single field.
+ AtomicString m_standaloneValueOrAttachedLocalName;
unsigned m_ignoreChildrenChanged;
};