Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(115)

Side by Side Diff: Source/WebCore/html/HTMLSelectElement.h

Issue 14096013: Implement select element list box with shadow DOM. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@shadowselect
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 void typeAheadFind(KeyboardEvent*); 144 void typeAheadFind(KeyboardEvent*);
145 void saveLastSelection(); 145 void saveLastSelection();
146 146
147 virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE; 147 virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE;
148 148
149 virtual bool isOptionalFormControl() const { return !isRequiredFormControl() ; } 149 virtual bool isOptionalFormControl() const { return !isRequiredFormControl() ; }
150 virtual bool isRequiredFormControl() const; 150 virtual bool isRequiredFormControl() const;
151 151
152 bool hasPlaceholderLabelOption() const; 152 bool hasPlaceholderLabelOption() const;
153 153
154 virtual void dispatchFormControlChangeEvent() OVERRIDE;
155
154 enum SelectOptionFlag { 156 enum SelectOptionFlag {
155 DeselectOtherOptions = 1 << 0, 157 DeselectOtherOptions = 1 << 0,
156 DispatchChangeEvent = 1 << 1, 158 DispatchChangeEvent = 1 << 1,
157 UserDriven = 1 << 2, 159 UserDriven = 1 << 2,
158 }; 160 };
159 typedef unsigned SelectOptionFlags; 161 typedef unsigned SelectOptionFlags;
160 void selectOption(int optionIndex, SelectOptionFlags = 0); 162 void selectOption(int optionIndex, SelectOptionFlags = 0);
161 void deselectItemsWithoutValidation(HTMLElement* elementToExclude = 0); 163 void deselectItemsWithoutValidation(HTMLElement* elementToExclude = 0);
162 void parseMultipleAttribute(const AtomicString&); 164 void parseMultipleAttribute(const AtomicString&);
163 int lastSelectedListIndex() const; 165 int lastSelectedListIndex() const;
164 void updateSelectedState(int listIndex, bool multi, bool shift); 166 void updateSelectedState(int listIndex, bool multi, bool shift);
165 void menuListDefaultEventHandler(Event*); 167 void menuListDefaultEventHandler(Event*);
166 bool platformHandleKeydownEvent(KeyboardEvent*); 168 bool platformHandleKeydownEvent(KeyboardEvent*);
167 void listBoxDefaultEventHandler(Event*); 169 void listBoxDefaultEventHandler(Event*);
168 void setOptionsChangedOnRenderer(); 170 void setOptionsChangedOnRenderer();
169 size_t searchOptionsForValue(const String&, size_t listIndexStart, size_t li stIndexEnd) const; 171 size_t searchOptionsForValue(const String&, size_t listIndexStart, size_t li stIndexEnd) const;
170 172
171 enum SkipDirection { 173 enum SkipDirection {
172 SkipBackwards = -1, 174 SkipBackwards = -1,
173 SkipForwards = 1 175 SkipForwards = 1
174 }; 176 };
175 int nextValidIndex(int listIndex, SkipDirection, int skip) const; 177 int nextValidIndex(int listIndex, SkipDirection, int skip) const;
176 int nextSelectableListIndex(int startIndex) const; 178 int nextSelectableListIndex(int startIndex) const;
177 int previousSelectableListIndex(int startIndex) const; 179 int previousSelectableListIndex(int startIndex) const;
178 int firstSelectableListIndex() const; 180 int firstSelectableListIndex() const;
179 int lastSelectableListIndex() const; 181 int lastSelectableListIndex() const;
180 int nextSelectableListIndexPageAway(int startIndex, SkipDirection) const; 182 int nextSelectableListIndexPageAway(int startIndex, SkipDirection) const;
183 int listIndexForEvent(Event*);
181 184
182 virtual void childrenChanged(bool changedByParser = false, Node* beforeChang e = 0, Node* afterChange = 0, int childCountDelta = 0); 185 virtual void childrenChanged(bool changedByParser = false, Node* beforeChang e = 0, Node* afterChange = 0, int childCountDelta = 0);
183 virtual bool areAuthorShadowsAllowed() const OVERRIDE { return false; } 186 virtual bool areAuthorShadowsAllowed() const OVERRIDE { return false; }
184 187
185 // TypeAheadDataSource functions. 188 // TypeAheadDataSource functions.
186 virtual int indexOfSelectedOption() const OVERRIDE; 189 virtual int indexOfSelectedOption() const OVERRIDE;
187 virtual int optionCount() const OVERRIDE; 190 virtual int optionCount() const OVERRIDE;
188 virtual String optionAtIndex(int index) const OVERRIDE; 191 virtual String optionAtIndex(int index) const OVERRIDE;
189 192
190 // m_listItems contains HTMLOptionElement, HTMLOptGroupElement, and HTMLHREl ement objects. 193 // m_listItems contains HTMLOptionElement, HTMLOptGroupElement, and HTMLHREl ement objects.
(...skipping 26 matching lines...) Expand all
217 { 220 {
218 ASSERT_WITH_SECURITY_IMPLICATION(!node || isHTMLSelectElement(node)); 221 ASSERT_WITH_SECURITY_IMPLICATION(!node || isHTMLSelectElement(node));
219 return static_cast<const HTMLSelectElement*>(node); 222 return static_cast<const HTMLSelectElement*>(node);
220 } 223 }
221 224
222 void toHTMLSelectElement(const HTMLSelectElement*); // This overload will catch anyone doing an unnecessary cast. 225 void toHTMLSelectElement(const HTMLSelectElement*); // This overload will catch anyone doing an unnecessary cast.
223 226
224 } // namespace 227 } // namespace
225 228
226 #endif 229 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698