Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2011, 2012 Apple Computer, Inc. | 2 * Copyright (C) 2006, 2011, 2012 Apple Computer, Inc. |
| 3 * Copyright (C) 2014 Samsung Electronics. All rights reserved. | 3 * Copyright (C) 2014 Samsung Electronics. All rights reserved. |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 84 return toHTMLSelectElement(ownerNode()).selectedIndex(); | 84 return toHTMLSelectElement(ownerNode()).selectedIndex(); |
| 85 } | 85 } |
| 86 | 86 |
| 87 void HTMLOptionsCollection::setSelectedIndex(int index) | 87 void HTMLOptionsCollection::setSelectedIndex(int index) |
| 88 { | 88 { |
| 89 toHTMLSelectElement(ownerNode()).setSelectedIndex(index); | 89 toHTMLSelectElement(ownerNode()).setSelectedIndex(index); |
| 90 } | 90 } |
| 91 | 91 |
| 92 void HTMLOptionsCollection::setLength(unsigned length, ExceptionState& exception State) | 92 void HTMLOptionsCollection::setLength(unsigned length, ExceptionState& exception State) |
| 93 { | 93 { |
| 94 if (length > HTMLSelectElement::maxSelectItems) | |
| 95 return; | |
|
tkent
2015/08/19 01:20:24
It's inconsistent with the current behavior of HTM
| |
| 94 toHTMLSelectElement(ownerNode()).setLength(length, exceptionState); | 96 toHTMLSelectElement(ownerNode()).setLength(length, exceptionState); |
| 95 } | 97 } |
| 96 | 98 |
| 97 void HTMLOptionsCollection::namedGetter(const AtomicString& name, NodeListOrElem ent& returnValue) | 99 void HTMLOptionsCollection::namedGetter(const AtomicString& name, NodeListOrElem ent& returnValue) |
| 98 { | 100 { |
| 99 WillBeHeapVector<RefPtrWillBeMember<Element>> namedItems; | 101 WillBeHeapVector<RefPtrWillBeMember<Element>> namedItems; |
| 100 this->namedItems(name, namedItems); | 102 this->namedItems(name, namedItems); |
| 101 | 103 |
| 102 if (!namedItems.size()) | 104 if (!namedItems.size()) |
| 103 return; | 105 return; |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 117 if (!value) { // undefined or null | 119 if (!value) { // undefined or null |
| 118 base.remove(index); | 120 base.remove(index); |
| 119 return true; | 121 return true; |
| 120 } | 122 } |
| 121 base.setOption(index, value.get(), exceptionState); | 123 base.setOption(index, value.get(), exceptionState); |
| 122 return true; | 124 return true; |
| 123 } | 125 } |
| 124 | 126 |
| 125 } // namespace | 127 } // namespace |
| 126 | 128 |
| OLD | NEW |