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

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

Issue 15899009: Support indexed setter generation (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: rebased Created 7 years, 6 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 if (namedItems.size() == 1) { 101 if (namedItems.size() == 1) {
102 returnValue1Enabled = true; 102 returnValue1Enabled = true;
103 returnValue1 = namedItems.at(0); 103 returnValue1 = namedItems.at(0);
104 return; 104 return;
105 } 105 }
106 106
107 returnValue0Enabled = true; 107 returnValue0Enabled = true;
108 returnValue0 = NamedNodesCollection::create(namedItems); 108 returnValue0 = NamedNodesCollection::create(namedItems);
109 } 109 }
110 110
111 bool HTMLOptionsCollection::anonymousIndexedSetterRemove(unsigned index, Excepti onCode& ec)
112 {
113 HTMLSelectElement* base = toHTMLSelectElement(ownerNode());
114 base->remove(index);
115 return true;
116 }
117
118 bool HTMLOptionsCollection::anonymousIndexedSetter(unsigned index, PassRefPtr<HT MLOptionElement> value, ExceptionCode& ec)
119 {
120 HTMLSelectElement* base = toHTMLSelectElement(ownerNode());
121 if (!value) {
122 ec = TYPE_MISMATCH_ERR;
123 return true;
124 }
125 base->setOption(index, value.get(), ec);
126 return true;
127 }
128
111 } //namespace 129 } //namespace
130
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