OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2001 Peter Kelly (pmk@post.com) | 4 * (C) 2001 Peter Kelly (pmk@post.com) |
5 * (C) 2001 Dirk Mueller (mueller@kde.org) | 5 * (C) 2001 Dirk Mueller (mueller@kde.org) |
6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights
reserved. | 6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights
reserved. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 public: | 42 public: |
43 static PassRefPtr<Attr> create(Element&, const QualifiedName&); | 43 static PassRefPtr<Attr> create(Element&, const QualifiedName&); |
44 static PassRefPtr<Attr> create(Document&, const QualifiedName&, const Atomic
String& value); | 44 static PassRefPtr<Attr> create(Document&, const QualifiedName&, const Atomic
String& value); |
45 virtual ~Attr(); | 45 virtual ~Attr(); |
46 | 46 |
47 String name() const { return qualifiedName().toString(); } | 47 String name() const { return qualifiedName().toString(); } |
48 bool specified() const { return true; } | 48 bool specified() const { return true; } |
49 Element* ownerElement() const { return m_element; } | 49 Element* ownerElement() const { return m_element; } |
50 | 50 |
51 const AtomicString& value() const; | 51 const AtomicString& value() const; |
52 void setValue(const AtomicString&, ExceptionState&); | |
53 void setValue(const AtomicString&); | 52 void setValue(const AtomicString&); |
54 | 53 |
| 54 const AtomicString& valueForBindings() const; |
| 55 void setValueForBindings(const AtomicString&); |
| 56 |
55 const QualifiedName& qualifiedName() const { return m_name; } | 57 const QualifiedName& qualifiedName() const { return m_name; } |
56 | 58 |
57 void attachToElement(Element*); | 59 void attachToElement(Element*); |
58 void detachFromElementWithValue(const AtomicString&); | 60 void detachFromElementWithValue(const AtomicString&); |
59 | 61 |
60 virtual const AtomicString& localName() const OVERRIDE { return m_name.local
Name(); } | 62 virtual const AtomicString& localName() const OVERRIDE { return m_name.local
Name(); } |
61 virtual const AtomicString& namespaceURI() const OVERRIDE { return m_name.na
mespaceURI(); } | 63 virtual const AtomicString& namespaceURI() const OVERRIDE { return m_name.na
mespaceURI(); } |
62 const AtomicString& prefix() const { return m_name.prefix(); } | 64 const AtomicString& prefix() const { return m_name.prefix(); } |
63 | 65 |
64 private: | 66 private: |
65 Attr(Element&, const QualifiedName&); | 67 Attr(Element&, const QualifiedName&); |
66 Attr(Document&, const QualifiedName&, const AtomicString& value); | 68 Attr(Document&, const QualifiedName&, const AtomicString& value); |
67 | 69 |
68 void createTextChild(); | 70 void createTextChild(); |
69 | 71 |
| 72 void setValueInternal(const AtomicString&); |
| 73 |
70 virtual String nodeName() const OVERRIDE { return name(); } | 74 virtual String nodeName() const OVERRIDE { return name(); } |
71 virtual NodeType nodeType() const OVERRIDE { return ATTRIBUTE_NODE; } | 75 virtual NodeType nodeType() const OVERRIDE { return ATTRIBUTE_NODE; } |
72 | 76 |
73 virtual String nodeValue() const OVERRIDE { return value(); } | 77 virtual String nodeValue() const OVERRIDE { return value(); } |
74 virtual void setNodeValue(const String&) OVERRIDE; | 78 virtual void setNodeValue(const String&) OVERRIDE; |
75 virtual PassRefPtr<Node> cloneNode(bool deep = true) OVERRIDE; | 79 virtual PassRefPtr<Node> cloneNode(bool deep = true) OVERRIDE; |
76 | 80 |
77 virtual bool isAttributeNode() const OVERRIDE { return true; } | 81 virtual bool isAttributeNode() const OVERRIDE { return true; } |
78 virtual bool childTypeAllowed(NodeType) const OVERRIDE; | 82 virtual bool childTypeAllowed(NodeType) const OVERRIDE; |
79 | 83 |
80 virtual void childrenChanged(bool changedByParser = false, Node* beforeChang
e = 0, Node* afterChange = 0, int childCountDelta = 0) OVERRIDE; | 84 virtual void childrenChanged(bool changedByParser = false, Node* beforeChang
e = 0, Node* afterChange = 0, int childCountDelta = 0) OVERRIDE; |
81 | 85 |
82 Attribute& elementAttribute(); | 86 Attribute& elementAttribute(); |
83 | 87 |
84 // Attr wraps either an element/name, or a name/value pair (when it's a stan
dalone Node.) | 88 // Attr wraps either an element/name, or a name/value pair (when it's a stan
dalone Node.) |
85 // Note that m_name is always set, but m_element/m_standaloneValue may be nu
ll. | 89 // Note that m_name is always set, but m_element/m_standaloneValue may be nu
ll. |
86 Element* m_element; | 90 Element* m_element; |
87 QualifiedName m_name; | 91 QualifiedName m_name; |
88 AtomicString m_standaloneValue; | 92 AtomicString m_standaloneValue; |
89 unsigned m_ignoreChildrenChanged; | 93 unsigned m_ignoreChildrenChanged; |
90 }; | 94 }; |
91 | 95 |
92 DEFINE_NODE_TYPE_CASTS(Attr, isAttributeNode()); | 96 DEFINE_NODE_TYPE_CASTS(Attr, isAttributeNode()); |
93 | 97 |
94 } // namespace WebCore | 98 } // namespace WebCore |
95 | 99 |
96 #endif // Attr_h | 100 #endif // Attr_h |
OLD | NEW |