Microdata: Basic implementation of document.getItems() method.
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Oct 2011 16:13:01 +0000 (16:13 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Oct 2011 16:13:01 +0000 (16:13 +0000)
commit38c9b20a27b3fe2b6cab2eed4ba11fbf75875abb
tree55a92852442849755da7ec63c83ae4b0ea79fe46
parent78ee0e26427c8e5079e562fdb4f462e4082bce6a
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
54 files changed:
ChangeLog
LayoutTests/ChangeLog
LayoutTests/fast/dom/MicroData/001-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/MicroData/001.html [new file with mode: 0644]
LayoutTests/fast/dom/MicroData/002-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/MicroData/002.html [new file with mode: 0644]
LayoutTests/fast/dom/MicroData/003-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/MicroData/003.html [new file with mode: 0644]
LayoutTests/fast/dom/MicroData/004-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/MicroData/004.html [new file with mode: 0644]
LayoutTests/fast/dom/MicroData/005-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/MicroData/005.html [new file with mode: 0644]
LayoutTests/fast/dom/MicroData/006-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/MicroData/006.html [new file with mode: 0644]
LayoutTests/fast/dom/MicroData/007-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/MicroData/007.html [new file with mode: 0644]
LayoutTests/fast/dom/MicroData/008-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/MicroData/008.html [new file with mode: 0644]
LayoutTests/fast/dom/MicroData/009-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/MicroData/009.html [new file with mode: 0644]
LayoutTests/fast/dom/MicroData/resources/microdata-common.js [new file with mode: 0644]
LayoutTests/platform/chromium/test_expectations.txt
LayoutTests/platform/gtk/Skipped
LayoutTests/platform/qt/Skipped
LayoutTests/platform/win/Skipped
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.make
Source/WebCore/GNUmakefile.am
Source/WebCore/GNUmakefile.list.am
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.pro
Source/WebCore/WebCore.vcproj/WebCore.vcproj
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Document.h
Source/WebCore/dom/Document.idl
Source/WebCore/dom/MicroDataItemList.cpp [new file with mode: 0644]
Source/WebCore/dom/MicroDataItemList.h [new file with mode: 0644]
Source/WebCore/dom/Node.cpp
Source/WebCore/dom/Node.h
Source/WebCore/dom/NodeRareData.h
Source/WebCore/features.pri
Source/WebCore/html/HTMLAttributeNames.in
Source/WebCore/html/HTMLElement.cpp
Source/WebCore/html/HTMLElement.idl
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/features.gypi
Tools/ChangeLog
Tools/Scripts/build-webkit
WebKitLibraries/ChangeLog
WebKitLibraries/win/tools/vsprops/FeatureDefines.vsprops
WebKitLibraries/win/tools/vsprops/FeatureDefinesCairo.vsprops
configure.ac