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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLSelectElement.h

Issue 1837463002: Improve conformance of default OPTION selection of SELECT element (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Renaming to resetToDefaultSelection Created 4 years, 9 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 String suggestedValue() const; 84 String suggestedValue() const;
85 void setSuggestedValue(const String&); 85 void setSuggestedValue(const String&);
86 86
87 PassRefPtrWillBeRawPtr<HTMLOptionsCollection> options(); 87 PassRefPtrWillBeRawPtr<HTMLOptionsCollection> options();
88 PassRefPtrWillBeRawPtr<HTMLCollection> selectedOptions(); 88 PassRefPtrWillBeRawPtr<HTMLCollection> selectedOptions();
89 89
90 void optionElementChildrenChanged(); 90 void optionElementChildrenChanged();
91 91
92 void setRecalcListItems(); 92 void setRecalcListItems();
93 void invalidateSelectedItems(); 93 void invalidateSelectedItems();
94 void updateListItemSelectedStates();
95 94
96 using ListItems = WillBeHeapVector<RawPtrWillBeMember<HTMLElement>>; 95 using ListItems = WillBeHeapVector<RawPtrWillBeMember<HTMLElement>>;
97 const ListItems& listItems() const; 96 const ListItems& listItems() const;
98 97
99 void accessKeyAction(bool sendMouseEvents) override; 98 void accessKeyAction(bool sendMouseEvents) override;
100 void accessKeySetSelectedIndex(int); 99 void accessKeySetSelectedIndex(int);
101 100
102 void setOption(unsigned index, HTMLOptionElement*, ExceptionState&); 101 void setOption(unsigned index, HTMLOptionElement*, ExceptionState&);
103 102
104 Element* namedItem(const AtomicString& name); 103 Element* namedItem(const AtomicString& name);
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 PopupMenu* popup() const { return m_popup.get(); } 155 PopupMenu* popup() const { return m_popup.get(); }
157 156
158 void resetTypeAheadSessionForTesting(); 157 void resetTypeAheadSessionForTesting();
159 158
160 DECLARE_VIRTUAL_TRACE(); 159 DECLARE_VIRTUAL_TRACE();
161 160
162 protected: 161 protected:
163 HTMLSelectElement(Document&, HTMLFormElement*); 162 HTMLSelectElement(Document&, HTMLFormElement*);
164 163
165 private: 164 private:
166 void willRecalcStyle(StyleRecalcChange) override;
167
168 const AtomicString& formControlType() const override; 165 const AtomicString& formControlType() const override;
169 166
170 bool shouldShowFocusRingOnMouseFocus() const override; 167 bool shouldShowFocusRingOnMouseFocus() const override;
171 168
172 void dispatchFocusEvent(Element* oldFocusedElement, WebFocusType, InputDevic eCapabilities* sourceCapabilities) override; 169 void dispatchFocusEvent(Element* oldFocusedElement, WebFocusType, InputDevic eCapabilities* sourceCapabilities) override;
173 void dispatchBlurEvent(Element* newFocusedElement, WebFocusType, InputDevice Capabilities* sourceCapabilities) override; 170 void dispatchBlurEvent(Element* newFocusedElement, WebFocusType, InputDevice Capabilities* sourceCapabilities) override;
174 171
175 bool canStartSelection() const override { return false; } 172 bool canStartSelection() const override { return false; }
176 173
177 bool isEnumeratable() const override { return true; } 174 bool isEnumeratable() const override { return true; }
(...skipping 10 matching lines...) Expand all
188 LayoutObject* createLayoutObject(const ComputedStyle&) override; 185 LayoutObject* createLayoutObject(const ComputedStyle&) override;
189 void didRecalcStyle(StyleRecalcChange) override; 186 void didRecalcStyle(StyleRecalcChange) override;
190 void detach(const AttachContext& = AttachContext()) override; 187 void detach(const AttachContext& = AttachContext()) override;
191 void appendToFormData(FormData&) override; 188 void appendToFormData(FormData&) override;
192 void didAddUserAgentShadowRoot(ShadowRoot&) override; 189 void didAddUserAgentShadowRoot(ShadowRoot&) override;
193 190
194 void defaultEventHandler(Event*) override; 191 void defaultEventHandler(Event*) override;
195 192
196 void dispatchInputAndChangeEventForMenuList(); 193 void dispatchInputAndChangeEventForMenuList();
197 194
198 void recalcListItems(bool updateSelectedStates = true) const; 195 void recalcListItems() const;
199 196 void resetToDefaultSelection();
200 void typeAheadFind(KeyboardEvent*); 197 void typeAheadFind(KeyboardEvent*);
201 void saveLastSelection(); 198 void saveLastSelection();
202 // Returns the first selected OPTION, or nullptr. 199 // Returns the first selected OPTION, or nullptr.
203 HTMLOptionElement* selectedOption() const; 200 HTMLOptionElement* selectedOption() const;
204 201
205 bool isOptionalFormControl() const override { return !isRequiredFormControl( ); } 202 bool isOptionalFormControl() const override { return !isRequiredFormControl( ); }
206 bool isRequiredFormControl() const override; 203 bool isRequiredFormControl() const override;
207 204
208 bool hasPlaceholderLabelOption() const; 205 bool hasPlaceholderLabelOption() const;
209 206
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 273
277 FRIEND_TEST_ALL_PREFIXES(HTMLSelectElementTest, FirstSelectableOption); 274 FRIEND_TEST_ALL_PREFIXES(HTMLSelectElementTest, FirstSelectableOption);
278 FRIEND_TEST_ALL_PREFIXES(HTMLSelectElementTest, LastSelectableOption); 275 FRIEND_TEST_ALL_PREFIXES(HTMLSelectElementTest, LastSelectableOption);
279 FRIEND_TEST_ALL_PREFIXES(HTMLSelectElementTest, NextSelectableOption); 276 FRIEND_TEST_ALL_PREFIXES(HTMLSelectElementTest, NextSelectableOption);
280 FRIEND_TEST_ALL_PREFIXES(HTMLSelectElementTest, PreviousSelectableOption); 277 FRIEND_TEST_ALL_PREFIXES(HTMLSelectElementTest, PreviousSelectableOption);
281 }; 278 };
282 279
283 } // namespace blink 280 } // namespace blink
284 281
285 #endif // HTMLSelectElement_h 282 #endif // HTMLSelectElement_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLOptionElement.cpp ('k') | third_party/WebKit/Source/core/html/HTMLSelectElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698