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

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

Issue 466323002: IDL: Use Nullable for union type return value (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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/core/html/HTMLFormControlsCollection.h ('k') | Source/core/html/HTMLFormElement.h » ('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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2010, 2011, 2012 Apple Inc. All r ights reserved. 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2010, 2011, 2012 Apple Inc. All r ights reserved.
5 * Copyright (C) 2014 Samsung Electronics. All rights reserved. 5 * Copyright (C) 2014 Samsung Electronics. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 cache->addElementWithId(idAttrVal, element); 186 cache->addElementWithId(idAttrVal, element);
187 if (!nameAttrVal.isEmpty() && idAttrVal != nameAttrVal && !foundInpu tElements.contains(nameAttrVal.impl())) 187 if (!nameAttrVal.isEmpty() && idAttrVal != nameAttrVal && !foundInpu tElements.contains(nameAttrVal.impl()))
188 cache->addElementWithName(nameAttrVal, element); 188 cache->addElementWithName(nameAttrVal, element);
189 } 189 }
190 } 190 }
191 191
192 // Set the named item cache last as traversing the tree may cause cache inva lidation. 192 // Set the named item cache last as traversing the tree may cause cache inva lidation.
193 setNamedItemCache(cache.release()); 193 setNamedItemCache(cache.release());
194 } 194 }
195 195
196 void HTMLFormControlsCollection::namedGetter(const AtomicString& name, bool& rad ioNodeListEnabled, RefPtrWillBeRawPtr<RadioNodeList>& radioNodeList, bool& eleme ntEnabled, RefPtrWillBeRawPtr<Element>& element) 196 void HTMLFormControlsCollection::namedGetter(const AtomicString& name, RefPtrWil lBeRawPtr<RadioNodeList>& radioNodeList, RefPtrWillBeRawPtr<Element>& element)
197 { 197 {
198 WillBeHeapVector<RefPtrWillBeMember<Element> > namedItems; 198 WillBeHeapVector<RefPtrWillBeMember<Element> > namedItems;
199 this->namedItems(name, namedItems); 199 this->namedItems(name, namedItems);
200 200
201 if (namedItems.isEmpty()) 201 if (namedItems.isEmpty())
202 return; 202 return;
203 203
204 if (namedItems.size() == 1) { 204 if (namedItems.size() == 1) {
205 elementEnabled = true;
206 element = namedItems.at(0); 205 element = namedItems.at(0);
207 return; 206 return;
208 } 207 }
209 208
210 radioNodeListEnabled = true;
211 radioNodeList = ownerNode().radioNodeList(name); 209 radioNodeList = ownerNode().radioNodeList(name);
212 } 210 }
213 211
214 void HTMLFormControlsCollection::supportedPropertyNames(Vector<String>& names) 212 void HTMLFormControlsCollection::supportedPropertyNames(Vector<String>& names)
215 { 213 {
216 // http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom-in terfaces.html#htmlformcontrolscollection-0: 214 // http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom-in terfaces.html#htmlformcontrolscollection-0:
217 // The supported property names consist of the non-empty values of all the i d and name attributes 215 // The supported property names consist of the non-empty values of all the i d and name attributes
218 // of all the elements represented by the collection, in tree order, ignorin g later duplicates, 216 // of all the elements represented by the collection, in tree order, ignorin g later duplicates,
219 // with the id of an element preceding its name if it contributes both, they differ from each 217 // with the id of an element preceding its name if it contributes both, they differ from each
220 // other, and neither is the duplicate of an earlier entry. 218 // other, and neither is the duplicate of an earlier entry.
(...skipping 17 matching lines...) Expand all
238 } 236 }
239 } 237 }
240 238
241 void HTMLFormControlsCollection::trace(Visitor* visitor) 239 void HTMLFormControlsCollection::trace(Visitor* visitor)
242 { 240 {
243 visitor->trace(m_cachedElement); 241 visitor->trace(m_cachedElement);
244 HTMLCollection::trace(visitor); 242 HTMLCollection::trace(visitor);
245 } 243 }
246 244
247 } 245 }
OLDNEW
« no previous file with comments | « Source/core/html/HTMLFormControlsCollection.h ('k') | Source/core/html/HTMLFormElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698