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

Unified Diff: Source/core/html/HTMLOptionsCollection.cpp

Issue 180143003: Have LiveNodeListBase::ownerNode() return a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 10 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 | « Source/core/html/HTMLNameCollection.cpp ('k') | Source/core/html/HTMLOptionsCollection.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLOptionsCollection.cpp
diff --git a/Source/core/html/HTMLOptionsCollection.cpp b/Source/core/html/HTMLOptionsCollection.cpp
index f99e5f42e41359944481aef85da3512daf7fe6a3..b63ab241f7ded87be308d604549737747968eeef 100644
--- a/Source/core/html/HTMLOptionsCollection.cpp
+++ b/Source/core/html/HTMLOptionsCollection.cpp
@@ -88,19 +88,19 @@ void HTMLOptionsCollection::add(PassRefPtr<HTMLOptionElement> element, int index
return;
}
- HTMLSelectElement* select = toHTMLSelectElement(ownerNode());
+ HTMLSelectElement& select = toHTMLSelectElement(ownerNode());
if (index == -1 || unsigned(index) >= length())
- select->add(newOption, 0, exceptionState);
+ select.add(newOption, 0, exceptionState);
else
- select->add(newOption, toHTMLOptionElement(item(index)), exceptionState);
+ select.add(newOption, toHTMLOptionElement(item(index)), exceptionState);
ASSERT(!exceptionState.hadException());
}
void HTMLOptionsCollection::remove(int index)
{
- toHTMLSelectElement(ownerNode())->remove(index);
+ toHTMLSelectElement(ownerNode()).remove(index);
}
void HTMLOptionsCollection::remove(HTMLOptionElement* option)
@@ -110,17 +110,17 @@ void HTMLOptionsCollection::remove(HTMLOptionElement* option)
int HTMLOptionsCollection::selectedIndex() const
{
- return toHTMLSelectElement(ownerNode())->selectedIndex();
+ return toHTMLSelectElement(ownerNode()).selectedIndex();
}
void HTMLOptionsCollection::setSelectedIndex(int index)
{
- toHTMLSelectElement(ownerNode())->setSelectedIndex(index);
+ toHTMLSelectElement(ownerNode()).setSelectedIndex(index);
}
void HTMLOptionsCollection::setLength(unsigned length, ExceptionState& exceptionState)
{
- toHTMLSelectElement(ownerNode())->setLength(length, exceptionState);
+ toHTMLSelectElement(ownerNode()).setLength(length, exceptionState);
}
void HTMLOptionsCollection::namedGetter(const AtomicString& name, bool& returnValue0Enabled, RefPtr<NodeList>& returnValue0, bool& returnValue1Enabled, RefPtr<Element>& returnValue1)
@@ -144,12 +144,12 @@ void HTMLOptionsCollection::namedGetter(const AtomicString& name, bool& returnVa
bool HTMLOptionsCollection::anonymousIndexedSetter(unsigned index, PassRefPtr<HTMLOptionElement> value, ExceptionState& exceptionState)
{
- HTMLSelectElement* base = toHTMLSelectElement(ownerNode());
+ HTMLSelectElement& base = toHTMLSelectElement(ownerNode());
if (!value) { // undefined or null
- base->remove(index);
+ base.remove(index);
return true;
}
- base->setOption(index, value.get(), exceptionState);
+ base.setOption(index, value.get(), exceptionState);
return true;
}
« no previous file with comments | « Source/core/html/HTMLNameCollection.cpp ('k') | Source/core/html/HTMLOptionsCollection.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698