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

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

Issue 189543012: Update <select> when any of its <option> children has "display: none" (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase + Layout Testcase Created 6 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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 int activeSelectionStartListIndex() const; 108 int activeSelectionStartListIndex() const;
109 int activeSelectionEndListIndex() const; 109 int activeSelectionEndListIndex() const;
110 void setActiveSelectionAnchorIndex(int); 110 void setActiveSelectionAnchorIndex(int);
111 void setActiveSelectionEndIndex(int); 111 void setActiveSelectionEndIndex(int);
112 void updateListBoxSelection(bool deselectOtherOptions); 112 void updateListBoxSelection(bool deselectOtherOptions);
113 113
114 // For use in the implementation of HTMLOptionElement. 114 // For use in the implementation of HTMLOptionElement.
115 void optionSelectionStateChanged(HTMLOptionElement*, bool optionIsSelected); 115 void optionSelectionStateChanged(HTMLOptionElement*, bool optionIsSelected);
116 bool anonymousIndexedSetter(unsigned, PassRefPtr<HTMLOptionElement>, Excepti onState&); 116 bool anonymousIndexedSetter(unsigned, PassRefPtr<HTMLOptionElement>, Excepti onState&);
117 117
118 void updateListOnRenderer();
118 protected: 119 protected:
119 HTMLSelectElement(Document&, HTMLFormElement*); 120 HTMLSelectElement(Document&, HTMLFormElement*);
120 121
121 private: 122 private:
122 virtual const AtomicString& formControlType() const OVERRIDE; 123 virtual const AtomicString& formControlType() const OVERRIDE;
123 124
124 virtual bool shouldShowFocusRingOnMouseFocus() const OVERRIDE; 125 virtual bool shouldShowFocusRingOnMouseFocus() const OVERRIDE;
125 126
126 virtual void dispatchFocusEvent(Element* oldFocusedElement, FocusType) OVERR IDE; 127 virtual void dispatchFocusEvent(Element* oldFocusedElement, FocusType) OVERR IDE;
127 virtual void dispatchBlurEvent(Element* newFocusedElemnet) OVERRIDE; 128 virtual void dispatchBlurEvent(Element* newFocusedElemnet) OVERRIDE;
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 189
189 virtual void childrenChanged(bool changedByParser = false, Node* beforeChang e = 0, Node* afterChange = 0, int childCountDelta = 0) OVERRIDE; 190 virtual void childrenChanged(bool changedByParser = false, Node* beforeChang e = 0, Node* afterChange = 0, int childCountDelta = 0) OVERRIDE;
190 virtual bool areAuthorShadowsAllowed() const OVERRIDE { return false; } 191 virtual bool areAuthorShadowsAllowed() const OVERRIDE { return false; }
191 virtual void finishParsingChildren() OVERRIDE; 192 virtual void finishParsingChildren() OVERRIDE;
192 193
193 // TypeAheadDataSource functions. 194 // TypeAheadDataSource functions.
194 virtual int indexOfSelectedOption() const OVERRIDE; 195 virtual int indexOfSelectedOption() const OVERRIDE;
195 virtual int optionCount() const OVERRIDE; 196 virtual int optionCount() const OVERRIDE;
196 virtual String optionAtIndex(int index) const OVERRIDE; 197 virtual String optionAtIndex(int index) const OVERRIDE;
197 198
199 void timerFired(Timer<HTMLSelectElement>*);
200
198 // m_listItems contains HTMLOptionElement, HTMLOptGroupElement, and HTMLHREl ement objects. 201 // m_listItems contains HTMLOptionElement, HTMLOptGroupElement, and HTMLHREl ement objects.
199 mutable Vector<HTMLElement*> m_listItems; 202 mutable Vector<HTMLElement*> m_listItems;
200 Vector<bool> m_lastOnChangeSelection; 203 Vector<bool> m_lastOnChangeSelection;
201 Vector<bool> m_cachedStateForActiveSelection; 204 Vector<bool> m_cachedStateForActiveSelection;
202 TypeAhead m_typeAhead; 205 TypeAhead m_typeAhead;
203 int m_size; 206 int m_size;
204 int m_lastOnChangeIndex; 207 int m_lastOnChangeIndex;
205 int m_activeSelectionAnchorIndex; 208 int m_activeSelectionAnchorIndex;
206 int m_activeSelectionEndIndex; 209 int m_activeSelectionEndIndex;
207 bool m_isProcessingUserDrivenChange; 210 bool m_isProcessingUserDrivenChange;
208 bool m_multiple; 211 bool m_multiple;
209 bool m_activeSelectionState; 212 bool m_activeSelectionState;
210 mutable bool m_shouldRecalcListItems; 213 mutable bool m_shouldRecalcListItems;
211 int m_suggestedIndex; 214 int m_suggestedIndex;
215 Timer<HTMLSelectElement> m_optionChildChangedTimer;
esprehn 2014/03/20 17:09:25 Please remove this timer, it's not correct to use
spartha 2014/03/21 05:13:26 The idea to use the timer is to avoid multiple cal
212 }; 216 };
213 217
214 } // namespace 218 } // namespace
215 219
216 #endif 220 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698