Changeset 140745 in webkit
- Timestamp:
- Jan 24, 2013 4:00:45 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 8 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r140742 r140745 1 2013-01-24 Arko Saha <arko@motorola.com> 2 3 Microdata: itemtype attribute must update correctly on adding or removing tokens 4 https://bugs.webkit.org/show_bug.cgi?id=106616 5 6 Reviewed by Ryosuke Niwa. 7 8 Added tests to ensure that itemtype, itemprop, itemref attributes must update 9 correctly when tokens have been added or removed. 10 11 * fast/dom/MicroData/microdata-domtokenlist-attribute-add-remove-tokens-expected.txt: Added. 12 * fast/dom/MicroData/microdata-domtokenlist-attribute-add-remove-tokens.html: Added. 13 * fast/dom/MicroData/propertynodelist-add-remove-itemprop-tokens-expected.txt: Added. 14 * fast/dom/MicroData/propertynodelist-add-remove-itemprop-tokens.html: Added. 15 * fast/dom/MicroData/propertynodelist-add-remove-itemref-tokens-expected.txt: Added. 16 * fast/dom/MicroData/propertynodelist-add-remove-itemref-tokens.html: Added. 17 1 18 2013-01-24 Emil A Eklund <eae@chromium.org> 2 19 -
trunk/Source/WebCore/CMakeLists.txt
r140741 r140745 1469 1469 html/MediaDocument.cpp 1470 1470 html/MediaFragmentURIParser.cpp 1471 html/MicroDataAttributeTokenList.cpp 1471 1472 html/MicroDataItemValue.cpp 1472 1473 html/MonthInputType.cpp -
trunk/Source/WebCore/ChangeLog
r140741 r140745 1 2013-01-24 Arko Saha <arko@motorola.com> 2 3 Microdata: itemtype attribute must update correctly on adding or removing tokens 4 https://bugs.webkit.org/show_bug.cgi?id=106616 5 6 Reviewed by Ryosuke Niwa. 7 8 Added a new class MicroDataAttributeTokenList, it overrides setValue() method of 9 DOMSettableTokenList. setValue() is responsible to set the new attribute value for 10 a given element. 11 12 Tests: fast/dom/MicroData/microdata-domtokenlist-attribute-add-remove-tokens.html 13 fast/dom/MicroData/propertynodelist-add-remove-itemprop-tokens.html 14 fast/dom/MicroData/propertynodelist-add-remove-itemref-tokens.html 15 16 * CMakeLists.txt: 17 * GNUmakefile.list.am: 18 * Target.pri: 19 * WebCore.gypi: 20 * WebCore.vcproj/WebCore.vcproj: 21 * WebCore.xcodeproj/project.pbxproj: 22 * dom/Node.cpp: 23 (WebCore::Node::itemProp): 24 (WebCore::Node::setItemProp): 25 (WebCore::Node::itemRef): 26 (WebCore::Node::setItemRef): 27 (WebCore::Node::itemType): 28 (WebCore::Node::setItemType): 29 * dom/NodeRareData.h: 30 (WebCore::NodeMicroDataTokenLists::itemProp): 31 (WebCore::NodeMicroDataTokenLists::itemRef): 32 (WebCore::NodeMicroDataTokenLists::itemType): 33 (NodeMicroDataTokenLists): 34 * html/DOMSettableTokenList.h: Made the constructor as protected, so that we can 35 override setValue() method. 36 (DOMSettableTokenList): 37 * html/MicroDataAttributeTokenList.cpp: Added. 38 (WebCore): 39 (WebCore::MicroDataAttributeTokenList::MicroDataAttributeTokenList): 40 (WebCore::MicroDataAttributeTokenList::setValueInternal): 41 (WebCore::MicroDataAttributeTokenList::setValue): It calls 42 DOMSettableTokenList::setValue to set internal tokens and value. 43 * html/MicroDataAttributeTokenList.h: Added. 44 (WebCore): 45 (MicroDataAttributeTokenList): 46 (WebCore::MicroDataAttributeTokenList::create): 47 1 48 2013-01-24 Joshua Bell <jsbell@chromium.org> 2 49 -
trunk/Source/WebCore/GNUmakefile.list.am
r140741 r140745 3529 3529 Source/WebCore/html/MediaFragmentURIParser.cpp \ 3530 3530 Source/WebCore/html/MediaFragmentURIParser.h \ 3531 Source/WebCore/html/MicroDataAttributeTokenList.cpp \ 3532 Source/WebCore/html/MicroDataAttributeTokenList.h \ 3531 3533 Source/WebCore/html/MicroDataItemValue.cpp \ 3532 3534 Source/WebCore/html/MicroDataItemValue.h \ -
trunk/Source/WebCore/Target.pri
r140683 r140745 681 681 html/LinkRelAttribute.cpp \ 682 682 html/MediaDocument.cpp \ 683 html/MicroDataAttributeTokenList.cpp \ 683 684 html/MicroDataItemValue.cpp \ 684 685 html/MonthInputType.cpp \ … … 1877 1878 html/MediaDocument.h \ 1878 1879 html/MediaFragmentURIParser.h \ 1880 html/MicroDataAttributeTokenList.h \ 1879 1881 html/MicroDataItemValue.h \ 1880 1882 html/PluginDocument.h \ -
trunk/Source/WebCore/WebCore.gypi
r140741 r140745 3217 3217 'html/MediaKeyEvent.cpp', 3218 3218 'html/MediaKeyEvent.h', 3219 'html/MicroDataAttributeTokenList.cpp', 3220 'html/MicroDataAttributeTokenList.h', 3219 3221 'html/MicroDataItemValue.cpp', 3220 3222 'html/MicroDataItemValue.h', -
trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj
r140718 r140745 64591 64591 </File> 64592 64592 <File 64593 RelativePath="..\html\MicroDataAttributeTokenList.cpp" 64594 > 64595 </File> 64596 <File 64597 RelativePath="..\html\MicroDataAttributeTokenList.h" 64598 > 64599 </File> 64600 <File 64593 64601 RelativePath="..\html\MicroDataItemValue.cpp" 64594 64602 > -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r140712 r140745 801 801 2D9F0E1314FF1CBF00BA0FF7 /* linearSRGB.icc in Resources */ = {isa = PBXBuildFile; fileRef = 2D9F0E1214FF1CBF00BA0FF7 /* linearSRGB.icc */; }; 802 802 2DF2E9D5166E39750035BEF2 /* ConsoleAPITypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DF2E9D4166E39740035BEF2 /* ConsoleAPITypes.h */; settings = {ATTRIBUTES = (Private, ); }; }; 803 2E07753116B1BD13004D9936 /* MicroDataAttributeTokenList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2E07753016B1BD13004D9936 /* MicroDataAttributeTokenList.cpp */; }; 804 2E07753416B1BD4C004D9936 /* MicroDataAttributeTokenList.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E07753316B1BD4C004D9936 /* MicroDataAttributeTokenList.h */; }; 803 805 2E0888D41148848A00AF4265 /* JSDOMFormData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2E0888D21148848A00AF4265 /* JSDOMFormData.cpp */; }; 804 806 2E0888D51148848A00AF4265 /* JSDOMFormData.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E0888D31148848A00AF4265 /* JSDOMFormData.h */; }; … … 8078 8080 2D9F0E1214FF1CBF00BA0FF7 /* linearSRGB.icc */ = {isa = PBXFileReference; lastKnownFileType = file; path = linearSRGB.icc; sourceTree = "<group>"; }; 8079 8081 2DF2E9D4166E39740035BEF2 /* ConsoleAPITypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConsoleAPITypes.h; sourceTree = "<group>"; }; 8082 2E07753016B1BD13004D9936 /* MicroDataAttributeTokenList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MicroDataAttributeTokenList.cpp; sourceTree = "<group>"; }; 8083 2E07753316B1BD4C004D9936 /* MicroDataAttributeTokenList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MicroDataAttributeTokenList.h; sourceTree = "<group>"; }; 8080 8084 2E0888C3114883A900AF4265 /* DOMFormData.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DOMFormData.idl; sourceTree = "<group>"; }; 8081 8085 2E0888D21148848A00AF4265 /* JSDOMFormData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMFormData.cpp; sourceTree = "<group>"; }; … … 18112 18116 CDB859F5160D489900E5B07F /* MediaKeyEvent.h */, 18113 18117 CDB859F6160D489900E5B07F /* MediaKeyEvent.idl */, 18118 2E07753016B1BD13004D9936 /* MicroDataAttributeTokenList.cpp */, 18119 2E07753316B1BD4C004D9936 /* MicroDataAttributeTokenList.h */, 18114 18120 9B2F7CF714562120007F8B50 /* MicroDataItemValue.cpp */, 18115 18121 9B2F7CF814562120007F8B50 /* MicroDataItemValue.h */, … … 26272 26278 FB91392616AE4C2F001FE682 /* CanvasPathMethods.h in Headers */, 26273 26279 FB91392A16AE4FC0001FE682 /* JSDOMPath.h in Headers */, 26280 2E07753416B1BD4C004D9936 /* MicroDataAttributeTokenList.h in Headers */, 26274 26281 ); 26275 26282 runOnlyForDeploymentPostprocessing = 0; … … 29422 29429 FB91392716AE4C34001FE682 /* CanvasPathMethods.cpp in Sources */, 29423 29430 FB91392B16AE4FC0001FE682 /* JSDOMPath.cpp in Sources */, 29431 2E07753116B1BD13004D9936 /* MicroDataAttributeTokenList.cpp in Sources */, 29424 29432 ); 29425 29433 runOnlyForDeploymentPostprocessing = 0; -
trunk/Source/WebCore/dom/Node.cpp
r140546 r140745 2529 2529 DOMSettableTokenList* Node::itemProp() 2530 2530 { 2531 return ensureRareData()->ensureMicroDataTokenLists()->itemProp( );2531 return ensureRareData()->ensureMicroDataTokenLists()->itemProp(this); 2532 2532 } 2533 2533 2534 2534 void Node::setItemProp(const String& value) 2535 2535 { 2536 ensureRareData()->ensureMicroDataTokenLists()->itemProp( )->setValue(value);2536 ensureRareData()->ensureMicroDataTokenLists()->itemProp(this)->setValueInternal(value); 2537 2537 } 2538 2538 2539 2539 DOMSettableTokenList* Node::itemRef() 2540 2540 { 2541 return ensureRareData()->ensureMicroDataTokenLists()->itemRef( );2541 return ensureRareData()->ensureMicroDataTokenLists()->itemRef(this); 2542 2542 } 2543 2543 2544 2544 void Node::setItemRef(const String& value) 2545 2545 { 2546 ensureRareData()->ensureMicroDataTokenLists()->itemRef( )->setValue(value);2546 ensureRareData()->ensureMicroDataTokenLists()->itemRef(this)->setValueInternal(value); 2547 2547 } 2548 2548 2549 2549 DOMSettableTokenList* Node::itemType() 2550 2550 { 2551 return ensureRareData()->ensureMicroDataTokenLists()->itemType( );2551 return ensureRareData()->ensureMicroDataTokenLists()->itemType(this); 2552 2552 } 2553 2553 2554 2554 void Node::setItemType(const String& value) 2555 2555 { 2556 ensureRareData()->ensureMicroDataTokenLists()->itemType( )->setValue(value);2556 ensureRareData()->ensureMicroDataTokenLists()->itemType(this)->setValueInternal(value); 2557 2557 } 2558 2558 -
trunk/Source/WebCore/dom/NodeRareData.h
r140700 r140745 25 25 #include "ChildNodeList.h" 26 26 #include "DOMSettableTokenList.h" 27 #include "HTMLNames.h" 27 28 #include "LiveNodeList.h" 28 29 #include "MutationObserver.h" … … 42 43 #if ENABLE(MICRODATA) 43 44 #include "HTMLPropertiesCollection.h" 45 #include "MicroDataAttributeTokenList.h" 44 46 #include "MicroDataItemList.h" 45 47 #endif … … 261 263 static PassOwnPtr<NodeMicroDataTokenLists> create() { return adoptPtr(new NodeMicroDataTokenLists); } 262 264 263 DOMSettableTokenList* itemProp() const265 MicroDataAttributeTokenList* itemProp(Node* node) const 264 266 { 265 267 if (!m_itemProp) 266 m_itemProp = DOMSettableTokenList::create();268 m_itemProp = MicroDataAttributeTokenList::create(toElement(node), HTMLNames::itempropAttr); 267 269 return m_itemProp.get(); 268 270 } 269 271 270 DOMSettableTokenList* itemRef() const272 MicroDataAttributeTokenList* itemRef(Node* node) const 271 273 { 272 274 if (!m_itemRef) 273 m_itemRef = DOMSettableTokenList::create();275 m_itemRef = MicroDataAttributeTokenList::create(toElement(node), HTMLNames::itemrefAttr); 274 276 return m_itemRef.get(); 275 277 } 276 278 277 DOMSettableTokenList* itemType() const279 MicroDataAttributeTokenList* itemType(Node* node) const 278 280 { 279 281 if (!m_itemType) 280 m_itemType = DOMSettableTokenList::create();282 m_itemType = MicroDataAttributeTokenList::create(toElement(node), HTMLNames::itemtypeAttr); 281 283 return m_itemType.get(); 282 284 } … … 285 287 NodeMicroDataTokenLists() { } 286 288 287 mutable RefPtr< DOMSettableTokenList> m_itemProp;288 mutable RefPtr< DOMSettableTokenList> m_itemRef;289 mutable RefPtr< DOMSettableTokenList> m_itemType;289 mutable RefPtr<MicroDataAttributeTokenList> m_itemProp; 290 mutable RefPtr<MicroDataAttributeTokenList> m_itemRef; 291 mutable RefPtr<MicroDataAttributeTokenList> m_itemType; 290 292 }; 291 293 #endif -
trunk/Source/WebCore/html/DOMSettableTokenList.h
r129779 r140745 59 59 const SpaceSplitString& tokens() const { return m_tokens; } 60 60 61 pr ivate:61 protected: 62 62 DOMSettableTokenList(); 63 63 64 private: 64 65 virtual void addInternal(const AtomicString&) OVERRIDE; 65 66 virtual bool containsInternal(const AtomicString&) const OVERRIDE;
Note: See TracChangeset
for help on using the changeset viewer.