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

Unified Diff: Source/core/fetch/FontResource.cpp

Issue 143453010: Have getElementsByClassName() / getElementsByTagName*() return an HTMLCollection (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/dom/shadow/ShadowRoot.idl ('k') | Source/core/html/CollectionType.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/fetch/FontResource.cpp
diff --git a/Source/core/fetch/FontResource.cpp b/Source/core/fetch/FontResource.cpp
index d45debb813047cb5db8debd1f2970bfae6e74429..a3c882487103a984b51a8fe88037a8436616f84b 100644
--- a/Source/core/fetch/FontResource.cpp
+++ b/Source/core/fetch/FontResource.cpp
@@ -37,7 +37,7 @@
#if ENABLE(SVG_FONTS)
#include "SVGNames.h"
-#include "core/dom/NodeList.h"
+#include "core/html/HTMLCollection.h"
#include "core/svg/SVGDocument.h"
#include "core/svg/SVGFontElement.h"
#endif
@@ -127,26 +127,26 @@ bool FontResource::ensureSVGFontData()
SVGFontElement* FontResource::getSVGFontById(const String& fontName) const
{
- RefPtr<NodeList> list = m_externalSVGDocument->getElementsByTagNameNS(SVGNames::fontTag.namespaceURI(), SVGNames::fontTag.localName());
- if (!list)
+ RefPtr<HTMLCollection> collection = m_externalSVGDocument->getElementsByTagNameNS(SVGNames::fontTag.namespaceURI(), SVGNames::fontTag.localName());
+ if (!collection)
return 0;
- unsigned listLength = list->length();
- if (!listLength)
+ unsigned collectionLength = collection->length();
+ if (!collectionLength)
return 0;
#ifndef NDEBUG
- for (unsigned i = 0; i < listLength; ++i) {
- ASSERT(list->item(i));
- ASSERT(list->item(i)->hasTagName(SVGNames::fontTag));
+ for (unsigned i = 0; i < collectionLength; ++i) {
+ ASSERT(collection->item(i));
+ ASSERT(collection->item(i)->hasTagName(SVGNames::fontTag));
}
#endif
if (fontName.isEmpty())
- return toSVGFontElement(list->item(0));
+ return toSVGFontElement(collection->item(0));
- for (unsigned i = 0; i < listLength; ++i) {
- SVGFontElement* element = toSVGFontElement(list->item(i));
+ for (unsigned i = 0; i < collectionLength; ++i) {
+ SVGFontElement* element = toSVGFontElement(collection->item(i));
if (element->getIdAttribute() == fontName)
return element;
}
« no previous file with comments | « Source/core/dom/shadow/ShadowRoot.idl ('k') | Source/core/html/CollectionType.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698