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

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

Issue 469913002: Rename CollectionIndexCache API to not use 'Element' (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/html/HTMLCollection.h ('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 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 || element.hasTagName(formTag) 321 || element.hasTagName(formTag)
322 || element.hasTagName(frameTag) 322 || element.hasTagName(frameTag)
323 || element.hasTagName(framesetTag) 323 || element.hasTagName(framesetTag)
324 || element.hasTagName(iframeTag) 324 || element.hasTagName(iframeTag)
325 || element.hasTagName(imgTag) 325 || element.hasTagName(imgTag)
326 || element.hasTagName(inputTag) 326 || element.hasTagName(inputTag)
327 || element.hasTagName(objectTag) 327 || element.hasTagName(objectTag)
328 || element.hasTagName(selectTag); 328 || element.hasTagName(selectTag);
329 } 329 }
330 330
331 Element* HTMLCollection::traverseToFirstElement() const 331 Element* HTMLCollection::traverseToFirst() const
332 { 332 {
333 switch (type()) { 333 switch (type()) {
334 case HTMLTagCollectionType: 334 case HTMLTagCollectionType:
335 return ElementTraversal::firstWithin(rootNode(), makeIsMatch(toHTMLTagCo llection(*this))); 335 return ElementTraversal::firstWithin(rootNode(), makeIsMatch(toHTMLTagCo llection(*this)));
336 case ClassCollectionType: 336 case ClassCollectionType:
337 return ElementTraversal::firstWithin(rootNode(), makeIsMatch(toClassColl ection(*this))); 337 return ElementTraversal::firstWithin(rootNode(), makeIsMatch(toClassColl ection(*this)));
338 default: 338 default:
339 if (overridesItemAfter()) 339 if (overridesItemAfter())
340 return virtualItemAfter(0); 340 return virtualItemAfter(0);
341 if (shouldOnlyIncludeDirectChildren()) 341 if (shouldOnlyIncludeDirectChildren())
342 return ElementTraversal::firstChild(rootNode(), makeIsMatch(*this)); 342 return ElementTraversal::firstChild(rootNode(), makeIsMatch(*this));
343 return ElementTraversal::firstWithin(rootNode(), makeIsMatch(*this)); 343 return ElementTraversal::firstWithin(rootNode(), makeIsMatch(*this));
344 } 344 }
345 } 345 }
346 346
347 Element* HTMLCollection::traverseToLastElement() const 347 Element* HTMLCollection::traverseToLast() const
348 { 348 {
349 ASSERT(canTraverseBackward()); 349 ASSERT(canTraverseBackward());
350 if (shouldOnlyIncludeDirectChildren()) 350 if (shouldOnlyIncludeDirectChildren())
351 return ElementTraversal::lastChild(rootNode(), makeIsMatch(*this)); 351 return ElementTraversal::lastChild(rootNode(), makeIsMatch(*this));
352 return ElementTraversal::lastWithin(rootNode(), makeIsMatch(*this)); 352 return ElementTraversal::lastWithin(rootNode(), makeIsMatch(*this));
353 } 353 }
354 354
355 Element* HTMLCollection::traverseForwardToOffset(unsigned offset, Element& curre ntElement, unsigned& currentOffset) const 355 Element* HTMLCollection::traverseForwardToOffset(unsigned offset, Element& curre ntElement, unsigned& currentOffset) const
356 { 356 {
357 ASSERT(currentOffset < offset); 357 ASSERT(currentOffset < offset);
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 } 503 }
504 504
505 void HTMLCollection::trace(Visitor* visitor) 505 void HTMLCollection::trace(Visitor* visitor)
506 { 506 {
507 visitor->trace(m_namedItemCache); 507 visitor->trace(m_namedItemCache);
508 visitor->trace(m_collectionIndexCache); 508 visitor->trace(m_collectionIndexCache);
509 LiveNodeListBase::trace(visitor); 509 LiveNodeListBase::trace(visitor);
510 } 510 }
511 511
512 } // namespace blink 512 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/html/HTMLCollection.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698