| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). | 2 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
| 3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 4 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 4 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 5 * (C) 2000 Dirk Mueller (mueller@kde.org) | 5 * (C) 2000 Dirk Mueller (mueller@kde.org) |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010, 2011 Apple Inc. All rights
reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010, 2011 Apple Inc. All rights
reserved. |
| 7 * Copyright (C) 2010 Google Inc. All rights reserved. | 7 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 8 * | 8 * |
| 9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 PassRefPtr<HTMLCollection> selectedOptions(); | 73 PassRefPtr<HTMLCollection> selectedOptions(); |
| 74 | 74 |
| 75 void optionElementChildrenChanged(); | 75 void optionElementChildrenChanged(); |
| 76 | 76 |
| 77 void setRecalcListItems(); | 77 void setRecalcListItems(); |
| 78 void invalidateSelectedItems(); | 78 void invalidateSelectedItems(); |
| 79 void updateListItemSelectedStates(); | 79 void updateListItemSelectedStates(); |
| 80 | 80 |
| 81 const Vector<HTMLElement*>& listItems() const; | 81 const Vector<HTMLElement*>& listItems() const; |
| 82 | 82 |
| 83 virtual void accessKeyAction(bool sendMouseEvents); | 83 virtual void accessKeyAction(bool sendMouseEvents) OVERRIDE; |
| 84 void accessKeySetSelectedIndex(int); | 84 void accessKeySetSelectedIndex(int); |
| 85 | 85 |
| 86 void setMultiple(bool); | 86 void setMultiple(bool); |
| 87 | 87 |
| 88 void setSize(int); | 88 void setSize(int); |
| 89 | 89 |
| 90 void setOption(unsigned index, HTMLOptionElement*, ExceptionState&); | 90 void setOption(unsigned index, HTMLOptionElement*, ExceptionState&); |
| 91 void setLength(unsigned, ExceptionState&); | 91 void setLength(unsigned, ExceptionState&); |
| 92 | 92 |
| 93 Node* namedItem(const AtomicString& name); | 93 Node* namedItem(const AtomicString& name); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 111 // For use in the implementation of HTMLOptionElement. | 111 // For use in the implementation of HTMLOptionElement. |
| 112 void optionSelectionStateChanged(HTMLOptionElement*, bool optionIsSelected); | 112 void optionSelectionStateChanged(HTMLOptionElement*, bool optionIsSelected); |
| 113 bool isParsingInProgress() const { return m_isParsingInProgress; } | 113 bool isParsingInProgress() const { return m_isParsingInProgress; } |
| 114 bool anonymousIndexedSetter(unsigned, PassRefPtr<HTMLOptionElement>, Excepti
onState&); | 114 bool anonymousIndexedSetter(unsigned, PassRefPtr<HTMLOptionElement>, Excepti
onState&); |
| 115 bool anonymousIndexedSetterRemove(unsigned, ExceptionState&); | 115 bool anonymousIndexedSetterRemove(unsigned, ExceptionState&); |
| 116 | 116 |
| 117 protected: | 117 protected: |
| 118 HTMLSelectElement(Document&, HTMLFormElement*, bool createdByParser); | 118 HTMLSelectElement(Document&, HTMLFormElement*, bool createdByParser); |
| 119 | 119 |
| 120 private: | 120 private: |
| 121 virtual const AtomicString& formControlType() const; | 121 virtual const AtomicString& formControlType() const OVERRIDE; |
| 122 | 122 |
| 123 virtual bool shouldShowFocusRingOnMouseFocus() const OVERRIDE; | 123 virtual bool shouldShowFocusRingOnMouseFocus() const OVERRIDE; |
| 124 | 124 |
| 125 virtual void dispatchFocusEvent(Element* oldFocusedElement, FocusDirection)
OVERRIDE; | 125 virtual void dispatchFocusEvent(Element* oldFocusedElement, FocusDirection)
OVERRIDE; |
| 126 virtual void dispatchBlurEvent(Element* newFocusedElemnet) OVERRIDE; | 126 virtual void dispatchBlurEvent(Element* newFocusedElemnet) OVERRIDE; |
| 127 | 127 |
| 128 virtual bool canStartSelection() const { return false; } | 128 virtual bool canStartSelection() const OVERRIDE { return false; } |
| 129 | 129 |
| 130 virtual bool isEnumeratable() const { return true; } | 130 virtual bool isEnumeratable() const OVERRIDE { return true; } |
| 131 virtual bool isInteractiveContent() const OVERRIDE; | 131 virtual bool isInteractiveContent() const OVERRIDE; |
| 132 virtual bool supportLabels() const OVERRIDE { return true; } | 132 virtual bool supportLabels() const OVERRIDE { return true; } |
| 133 | 133 |
| 134 virtual FormControlState saveFormControlState() const OVERRIDE; | 134 virtual FormControlState saveFormControlState() const OVERRIDE; |
| 135 virtual void restoreFormControlState(const FormControlState&) OVERRIDE; | 135 virtual void restoreFormControlState(const FormControlState&) OVERRIDE; |
| 136 | 136 |
| 137 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERR
IDE; | 137 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERR
IDE; |
| 138 virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE; | 138 virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE; |
| 139 | 139 |
| 140 virtual RenderObject* createRenderer(RenderStyle *); | 140 virtual RenderObject* createRenderer(RenderStyle*) OVERRIDE; |
| 141 virtual bool appendFormData(FormDataList&, bool); | 141 virtual bool appendFormData(FormDataList&, bool) OVERRIDE; |
| 142 | 142 |
| 143 virtual void defaultEventHandler(Event*); | 143 virtual void defaultEventHandler(Event*) OVERRIDE; |
| 144 | 144 |
| 145 void dispatchChangeEventForMenuList(); | 145 void dispatchChangeEventForMenuList(); |
| 146 | 146 |
| 147 void recalcListItems(bool updateSelectedStates = true) const; | 147 void recalcListItems(bool updateSelectedStates = true) const; |
| 148 | 148 |
| 149 void deselectItems(HTMLOptionElement* excludeElement = 0); | 149 void deselectItems(HTMLOptionElement* excludeElement = 0); |
| 150 void typeAheadFind(KeyboardEvent*); | 150 void typeAheadFind(KeyboardEvent*); |
| 151 void saveLastSelection(); | 151 void saveLastSelection(); |
| 152 | 152 |
| 153 virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE; | 153 virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE; |
| 154 | 154 |
| 155 virtual bool isOptionalFormControl() const { return !isRequiredFormControl()
; } | 155 virtual bool isOptionalFormControl() const OVERRIDE { return !isRequiredForm
Control(); } |
| 156 virtual bool isRequiredFormControl() const; | 156 virtual bool isRequiredFormControl() const OVERRIDE; |
| 157 | 157 |
| 158 bool hasPlaceholderLabelOption() const; | 158 bool hasPlaceholderLabelOption() const; |
| 159 | 159 |
| 160 enum SelectOptionFlag { | 160 enum SelectOptionFlag { |
| 161 DeselectOtherOptions = 1 << 0, | 161 DeselectOtherOptions = 1 << 0, |
| 162 DispatchChangeEvent = 1 << 1, | 162 DispatchChangeEvent = 1 << 1, |
| 163 UserDriven = 1 << 2, | 163 UserDriven = 1 << 2, |
| 164 }; | 164 }; |
| 165 typedef unsigned SelectOptionFlags; | 165 typedef unsigned SelectOptionFlags; |
| 166 void selectOption(int optionIndex, SelectOptionFlags = 0); | 166 void selectOption(int optionIndex, SelectOptionFlags = 0); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 178 SkipBackwards = -1, | 178 SkipBackwards = -1, |
| 179 SkipForwards = 1 | 179 SkipForwards = 1 |
| 180 }; | 180 }; |
| 181 int nextValidIndex(int listIndex, SkipDirection, int skip) const; | 181 int nextValidIndex(int listIndex, SkipDirection, int skip) const; |
| 182 int nextSelectableListIndex(int startIndex) const; | 182 int nextSelectableListIndex(int startIndex) const; |
| 183 int previousSelectableListIndex(int startIndex) const; | 183 int previousSelectableListIndex(int startIndex) const; |
| 184 int firstSelectableListIndex() const; | 184 int firstSelectableListIndex() const; |
| 185 int lastSelectableListIndex() const; | 185 int lastSelectableListIndex() const; |
| 186 int nextSelectableListIndexPageAway(int startIndex, SkipDirection) const; | 186 int nextSelectableListIndexPageAway(int startIndex, SkipDirection) const; |
| 187 | 187 |
| 188 virtual void childrenChanged(bool changedByParser = false, Node* beforeChang
e = 0, Node* afterChange = 0, int childCountDelta = 0); | 188 virtual void childrenChanged(bool changedByParser = false, Node* beforeChang
e = 0, Node* afterChange = 0, int childCountDelta = 0) OVERRIDE; |
| 189 virtual bool areAuthorShadowsAllowed() const OVERRIDE { return false; } | 189 virtual bool areAuthorShadowsAllowed() const OVERRIDE { return false; } |
| 190 virtual void finishParsingChildren() OVERRIDE; | 190 virtual void finishParsingChildren() OVERRIDE; |
| 191 | 191 |
| 192 // TypeAheadDataSource functions. | 192 // TypeAheadDataSource functions. |
| 193 virtual int indexOfSelectedOption() const OVERRIDE; | 193 virtual int indexOfSelectedOption() const OVERRIDE; |
| 194 virtual int optionCount() const OVERRIDE; | 194 virtual int optionCount() const OVERRIDE; |
| 195 virtual String optionAtIndex(int index) const OVERRIDE; | 195 virtual String optionAtIndex(int index) const OVERRIDE; |
| 196 | 196 |
| 197 // m_listItems contains HTMLOptionElement, HTMLOptGroupElement, and HTMLHREl
ement objects. | 197 // m_listItems contains HTMLOptionElement, HTMLOptGroupElement, and HTMLHREl
ement objects. |
| 198 mutable Vector<HTMLElement*> m_listItems; | 198 mutable Vector<HTMLElement*> m_listItems; |
| 199 Vector<bool> m_lastOnChangeSelection; | 199 Vector<bool> m_lastOnChangeSelection; |
| 200 Vector<bool> m_cachedStateForActiveSelection; | 200 Vector<bool> m_cachedStateForActiveSelection; |
| 201 TypeAhead m_typeAhead; | 201 TypeAhead m_typeAhead; |
| 202 int m_size; | 202 int m_size; |
| 203 int m_lastOnChangeIndex; | 203 int m_lastOnChangeIndex; |
| 204 int m_activeSelectionAnchorIndex; | 204 int m_activeSelectionAnchorIndex; |
| 205 int m_activeSelectionEndIndex; | 205 int m_activeSelectionEndIndex; |
| 206 bool m_isProcessingUserDrivenChange; | 206 bool m_isProcessingUserDrivenChange; |
| 207 bool m_multiple; | 207 bool m_multiple; |
| 208 bool m_activeSelectionState; | 208 bool m_activeSelectionState; |
| 209 mutable bool m_shouldRecalcListItems; | 209 mutable bool m_shouldRecalcListItems; |
| 210 bool m_isParsingInProgress; | 210 bool m_isParsingInProgress; |
| 211 }; | 211 }; |
| 212 | 212 |
| 213 DEFINE_NODE_TYPE_CASTS(HTMLSelectElement, hasTagName(HTMLNames::selectTag)); | 213 DEFINE_NODE_TYPE_CASTS(HTMLSelectElement, hasTagName(HTMLNames::selectTag)); |
| 214 | 214 |
| 215 } // namespace | 215 } // namespace |
| 216 | 216 |
| 217 #endif | 217 #endif |
| OLD | NEW |