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

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

Issue 1535803003: Add two UseCounters for form.imageName and form.elements.imageName. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2564
Patch Set: Created 5 years 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
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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 195
196 void HTMLFormControlsCollection::namedGetter(const AtomicString& name, RadioNode ListOrElement& returnValue) 196 void HTMLFormControlsCollection::namedGetter(const AtomicString& name, RadioNode ListOrElement& returnValue)
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 if (isHTMLImageElement(*namedItems[0]))
206 UseCounter::count(document(), UseCounter::FormControlsCollectionName AccessForImageElement);
205 returnValue.setElement(namedItems.at(0)); 207 returnValue.setElement(namedItems.at(0));
206 return; 208 return;
207 } 209 }
208 210
211 // This path never returns a RadioNodeList for <img> because
212 // onlyMatchingImgElements flag is false by default.
209 returnValue.setRadioNodeList(ownerNode().radioNodeList(name)); 213 returnValue.setRadioNodeList(ownerNode().radioNodeList(name));
210 } 214 }
211 215
212 void HTMLFormControlsCollection::supportedPropertyNames(Vector<String>& names) 216 void HTMLFormControlsCollection::supportedPropertyNames(Vector<String>& names)
213 { 217 {
214 // http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom-in terfaces.html#htmlformcontrolscollection-0: 218 // http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom-in terfaces.html#htmlformcontrolscollection-0:
215 // The supported property names consist of the non-empty values of all the i d and name attributes 219 // The supported property names consist of the non-empty values of all the i d and name attributes
216 // of all the elements represented by the collection, in tree order, ignorin g later duplicates, 220 // of all the elements represented by the collection, in tree order, ignorin g later duplicates,
217 // with the id of an element preceding its name if it contributes both, they differ from each 221 // with the id of an element preceding its name if it contributes both, they differ from each
218 // other, and neither is the duplicate of an earlier entry. 222 // other, and neither is the duplicate of an earlier entry.
(...skipping 17 matching lines...) Expand all
236 } 240 }
237 } 241 }
238 242
239 DEFINE_TRACE(HTMLFormControlsCollection) 243 DEFINE_TRACE(HTMLFormControlsCollection)
240 { 244 {
241 visitor->trace(m_cachedElement); 245 visitor->trace(m_cachedElement);
242 HTMLCollection::trace(visitor); 246 HTMLCollection::trace(visitor);
243 } 247 }
244 248
245 } 249 }
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/UseCounter.h ('k') | third_party/WebKit/Source/core/html/HTMLFormElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698