OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
5 * Copyright (C) 2004, 2005, 2006, 2010, 2011 Apple Inc. All rights reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2010, 2011 Apple Inc. All rights reserved. |
6 * Copyright (C) 2010 Google Inc. All rights reserved. | 6 * Copyright (C) 2010 Google Inc. All rights reserved. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 15 matching lines...) Expand all Loading... |
26 #define HTMLOptionElement_h | 26 #define HTMLOptionElement_h |
27 | 27 |
28 #include "core/html/HTMLElement.h" | 28 #include "core/html/HTMLElement.h" |
29 | 29 |
30 namespace blink { | 30 namespace blink { |
31 | 31 |
32 class ExceptionState; | 32 class ExceptionState; |
33 class HTMLDataListElement; | 33 class HTMLDataListElement; |
34 class HTMLSelectElement; | 34 class HTMLSelectElement; |
35 | 35 |
36 class HTMLOptionElement FINAL : public HTMLElement { | 36 class HTMLOptionElement final : public HTMLElement { |
37 DEFINE_WRAPPERTYPEINFO(); | 37 DEFINE_WRAPPERTYPEINFO(); |
38 public: | 38 public: |
39 static PassRefPtrWillBeRawPtr<HTMLOptionElement> create(Document&); | 39 static PassRefPtrWillBeRawPtr<HTMLOptionElement> create(Document&); |
40 static PassRefPtrWillBeRawPtr<HTMLOptionElement> createForJSConstructor(Docu
ment&, const String& data, const AtomicString& value, | 40 static PassRefPtrWillBeRawPtr<HTMLOptionElement> createForJSConstructor(Docu
ment&, const String& data, const AtomicString& value, |
41 bool defaultSelected, bool selected, ExceptionState&); | 41 bool defaultSelected, bool selected, ExceptionState&); |
42 | 42 |
43 String text() const; | 43 String text() const; |
44 void setText(const String&, ExceptionState&); | 44 void setText(const String&, ExceptionState&); |
45 | 45 |
46 int index() const; | 46 int index() const; |
47 | 47 |
48 String value() const; | 48 String value() const; |
49 void setValue(const AtomicString&); | 49 void setValue(const AtomicString&); |
50 | 50 |
51 bool selected() const; | 51 bool selected() const; |
52 void setSelected(bool); | 52 void setSelected(bool); |
53 | 53 |
54 HTMLDataListElement* ownerDataListElement() const; | 54 HTMLDataListElement* ownerDataListElement() const; |
55 HTMLSelectElement* ownerSelectElement() const; | 55 HTMLSelectElement* ownerSelectElement() const; |
56 | 56 |
57 String label() const; | 57 String label() const; |
58 void setLabel(const AtomicString&); | 58 void setLabel(const AtomicString&); |
59 | 59 |
60 bool ownElementDisabled() const { return m_disabled; } | 60 bool ownElementDisabled() const { return m_disabled; } |
61 | 61 |
62 virtual bool isDisabledFormControl() const OVERRIDE; | 62 virtual bool isDisabledFormControl() const override; |
63 | 63 |
64 String textIndentedToRespectGroupLabel() const; | 64 String textIndentedToRespectGroupLabel() const; |
65 | 65 |
66 void setSelectedState(bool); | 66 void setSelectedState(bool); |
67 | 67 |
68 HTMLFormElement* form() const; | 68 HTMLFormElement* form() const; |
69 bool spatialNavigationFocused() const; | 69 bool spatialNavigationFocused() const; |
70 | 70 |
71 bool isDisplayNone() const; | 71 bool isDisplayNone() const; |
72 private: | 72 private: |
73 explicit HTMLOptionElement(Document&); | 73 explicit HTMLOptionElement(Document&); |
74 virtual ~HTMLOptionElement(); | 74 virtual ~HTMLOptionElement(); |
75 | 75 |
76 virtual bool rendererIsFocusable() const OVERRIDE { return true; } | 76 virtual bool rendererIsFocusable() const override { return true; } |
77 virtual void attach(const AttachContext& = AttachContext()) OVERRIDE; | 77 virtual void attach(const AttachContext& = AttachContext()) override; |
78 virtual void detach(const AttachContext& = AttachContext()) OVERRIDE; | 78 virtual void detach(const AttachContext& = AttachContext()) override; |
79 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERR
IDE; | 79 virtual void parseAttribute(const QualifiedName&, const AtomicString&) overr
ide; |
80 virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE; | 80 virtual InsertionNotificationRequest insertedInto(ContainerNode*) override; |
81 virtual void removedFrom(ContainerNode*) OVERRIDE; | 81 virtual void removedFrom(ContainerNode*) override; |
82 virtual void accessKeyAction(bool) OVERRIDE; | 82 virtual void accessKeyAction(bool) override; |
83 virtual void childrenChanged(const ChildrenChange&) OVERRIDE; | 83 virtual void childrenChanged(const ChildrenChange&) override; |
84 | 84 |
85 // <option> never has a renderer so we manually manage a cached style. | 85 // <option> never has a renderer so we manually manage a cached style. |
86 void updateNonRenderStyle(); | 86 void updateNonRenderStyle(); |
87 virtual RenderStyle* nonRendererStyle() const OVERRIDE; | 87 virtual RenderStyle* nonRendererStyle() const override; |
88 virtual PassRefPtr<RenderStyle> customStyleForRenderer() OVERRIDE; | 88 virtual PassRefPtr<RenderStyle> customStyleForRenderer() override; |
89 virtual void didRecalcStyle(StyleRecalcChange) OVERRIDE; | 89 virtual void didRecalcStyle(StyleRecalcChange) override; |
90 virtual void didAddUserAgentShadowRoot(ShadowRoot&) OVERRIDE; | 90 virtual void didAddUserAgentShadowRoot(ShadowRoot&) override; |
91 | 91 |
92 String collectOptionInnerText() const; | 92 String collectOptionInnerText() const; |
93 | 93 |
94 void updateLabel(); | 94 void updateLabel(); |
95 | 95 |
96 bool m_disabled; | 96 bool m_disabled; |
97 bool m_isSelected; | 97 bool m_isSelected; |
98 RefPtr<RenderStyle> m_style; | 98 RefPtr<RenderStyle> m_style; |
99 }; | 99 }; |
100 | 100 |
101 } // namespace blink | 101 } // namespace blink |
102 | 102 |
103 #endif // HTMLOptionElement_h | 103 #endif // HTMLOptionElement_h |
OLD | NEW |