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

Side by Side Diff: Source/core/html/HTMLOptionsCollection.cpp

Issue 148013008: Use stricter typing for HTMLCollection named getter (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « Source/core/html/HTMLOptionsCollection.h ('k') | Source/core/html/HTMLOptionsCollection.idl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2011, 2012 Apple Computer, Inc. 2 * Copyright (C) 2006, 2011, 2012 Apple Computer, Inc.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 void HTMLOptionsCollection::setSelectedIndex(int index) 89 void HTMLOptionsCollection::setSelectedIndex(int index)
90 { 90 {
91 toHTMLSelectElement(ownerNode())->setSelectedIndex(index); 91 toHTMLSelectElement(ownerNode())->setSelectedIndex(index);
92 } 92 }
93 93
94 void HTMLOptionsCollection::setLength(unsigned length, ExceptionState& exception State) 94 void HTMLOptionsCollection::setLength(unsigned length, ExceptionState& exception State)
95 { 95 {
96 toHTMLSelectElement(ownerNode())->setLength(length, exceptionState); 96 toHTMLSelectElement(ownerNode())->setLength(length, exceptionState);
97 } 97 }
98 98
99 void HTMLOptionsCollection::anonymousNamedGetter(const AtomicString& name, bool& returnValue0Enabled, RefPtr<NodeList>& returnValue0, bool& returnValue1Enabled, RefPtr<Node>& returnValue1) 99 void HTMLOptionsCollection::anonymousNamedGetter(const AtomicString& name, bool& returnValue0Enabled, RefPtr<NodeList>& returnValue0, bool& returnValue1Enabled, RefPtr<Element>& returnValue1)
100 { 100 {
101 Vector<RefPtr<Node> > namedItems; 101 Vector<RefPtr<Element> > namedItems;
102 this->namedItems(name, namedItems); 102 this->namedItems(name, namedItems);
103 103
104 if (!namedItems.size()) 104 if (!namedItems.size())
105 return; 105 return;
106 106
107 if (namedItems.size() == 1) { 107 if (namedItems.size() == 1) {
108 returnValue1Enabled = true; 108 returnValue1Enabled = true;
109 returnValue1 = namedItems.at(0); 109 returnValue1 = namedItems.at(0);
110 return; 110 return;
111 } 111 }
(...skipping 15 matching lines...) Expand all
127 if (!value) { 127 if (!value) {
128 exceptionState.throwTypeError(ExceptionMessages::failedToSet(String::num ber(index), "HTMLOptionsCollection", "The element provided was not an HTMLOption Element.")); 128 exceptionState.throwTypeError(ExceptionMessages::failedToSet(String::num ber(index), "HTMLOptionsCollection", "The element provided was not an HTMLOption Element."));
129 return true; 129 return true;
130 } 130 }
131 base->setOption(index, value.get(), exceptionState); 131 base->setOption(index, value.get(), exceptionState);
132 return true; 132 return true;
133 } 133 }
134 134
135 } //namespace 135 } //namespace
136 136
OLDNEW
« no previous file with comments | « Source/core/html/HTMLOptionsCollection.h ('k') | Source/core/html/HTMLOptionsCollection.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698