Microdata: document.getItems(typeNames) is not returning Microdata items when typeNam...
authorarko@motorola.com <arko@motorola.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 25 Jun 2012 12:09:33 +0000 (12:09 +0000)
committerarko@motorola.com <arko@motorola.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 25 Jun 2012 12:09:33 +0000 (12:09 +0000)
commitc2218d7091781e34b433651a9b570a0b364ce374
treea2c5810213d1bbd3982e9bb567b8b5c76658ee86
parent5b4a1f2a2b05ff408538ce8903dcf65eb1e2bdd1
Microdata: document.getItems(typeNames) is not returning Microdata items when typeNames argument is not specified.
https://bugs.webkit.org/show_bug.cgi?id=89757

Reviewed by Ryosuke Niwa.

With r120979 change, it creates MicroDataItemList with m_typeNames = "http://webkit.org/microdata/undefinedItemType",
when typeNames argument is not specified. Modified the check in nodeMatches() accordingly.

This fixes the following failing tests :
    fast/dom/MicroData/002.html
    fast/dom/MicroData/003.html
    fast/dom/MicroData/007.html
    fast/dom/MicroData/009.html
    fast/dom/MicroData/properties-collection-must-see-the-properties-added-in-itemref.html

* dom/Document.cpp:
(WebCore::Document::getItems): Use undefinedItemType to avoid String conversion.
* dom/MicroDataItemList.cpp:
(WebCore::MicroDataItemList::undefinedItemType): It defines "http://webkit.org/microdata/undefinedItemType"
string using DEFINE_STATIC_LOCAL to avoid String conversion.
(WebCore::MicroDataItemList::MicroDataItemList): Use document() method of DynamicNodeList to obtain
document of owner element.
(WebCore::MicroDataItemList::~MicroDataItemList): Removed originalTypeNames null check.
(WebCore::MicroDataItemList::nodeMatches): Return true if originalTypeNames is equal to undefinedItemType.
* dom/MicroDataItemList.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@121149 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/MicroDataItemList.cpp
Source/WebCore/dom/MicroDataItemList.h