Changeset 98353 in webkit
- Timestamp:
- Oct 25, 2011 9:53:52 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r98349 r98353 1 2011-10-25 Arko Saha <arko@motorola.com> 2 3 Microdata: itemtype attribute should be space-separated list to allow multiple types 4 https://bugs.webkit.org/show_bug.cgi?id=70501 5 6 Reviewed by Ryosuke Niwa. 7 8 * fast/dom/MicroData/006.html: 9 * fast/dom/MicroData/007.html: 10 * fast/dom/MicroData/getitems-multiple-itemtypes-expected.txt: Added. 11 * fast/dom/MicroData/getitems-multiple-itemtypes.html: Added. 12 * fast/dom/MicroData/itemtype-add-remove-tokens-expected.txt: Added. 13 * fast/dom/MicroData/itemtype-add-remove-tokens.html: Added. 14 * fast/dom/MicroData/itemtype-attribute-test-expected.txt: Added. 15 * fast/dom/MicroData/itemtype-attribute-test.html: Added. 16 1 17 2011-10-25 Cary Clark <caryclark@google.com> 2 18 -
trunk/LayoutTests/fast/dom/MicroData/006.html
r97471 r98353 8 8 <br>This test also ensure that document.getItems must ignore duplicated tokens. 9 9 </p> 10 <div itemscope itemtype="http://example.com/foo "></div>11 <div itemscope itemtype="http://example.com/bar ">12 <div itemscope itemtype="data:text/plain "></div>10 <div itemscope itemtype="http://example.com/foo http://example.com/bar data:text/plain"></div> 11 <div itemscope itemtype="http://example.com/bar http://example.com/foo"> 12 <div itemscope itemtype="data:text/plain http://example.com/foo"></div> 13 13 </div> 14 14 <div id="console"></div> -
trunk/LayoutTests/fast/dom/MicroData/007.html
r97471 r98353 15 15 <div id="console"></div> 16 16 <script> 17 var nodeList = document.getItems( 'http://example.com/bar data:text/plain, http://example.com/foo');17 var nodeList = document.getItems(); 18 18 19 19 shouldBe("nodeList[0].id", "'one'"); -
trunk/Source/WebCore/ChangeLog
r98350 r98353 1 2011-10-25 Arko Saha <arko@motorola.com> 2 3 Microdata: itemtype attribute should be space-separated list to allow multiple types. 4 https://bugs.webkit.org/show_bug.cgi?id=70501 5 6 Reviewed by Ryosuke Niwa. 7 8 Tests: fast/dom/MicroData/getitems-multiple-itemtypes.html 9 fast/dom/MicroData/itemtype-add-remove-tokens.html 10 fast/dom/MicroData/itemtype-attribute-test.html 11 12 * dom/MicroDataItemList.cpp: 13 (WebCore::MicroDataItemList::nodeMatches): 14 * html/DOMSettableTokenList.h: 15 (WebCore::DOMSettableTokenList::tokens): 16 * html/HTMLElement.cpp: 17 (WebCore::HTMLElement::parseMappedAttribute): 18 (WebCore::HTMLElement::setItemValueText): 19 (WebCore::HTMLElement::itemType): 20 (WebCore::HTMLElement::setItemType): 21 * html/HTMLElement.h: 22 * html/HTMLElement.idl: 23 1 24 2011-10-25 Dan Bernstein <mitz@apple.com> 2 25 -
trunk/Source/WebCore/dom/MicroDataItemList.cpp
r98300 r98353 61 61 return true; 62 62 63 return m_typeNames.contains(testElement->fastGetAttribute(itemtypeAttr));63 return testElement->itemType()->tokens().containsAll(m_typeNames); 64 64 } 65 65 -
trunk/Source/WebCore/html/DOMSettableTokenList.h
r95901 r98353 56 56 57 57 String value() const { return m_value; } 58 const SpaceSplitString& tokens() const { return m_tokens; } 58 59 void setValue(const String&); 59 60 -
trunk/Source/WebCore/html/HTMLElement.cpp
r98300 r98353 208 208 setItemRef(attr->value()); 209 209 } else if (attr->name() == itemtypeAttr) { 210 setItemType(attr->value()); 210 211 itemTypeAttributeChanged(); 211 212 #endif … … 1057 1058 setTextContent(value, ec); 1058 1059 } 1060 1061 PassRefPtr<DOMSettableTokenList> HTMLElement::itemType() const 1062 { 1063 if (!m_itemType) 1064 m_itemType = DOMSettableTokenList::create(); 1065 1066 return m_itemType; 1067 } 1068 1069 void HTMLElement::setItemType(const String& value) 1070 { 1071 if (!m_itemType) 1072 m_itemType = DOMSettableTokenList::create(); 1073 1074 m_itemType->setValue(value); 1075 } 1059 1076 #endif 1060 1077 -
trunk/Source/WebCore/html/HTMLElement.h
r98300 r98353 93 93 PassRefPtr<DOMSettableTokenList> itemRef() const; 94 94 PassRefPtr<DOMSettableTokenList> itemProp() const; 95 PassRefPtr<DOMSettableTokenList> itemType() const; 95 96 96 97 void setItemValue(const String&, ExceptionCode&); … … 128 129 void setItemProp(const String&); 129 130 void setItemRef(const String&); 131 void setItemType(const String&); 130 132 131 133 virtual String itemValueText() const; … … 134 136 mutable RefPtr<DOMSettableTokenList> m_itemProp; 135 137 mutable RefPtr<DOMSettableTokenList> m_itemRef; 138 mutable RefPtr<DOMSettableTokenList> m_itemType; 136 139 #endif 137 140 }; -
trunk/Source/WebCore/html/HTMLElement.idl
r98300 r98353 68 68 69 69 attribute [Conditional=MICRODATA, Reflect] boolean itemScope; 70 attribute [Conditional=MICRODATA, Reflect] DOMStringitemType;70 readonly attribute [Conditional=MICRODATA] DOMSettableTokenList itemType; 71 71 attribute [Conditional=MICRODATA, Reflect] DOMString itemId; 72 72
Note: See TracChangeset
for help on using the changeset viewer.