HTMLOptionElement.h [plain text]
#ifndef HTMLOptionElement_h
#define HTMLOptionElement_h
#include "HTMLElement.h"
namespace WebCore {
class HTMLDataListElement;
class HTMLSelectElement;
class HTMLOptionElement FINAL : public HTMLElement {
public:
static PassRefPtr<HTMLOptionElement> create(Document*);
static PassRefPtr<HTMLOptionElement> create(const QualifiedName&, Document*);
static PassRefPtr<HTMLOptionElement> createForJSConstructor(Document*, const String& data, const String& value,
bool defaultSelected, bool selected, ExceptionCode&);
virtual String text() const;
void setText(const String&, ExceptionCode&);
int index() const;
String value() const;
void setValue(const String&);
bool selected();
void setSelected(bool);
#if ENABLE(DATALIST_ELEMENT)
HTMLDataListElement* ownerDataListElement() const;
#endif
HTMLSelectElement* ownerSelectElement() const;
String label() const;
void setLabel(const String&);
bool ownElementDisabled() const { return m_disabled; }
virtual bool isDisabledFormControl() const OVERRIDE;
String textIndentedToRespectGroupLabel() const;
void setSelectedState(bool);
private:
HTMLOptionElement(const QualifiedName&, Document*);
virtual bool supportsFocus() const OVERRIDE;
virtual bool isFocusable() const OVERRIDE;
virtual bool rendererIsNeeded(const NodeRenderingContext&) { return false; }
virtual void attach(const AttachContext& = AttachContext()) OVERRIDE;
virtual void detach(const AttachContext& = AttachContext()) OVERRIDE;
virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE;
virtual void accessKeyAction(bool);
virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
void updateNonRenderStyle();
virtual RenderStyle* nonRendererStyle() const OVERRIDE;
virtual PassRefPtr<RenderStyle> customStyleForRenderer() OVERRIDE;
void didRecalcStyle(StyleChange) OVERRIDE;
String collectOptionInnerText() const;
bool m_disabled;
bool m_isSelected;
RefPtr<RenderStyle> m_style;
};
HTMLOptionElement* toHTMLOptionElement(Node*);
const HTMLOptionElement* toHTMLOptionElement(const Node*);
void toHTMLOptionElement(const HTMLOptionElement*);
#ifdef NDEBUG
inline HTMLOptionElement* toHTMLOptionElement(Node* node)
{
return static_cast<HTMLOptionElement*>(node);
}
inline const HTMLOptionElement* toHTMLOptionElement(const Node* node)
{
return static_cast<const HTMLOptionElement*>(node);
}
#endif
}
#endif