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

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

Issue 1292653003: [bindings] Avoid using custom binding for HTMLOptionsCollection.length attribute (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Aligned with maxSelectedItems value Created 5 years, 4 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/bindings/core/v8/custom/custom.gypi ('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 * 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
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)
haraken 2015/08/18 13:27:12 Can we add a test case for this branch?
95 return;
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
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
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/custom/custom.gypi ('k') | Source/core/html/HTMLOptionsCollection.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698