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

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

Issue 1889793005: Make "document.anchors" return anchors with "id" attribute also (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | « third_party/WebKit/LayoutTests/fast/dom/collection-anchor-id-getter.html ('k') | no next file » | 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-2008, 2011, 2012, 2014 Apple Inc. All rights reserved. 4 * Copyright (C) 2003-2008, 2011, 2012, 2014 Apple Inc. All rights 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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 case TRCells: 134 case TRCells:
135 case SelectOptions: 135 case SelectOptions:
136 case MapAreas: 136 case MapAreas:
137 return DoNotInvalidateOnAttributeChanges; 137 return DoNotInvalidateOnAttributeChanges;
138 case DocApplets: 138 case DocApplets:
139 case SelectedOptions: 139 case SelectedOptions:
140 case DataListOptions: 140 case DataListOptions:
141 // FIXME: We can do better some day. 141 // FIXME: We can do better some day.
142 return InvalidateOnAnyAttrChange; 142 return InvalidateOnAnyAttrChange;
143 case DocAnchors: 143 case DocAnchors:
144 return InvalidateOnNameAttrChange; 144 case DocumentNamedItems:
145 case WindowNamedItems:
146 return InvalidateOnIdNameAttrChange;
145 case DocLinks: 147 case DocLinks:
146 return InvalidateOnHRefAttrChange; 148 return InvalidateOnHRefAttrChange;
147 case WindowNamedItems:
148 return InvalidateOnIdNameAttrChange;
149 case DocumentNamedItems:
150 return InvalidateOnIdNameAttrChange;
151 case FormControls: 149 case FormControls:
152 return InvalidateForFormControls; 150 return InvalidateForFormControls;
153 case ClassCollectionType: 151 case ClassCollectionType:
154 return InvalidateOnClassAttrChange; 152 return InvalidateOnClassAttrChange;
155 case NameNodeListType: 153 case NameNodeListType:
156 case RadioNodeListType: 154 case RadioNodeListType:
157 case RadioImgNodeListType: 155 case RadioImgNodeListType:
158 case LabelsNodeListType: 156 case LabelsNodeListType:
159 break; 157 break;
160 } 158 }
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 return toHTMLDataListOptionsCollection(htmlCollection).elementMatches(el ement); 224 return toHTMLDataListOptionsCollection(htmlCollection).elementMatches(el ement);
227 case MapAreas: 225 case MapAreas:
228 return element.hasTagName(areaTag); 226 return element.hasTagName(areaTag);
229 case DocApplets: 227 case DocApplets:
230 return isHTMLObjectElement(element) && toHTMLObjectElement(element).cont ainsJavaApplet(); 228 return isHTMLObjectElement(element) && toHTMLObjectElement(element).cont ainsJavaApplet();
231 case DocEmbeds: 229 case DocEmbeds:
232 return element.hasTagName(embedTag); 230 return element.hasTagName(embedTag);
233 case DocLinks: 231 case DocLinks:
234 return (element.hasTagName(aTag) || element.hasTagName(areaTag)) && elem ent.fastHasAttribute(hrefAttr); 232 return (element.hasTagName(aTag) || element.hasTagName(areaTag)) && elem ent.fastHasAttribute(hrefAttr);
235 case DocAnchors: 233 case DocAnchors:
236 return element.hasTagName(aTag) && element.fastHasAttribute(nameAttr); 234 return element.hasTagName(aTag) && (element.fastHasAttribute(nameAttr) | | element.fastHasAttribute(idAttr));
237 case ClassCollectionType: 235 case ClassCollectionType:
238 case TagCollectionType: 236 case TagCollectionType:
239 case HTMLTagCollectionType: 237 case HTMLTagCollectionType:
240 case DocAll: 238 case DocAll:
241 case NodeChildren: 239 case NodeChildren:
242 case FormControls: 240 case FormControls:
243 case TableRows: 241 case TableRows:
244 case WindowNamedItems: 242 case WindowNamedItems:
245 case NameNodeListType: 243 case NameNodeListType:
246 case RadioNodeListType: 244 case RadioNodeListType:
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 } 495 }
498 496
499 DEFINE_TRACE(HTMLCollection) 497 DEFINE_TRACE(HTMLCollection)
500 { 498 {
501 visitor->trace(m_namedItemCache); 499 visitor->trace(m_namedItemCache);
502 visitor->trace(m_collectionItemsCache); 500 visitor->trace(m_collectionItemsCache);
503 LiveNodeListBase::trace(visitor); 501 LiveNodeListBase::trace(visitor);
504 } 502 }
505 503
506 } // namespace blink 504 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/dom/collection-anchor-id-getter.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698