Calling DOM Element.attributes shouldn't force creation of ElementData.
<http://webkit.org/b/109976>
Reviewed by Darin Adler.
Don't create ElementData for an Element unnecessarily just because someone calls .attributes on it.
Previously, JS like this would create empty ElementData when 'element' has no attributes:
for (i = 0; i < element.attributes.length; ++i)
doStuff(element.attributes[i]);
Make NamedNodeMap::length() short-circuit and return 0 if !Element::hasAttributes().
* dom/Element.cpp:
(WebCore::Element::attributes):
* dom/NamedNodeMap.cpp:
(WebCore::NamedNodeMap::length):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@143076
268f45cc-cd09-0410-ab3c-
d52691b4dbfc