Changeset 97471 in webkit


Ignore:
Timestamp:
Oct 14, 2011 9:13:01 AM (12 years ago)
Author:
rniwa@webkit.org
Message:

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:
Location:
trunk
Files:
23 added
33 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r97464 r97471  
     12011-10-13  Arko Saha  <arko@motorola.com>
     2
     3        Microdata: Basic implementation of document.getItems() method.
     4        https://bugs.webkit.org/show_bug.cgi?id=68610
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Added ENABLE(MICRODATA) feature flag.
     9
     10        * configure.ac:
     11
    1122011-10-14  Raphael Kubo da Costa  <kubo@profusion.mobi>
    213
  • trunk/LayoutTests/ChangeLog

    r97459 r97471  
     12011-10-13  Arko Saha  <arko@motorola.com>
     2
     3        Microdata: Basic implementation of document.getItems() method.
     4        https://bugs.webkit.org/show_bug.cgi?id=68610
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Added test-cases for document.getItems() method.
     9        Spec: http://www.whatwg.org/specs/web-apps/current-work/complete/microdata.html
     10        Skipping test-cases for now as Microdata DOM API is not yet enabled.
     11
     12        * fast/dom/MicroData: Added.
     13        * fast/dom/MicroData/001-expected.txt: Added.
     14        * fast/dom/MicroData/001.html: Added.
     15        * fast/dom/MicroData/002-expected.txt: Added.
     16        * fast/dom/MicroData/002.html: Added.
     17        * fast/dom/MicroData/003-expected.txt: Added.
     18        * fast/dom/MicroData/003.html: Added.
     19        * fast/dom/MicroData/004-expected.txt: Added.
     20        * fast/dom/MicroData/004.html: Added.
     21        * fast/dom/MicroData/005-expected.txt: Added.
     22        * fast/dom/MicroData/005.html: Added.
     23        * fast/dom/MicroData/006-expected.txt: Added.
     24        * fast/dom/MicroData/006.html: Added.
     25        * fast/dom/MicroData/007-expected.txt: Added.
     26        * fast/dom/MicroData/007.html: Added.
     27        * fast/dom/MicroData/008-expected.txt: Added.
     28        * fast/dom/MicroData/008.html: Added.
     29        * fast/dom/MicroData/009-expected.txt: Added.
     30        * fast/dom/MicroData/009.html: Added.
     31        * fast/dom/MicroData/resources: Added.
     32        * fast/dom/MicroData/resources/microdata-common.js: Added.
     33        (createElem):
     34        (runTest):
     35        * platform/win/Skipped:
     36
    1372011-10-14  Adam Barth  <abarth@webkit.org>
    238
  • trunk/LayoutTests/platform/chromium/test_expectations.txt

    r97455 r97471  
    101101BUGWK63933 : fast/canvas/canvas-webkitLineDash.html = FAIL
    102102BUGWK63933 : fast/canvas/canvas-webkitLineDash-invalid.html = FAIL
     103
     104// Microdata DOM API is not yet enabled.
     105BUGWK68610 SKIP : fast/dom/MicroData = PASS
    103106
    104107// -----------------------------------------------------------------
  • trunk/LayoutTests/platform/gtk/Skipped

    r97407 r97471  
    16851685http/tests/local/fileapi/send-sliced-dragged-file.html 
    16861686http/tests/local/blob/send-hybrid-blob.html
     1687
     1688# Microdata DOM API is not yet enabled.
     1689fast/dom/MicroData
  • trunk/LayoutTests/platform/qt/Skipped

    r97407 r97471  
    24232423http/tests/inspector/resource-tree/resource-tree-frame-navigate.html
    24242424http/tests/inspector/resource-tree/resource-tree-non-unique-url.html
     2425
     2426# Microdata DOM API is not yet enabled.
     2427BUGWK68610 SKIP : fast/dom/MicroData = PASS
  • trunk/LayoutTests/platform/win/Skipped

    r97407 r97471  
    14241424http/tests/loading/progress-finished-callback.html
    14251425
     1426# Microdata DOM API is not yet enabled.
     1427fast/dom/MicroData
     1428
    14261429# HiDPI tests require test infrastructure enhancements
    14271430fast/hidpi
  • trunk/Source/WebCore/CMakeLists.txt

    r97460 r97471  
    550550    dom/MessagePortChannel.cpp
    551551    dom/MessagePort.cpp
     552    dom/MicroDataItemList.cpp
    552553    dom/MouseEvent.cpp
    553554    dom/MouseRelatedEvent.cpp
  • trunk/Source/WebCore/ChangeLog

    r97468 r97471  
     12011-10-13  Arko Saha  <arko@motorola.com>
     2
     3        Microdata: Basic implementation of document.getItems() method.
     4        https://bugs.webkit.org/show_bug.cgi?id=68610
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Added ENABLE(MICRODATA) feature flag. Implement document.getItems() DOM API.
     9        Spec: http://www.whatwg.org/specs/web-apps/current-work/complete/microdata.html
     10
     11        Tests: fast/dom/MicroData/001.html
     12               fast/dom/MicroData/002.html
     13               fast/dom/MicroData/003.html
     14               fast/dom/MicroData/004.html
     15               fast/dom/MicroData/005.html
     16               fast/dom/MicroData/006.html
     17               fast/dom/MicroData/007.html
     18               fast/dom/MicroData/008.html
     19               fast/dom/MicroData/009.html
     20
     21        * CMakeLists.txt:
     22        * DerivedSources.make:
     23        * GNUmakefile.am:
     24        * GNUmakefile.list.am:
     25        * WebCore.gypi:
     26        * WebCore.pro:
     27        * WebCore.vcproj/WebCore.vcproj:
     28        * dom/Document.cpp:
     29        (WebCore::Document::getItems): Returns NodeList of the element in the Document that
     30        create items, that are not part of other items, and that are of one of the types
     31        given in the argument. If no tokens specified/undefined in the argument, then
     32        return a NodeList containing all top level microdata items.
     33        (WebCore::Document::removeCachedMicroDataItemList): Remove Microdata item node list
     34        from cache.
     35        * dom/Document.h:
     36        * dom/Document.idl: Added getItems() microdata DOM API.
     37        * dom/MicroDataItemList.cpp: Added.
     38        (WebCore::MicroDataItemList::MicroDataItemList):
     39        (WebCore::MicroDataItemList::~MicroDataItemList):
     40        (WebCore::MicroDataItemList::nodeMatches):
     41        * dom/MicroDataItemList.h: Added.
     42        (WebCore::MicroDataItemList::create):
     43        * dom/Node.cpp:
     44        (WebCore::Node::itemTypeAttributeChanged): It is responsible to invalidate the Microdata
     45        item node cache when itemType attribute changes.
     46        (WebCore::NodeListsNodeData::invalidateCachesThatDependOnAttributes):
     47        (WebCore::NodeListsNodeData::invalidateMicrodataItemListCaches): Invalidate Microdata item
     48        list cache.
     49        (WebCore::NodeListsNodeData::isEmpty):
     50        * dom/Node.h:
     51        * dom/NodeRareData.h:
     52        * features.pri:
     53        * html/HTMLAttributeNames.in: Added itemid, itemprop, itemscope, itemtype attributes.
     54        * html/HTMLElement.cpp:
     55        (WebCore::HTMLElement::parseMappedAttribute): Handle itemtype attribute change.
     56        * html/HTMLElement.idl: Added itemid, itemprop, itemscope, itemtypes microdata attributes.
     57
    1582011-10-14  Andreas Kling  <kling@webkit.org>
    259
  • trunk/Source/WebCore/DerivedSources.make

    r97159 r97471  
    788788endif
    789789
     790ifeq ($(findstring ENABLE_MICRODATA,$(FEATURE_DEFINES)), ENABLE_MICRODATA)
     791    HTML_FLAGS := $(HTML_FLAGS) ENABLE_MICRODATA=1
     792endif
     793
    790794ifeq ($(findstring ENABLE_PROGRESS_TAG,$(FEATURE_DEFINES)), ENABLE_PROGRESS_TAG)
    791795    HTML_FLAGS := $(HTML_FLAGS) ENABLE_PROGRESS_TAG=1
  • trunk/Source/WebCore/GNUmakefile.am

    r97333 r97471  
    576576webcore_cppflags += -DENABLE_MHTML=1
    577577endif  # END ENABLE_MHTML
     578
     579# ---
     580# HTML5 Microdata support
     581# ---
     582if ENABLE_MICRODATA
     583FEATURE_DEFINES += ENABLE_MICRODATA=1
     584webcore_cppflags += -DENABLE_MICRODATA=1
     585endif  # END ENABLE_MICRODATA
    578586
    579587# ---
  • trunk/Source/WebCore/GNUmakefile.list.am

    r97460 r97471  
    12261226        Source/WebCore/dom/MessagePort.cpp \
    12271227        Source/WebCore/dom/MessagePort.h \
     1228        Source/WebCore/dom/MicroDataItemList.cpp \
     1229        Source/WebCore/dom/MicroDataItemList.h \
    12281230        Source/WebCore/dom/MouseEvent.cpp \
    12291231        Source/WebCore/dom/MouseEvent.h \
  • trunk/Source/WebCore/WebCore.gypi

    r97460 r97471  
    52255225            'dom/MessagePort.cpp',
    52265226            'dom/MessagePortChannel.cpp',
     5227            'dom/MicroDataItemList.cpp',
     5228            'dom/MicroDataItemList.h',
    52275229            'dom/MouseEvent.cpp',
    52285230            'dom/MouseRelatedEvent.cpp',
  • trunk/Source/WebCore/WebCore.pro

    r97460 r97471  
    516516    dom/MessagePort.cpp \
    517517    dom/MessagePortChannel.cpp \
     518    dom/MicroDataItemList.cpp \
    518519    dom/MouseEvent.cpp \
    519520    dom/MouseRelatedEvent.cpp \
     
    15341535    dom/MessagePortChannel.h \
    15351536    dom/MessagePort.h \
     1537    dom/MicroDataItemList.h \
    15361538    dom/MouseEvent.h \
    15371539    dom/MouseRelatedEvent.h \
  • trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj

    r97460 r97471  
    4720747207                        </File>
    4720847208                        <File
     47209                                RelativePath="..\dom\MicroDataItemList.cpp"
     47210                                >
     47211                                <FileConfiguration
     47212                                        Name="Debug|Win32"
     47213                                        ExcludedFromBuild="true"
     47214                                        >
     47215                                        <Tool
     47216                                                Name="VCCLCompilerTool"
     47217                                        />
     47218                                </FileConfiguration>
     47219                                <FileConfiguration
     47220                                        Name="Release|Win32"
     47221                                        ExcludedFromBuild="true"
     47222                                        >
     47223                                        <Tool
     47224                                                Name="VCCLCompilerTool"
     47225                                        />
     47226                                </FileConfiguration>
     47227                                <FileConfiguration
     47228                                        Name="Debug_Cairo_CFLite|Win32"
     47229                                        ExcludedFromBuild="true"
     47230                                        >
     47231                                        <Tool
     47232                                                Name="VCCLCompilerTool"
     47233                                        />
     47234                                </FileConfiguration>
     47235                                <FileConfiguration
     47236                                        Name="Release_Cairo_CFLite|Win32"
     47237                                        ExcludedFromBuild="true"
     47238                                        >
     47239                                        <Tool
     47240                                                Name="VCCLCompilerTool"
     47241                                        />
     47242                                </FileConfiguration>
     47243                                <FileConfiguration
     47244                                        Name="Debug_All|Win32"
     47245                                        ExcludedFromBuild="true"
     47246                                        >
     47247                                        <Tool
     47248                                                Name="VCCLCompilerTool"
     47249                                        />
     47250                                </FileConfiguration>
     47251                                <FileConfiguration
     47252                                        Name="Production|Win32"
     47253                                        ExcludedFromBuild="true"
     47254                                        >
     47255                                        <Tool
     47256                                                Name="VCCLCompilerTool"
     47257                                        />
     47258                                </FileConfiguration>
     47259                        </File>
     47260                        <File
     47261                                RelativePath="..\dom\MicroDataItemList.h"
     47262                                >
     47263                        </File>
     47264                        <File
    4720947265                                RelativePath="..\dom\MouseEvent.cpp"
    4721047266                                >
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r97460 r97471  
    33053305                9B32CDA913DF7FA900F34D13 /* RenderedPosition.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B32CDA713DF7FA900F34D13 /* RenderedPosition.h */; };
    33063306                9B32CDAA13DF7FA900F34D13 /* RenderedPosition.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9B32CDA813DF7FA900F34D13 /* RenderedPosition.cpp */; };
     3307                9B375EDA14478A0100F3CAE5 /* MicroDataItemList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9B375ED814478A0100F3CAE5 /* MicroDataItemList.cpp */; };
     3308                9B375EDB14478A0100F3CAE5 /* MicroDataItemList.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B375ED914478A0100F3CAE5 /* MicroDataItemList.h */; };
    33073309                9B417064125662B3006B28FC /* ApplyBlockElementCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B417062125662B3006B28FC /* ApplyBlockElementCommand.h */; settings = {ATTRIBUTES = (Private, ); }; };
    33083310                9B417065125662B3006B28FC /* ApplyBlockElementCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9B417063125662B3006B28FC /* ApplyBlockElementCommand.cpp */; };
     
    1047110473                9B32CDA713DF7FA900F34D13 /* RenderedPosition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderedPosition.h; sourceTree = "<group>"; };
    1047210474                9B32CDA813DF7FA900F34D13 /* RenderedPosition.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderedPosition.cpp; sourceTree = "<group>"; };
     10475                9B375ED814478A0100F3CAE5 /* MicroDataItemList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MicroDataItemList.cpp; sourceTree = "<group>"; };
     10476                9B375ED914478A0100F3CAE5 /* MicroDataItemList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MicroDataItemList.h; sourceTree = "<group>"; };
    1047310477                9B417062125662B3006B28FC /* ApplyBlockElementCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ApplyBlockElementCommand.h; sourceTree = "<group>"; };
    1047410478                9B417063125662B3006B28FC /* ApplyBlockElementCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ApplyBlockElementCommand.cpp; sourceTree = "<group>"; };
     
    2110721111                                41BF70090FE86F49005E8DEC /* MessagePortChannel.cpp */,
    2110821112                                41BF700A0FE86F49005E8DEC /* MessagePortChannel.h */,
     21113                                9B375ED814478A0100F3CAE5 /* MicroDataItemList.cpp */,
     21114                                9B375ED914478A0100F3CAE5 /* MicroDataItemList.h */,
    2110921115                                85031B2F0A44EFC700F992E0 /* MouseEvent.cpp */,
    2111021116                                85031B300A44EFC700F992E0 /* MouseEvent.h */,
     
    2461624622                                3106037B143281CD00ABF4BA /* DOMWebKitCSSFilterValueInternal.h in Headers */,
    2461724623                                29ACB212143E7128006BCA5F /* AccessibilityMockObject.h in Headers */,
     24624                                9B375EDB14478A0100F3CAE5 /* MicroDataItemList.h in Headers */,
    2461824625                                49AF2D6914435D050016A784 /* DisplayRefreshMonitor.h in Headers */,
    2461924626                                71CCB49D144824AC00C676D6 /* ImageBySizeCache.h in Headers */,
     
    2746727474                                29ACB214143E7498006BCA5F /* AccessibilityMockObject.cpp in Sources */,
    2746827475                                0F09087F1444FDB200028917 /* ScrollbarTheme.cpp in Sources */,
     27476                                9B375EDA14478A0100F3CAE5 /* MicroDataItemList.cpp in Sources */,
    2746927477                                49AF2D6C14435D210016A784 /* DisplayRefreshMonitorMac.cpp in Sources */,
    2747027478                                49FC7A501444AF5F00A5D864 /* DisplayRefreshMonitor.cpp in Sources */,
  • trunk/Source/WebCore/dom/Document.cpp

    r97405 r97471  
    235235#endif
    236236
     237#if ENABLE(MICRODATA)
     238#include "MicroDataItemList.h"
     239#include "NodeRareData.h"
     240#endif
     241
    237242using namespace std;
    238243using namespace WTF;
     
    51745179}
    51755180
     5181#if ENABLE(MICRODATA)
     5182PassRefPtr<NodeList> Document::getItems(const String& typeNames)
     5183{
     5184    NodeRareData* data = ensureRareData();
     5185    if (!data->nodeLists()) {
     5186        data->setNodeLists(NodeListsNodeData::create());
     5187        treeScope()->addNodeListCache();
     5188    }
     5189
     5190    // Since documet.getItem() is allowed for microdata, typeNames will be null string.
     5191    // In this case we need to create an unique string identifier to map such request in the cache.
     5192    String localTypeNames = typeNames.isNull() ? String("http://webkit.org/microdata/undefinedItemType") : typeNames;
     5193
     5194    pair<NodeListsNodeData::MicroDataItemListCache::iterator, bool> result = data->nodeLists()->m_microDataItemListCache.add(localTypeNames, 0);
     5195    if (!result.second)
     5196        return PassRefPtr<NodeList>(result.first->second);
     5197
     5198    RefPtr<MicroDataItemList> list = MicroDataItemList::create(this, typeNames);
     5199    result.first->second = list.get();
     5200    return list.release();
     5201}
     5202
     5203void Document::removeCachedMicroDataItemList(MicroDataItemList* list, const String& typeNames)
     5204{
     5205    ASSERT(rareData());
     5206    ASSERT(rareData()->nodeLists());
     5207    ASSERT_UNUSED(list, list->hasOwnCaches());
     5208
     5209    NodeListsNodeData* data = rareData()->nodeLists();
     5210
     5211    String localTypeNames = typeNames.isNull() ? String("http://webkit.org/microdata/undefinedItemType") : typeNames;
     5212    ASSERT_UNUSED(list, list == data->m_microDataItemListCache.get(localTypeNames));
     5213    data->m_microDataItemListCache.remove(localTypeNames);
     5214}
     5215#endif
     5216
    51765217} // namespace WebCore
  • trunk/Source/WebCore/dom/Document.h

    r97405 r97471  
    160160#endif
    161161
     162#if ENABLE(MICRODATA)
     163class MicroDataItemList;
     164#endif
     165
    162166typedef int ExceptionCode;
    163167
     
    10971101   
    10981102    bool visualUpdatesAllowed() const;
     1103
     1104#if ENABLE(MICRODATA)
     1105    PassRefPtr<NodeList> getItems(const String& typeNames);
     1106    void removeCachedMicroDataItemList(MicroDataItemList*, const String&);
     1107#endif
    10991108   
    11001109protected:
  • trunk/Source/WebCore/dom/Document.idl

    r92576 r97471  
    175175
    176176        NodeList getElementsByName(in [Optional=CallWithDefaultValue] DOMString elementName);
     177
     178#if defined(ENABLE_MICRODATA) && ENABLE_MICRODATA
     179        NodeList getItems(in [ConvertUndefinedOrNullToNullString, Optional=CallWithDefaultValue] DOMString typeNames);
     180#endif
    177181
    178182#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
  • trunk/Source/WebCore/dom/Node.cpp

    r97333 r97471  
    22762276}
    22772277
     2278#if ENABLE(MICRODATA)
     2279void Node::itemTypeAttributeChanged()
     2280{
     2281    Node * rootNode = document();
     2282
     2283    if (!rootNode->hasRareData())
     2284        return;
     2285
     2286    NodeRareData* data = rootNode->rareData();
     2287
     2288    if (!data->nodeLists())
     2289        return;
     2290
     2291    data->nodeLists()->invalidateMicrodataItemListCaches();
     2292}
     2293#endif
     2294
    22782295#ifndef NDEBUG
    22792296
     
    24252442    if (m_labelsNodeListCache)
    24262443        m_labelsNodeListCache->invalidateCache();
    2427 }
     2444
     2445#if ENABLE(MICRODATA)
     2446    invalidateMicrodataItemListCaches();
     2447#endif
     2448}
     2449
     2450#if ENABLE(MICRODATA)
     2451void NodeListsNodeData::invalidateMicrodataItemListCaches()
     2452{
     2453    MicroDataItemListCache::iterator itemListCacheEnd = m_microDataItemListCache.end();
     2454    for (MicroDataItemListCache::iterator it = m_microDataItemListCache.begin(); it != itemListCacheEnd; ++it)
     2455        it->second->invalidateCache();
     2456}
     2457#endif
    24282458
    24292459bool NodeListsNodeData::isEmpty() const
     
    24432473    if (!m_nameNodeListCache.isEmpty())
    24442474        return false;
     2475#if ENABLE(MICRODATA)
     2476    if (!m_microDataItemListCache.isEmpty())
     2477        return false;
     2478#endif
    24452479
    24462480    if (m_labelsNodeListCache)
  • trunk/Source/WebCore/dom/Node.h

    r97137 r97471  
    517517    void notifyLocalNodeListsLabelChanged();
    518518    void removeCachedClassNodeList(ClassNodeList*, const String&);
     519
    519520    void removeCachedNameNodeList(NameNodeList*, const String&);
    520521    void removeCachedTagNodeList(TagNodeList*, const AtomicString&);
     
    580581    virtual EventTargetData* eventTargetData();
    581582    virtual EventTargetData* ensureEventTargetData();
     583
     584#if ENABLE(MICRODATA)
     585    void itemTypeAttributeChanged();
     586#endif
    582587
    583588private:
  • trunk/Source/WebCore/dom/NodeRareData.h

    r95901 r97471  
    2525#include "ClassNodeList.h"
    2626#include "DynamicNodeList.h"
     27
     28#if ENABLE(MICRODATA)
     29#include "MicroDataItemList.h"
     30#endif
     31
    2732#include "NameNodeList.h"
    2833#include "QualifiedName.h"
     
    5762    typedef HashMap<RefPtr<QualifiedName::QualifiedNameImpl>, TagNodeList*> TagNodeListCacheNS;
    5863    TagNodeListCacheNS m_tagNodeListCacheNS;
    59  
     64
     65#if ENABLE(MICRODATA)
     66    typedef HashMap<String, MicroDataItemList*> MicroDataItemListCache;
     67    MicroDataItemListCache m_microDataItemListCache;
     68#endif
     69
    6070    LabelsNodeList* m_labelsNodeListCache;
    6171 
     
    6777    void invalidateCaches();
    6878    void invalidateCachesThatDependOnAttributes();
     79
     80#if ENABLE(MICRODATA)
     81    void invalidateMicrodataItemListCaches();
     82#endif
     83
    6984    bool isEmpty() const;
    7085
  • trunk/Source/WebCore/features.pri

    r97333 r97471  
    5858!contains(DEFINES, ENABLE_METER_TAG=.): DEFINES += ENABLE_METER_TAG=1
    5959!contains(DEFINES, ENABLE_MHTML=.): DEFINES += ENABLE_MHTML=0
     60!contains(DEFINES, ENABLE_MICRODATA=.): DEFINES += ENABLE_MICRODATA=0
    6061!contains(DEFINES, ENABLE_PROGRESS_TAG=.): DEFINES += ENABLE_PROGRESS_TAG=1
    6162!contains(DEFINES, ENABLE_BLOB=.): DEFINES += ENABLE_BLOB=1
  • trunk/Source/WebCore/html/HTMLAttributeNames.in

    r94813 r97471  
    122122indeterminate
    123123ismap
     124itemid
     125itemprop
     126itemscope
     127itemtype
    124128keytype
    125129kind
  • trunk/Source/WebCore/html/HTMLElement.cpp

    r97333 r97471  
    196196        } else if (equalIgnoringCase(value, "false"))
    197197            addCSSProperty(attr, CSSPropertyWebkitUserDrag, CSSValueNone);
     198#if ENABLE(MICRODATA)
     199    } else if (attr->name() == itemtypeAttr) {
     200        itemTypeAttributeChanged();
     201#endif
    198202    }
    199203// standard events
  • trunk/Source/WebCore/html/HTMLElement.idl

    r92327 r97471  
    6767                 attribute boolean spellcheck;
    6868
     69                 attribute [Conditional=MICRODATA, Reflect] boolean itemScope;
     70                 attribute [Conditional=MICRODATA, Reflect] DOMString itemType;
     71                 attribute [Conditional=MICRODATA, Reflect] DOMString itemId;
     72
    6973#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
    7074        readonly attribute DOMString titleDisplayString;
  • trunk/Source/WebKit/chromium/ChangeLog

    r97453 r97471  
     12011-10-13  Arko Saha  <arko@motorola.com>
     2
     3        Microdata: Basic implementation of document.getItems() method.
     4        https://bugs.webkit.org/show_bug.cgi?id=68610
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Added ENABLE(MICRODATA) feature flag. Implement document.getItems() DOM API.
     9        Spec : http://www.whatwg.org/specs/web-apps/current-work/complete/microdata.html
     10
     11        * features.gypi:
     12
    1132011-10-12  Hans Wennborg  <hans@chromium.org>
    214
  • trunk/Source/WebKit/chromium/features.gypi

    r97159 r97471  
    6969      'ENABLE_METER_TAG=1',
    7070      'ENABLE_MHTML=1',
     71      'ENABLE_MICRODATA=0',
    7172      'ENABLE_MUTATION_OBSERVERS=<(enable_mutation_observers)',
    7273      'ENABLE_NOTIFICATIONS=1',
  • trunk/Tools/ChangeLog

    r97470 r97471  
     12011-10-13  Arko Saha  <arko@motorola.com>
     2
     3        Microdata: Basic implementation of document.getItems() method.
     4        https://bugs.webkit.org/show_bug.cgi?id=68610
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Added ENABLE(MICRODATA) feature flag. Implement document.getItems() DOM API.
     9        Spec : http://www.whatwg.org/specs/web-apps/current-work/complete/microdata.html
     10
     11        * Scripts/build-webkit:
     12
    1132011-10-14  Csaba Osztrogonác  <ossy@webkit.org>
    214
  • trunk/Tools/Scripts/build-webkit

    r97333 r97471  
    107107    $meterTagSupport,
    108108    $mhtmlSupport,
     109    $microdataSupport,
    109110    $mutationObserversSupport,
    110111    $netscapePluginSupport,
     
    263264      define => "ENABLE_MHTML", default => 0, value => \$mhtmlSupport },
    264265
     266    { option => "microdata", desc => "Toggle Microdata support",
     267      define => "ENABLE_MICRODATA", default => 0, value => \$microdataSupport },
     268
    265269    { option => "netscape-plugin", desc => "Netscape Plugin support",
    266270      define => "ENABLE_NETSCAPE_PLUGIN_API", default => !isEfl(), value => \$netscapePluginSupport },
  • trunk/WebKitLibraries/ChangeLog

    r97333 r97471  
     12011-10-13  Arko Saha  <arko@motorola.com>
     2
     3        Microdata: Basic implementation of document.getItems() method.
     4        https://bugs.webkit.org/show_bug.cgi?id=68610
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Added ENABLE(MICRODATA) feature flag. Implement document.getItems() DOM API.
     9        Spec: http://www.whatwg.org/specs/web-apps/current-work/complete/microdata.html
     10
     11        * win/tools/vsprops/FeatureDefines.vsprops:
     12        * win/tools/vsprops/FeatureDefinesCairo.vsprops:
     13
    1142011-10-12  Adam Barth  <abarth@webkit.org>
    215
  • trunk/WebKitLibraries/win/tools/vsprops/FeatureDefines.vsprops

    r97333 r97471  
    1010  <Tool
    1111                Name="VCCLCompilerTool"
    12                 PreprocessorDefinitions="$(ENABLE_REQUEST_ANIMATION_FRAME);$(ENABLE_3D_CANVAS);$(ENABLE_3D_RENDERING);$(ENABLE_ACCELERATED_2D_CANVAS);$(ENABLE_BLOB);$(ENABLE_CHANNEL_MESSAGING);$(ENABLE_CLIENT_BASED_GEOLOCATION);$(ENABLE_CSS_FILTERS);$(ENABLE_CSS_REGIONS);$(ENABLE_CSS_EXCLUSIONS);$(ENABLE_SQL_DATABASE);$(ENABLE_DATAGRID);$(ENABLE_DATALIST);$(ENABLE_DATA_TRANSFER_ITEMS);$(ENABLE_DETAILS);$(ENABLE_DEVICE_ORIENTATION);$(ENABLE_DIRECTORY_UPLOAD);$(ENABLE_DOM_STORAGE);$(ENABLE_FILTERS);$(ENABLE_FILE_SYSTEM);$(ENABLE_CSS3_FLEXBOX);$(ENABLE_FULLSCREEN_API);$(ENABLE_GAMEPAD);$(ENABLE_GEOLOCATION);$(ENABLE_ICONDATABASE);$(ENABLE_INDEXED_DATABASE);$(ENABLE_INPUT_COLOR);$(ENABLE_INPUT_SPEECH);$(ENABLE_INPUT_TYPE_DATE);$(ENABLE_INPUT_TYPE_DATETIME);$(ENABLE_INPUT_TYPE_DATETIMELOCAL);$(ENABLE_INPUT_TYPE_MONTH);$(ENABLE_INPUT_TYPE_TIME);$(ENABLE_INPUT_TYPE_WEEK);$(ENABLE_JAVASCRIPT_DEBUGGER);$(ENABLE_LINK_PREFETCH);$(ENABLE_MATHML);$(ENABLE_METER_TAG);$(ENABLE_MUTATION_OBSERVERS);$(ENABLE_NOTIFICATIONS);$(ENABLE_PAGE_VISIBILITY_API);$(ENABLE_PROGRESS_TAG);$(ENABLE_QUOTA);$(ENABLE_REGISTER_PROTOCOL_HANDLER);$(ENABLE_SHARED_WORKERS);$(ENABLE_SVG);$(ENABLE_SVG_DOM_OBJC_BINDINGS);$(ENABLE_SVG_FONTS);$(ENABLE_VIDEO);$(ENABLE_MEDIA_SOURCE);$(ENABLE_MEDIA_STATISTICS);$(ENABLE_WEB_SOCKETS);$(ENABLE_WEB_TIMING);$(ENABLE_WORKERS);$(ENABLE_XPATH);$(ENABLE_XSLT)"
     12                PreprocessorDefinitions="$(ENABLE_REQUEST_ANIMATION_FRAME);$(ENABLE_3D_CANVAS);$(ENABLE_3D_RENDERING);$(ENABLE_ACCELERATED_2D_CANVAS);$(ENABLE_BLOB);$(ENABLE_CHANNEL_MESSAGING);$(ENABLE_CLIENT_BASED_GEOLOCATION);$(ENABLE_CSS_FILTERS);$(ENABLE_CSS_REGIONS);$(ENABLE_CSS_EXCLUSIONS);$(ENABLE_SQL_DATABASE);$(ENABLE_DATAGRID);$(ENABLE_DATALIST);$(ENABLE_DATA_TRANSFER_ITEMS);$(ENABLE_DETAILS);$(ENABLE_DEVICE_ORIENTATION);$(ENABLE_DIRECTORY_UPLOAD);$(ENABLE_DOM_STORAGE);$(ENABLE_FILTERS);$(ENABLE_FILE_SYSTEM);$(ENABLE_CSS3_FLEXBOX);$(ENABLE_FULLSCREEN_API);$(ENABLE_GAMEPAD);$(ENABLE_GEOLOCATION);$(ENABLE_ICONDATABASE);$(ENABLE_INDEXED_DATABASE);$(ENABLE_INPUT_COLOR);$(ENABLE_INPUT_SPEECH);$(ENABLE_INPUT_TYPE_DATE);$(ENABLE_INPUT_TYPE_DATETIME);$(ENABLE_INPUT_TYPE_DATETIMELOCAL);$(ENABLE_INPUT_TYPE_MONTH);$(ENABLE_INPUT_TYPE_TIME);$(ENABLE_INPUT_TYPE_WEEK);$(ENABLE_JAVASCRIPT_DEBUGGER);$(ENABLE_LINK_PREFETCH);$(ENABLE_MATHML);$(ENABLE_METER_TAG);$(ENABLE_MICRODATA);$(ENABLE_MUTATION_OBSERVERS);$(ENABLE_NOTIFICATIONS);$(ENABLE_PAGE_VISIBILITY_API);$(ENABLE_PROGRESS_TAG);$(ENABLE_QUOTA);$(ENABLE_REGISTER_PROTOCOL_HANDLER);$(ENABLE_SHARED_WORKERS);$(ENABLE_SVG);$(ENABLE_SVG_DOM_OBJC_BINDINGS);$(ENABLE_SVG_FONTS);$(ENABLE_VIDEO);$(ENABLE_MEDIA_SOURCE);$(ENABLE_MEDIA_STATISTICS);$(ENABLE_WEB_SOCKETS);$(ENABLE_WEB_TIMING);$(ENABLE_WORKERS);$(ENABLE_XPATH);$(ENABLE_XSLT)"
    1313        />
    1414  <UserMacro
     
    203203        />
    204204  <UserMacro
     205                Name="ENABLE_MICRODATA"
     206                Value=""
     207                PerformEnvironmentSet="true"
     208        />
     209  <UserMacro
    205210                Name="ENABLE_MUTATION_OBSERVERS"
    206211                Value=""
  • trunk/WebKitLibraries/win/tools/vsprops/FeatureDefinesCairo.vsprops

    r97333 r97471  
    1010  <Tool
    1111                Name="VCCLCompilerTool"
    12                 PreprocessorDefinitions="$(ENABLE_3D_CANVAS);$(ENABLE_3D_RENDERING);$(ENABLE_ACCELERATED_2D_CANVAS);$(ENABLE_BLOB);$(ENABLE_CHANNEL_MESSAGING);$(ENABLE_CLIENT_BASED_GEOLOCATION);$(ENABLE_CSS_FILTERS);$(ENABLE_CSS_REGIONS);$(ENABLE_CSS_EXCLUSIONS);$(ENABLE_SQL_DATABASE);$(ENABLE_DATAGRID);$(ENABLE_DATALIST);$(ENABLE_DATA_TRANSFER_ITEMS);$(ENABLE_DETAILS);$(ENABLE_DEVICE_ORIENTATION);$(ENABLE_DIRECTORY_UPLOAD);$(ENABLE_DOM_STORAGE);$(ENABLE_FILTERS);$(ENABLE_FILE_SYSTEM);$(ENABLE_CSS3_FLEXBOX);$(ENABLE_FULLSCREEN_API);$(ENABLE_GAMEPAD);$(ENABLE_GEOLOCATION);$(ENABLE_ICONDATABASE);$(ENABLE_INDEXED_DATABASE);$(ENABLE_INPUT_COLOR);$(ENABLE_INPUT_SPEECH);$(ENABLE_INPUT_TYPE_DATE);$(ENABLE_INPUT_TYPE_DATETIME);$(ENABLE_INPUT_TYPE_DATETIMELOCAL);$(ENABLE_INPUT_TYPE_MONTH);$(ENABLE_INPUT_TYPE_TIME);$(ENABLE_INPUT_TYPE_WEEK);$(ENABLE_JAVASCRIPT_DEBUGGER);$(ENABLE_LINK_PREFETCH);$(ENABLE_MATHML);$(ENABLE_METER_TAG);$(ENABLE_MUTATION_OBSERVERS);$(ENABLE_NOTIFICATIONS);$(ENABLE_PAGE_VISIBILITY_API);$(ENABLE_PROGRESS_TAG);$(ENABLE_QUOTA);$(ENABLE_REGISTER_PROTOCOL_HANDLER);$(ENABLE_SHARED_WORKERS);$(ENABLE_SVG);$(ENABLE_SVG_DOM_OBJC_BINDINGS);$(ENABLE_SVG_FONTS);$(ENABLE_VIDEO);$(ENABLE_MEDIA_SOURCE);$(ENABLE_MEDIA_STATISTICS);$(ENABLE_WEB_SOCKETS);$(ENABLE_WEB_TIMING);$(ENABLE_WORKERS);$(ENABLE_XPATH);$(ENABLE_XSLT)"
     12                PreprocessorDefinitions="$(ENABLE_3D_CANVAS);$(ENABLE_3D_RENDERING);$(ENABLE_ACCELERATED_2D_CANVAS);$(ENABLE_BLOB);$(ENABLE_CHANNEL_MESSAGING);$(ENABLE_CLIENT_BASED_GEOLOCATION);$(ENABLE_CSS_FILTERS);$(ENABLE_CSS_REGIONS);$(ENABLE_CSS_EXCLUSIONS);$(ENABLE_SQL_DATABASE);$(ENABLE_DATAGRID);$(ENABLE_DATALIST);$(ENABLE_DATA_TRANSFER_ITEMS);$(ENABLE_DETAILS);$(ENABLE_DEVICE_ORIENTATION);$(ENABLE_DIRECTORY_UPLOAD);$(ENABLE_DOM_STORAGE);$(ENABLE_FILTERS);$(ENABLE_FILE_SYSTEM);$(ENABLE_CSS3_FLEXBOX);$(ENABLE_FULLSCREEN_API);$(ENABLE_GAMEPAD);$(ENABLE_GEOLOCATION);$(ENABLE_ICONDATABASE);$(ENABLE_INDEXED_DATABASE);$(ENABLE_INPUT_COLOR);$(ENABLE_INPUT_SPEECH);$(ENABLE_INPUT_TYPE_DATE);$(ENABLE_INPUT_TYPE_DATETIME);$(ENABLE_INPUT_TYPE_DATETIMELOCAL);$(ENABLE_INPUT_TYPE_MONTH);$(ENABLE_INPUT_TYPE_TIME);$(ENABLE_INPUT_TYPE_WEEK);$(ENABLE_JAVASCRIPT_DEBUGGER);$(ENABLE_LINK_PREFETCH);$(ENABLE_MATHML);$(ENABLE_METER_TAG);$(ENABLE_MICRODATA);$(ENABLE_MUTATION_OBSERVERS);$(ENABLE_NOTIFICATIONS);$(ENABLE_PAGE_VISIBILITY_API);$(ENABLE_PROGRESS_TAG);$(ENABLE_QUOTA);$(ENABLE_REGISTER_PROTOCOL_HANDLER);$(ENABLE_SHARED_WORKERS);$(ENABLE_SVG);$(ENABLE_SVG_DOM_OBJC_BINDINGS);$(ENABLE_SVG_FONTS);$(ENABLE_VIDEO);$(ENABLE_MEDIA_SOURCE);$(ENABLE_MEDIA_STATISTICS);$(ENABLE_WEB_SOCKETS);$(ENABLE_WEB_TIMING);$(ENABLE_WORKERS);$(ENABLE_XPATH);$(ENABLE_XSLT)"
    1313        />
    1414  <UserMacro
     
    198198        />
    199199  <UserMacro
     200                Name="ENABLE_MICRODATA"
     201                Value=""
     202                PerformEnvironmentSet="true"
     203        />
     204  <UserMacro
    200205                Name="ENABLE_MUTATION_OBSERVERS"
    201206                Value=""
  • trunk/configure.ac

    r97333 r97471  
    417417              [],[enable_meter_tag="yes"])
    418418AC_MSG_RESULT([$enable_meter_tag])
     419
     420# check whether to enable HTML5 Microdata support
     421AC_MSG_CHECKING([whether to enable HTML5 Microdata support])
     422AC_ARG_ENABLE(microdata,
     423              AC_HELP_STRING([--enable-microdata],
     424                             [enable HTML5 microdata support [default=no]]),
     425              [],[enable_microdata="no"])
     426AC_MSG_RESULT([$enable_microdata])
    419427
    420428# check whether to enable page visibility API.
     
    11381146AM_CONDITIONAL([ENABLE_BLOB],[test "$enable_blob" = "yes"])
    11391147AM_CONDITIONAL([ENABLE_METER_TAG],[test "$enable_meter_tag" = "yes"])
     1148AM_CONDITIONAL([ENABLE_MICRODATA],[test "$enable_microdata" = "yes"])
    11401149AM_CONDITIONAL([ENABLE_PAGE_VISIBILITY_API],[test "$enable_page_visibility_api" = "yes"])
    11411150AM_CONDITIONAL([ENABLE_PROGRESS_TAG],[test "$enable_progress_tag" = "yes"])
     
    12631272 HTML5 channel messaging support                          : $enable_channel_messaging
    12641273 HTML5 meter element support                              : $enable_meter_tag
     1274 HTML5 microdata support                                  : $enable_microdata
    12651275 Page Visibility API support                              : $enable_page_visibility_api
    12661276 HTML5 progress element support                           : $enable_progress_tag
Note: See TracChangeset for help on using the changeset viewer.