#ifndef HTMLOptionElement_h
#define HTMLOptionElement_h
#include "core/html/HTMLElement.h"
namespace WebCore {
class ExceptionState;
class HTMLDataListElement;
class HTMLSelectElement;
class HTMLOptionElement FINAL : public HTMLElement {
public:
    static PassRefPtr<HTMLOptionElement> create(Document&);
    static PassRefPtr<HTMLOptionElement> createForJSConstructor(Document&, const String& data, const AtomicString& value,
        bool defaultSelected, bool selected, ExceptionState&);
    String text() const;
    void setText(const String&, ExceptionState&);
    int index() const;
    String value() const;
    void setValue(const AtomicString&);
    bool selected() const;
    void setSelected(bool);
    HTMLDataListElement* ownerDataListElement() const;
    HTMLSelectElement* ownerSelectElement() const;
    String label() const;
    void setLabel(const AtomicString&);
    bool ownElementDisabled() const { return m_disabled; }
    virtual bool isDisabledFormControl() const OVERRIDE;
    String textIndentedToRespectGroupLabel() const;
    void setSelectedState(bool);
    HTMLFormElement* form() const;
private:
    explicit HTMLOptionElement(Document&);
    virtual bool rendererIsFocusable() const OVERRIDE;
    virtual bool rendererIsNeeded(const RenderStyle&) OVERRIDE { 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) OVERRIDE;
    virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0) OVERRIDE;
    
    void updateNonRenderStyle();
    virtual RenderStyle* nonRendererStyle() const OVERRIDE;
    virtual PassRefPtr<RenderStyle> customStyleForRenderer() OVERRIDE;
    virtual void didRecalcStyle(StyleRecalcChange) OVERRIDE;
    String collectOptionInnerText() const;
    bool m_disabled;
    bool m_isSelected;
    RefPtr<RenderStyle> m_style;
};
} 
#endif