Changeset 21184 for trunk/WebCore/dom/Element.h
- Timestamp:
- 04/29/07 13:32:51 (21 months ago)
- Files:
-
- 1 modified
-
trunk/WebCore/dom/Element.h (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/dom/Element.h
r20072 r21184 1 1 /* 2 * This file is part of the DOM implementation for KDE.3 *4 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 5 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 6 4 * (C) 2001 Peter Kelly (pmk@post.com) 7 5 * (C) 2001 Dirk Mueller (mueller@kde.org) 8 * Copyright (C) 2003, 2004, 2005, 2006 Apple Computer, Inc.6 * Copyright (C) 2003, 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. 9 7 * 10 8 * This library is free software; you can redistribute it and/or … … 28 26 #define Element_h 29 27 30 #include "Attr.h" 28 #include "ContainerNode.h" 29 #include "QualifiedName.h" 31 30 #include "ScrollTypes.h" 32 31 #include "Timer.h" … … 35 34 36 35 class AtomicStringList; 36 class Attr; 37 37 class Attribute; 38 class CSSStyleDeclaration; 39 class ElementRareData; 40 class IntSize; 38 41 39 42 class Element : public ContainerNode { 40 friend class Document;41 friend class NamedAttrMap;42 friend class Attr;43 friend class Node;44 friend class CSSStyleSelector;45 43 public: 46 44 Element(const QualifiedName&, Document*); … … 50 48 virtual const AtomicStringList* getClassList() const; 51 49 const AtomicString& getIDAttribute() const; 52 bool hasAttribute(const QualifiedName& name) const;53 const AtomicString& getAttribute(const QualifiedName& name) const;54 void setAttribute(const QualifiedName& name, StringImpl* value, ExceptionCode&);55 void removeAttribute(const QualifiedName& name, ExceptionCode&);50 bool hasAttribute(const QualifiedName&) const; 51 const AtomicString& getAttribute(const QualifiedName&) const; 52 void setAttribute(const QualifiedName&, StringImpl* value, ExceptionCode&); 53 void removeAttribute(const QualifiedName&, ExceptionCode&); 56 54 57 55 bool hasAttributes() const; … … 89 87 int scrollHeight(); 90 88 91 void removeAttribute(const String &name, ExceptionCode& ec);92 void removeAttributeNS(const String &namespaceURI, const String& localName, ExceptionCode&);89 void removeAttribute(const String& name, ExceptionCode&); 90 void removeAttributeNS(const String& namespaceURI, const String& localName, ExceptionCode&); 93 91 94 92 PassRefPtr<Attr> getAttributeNode(const String& name); 95 93 PassRefPtr<Attr> getAttributeNodeNS(const String& namespaceURI, const String& localName); 96 94 PassRefPtr<Attr> setAttributeNode(Attr*, ExceptionCode&); 97 PassRefPtr<Attr> setAttributeNodeNS(Attr* newAttr, ExceptionCode& ec) { return setAttributeNode(newAttr, ec); }95 PassRefPtr<Attr> setAttributeNodeNS(Attr*, ExceptionCode&); 98 96 PassRefPtr<Attr> removeAttributeNode(Attr*, ExceptionCode&); 99 97 100 virtual CSSStyleDeclaration *style();98 virtual CSSStyleDeclaration* style(); 101 99 102 100 const QualifiedName& tagQName() const { return m_tagName; } … … 126 124 127 125 // convenience methods which ignore exceptions 128 void setAttribute(const QualifiedName& name, const String& value);129 130 virtual NamedAttrMap *attributes() const;126 void setAttribute(const QualifiedName&, const String& value); 127 128 virtual NamedAttrMap* attributes() const; 131 129 NamedAttrMap* attributes(bool readonly) const; 132 130 133 131 // This method is called whenever an attribute is added, changed or removed. 134 virtual void attributeChanged(Attribute* attr, bool preserveDecls = false) {}132 virtual void attributeChanged(Attribute*, bool preserveDecls = false) {} 135 133 136 134 // not part of the DOM 137 135 void setAttributeMap(NamedAttrMap*); 138 136 139 virtual void copyNonAttributeProperties(const Element *source) {}137 virtual void copyNonAttributeProperties(const Element* source) {} 140 138 141 139 virtual void attach(); 142 140 virtual void detach(); 143 virtual RenderStyle *styleForRenderer(RenderObject *parent);144 virtual RenderObject *createRenderer(RenderArena *, RenderStyle*);145 virtual void recalcStyle( StyleChange = NoChange);141 virtual RenderStyle* styleForRenderer(RenderObject* parent); 142 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); 143 virtual void recalcStyle(StyleChange = NoChange); 146 144 147 145 virtual bool childTypeAllowed(NodeType); … … 149 147 virtual Attribute* createAttribute(const QualifiedName& name, StringImpl* value); 150 148 151 void dispatchAttrRemovalEvent(Attribute *attr);152 void dispatchAttrAdditionEvent(Attribute *attr);149 void dispatchAttrRemovalEvent(Attribute*); 150 void dispatchAttrAdditionEvent(Attribute*); 153 151 154 152 virtual void accessKeyAction(bool sendToAnyEvent) { } … … 156 154 virtual String toString() const; 157 155 158 virtual bool isURLAttribute(Attribute *attr) const;156 virtual bool isURLAttribute(Attribute*) const; 159 157 virtual String target() const { return String(); } 160 158 … … 164 162 bool needsFocusAppearanceUpdate() const { return m_needsFocusAppearanceUpdate; } 165 163 void setNeedsFocusAppearanceUpdate(bool b) { m_needsFocusAppearanceUpdate = b; } 166 164 167 165 #ifndef NDEBUG 168 virtual void dump(TextStream *stream, DeprecatedString ind = "") const;169 virtual void formatForDebugger(char *buffer, unsigned length) const;166 virtual void dump(TextStream* , DeprecatedString ind = "") const; 167 virtual void formatForDebugger(char* buffer, unsigned length) const; 170 168 #endif 171 169 172 Node* insertAdjacentElement(const String& where, Node* newChild, int& exception);170 Node* insertAdjacentElement(const String& where, Node* newChild, ExceptionCode&); 173 171 bool contains(const Node*) const; 174 172 … … 178 176 virtual String title() const; 179 177 180 protected: 178 String openTagStartToString() const; 179 180 void updateId(const AtomicString& oldId, const AtomicString& newId); 181 182 IntSize minimumSizeForResizing() const; 183 void setMinimumSizeForResizing(const IntSize&); 184 185 private: 186 ElementRareData* rareData(); 187 const ElementRareData* rareData() const; 188 ElementRareData* createRareData(); 189 181 190 virtual void createAttributeMap() const; 182 String openTagStartToString() const;183 184 private:185 void updateId(const AtomicString& oldId, const AtomicString& newId);186 191 187 192 virtual void updateStyleAttributeIfNeeded() const {} … … 192 197 bool m_needsFocusAppearanceUpdate; 193 198 194 protected: // member variables199 protected: 195 200 mutable RefPtr<NamedAttrMap> namedAttrMap; 201 202 private: 196 203 QualifiedName m_tagName; 197 204 };