* (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, 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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
class DOMTokenList;
class ElementRareData;
class IntSize;
+class WebKitAnimationList;
enum SpellcheckAttributeState {
SpellcheckAttributeTrue,
virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
virtual void recalcStyle(StyleChange = NoChange);
- Node* shadowRoot();
- void setShadowRoot(PassRefPtr<Node>);
+ ContainerNode* shadowRoot() const;
+ ContainerNode* ensureShadowRoot();
+ void removeShadowRoot();
+
+ virtual const AtomicString& shadowPseudoId() const;
RenderStyle* computedStyle(PseudoId = NOPSEUDO);
// Use Document::registerForMediaVolumeCallbacks() to subscribe to this
virtual void mediaVolumeDidChange() { }
+ // Use Document::registerForPrivateBrowsingStateChangedCallbacks() to subscribe to this.
+ virtual void privateBrowsingStateDidChange() { }
+
bool isFinishedParsingChildren() const { return isParsingChildrenFinished(); }
virtual void finishParsingChildren();
- virtual void beginParsingChildren() { clearIsParsingChildrenFinished(); }
+ virtual void beginParsingChildren();
// ElementTraversal API
Element* firstElementChild() const;
static bool isMathMLElement() { return false; }
#endif
+#if ENABLE(INPUT_SPEECH)
+ virtual bool isInputFieldSpeechButtonElement() const { return false; }
+#endif
+
virtual bool isFormControlElement() const { return false; }
virtual bool isEnabledFormControl() const { return true; }
virtual bool isReadOnlyFormControl() const { return false; }
virtual bool saveFormControlState(String&) const { return false; }
virtual void restoreFormControlState(const String&) { }
+ virtual bool wasChangedSinceLastFormControlChangeEvent() const;
+ virtual void setChangedSinceLastFormControlChangeEvent(bool);
virtual void dispatchFormControlChangeEvent() { }
#if ENABLE(SVG)
virtual bool isSpellCheckingEnabled() const;
+ PassRefPtr<WebKitAnimationList> webkitGetAnimations() const;
+
protected:
Element(const QualifiedName& tagName, Document* document, ConstructionType type)
: ContainerNode(document, type)
// They are separated to allow a different flow of control in StyledElement::attributeChanged().
void recalcStyleIfNeededAfterAttributeChanged(Attribute*);
void updateAfterAttributeChanged(Attribute*);
+
+ void idAttributeChanged(Attribute*);
private:
void scrollByUnits(int units, ScrollGranularity);
virtual void setPrefix(const AtomicString&, ExceptionCode&);
virtual NodeType nodeType() const;
- virtual bool childTypeAllowed(NodeType);
+ virtual bool childTypeAllowed(NodeType) const;
virtual PassRefPtr<Attribute> createAttribute(const QualifiedName&, const AtomicString& value);
ElementRareData* ensureRareData();
SpellcheckAttributeState spellcheckAttributeState() const;
- void removeShadowRoot();
private:
mutable RefPtr<NamedNodeMap> m_attributeMap;
{
return isElementNode() && toElement(this)->hasTagName(name);
}
+
+inline bool Node::hasLocalName(const AtomicString& name) const
+{
+ return isElementNode() && toElement(this)->hasLocalName(name);
+}
inline bool Node::hasAttributes() const
{
setAttribute(document()->idAttributeName(), value);
}
+inline const AtomicString& Element::shadowPseudoId() const
+{
+ return nullAtom;
+}
+
+inline Element* firstElementChild(const ContainerNode* container)
+{
+ ASSERT_ARG(container, container);
+ Node* child = container->firstChild();
+ while (child && !child->isElementNode())
+ child = child->nextSibling();
+ return static_cast<Element*>(child);
+}
+
} // namespace
#endif