Microdata: Basic implementation of document.getItems() method.
https://bugs.webkit.org/show_bug.cgi?id=68610
Patch by Arko Saha <arko@motorola.com> on 2011-10-13
Reviewed by Ryosuke Niwa.
.:
Added ENABLE(MICRODATA) feature flag.
* configure.ac:
Source/WebCore:
Added ENABLE(MICRODATA) feature flag. Implement document.getItems() DOM API.
Spec: http://www.whatwg.org/specs/web-apps/current-work/complete/microdata.html
Tests: fast/dom/MicroData/001.html
fast/dom/MicroData/002.html
fast/dom/MicroData/003.html
fast/dom/MicroData/004.html
fast/dom/MicroData/005.html
fast/dom/MicroData/006.html
fast/dom/MicroData/007.html
fast/dom/MicroData/008.html
fast/dom/MicroData/009.html
* CMakeLists.txt:
* DerivedSources.make:
* GNUmakefile.am:
* GNUmakefile.list.am:
* WebCore.gypi:
* WebCore.pro:
* WebCore.vcproj/WebCore.vcproj:
* dom/Document.cpp:
(WebCore::Document::getItems): Returns NodeList of the element in the Document that
create items, that are not part of other items, and that are of one of the types
given in the argument. If no tokens specified/undefined in the argument, then
return a NodeList containing all top level microdata items.
(WebCore::Document::removeCachedMicroDataItemList): Remove Microdata item node list
from cache.
* dom/Document.h:
* dom/Document.idl: Added getItems() microdata DOM API.
* dom/MicroDataItemList.cpp: Added.
(WebCore::MicroDataItemList::MicroDataItemList):
(WebCore::MicroDataItemList::~MicroDataItemList):
(WebCore::MicroDataItemList::nodeMatches):
* dom/MicroDataItemList.h: Added.
(WebCore::MicroDataItemList::create):
* dom/Node.cpp:
(WebCore::Node::itemTypeAttributeChanged): It is responsible to invalidate the Microdata
item node cache when itemType attribute changes.
(WebCore::NodeListsNodeData::invalidateCachesThatDependOnAttributes):
(WebCore::NodeListsNodeData::invalidateMicrodataItemListCaches): Invalidate Microdata item
list cache.
(WebCore::NodeListsNodeData::isEmpty):
* dom/Node.h:
* dom/NodeRareData.h:
* features.pri:
* html/HTMLAttributeNames.in: Added itemid, itemprop, itemscope, itemtype attributes.
* html/HTMLElement.cpp:
(WebCore::HTMLElement::parseMappedAttribute): Handle itemtype attribute change.
* html/HTMLElement.idl: Added itemid, itemprop, itemscope, itemtypes microdata attributes.
Source/WebKit/chromium:
Added ENABLE(MICRODATA) feature flag. Implement document.getItems() DOM API.
Spec : http://www.whatwg.org/specs/web-apps/current-work/complete/microdata.html
* features.gypi:
Tools:
Added ENABLE(MICRODATA) feature flag. Implement document.getItems() DOM API.
Spec : http://www.whatwg.org/specs/web-apps/current-work/complete/microdata.html
* Scripts/build-webkit:
WebKitLibraries:
Added ENABLE(MICRODATA) feature flag. Implement document.getItems() DOM API.
Spec: http://www.whatwg.org/specs/web-apps/current-work/complete/microdata.html
* win/tools/vsprops/FeatureDefines.vsprops:
* win/tools/vsprops/FeatureDefinesCairo.vsprops:
LayoutTests:
Added test-cases for document.getItems() method.
Spec: http://www.whatwg.org/specs/web-apps/current-work/complete/microdata.html
Skipping test-cases for now as Microdata DOM API is not yet enabled.
* fast/dom/MicroData: Added.
* fast/dom/MicroData/001-expected.txt: Added.
* fast/dom/MicroData/001.html: Added.
* fast/dom/MicroData/002-expected.txt: Added.
* fast/dom/MicroData/002.html: Added.
* fast/dom/MicroData/003-expected.txt: Added.
* fast/dom/MicroData/003.html: Added.
* fast/dom/MicroData/004-expected.txt: Added.
* fast/dom/MicroData/004.html: Added.
* fast/dom/MicroData/005-expected.txt: Added.
* fast/dom/MicroData/005.html: Added.
* fast/dom/MicroData/006-expected.txt: Added.
* fast/dom/MicroData/006.html: Added.
* fast/dom/MicroData/007-expected.txt: Added.
* fast/dom/MicroData/007.html: Added.
* fast/dom/MicroData/008-expected.txt: Added.
* fast/dom/MicroData/008.html: Added.
* fast/dom/MicroData/009-expected.txt: Added.
* fast/dom/MicroData/009.html: Added.
* fast/dom/MicroData/resources: Added.
* fast/dom/MicroData/resources/microdata-common.js: Added.
(createElem):
(runTest):
* platform/win/Skipped:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@97471
268f45cc-cd09-0410-ab3c-
d52691b4dbfc