diff options
Diffstat (limited to 'WebCore/dom/Element.h')
-rw-r--r-- | WebCore/dom/Element.h | 59 |
1 files changed, 28 insertions, 31 deletions
diff --git a/WebCore/dom/Element.h b/WebCore/dom/Element.h index 6aa6312..223c26a 100644 --- a/WebCore/dom/Element.h +++ b/WebCore/dom/Element.h @@ -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) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. + * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 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 @@ -42,7 +42,7 @@ class IntSize; class Element : public ContainerNode { public: Element(const QualifiedName&, Document*); - virtual ~Element(); + ~Element(); const AtomicString& getIDAttribute() const; bool hasAttribute(const QualifiedName&) const; @@ -64,6 +64,7 @@ public: void scrollIntoView(bool alignToTop = true); void scrollIntoViewIfNeeded(bool centerIfNeeded = true); + void scrollByUnits(int units, ScrollGranularity); void scrollByLines(int lines); void scrollByPages(int pages); @@ -107,11 +108,17 @@ public: const AtomicString& localName() const { return m_tagName.localName(); } const AtomicString& prefix() const { return m_tagName.prefix(); } + virtual void setPrefix(const AtomicString&, ExceptionCode&); const AtomicString& namespaceURI() const { return m_tagName.namespaceURI(); } virtual KURL baseURI() const; + // DOM methods overridden from parent classes + virtual NodeType nodeType() const; virtual String nodeName() const; + virtual void insertedIntoDocument(); + virtual void removedFromDocument(); + virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0); PassRefPtr<Element> cloneElementWithChildren(); PassRefPtr<Element> cloneElementWithoutChildren(); @@ -129,9 +136,13 @@ public: // This method is called whenever an attribute is added, changed or removed. virtual void attributeChanged(Attribute*, bool preserveDecls = false); + // The implementation of Element::attributeChanged() calls the following two functions. + // They are separated to allow a different flow of control in StyledElement::attributeChanged(). + void recalcStyleIfNeededAfterAttributeChanged(Attribute*); + void updateAfterAttributeChanged(Attribute*); + // not part of the DOM void setAttributeMap(PassRefPtr<NamedNodeMap>); - NamedNodeMap* attributeMap() const { return namedAttrMap.get(); } virtual void copyNonAttributeProperties(const Element* /*source*/) { } @@ -142,6 +153,10 @@ public: virtual RenderStyle* computedStyle(); + virtual bool childTypeAllowed(NodeType); + + virtual PassRefPtr<Attribute> createAttribute(const QualifiedName&, const AtomicString& value); + void dispatchAttrRemovalEvent(Attribute*); void dispatchAttrAdditionEvent(Attribute*); @@ -155,6 +170,12 @@ public: virtual void updateFocusAppearance(bool restorePreviousSelection); void blur(); +#ifndef NDEBUG + virtual void formatForDebugger(char* buffer, unsigned length) const; +#endif + + bool pseudoStyleCacheIsInvalid(const RenderStyle* currentStyle, RenderStyle* newStyle); + String innerText() const; String outerText() const; @@ -185,13 +206,13 @@ public: Element* nextElementSibling() const; unsigned childElementCount() const; + // FormControlElement API virtual bool isFormControlElement() const { return false; } virtual bool isEnabledFormControl() const { return true; } virtual bool isReadOnlyFormControl() const { return false; } virtual bool isTextFormControl() const { return false; } virtual bool isOptionalFormControl() const { return false; } virtual bool isRequiredFormControl() const { return false; } - virtual bool isDefaultButtonForForm() const { return false; } virtual bool formControlValueMatchesRenderer() const { return false; } virtual void setFormControlValueMatchesRenderer(bool) { } @@ -204,37 +225,13 @@ public: virtual void dispatchFormControlChangeEvent() { } -protected: - virtual void insertedIntoDocument(); - virtual void removedFromDocument(); - virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0); - - // The implementation of Element::attributeChanged() calls the following two functions. - // They are separated to allow a different flow of control in StyledElement::attributeChanged(). - void recalcStyleIfNeededAfterAttributeChanged(Attribute*); - void updateAfterAttributeChanged(Attribute*); - private: - void scrollByUnits(int units, ScrollGranularity); - - virtual void setPrefix(const AtomicString&, ExceptionCode&); - virtual NodeType nodeType() const; - virtual bool childTypeAllowed(NodeType); - - virtual PassRefPtr<Attribute> createAttribute(const QualifiedName&, const AtomicString& value); - -#ifndef NDEBUG - virtual void formatForDebugger(char* buffer, unsigned length) const; -#endif - - bool pseudoStyleCacheIsInvalid(const RenderStyle* currentStyle, RenderStyle* newStyle); - virtual void createAttributeMap() const; - virtual void updateStyleAttribute() const { } + virtual void updateStyleAttribute() const {} #if ENABLE(SVG) - virtual void updateAnimatedSVGAttribute(const String&) const { } + virtual void updateAnimatedSVGAttribute(const String&) const {} #endif void updateFocusAppearanceSoonAfterAttach(); @@ -251,10 +248,10 @@ private: QualifiedName m_tagName; virtual NodeRareData* createRareData(); +protected: ElementRareData* rareData() const; ElementRareData* ensureRareData(); -protected: mutable RefPtr<NamedNodeMap> namedAttrMap; }; |