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

Unified Diff: third_party/WebKit/Source/core/html/HTMLSelectElement.h

Issue 2130653002: SELECT element: Introduce light-weight OPTION iterater. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/core.gypi ('k') | third_party/WebKit/Source/core/html/HTMLSelectElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/HTMLSelectElement.h
diff --git a/third_party/WebKit/Source/core/html/HTMLSelectElement.h b/third_party/WebKit/Source/core/html/HTMLSelectElement.h
index cdc4fe9a9b0a5d5e6fc00a471a4ffcb639bdd1fb..17f791d61aa589cf343b7e0d3da965b953fff58c 100644
--- a/third_party/WebKit/Source/core/html/HTMLSelectElement.h
+++ b/third_party/WebKit/Source/core/html/HTMLSelectElement.h
@@ -31,6 +31,7 @@
#include "core/html/HTMLContentElement.h"
#include "core/html/HTMLFormControlElementWithState.h"
#include "core/html/HTMLOptionsCollection.h"
+#include "core/html/forms/OptionList.h"
#include "core/html/forms/TypeAhead.h"
#include "wtf/Vector.h"
@@ -83,14 +84,23 @@ public:
String suggestedValue() const;
void setSuggestedValue(const String&);
+ // |options| and |selectedOptions| are not safe to be used in in
+ // HTMLOptionElement::removedFrom() and insertedInto() because their cache
+ // is inconsistent in these functions.
HTMLOptionsCollection* options();
HTMLCollection* selectedOptions();
+ // This is similar to |options| HTMLCollection. But this is safe in
+ // HTMLOptionElement::removedFrom() and insertedInto().
+ // OptionList supports only forward iteration.
+ OptionList optionList() { return OptionList(*this); }
+
void optionElementChildrenChanged(const HTMLOptionElement&);
void invalidateSelectedItems();
using ListItems = HeapVector<Member<HTMLElement>>;
+ // We prefer |optionList()| to |listItems()|.
const ListItems& listItems() const;
void accessKeyAction(bool sendMouseEvents) override;
« no previous file with comments | « third_party/WebKit/Source/core/core.gypi ('k') | third_party/WebKit/Source/core/html/HTMLSelectElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698