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

Unified Diff: third_party/WebKit/Source/core/html/forms/OptionList.h

Issue 2131073002: SELECT element: Avoid to use listItems() in HTMLSelectElement::selectOption() (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
Index: third_party/WebKit/Source/core/html/forms/OptionList.h
diff --git a/third_party/WebKit/Source/core/html/forms/OptionList.h b/third_party/WebKit/Source/core/html/forms/OptionList.h
index 07a36cf7da558b34f7b15b39bf22eee866f290d2..d3bd115195f06e656d2025c2b2a0808229ee6863 100644
--- a/third_party/WebKit/Source/core/html/forms/OptionList.h
+++ b/third_party/WebKit/Source/core/html/forms/OptionList.h
@@ -16,7 +16,7 @@ class HTMLOptionElement;
class CORE_EXPORT OptionListIterator final {
STACK_ALLOCATED();
public:
- explicit OptionListIterator(HTMLSelectElement* select) : m_select(select)
+ explicit OptionListIterator(const HTMLSelectElement* select) : m_select(select)
{
if (m_select)
advance(nullptr);
@@ -33,7 +33,7 @@ public:
private:
void advance(HTMLOptionElement* current);
- Member<HTMLSelectElement> m_select;
+ Member<const HTMLSelectElement> m_select;
Member<HTMLOptionElement> m_current; // nullptr means we reached to the end.
};
@@ -41,13 +41,13 @@ private:
class OptionList final {
STACK_ALLOCATED();
public:
- explicit OptionList(HTMLSelectElement& select) : m_select(select) {}
+ explicit OptionList(const HTMLSelectElement& select) : m_select(select) {}
using Iterator = OptionListIterator;
Iterator begin() { return Iterator(m_select); }
Iterator end() { return Iterator(nullptr); }
private:
- Member<HTMLSelectElement> m_select;
+ Member<const HTMLSelectElement> m_select;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698