| Index: Source/core/html/HTMLCollection.cpp
|
| diff --git a/Source/core/html/HTMLCollection.cpp b/Source/core/html/HTMLCollection.cpp
|
| index 46350053705dcac07eea661a6ea0e57f2e920095..e0bec9f3a86e5dac04dd18d4b60b4d5e008b8438 100644
|
| --- a/Source/core/html/HTMLCollection.cpp
|
| +++ b/Source/core/html/HTMLCollection.cpp
|
| @@ -30,6 +30,7 @@
|
| #include "core/dom/NodeList.h"
|
| #include "core/dom/NodeRareData.h"
|
| #include "core/dom/NodeTraversal.h"
|
| +#include "core/html/HTMLAllCollection.h"
|
| #include "core/html/HTMLElement.h"
|
| #include "core/html/HTMLObjectElement.h"
|
| #include "core/html/HTMLOptionElement.h"
|
| @@ -385,19 +386,6 @@ Element* HTMLCollection::virtualItemAfter(Element*) const
|
| return 0;
|
| }
|
|
|
| -static inline bool nameShouldBeVisibleInDocumentAll(const HTMLElement& element)
|
| -{
|
| - // The document.all collection returns only certain types of elements by name,
|
| - // although it returns any type of element by id.
|
| - return element.hasLocalName(appletTag)
|
| - || element.hasLocalName(embedTag)
|
| - || element.hasLocalName(formTag)
|
| - || element.hasLocalName(imgTag)
|
| - || element.hasLocalName(inputTag)
|
| - || element.hasLocalName(objectTag)
|
| - || element.hasLocalName(selectTag);
|
| -}
|
| -
|
| inline Element* firstMatchingChildElement(const HTMLCollection& nodeList, const ContainerNode& root)
|
| {
|
| Element* element = ElementTraversal::firstWithin(root);
|
| @@ -431,7 +419,7 @@ Element* HTMLCollection::traverseToFirstElement(const ContainerNode& root) const
|
| }
|
| }
|
|
|
| -inline Element* HTMLCollection::traverseNextElement(Element& previous, const ContainerNode& root) const
|
| +Element* HTMLCollection::traverseNextElement(Element& previous, const ContainerNode& root) const
|
| {
|
| if (overridesItemAfter())
|
| return virtualItemAfter(&previous);
|
| @@ -542,7 +530,7 @@ void HTMLCollection::updateNameCache() const
|
| if (!element->isHTMLElement())
|
| continue;
|
| const AtomicString& nameAttrVal = element->getNameAttribute();
|
| - if (!nameAttrVal.isEmpty() && idAttrVal != nameAttrVal && (type() != DocAll || nameShouldBeVisibleInDocumentAll(toHTMLElement(*element))))
|
| + if (!nameAttrVal.isEmpty() && idAttrVal != nameAttrVal && (type() != DocAll || HTMLAllCollection::elementNameShouldBeVisible(toHTMLElement(*element))))
|
| appendNameCache(nameAttrVal, element);
|
| }
|
|
|
|
|