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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 const QualifiedName qualifiedName() const; | 57 const QualifiedName qualifiedName() const; |
58 | 58 |
59 void attachToElement(Element*, const AtomicString&); | 59 void attachToElement(Element*, const AtomicString&); |
60 void detachFromElementWithValue(const AtomicString&); | 60 void detachFromElementWithValue(const AtomicString&); |
61 | 61 |
62 virtual const AtomicString& localName() const OVERRIDE { return m_name.local
Name(); } | 62 virtual const AtomicString& localName() const OVERRIDE { return m_name.local
Name(); } |
63 virtual const AtomicString& namespaceURI() const OVERRIDE { return m_name.na
mespaceURI(); } | 63 virtual const AtomicString& namespaceURI() const OVERRIDE { return m_name.na
mespaceURI(); } |
64 const AtomicString& prefix() const { return m_name.prefix(); } | 64 const AtomicString& prefix() const { return m_name.prefix(); } |
65 | 65 |
66 virtual void trace(Visitor*) OVERRIDE; | 66 virtual void trace(Visitor*) OVERRIDE; |
67 void clearWeakMembers(Visitor*); | |
68 | 67 |
69 private: | 68 private: |
70 Attr(Element&, const QualifiedName&); | 69 Attr(Element&, const QualifiedName&); |
71 Attr(Document&, const QualifiedName&, const AtomicString& value); | 70 Attr(Document&, const QualifiedName&, const AtomicString& value); |
72 | 71 |
73 void createTextChild(); | 72 void createTextChild(); |
74 | 73 |
75 void setValueInternal(const AtomicString&); | 74 void setValueInternal(const AtomicString&); |
76 | 75 |
77 virtual String nodeName() const OVERRIDE { return name(); } | 76 virtual String nodeName() const OVERRIDE { return name(); } |
78 virtual NodeType nodeType() const OVERRIDE { return ATTRIBUTE_NODE; } | 77 virtual NodeType nodeType() const OVERRIDE { return ATTRIBUTE_NODE; } |
79 | 78 |
80 virtual String nodeValue() const OVERRIDE { return value(); } | 79 virtual String nodeValue() const OVERRIDE { return value(); } |
81 virtual void setNodeValue(const String&) OVERRIDE; | 80 virtual void setNodeValue(const String&) OVERRIDE; |
82 virtual PassRefPtrWillBeRawPtr<Node> cloneNode(bool deep = true) OVERRIDE; | 81 virtual PassRefPtrWillBeRawPtr<Node> cloneNode(bool deep = true) OVERRIDE; |
83 | 82 |
84 virtual bool isAttributeNode() const OVERRIDE { return true; } | 83 virtual bool isAttributeNode() const OVERRIDE { return true; } |
85 virtual bool childTypeAllowed(NodeType) const OVERRIDE; | 84 virtual bool childTypeAllowed(NodeType) const OVERRIDE; |
86 | 85 |
87 virtual void childrenChanged(bool changedByParser = false, Node* beforeChang
e = 0, Node* afterChange = 0, int childCountDelta = 0) OVERRIDE; | 86 virtual void childrenChanged(bool changedByParser = false, Node* beforeChang
e = 0, Node* afterChange = 0, int childCountDelta = 0) OVERRIDE; |
88 | 87 |
89 Attribute& elementAttribute(); | 88 Attribute& elementAttribute(); |
90 | 89 |
91 // Attr wraps either an element/name, or a name/value pair (when it's a stan
dalone Node.) | 90 // Attr wraps either an element/name, or a name/value pair (when it's a stan
dalone Node.) |
92 // Note that m_name is always set, but m_element/m_standaloneValue may be nu
ll. | 91 // Note that m_name is always set, but m_element/m_standaloneValue may be nu
ll. |
93 // | 92 RawPtrWillBeMember<Element> m_element; |
94 // FIXME: Oilpan: m_element should be a Member. However, because of the | |
95 // current semantics of weak maps, we have to make it a WeakMember in order | |
96 // to not leak through the attrNodeListMap in Element.cpp. Once the semantic
s | |
97 // of weak maps has changed we should make this a Member and remove the cust
om | |
98 // weak processing. | |
99 RawPtrWillBeWeakMember<Element> m_element; | |
100 QualifiedName m_name; | 93 QualifiedName m_name; |
101 // Holds the value if it is a standalone Node, or the local name of the | 94 // Holds the value if it is a standalone Node, or the local name of the |
102 // attribute it is attached to on an Element. The latter may (letter case) | 95 // attribute it is attached to on an Element. The latter may (letter case) |
103 // differ from m_name's local name. As these two modes are non-overlapping, | 96 // differ from m_name's local name. As these two modes are non-overlapping, |
104 // use a single field. | 97 // use a single field. |
105 AtomicString m_standaloneValueOrAttachedLocalName; | 98 AtomicString m_standaloneValueOrAttachedLocalName; |
106 unsigned m_ignoreChildrenChanged; | 99 unsigned m_ignoreChildrenChanged; |
107 }; | 100 }; |
108 | 101 |
109 DEFINE_NODE_TYPE_CASTS(Attr, isAttributeNode()); | 102 DEFINE_NODE_TYPE_CASTS(Attr, isAttributeNode()); |
110 | 103 |
111 } // namespace WebCore | 104 } // namespace WebCore |
112 | 105 |
113 #endif // Attr_h | 106 #endif // Attr_h |
OLD | NEW |