summaryrefslogtreecommitdiff
path: root/Source/WebCore/html/HTMLOptionsCollection.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-01-11 10:03:25 +0100
committerSimon Hausmann <simon.hausmann@nokia.com>2012-01-11 10:03:25 +0100
commitd11f84f5b5cdc0d92a08af01b13472fdd5f9acb9 (patch)
treeb318cf594dc1da2fa48224005945c9157f35bb41 /Source/WebCore/html/HTMLOptionsCollection.cpp
parent6300a96eca9f152b379f1bcf3d9efdc5572d989a (diff)
downloadqtwebkit-d11f84f5b5cdc0d92a08af01b13472fdd5f9acb9.tar.gz
Imported WebKit commit 75bb2fc5882d2e1b3d5572c2961507996cbca5e3 (http://svn.webkit.org/repository/webkit/trunk@104681)
Diffstat (limited to 'Source/WebCore/html/HTMLOptionsCollection.cpp')
-rw-r--r--Source/WebCore/html/HTMLOptionsCollection.cpp15
1 files changed, 2 insertions, 13 deletions
diff --git a/Source/WebCore/html/HTMLOptionsCollection.cpp b/Source/WebCore/html/HTMLOptionsCollection.cpp
index 3abb35300..ca8a1b07d 100644
--- a/Source/WebCore/html/HTMLOptionsCollection.cpp
+++ b/Source/WebCore/html/HTMLOptionsCollection.cpp
@@ -32,9 +32,9 @@ HTMLOptionsCollection::HTMLOptionsCollection(HTMLSelectElement* select)
{
}
-PassRefPtr<HTMLOptionsCollection> HTMLOptionsCollection::create(HTMLSelectElement* select)
+PassOwnPtr<HTMLOptionsCollection> HTMLOptionsCollection::create(HTMLSelectElement* select)
{
- return adoptRef(new HTMLOptionsCollection(select));
+ return adoptPtr(new HTMLOptionsCollection(select));
}
void HTMLOptionsCollection::add(PassRefPtr<HTMLOptionElement> element, ExceptionCode &ec)
@@ -59,9 +59,6 @@ void HTMLOptionsCollection::add(PassRefPtr<HTMLOptionElement> element, int index
ec = 0;
HTMLSelectElement* select = toHTMLSelectElement(base());
- if (!select)
- return;
-
if (index == -1 || unsigned(index) >= length())
select->add(newOption, 0, ec);
else
@@ -72,29 +69,21 @@ void HTMLOptionsCollection::add(PassRefPtr<HTMLOptionElement> element, int index
void HTMLOptionsCollection::remove(int index)
{
- if (!base())
- return;
toHTMLSelectElement(base())->remove(index);
}
int HTMLOptionsCollection::selectedIndex() const
{
- if (!base())
- return -1;
return toHTMLSelectElement(base())->selectedIndex();
}
void HTMLOptionsCollection::setSelectedIndex(int index)
{
- if (!base())
- return;
toHTMLSelectElement(base())->setSelectedIndex(index);
}
void HTMLOptionsCollection::setLength(unsigned length, ExceptionCode& ec)
{
- if (!base())
- return;
toHTMLSelectElement(base())->setLength(length, ec);
}