Changeset 98300 in webkit
- Timestamp:
- Oct 24, 2011, 5:13:34 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 36 added
- 46 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r98299 r98300 1 2011-10-24 Arko Saha <arko@motorola.com> 2 3 Microdata: Add itemprop, itemref, itemvalue attributes. 4 https://bugs.webkit.org/show_bug.cgi?id=69839 5 6 Reviewed by Ryosuke Niwa. 7 8 Added test-cases for Microdata itemprop, itemref, itemvalue attributes. 9 10 * fast/dom/MicroData/002-expected.txt: 11 * fast/dom/MicroData/002.html: 12 * fast/dom/MicroData/003-expected.txt: 13 * fast/dom/MicroData/003.html: 14 * fast/dom/MicroData/005-expected.txt: 15 * fast/dom/MicroData/005.html: 16 * fast/dom/MicroData/006-expected.txt: 17 * fast/dom/MicroData/009.html: 18 * fast/dom/MicroData/itemprop-add-remove-tokens-expected.txt: Added. 19 * fast/dom/MicroData/itemprop-add-remove-tokens.html: Added. 20 * fast/dom/MicroData/itemprop-for-an-element-must-be-correct-expected.txt: Added. 21 * fast/dom/MicroData/itemprop-for-an-element-must-be-correct.html: Added. 22 * fast/dom/MicroData/itemprop-must-be-read-only-expected.txt: Added. 23 * fast/dom/MicroData/itemprop-must-be-read-only.html: Added. 24 * fast/dom/MicroData/itemprop-reflected-by-itemProp-property-expected.txt: Added. 25 * fast/dom/MicroData/itemprop-reflected-by-itemProp-property.html: Added. 26 * fast/dom/MicroData/itemref-add-remove-tokens-expected.txt: Added. 27 * fast/dom/MicroData/itemref-add-remove-tokens.html: Added. 28 * fast/dom/MicroData/itemref-attribute-reflected-by-itemRef-property-expected.txt: Added. 29 * fast/dom/MicroData/itemref-attribute-reflected-by-itemRef-property.html: Added. 30 * fast/dom/MicroData/itemref-for-an-element-must-be-correct-expected.txt: Added. 31 * fast/dom/MicroData/itemref-for-an-element-must-be-correct.html: Added. 32 * fast/dom/MicroData/itemref-must-be-read-only-expected.txt: Added. 33 * fast/dom/MicroData/itemref-must-be-read-only.html: Added. 34 * fast/dom/MicroData/itemvalue-reflects-data-attr-on-object-element-expected.txt: Added. 35 * fast/dom/MicroData/itemvalue-reflects-data-attr-on-object-element.html: Added. 36 * fast/dom/MicroData/itemvalue-reflects-href-attr-expected.txt: Added. 37 * fast/dom/MicroData/itemvalue-reflects-href-attr.html: Added. 38 * fast/dom/MicroData/itemvalue-reflects-src-attribute-on-img-element-expected.txt: Added. 39 * fast/dom/MicroData/itemvalue-reflects-src-attribute-on-img-element.html: Added. 40 * fast/dom/MicroData/itemvalue-reflects-the-content-attr-on-meta-element-expected.txt: Added. 41 * fast/dom/MicroData/itemvalue-reflects-the-content-attr-on-meta-element.html: Added. 42 * fast/dom/MicroData/itemvalue-reflects-the-src-attr-expected.txt: Added. 43 * fast/dom/MicroData/itemvalue-reflects-the-src-attr.html: Added. 44 * fast/dom/MicroData/itemvalue-returns-element-itself-expected.txt: Added. 45 * fast/dom/MicroData/itemvalue-returns-element-itself.html: Added. 46 * fast/dom/MicroData/itemvalue-returns-null-expected.txt: Added. 47 * fast/dom/MicroData/itemvalue-returns-null.html: Added. 48 * fast/dom/MicroData/itemvalue-throws-excpetion-onsetting-001-expected.txt: Added. 49 * fast/dom/MicroData/itemvalue-throws-excpetion-onsetting-001.html: Added. 50 * fast/dom/MicroData/itemvalue-throws-excpetion-onsetting-002-expected.txt: Added. 51 * fast/dom/MicroData/itemvalue-throws-excpetion-onsetting-002.html: Added. 52 * fast/dom/MicroData/resources/microdata-common.js: 53 (createElement): 54 (runTest): 55 1 56 2011-10-24 Filip Pizlo <fpizlo@apple.com> 2 57 -
trunk/LayoutTests/fast/dom/MicroData/002-expected.txt
r97471 r98300 7 7 document.getItems() with 'http://example.com/bar' itemtype in the aurgument: PASS 8 8 document.getItems() with 'http://example.com/f1' itemtype in the aurgument: PASS 9 Created element of type: div 10 Set attribute: itemscope, value: itemscope 9 11 Newly appended item should be noticed in the NodeList: PASS 10 12 Removing item should be noticed in the NodeList: PASS 13 PASS successfullyParsed is true 11 14 12 15 TEST COMPLETE 16 -
trunk/LayoutTests/fast/dom/MicroData/002.html
r97471 r98300 2 2 <html> 3 3 <head> 4 <script src="../../js/resources/js-test-pre.js"></script> 4 5 <script src="resources/microdata-common.js"></script> 5 6 </head> … … 14 15 <div itemscope itemtype="http://example.com/f1" id="four"></div> 15 16 </div> 16 17 <div id="console"></div> 17 18 <script> 18 19 var one = document.getElementById('one'); … … 27 28 runTest(document.getItems('http://example.com/f1'), [four], "document.getItems() with 'http://example.com/f1' itemtype in the aurgument"); 28 29 29 var element = createElem ('div', {itemscope:'itemscope'});30 var element = createElement('div', {itemscope:'itemscope'}); 30 31 31 32 // Append newly created item to body … … 37 38 runTest(document.getItems(), [one, two, three, four], "Removing item should be noticed in the NodeList"); 38 39 39 document.write("<br>TEST COMPLETE");40 var successfullyParsed = true; 40 41 </script> 42 <script src="../../js/resources/js-test-post.js"></script> 41 43 </body> 42 44 </html> -
trunk/LayoutTests/fast/dom/MicroData/003-expected.txt
r97471 r98300 6 6 Set element.itemScope to false should notice in the NodeList: PASS 7 7 Set element.itemScope to true should notice in the NodeList: PASS 8 PASS successfullyParsed is true 8 9 9 10 TEST COMPLETE 11 -
trunk/LayoutTests/fast/dom/MicroData/003.html
r97471 r98300 2 2 <html> 3 3 <head> 4 <script src="../../js/resources/js-test-pre.js"></script> 4 5 <script src="resources/microdata-common.js"></script> 5 6 </head> … … 8 9 <div itemscope itemtype="http://example.com/foo" id="one"></div> 9 10 <div itemscope itemtype="http://example.com/bar" id="two"></div> 11 <div id="console"></div> 10 12 <script> 11 13 var one = document.getElementById('one'); … … 30 32 runTest(document.getItems(), [one, two], "Set element.itemScope to true should notice in the NodeList"); 31 33 32 document.write("<br>TEST COMPLETE");34 var successfullyParsed = true; 33 35 </script> 36 <script src="../../js/resources/js-test-post.js"></script> 34 37 </body> 35 38 </html> -
trunk/LayoutTests/fast/dom/MicroData/005-expected.txt
r97471 r98300 4 4 NodeList must notice on remove attribute itemtype: PASS 5 5 NodeList must notice on set attribute itemtype: PASS 6 PASS successfullyParsed is true 6 7 7 8 TEST COMPLETE 9 -
trunk/LayoutTests/fast/dom/MicroData/005.html
r97471 r98300 2 2 <html> 3 3 <head> 4 <script src="../../js/resources/js-test-pre.js"></script> 4 5 <script src="resources/microdata-common.js"></script> 5 6 </head> … … 8 9 <div itemscope itemtype="http://example.com/foo" id="one"></div> 9 10 <div itemscope itemtype="http://example.com/foo" id="two"></div> 10 11 <div id="console"></div> 11 12 <script> 12 13 var one = document.getElementById('one'); … … 23 24 runTest(document.getItems('http://example.com/foo'), [one, two], "NodeList must notice on set attribute itemtype"); 24 25 25 document.write("<br>TEST COMPLETE");26 var successfullyParsed = true; 26 27 </script> 28 <script src="../../js/resources/js-test-post.js"></script> 27 29 </body> 28 30 </html> -
trunk/LayoutTests/fast/dom/MicroData/006-expected.txt
r97471 r98300 3 3 4 4 PASS document.getItems(' http://example.com/foo http://example.com/bar ').length == 2 is true 5 PASS document.getItems(' http://example.com/foo data:text/plain').length == 2 is true6 PASS document.getItems(' http://example.com/foo data:text/plainhttp://example.com/foo').length == 2 is true5 PASS document.getItems(' http://example.com/foo data:text/plain ').length == 2 is true 6 PASS document.getItems(' http://example.com/foo data:text/plain http://example.com/foo').length == 2 is true 7 7 PASS successfullyParsed is true 8 8 -
trunk/LayoutTests/fast/dom/MicroData/009.html
r97471 r98300 1 <!DOCTYPE html> 1 2 <html> 2 3 <head> -
trunk/LayoutTests/fast/dom/MicroData/resources/microdata-common.js
r97471 r98300 1 1 // this function creates element with specified property and contents. 2 function createElem (type,props,contents) {2 function createElement(type, props, contents) { 3 3 if (window.layoutTestController) 4 4 layoutTestController.dumpAsText(); 5 5 6 var elem = document.createElement(type);6 var element = document.createElement(type); 7 7 8 for( var i in props ) { 9 if( props.hasOwnProperty(i) ) { 10 elem.setAttribute(i,props[i]); 8 debug('Created element of type: ' + type); 9 for (var i in props) { 10 if (props.hasOwnProperty(i)) { 11 debug('Set attribute: ' + i + ', value: ' + props[i]); 12 element.setAttribute(i,props[i]); 11 13 } 12 14 } 13 if ( contents) {14 elem .innerHTML = contents;15 if (contents) { 16 element.innerHTML = contents; 15 17 } 16 return elem ;18 return element; 17 19 } 18 20 … … 23 25 layoutTestController.dumpAsText(); 24 26 25 document.write(title + ': ');26 27 pass = true; 27 28 28 29 if (collection.length != elements.length) { 29 30 pass = false 30 d ocument.write('FAIL - expected ' + elements.length + ' elements but got ' + collection.length + " elements. ");31 debug('FAIL - expected ' + elements.length + ' elements but got ' + collection.length + " elements. "); 31 32 } 32 33 for(var i = 0, max = collection.length > elements.length ? elements.length : collection.length; i < max; i++) { 33 34 if(collection[i] != elements[i]) { 35 debug(title); 34 36 pass = false 35 d ocument.write('FAIL - expected element : ' + elements[i].tagName + " but got element :" + collection[i].tagName);36 d ocument.write('FAIL - expected element with id: ' + elements[i].id + " but got element with id:" + collection[i].id);37 debug('FAIL - expected element : ' + elements[i].tagName + " but got element :" + collection[i].tagName); 38 debug('FAIL - expected element with id: ' + elements[i].id + " but got element with id:" + collection[i].id); 37 39 } 38 40 } 39 41 if (pass) 40 document.write('PASS'); 41 document.write('<br>'); 42 debug(title + ': PASS'); 42 43 } -
trunk/Source/WebCore/CMakeLists.txt
r98238 r98300 804 804 html/LinkRelAttribute.cpp 805 805 html/MediaDocument.cpp 806 html/MicroDataItemValue.cpp 806 807 html/MonthInputType.cpp 807 808 html/NumberInputType.cpp -
trunk/Source/WebCore/ChangeLog
r98295 r98300 1 2011-10-24 Arko Saha <arko@motorola.com> 2 3 Microdata: Add itemprop, itemref, itemvalue attributes. 4 https://bugs.webkit.org/show_bug.cgi?id=69839 5 6 Reviewed by Ryosuke Niwa. 7 8 Tests: fast/dom/MicroData/itemprop-add-remove-tokens.html 9 fast/dom/MicroData/itemprop-for-an-element-must-be-correct.html 10 fast/dom/MicroData/itemprop-must-be-read-only.html 11 fast/dom/MicroData/itemprop-reflected-by-itemProp-property.html 12 fast/dom/MicroData/itemref-add-remove-tokens.html 13 fast/dom/MicroData/itemref-attribute-reflected-by-itemRef-property.html 14 fast/dom/MicroData/itemref-for-an-element-must-be-correct.html 15 fast/dom/MicroData/itemref-must-be-read-only.html 16 fast/dom/MicroData/itemvalue-reflects-data-attr-on-object-element.html 17 fast/dom/MicroData/itemvalue-reflects-href-attr.html 18 fast/dom/MicroData/itemvalue-reflects-src-attribute-on-img-element.html 19 fast/dom/MicroData/itemvalue-reflects-the-content-attr-on-meta-element.html 20 fast/dom/MicroData/itemvalue-reflects-the-src-attr.html 21 fast/dom/MicroData/itemvalue-returns-element-itself.html 22 fast/dom/MicroData/itemvalue-returns-null.html 23 fast/dom/MicroData/itemvalue-throws-excpetion-onsetting-001.html 24 fast/dom/MicroData/itemvalue-throws-excpetion-onsetting-002.html 25 26 * CMakeLists.txt: 27 * GNUmakefile.list.am: 28 * WebCore.gypi: 29 * WebCore.pro: 30 * WebCore.vcproj/WebCore.vcproj: 31 * bindings/js/JSHTMLElementCustom.cpp: 32 (WebCore::toJS): 33 (WebCore::JSHTMLElement::itemValue): 34 (WebCore::JSHTMLElement::setItemValue): 35 * bindings/v8/custom/V8HTMLElementCustom.cpp: 36 (WebCore::toV8Object): 37 (WebCore::V8HTMLElement::itemValueAccessorGetter): 38 (WebCore::V8HTMLElement::itemValueAccessorSetter): 39 * dom/MicroDataItemList.cpp: 40 * html/HTMLAnchorElement.cpp: 41 (WebCore::HTMLAnchorElement::itemValueText): 42 (WebCore::HTMLAnchorElement::setItemValueText): 43 * html/HTMLAnchorElement.h: 44 * html/HTMLAreaElement.cpp: 45 (WebCore::HTMLAreaElement::itemValueText): 46 (WebCore::HTMLAreaElement::setItemValueText): 47 * html/HTMLAreaElement.h: 48 * html/HTMLAttributeNames.in: 49 * html/HTMLElement.cpp: 50 (WebCore::HTMLElement::parseMappedAttribute): 51 (WebCore::HTMLElement::itemProp): Returns element's itemprop content attribute. 52 (WebCore::HTMLElement::setItemProp): Sets itemprop value on changing elemet's 53 itemprop attribute. 54 (WebCore::HTMLElement::itemRef): Returns element's itemref content attribute. 55 (WebCore::HTMLElement::setItemRef): Sets itemref value on changing elemet's 56 itemref attribute. 57 (WebCore::HTMLElement::setItemValue): Sets element's itemvalue. If the element has no 58 itemprop attribute or if element has an itemscope attribute, it throws INVALID_ACCESS_ERR 59 exception. 60 (WebCore::HTMLElement::itemValue): Returns the elements itemvalue. 61 62 If the element has no itemprop attribute it returns null. 63 If the element has an itemscope attribute, it returns the element itself. 64 If the element is a meta element: It acts as it would if it was reflecting the element's 65 content content attribute. 66 If the element is an audio, embed, iframe, img, source, track, or video element: It acts 67 as it would if it was reflecting the element's src content attribute. 68 If the element is an a, area, or link element: It act as it would if it was reflecting the 69 href content attribute. 70 If the element is an object element: It acts as it would if it was reflecting the element's 71 data content attribute. 72 73 (WebCore::HTMLElement::itemValueText): 74 (WebCore::HTMLElement::setItemValueText): 75 * html/HTMLElement.h: 76 * html/HTMLElement.idl: 77 * html/HTMLEmbedElement.cpp: 78 (WebCore::HTMLEmbedElement::itemValueText): 79 (WebCore::HTMLEmbedElement::setItemValueText): 80 * html/HTMLEmbedElement.h: 81 * html/HTMLIFrameElement.cpp: 82 (WebCore::HTMLIFrameElement::itemValueText): 83 (WebCore::HTMLIFrameElement::setItemValueText): 84 * html/HTMLIFrameElement.h: 85 * html/HTMLImageElement.cpp: 86 (WebCore::HTMLImageElement::itemValueText): 87 (WebCore::HTMLImageElement::setItemValueText): 88 * html/HTMLImageElement.h: 89 * html/HTMLLinkElement.cpp: 90 (WebCore::HTMLLinkElement::itemValueText): 91 (WebCore::HTMLLinkElement::setItemValueText): 92 * html/HTMLLinkElement.h: 93 * html/HTMLMediaElement.cpp: 94 (WebCore::HTMLMediaElement::itemValueText): 95 (WebCore::HTMLMediaElement::setItemValueText): 96 * html/HTMLMediaElement.h: 97 * html/HTMLMetaElement.cpp: 98 (WebCore::HTMLMetaElement::itemValueText): 99 (WebCore::HTMLMetaElement::setItemValueText): 100 * html/HTMLMetaElement.h: 101 * html/HTMLObjectElement.cpp: 102 (WebCore::HTMLObjectElement::itemValueText): 103 (WebCore::HTMLObjectElement::setItemValueText): 104 * html/HTMLObjectElement.h: 105 * html/HTMLSourceElement.cpp: 106 (WebCore::HTMLSourceElement::itemValueText): 107 (WebCore::HTMLSourceElement::setItemValueText): 108 * html/HTMLSourceElement.h: 109 * html/HTMLTrackElement.cpp: 110 (WebCore::HTMLTrackElement::itemValueText): 111 (WebCore::HTMLTrackElement::setItemValueText): 112 * html/HTMLTrackElement.h: 113 * html/MicroDataItemValue.cpp: Added. 114 (WebCore::MicroDataItemValue::MicroDataItemValue): 115 (WebCore::MicroDataItemValue::createFromString): 116 (WebCore::MicroDataItemValue::createFromNode): 117 * html/MicroDataItemValue.h: Added. 118 (WebCore::MicroDataItemValue::isNode): 119 (WebCore::MicroDataItemValue::getNode): 120 (WebCore::MicroDataItemValue::getString): 121 1 122 2011-10-24 Joseph Pecoraro <joepeck@webkit.org> 2 123 -
trunk/Source/WebCore/GNUmakefile.list.am
r98250 r98300 1853 1853 Source/WebCore/html/MediaDocument.h \ 1854 1854 Source/WebCore/html/MediaError.h \ 1855 Source/WebCore/html/MicroDataItemValue.cpp \ 1856 Source/WebCore/html/MicroDataItemValue.h \ 1855 1857 Source/WebCore/html/MonthInputType.cpp \ 1856 1858 Source/WebCore/html/MonthInputType.h \ -
trunk/Source/WebCore/WebCore.gypi
r98238 r98300 5558 5558 'html/MediaDocument.h', 5559 5559 'html/MediaError.h', 5560 'html/MicroDataItemValue.cpp', 5561 'html/MicroDataItemValue.h', 5562 'html/MutableTextTrack.cpp', 5563 'html/MutableTextTrack.h', 5560 5564 'html/MonthInputType.cpp', 5561 5565 'html/MonthInputType.h', -
trunk/Source/WebCore/WebCore.pro
r98238 r98300 759 759 html/LinkRelAttribute.cpp \ 760 760 html/MediaDocument.cpp \ 761 html/MicroDataItemValue.cpp \ 761 762 html/MonthInputType.cpp \ 762 763 html/NumberInputType.cpp \ … … 1811 1812 html/LoadableTextTrack.h \ 1812 1813 html/MediaDocument.h \ 1814 html/MicroDataItemValue.h \ 1815 html/MutableTextTrack.h \ 1813 1816 html/PluginDocument.h \ 1814 1817 html/StepRange.h \ -
trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj
r98228 r98300 57407 57407 </File> 57408 57408 <File 57409 RelativePath="..\html\MicroDataItemValue.cpp" 57410 > 57411 </File> 57412 <File 57413 RelativePath="..\html\MicroDataItemValue.h" 57414 > 57415 </File> 57416 <File 57409 57417 RelativePath="..\fileapi\Metadata.h" 57410 57418 > -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r98238 r98300 1294 1294 4ACBC0BF12713CBD0094F9B2 /* ClassList.h in Headers */ = {isa = PBXBuildFile; fileRef = 4ACBC0BD12713CBD0094F9B2 /* ClassList.h */; }; 1295 1295 4ACBC0C312713CCA0094F9B2 /* DOMSettableTokenList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4ACBC0C012713CCA0094F9B2 /* DOMSettableTokenList.cpp */; }; 1296 4ACBC0C412713CCA0094F9B2 /* DOMSettableTokenList.h in Headers */ = {isa = PBXBuildFile; fileRef = 4ACBC0C112713CCA0094F9B2 /* DOMSettableTokenList.h */; };1296 4ACBC0C412713CCA0094F9B2 /* DOMSettableTokenList.h in Headers */ = {isa = PBXBuildFile; fileRef = 4ACBC0C112713CCA0094F9B2 /* DOMSettableTokenList.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1297 1297 4ACBC0CA12713D0A0094F9B2 /* JSDOMSettableTokenList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4ACBC0C812713D0A0094F9B2 /* JSDOMSettableTokenList.cpp */; }; 1298 1298 4ACBC0CB12713D0A0094F9B2 /* JSDOMSettableTokenList.h in Headers */ = {isa = PBXBuildFile; fileRef = 4ACBC0C912713D0A0094F9B2 /* JSDOMSettableTokenList.h */; }; … … 3300 3300 9B375EDA14478A0100F3CAE5 /* MicroDataItemList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9B375ED814478A0100F3CAE5 /* MicroDataItemList.cpp */; }; 3301 3301 9B375EDB14478A0100F3CAE5 /* MicroDataItemList.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B375ED914478A0100F3CAE5 /* MicroDataItemList.h */; }; 3302 9B3A8872145632F9003AE8F5 /* DOMDOMSettableTokenList.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B3A8871145632F9003AE8F5 /* DOMDOMSettableTokenList.h */; }; 3302 3303 9B417064125662B3006B28FC /* ApplyBlockElementCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B417062125662B3006B28FC /* ApplyBlockElementCommand.h */; settings = {ATTRIBUTES = (Private, ); }; }; 3303 3304 9B417065125662B3006B28FC /* ApplyBlockElementCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9B417063125662B3006B28FC /* ApplyBlockElementCommand.cpp */; }; … … 10426 10427 9B0FB18F140DB5790022588F /* HTTPValidation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTTPValidation.cpp; sourceTree = "<group>"; }; 10427 10428 9B0FB190140DB5790022588F /* HTTPValidation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTTPValidation.h; sourceTree = "<group>"; }; 10429 9B2F7CF714562120007F8B50 /* MicroDataItemValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MicroDataItemValue.cpp; sourceTree = "<group>"; }; 10430 9B2F7CF814562120007F8B50 /* MicroDataItemValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MicroDataItemValue.h; sourceTree = "<group>"; }; 10428 10431 9B32CDA713DF7FA900F34D13 /* RenderedPosition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderedPosition.h; sourceTree = "<group>"; }; 10429 10432 9B32CDA813DF7FA900F34D13 /* RenderedPosition.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderedPosition.cpp; sourceTree = "<group>"; }; 10430 10433 9B375ED814478A0100F3CAE5 /* MicroDataItemList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MicroDataItemList.cpp; sourceTree = "<group>"; }; 10431 10434 9B375ED914478A0100F3CAE5 /* MicroDataItemList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MicroDataItemList.h; sourceTree = "<group>"; }; 10435 9B3A8871145632F9003AE8F5 /* DOMDOMSettableTokenList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMDOMSettableTokenList.h; sourceTree = "<group>"; }; 10432 10436 9B417062125662B3006B28FC /* ApplyBlockElementCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ApplyBlockElementCommand.h; sourceTree = "<group>"; }; 10433 10437 9B417063125662B3006B28FC /* ApplyBlockElementCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ApplyBlockElementCommand.cpp; sourceTree = "<group>"; }; … … 15128 15132 isa = PBXGroup; 15129 15133 children = ( 15130 1A1414B313A0F0500019996C /* WebKitFontFamilyNames.cpp */,15131 1A1414B413A0F0500019996C /* WebKitFontFamilyNames.h */,15132 15134 656581AC09D14EE6000E61D7 /* CharsetData.cpp */, 15133 15135 E406F3FB1198307D009D59D6 /* ColorData.cpp */, … … 15140 15142 6565814709D13043000E61D7 /* CSSValueKeywords.gperf */, 15141 15143 6565814809D13043000E61D7 /* CSSValueKeywords.h */, 15144 9B3A8871145632F9003AE8F5 /* DOMDOMSettableTokenList.h */, 15142 15145 9766504E144FBFFE00F6BB51 /* EventFactory.cpp */, 15143 15146 970B72A5145008EB00F00A37 /* EventHeaders.h */, … … 15163 15166 656581AE09D14EE6000E61D7 /* UserAgentStyleSheets.h */, 15164 15167 656581AF09D14EE6000E61D7 /* UserAgentStyleSheetsData.cpp */, 15168 1A1414B313A0F0500019996C /* WebKitFontFamilyNames.cpp */, 15169 1A1414B413A0F0500019996C /* WebKitFontFamilyNames.h */, 15165 15170 656581EA09D1508D000E61D7 /* XLinkNames.cpp */, 15166 15171 656581EB09D1508D000E61D7 /* XLinkNames.h */, … … 17209 17214 E446139B0CD6331000FADA75 /* MediaError.h */, 17210 17215 E446139C0CD6331000FADA75 /* MediaError.idl */, 17216 9B2F7CF714562120007F8B50 /* MicroDataItemValue.cpp */, 17217 9B2F7CF814562120007F8B50 /* MicroDataItemValue.h */, 17211 17218 F55B3D911251F12D003EF269 /* MonthInputType.cpp */, 17212 17219 F55B3D921251F12D003EF269 /* MonthInputType.h */, … … 24475 24482 970B728A144FFAC600F00A37 /* EventInterfaces.h in Headers */, 24476 24483 970B72A6145008EB00F00A37 /* EventHeaders.h in Headers */, 24484 9B3A8872145632F9003AE8F5 /* DOMDOMSettableTokenList.h in Headers */, 24477 24485 ); 24478 24486 runOnlyForDeploymentPostprocessing = 0; -
trunk/Source/WebCore/bindings/js/JSHTMLElementCustom.cpp
r79904 r98300 30 30 #include "HTMLFormElement.h" 31 31 32 #if ENABLE(MICRODATA) 33 #include "MicroDataItemValue.h" 34 #endif 35 32 36 namespace WebCore { 33 37 34 38 using namespace JSC; 39 40 #if ENABLE(MICRODATA) 41 static JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, MicroDataItemValue* itemValue) 42 { 43 if (!itemValue) 44 return jsNull(); 45 if (itemValue->isNode()) 46 return toJS(exec, globalObject, itemValue->getNode()); 47 return jsString(exec, itemValue->getString()); 48 } 49 #endif 35 50 36 51 ScopeChainNode* JSHTMLElement::pushEventHandlerScope(ExecState* exec, ScopeChainNode* scope) const … … 49 64 } 50 65 66 #if ENABLE(MICRODATA) 67 JSValue JSHTMLElement::itemValue(ExecState* exec) const 68 { 69 HTMLElement* element = impl(); 70 return toJS(exec, globalObject(), WTF::getPtr(element->itemValue())); 71 } 72 73 void JSHTMLElement::setItemValue(ExecState* exec, JSValue value) 74 { 75 HTMLElement* imp = impl(); 76 ExceptionCode ec = 0; 77 imp->setItemValue(valueToStringWithNullCheck(exec, value), ec); 78 setDOMException(exec, ec); 79 } 80 #endif 81 51 82 } // namespace WebCore -
trunk/Source/WebCore/bindings/v8/custom/V8HTMLElementCustom.cpp
r95901 r98300 34 34 #include "V8HTMLElementWrapperFactory.h" 35 35 36 #if ENABLE(MICRODATA) 37 #include "MicroDataItemValue.h" 38 #include "V8Binding.h" 39 #endif 40 36 41 namespace WebCore { 42 43 #if ENABLE(MICRODATA) 44 static v8::Handle<v8::Value> toV8Object(MicroDataItemValue* itemValue) 45 { 46 if (!itemValue) 47 return v8::Null(); 48 49 if (itemValue->isNode()) 50 return toV8(itemValue->getNode()); 51 52 return v8String(itemValue->getString()); 53 } 54 #endif 37 55 38 56 v8::Handle<v8::Value> toV8(HTMLElement* impl, bool forceNewObject) … … 43 61 } 44 62 63 #if ENABLE(MICRODATA) 64 v8::Handle<v8::Value> V8HTMLElement::itemValueAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) 65 { 66 HTMLElement* impl = V8HTMLElement::toNative(info.Holder()); 67 return toV8Object(impl->itemValue().get()); 68 } 69 70 void V8HTMLElement::itemValueAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) 71 { 72 HTMLElement* impl = V8HTMLElement::toNative(info.Holder()); 73 ExceptionCode ec = 0; 74 impl->setItemValue(toWebCoreString(value), ec); 75 if (ec) 76 V8Proxy::setDOMException(ec); 77 } 78 #endif 79 45 80 } // namespace WebCore -
trunk/Source/WebCore/dom/MicroDataItemList.cpp
r97551 r98300 33 33 #include "HTMLNames.h" 34 34 35 namespace WebCore { 36 35 37 using namespace HTMLNames; 36 37 namespace WebCore {38 38 39 39 MicroDataItemList::MicroDataItemList(PassRefPtr<Node> rootNode, const String& typeNames) -
trunk/Source/WebCore/html/HTMLAnchorElement.cpp
r94427 r98300 587 587 } 588 588 589 } 589 #if ENABLE(MICRODATA) 590 String HTMLAnchorElement::itemValueText() const 591 { 592 return getURLAttribute(hrefAttr); 593 } 594 595 void HTMLAnchorElement::setItemValueText(const String& value, ExceptionCode& ec) 596 { 597 setAttribute(hrefAttr, value, ec); 598 } 599 #endif 600 601 } -
trunk/Source/WebCore/html/HTMLAnchorElement.h
r96352 r98300 126 126 bool treatLinkAsLiveForEventType(EventType) const; 127 127 128 #if ENABLE(MICRODATA) 129 virtual String itemValueText() const OVERRIDE; 130 virtual void setItemValueText(const String&, ExceptionCode&) OVERRIDE; 131 #endif 132 128 133 RefPtr<Element> m_rootEditableElementForSelectionOnMouseDown; 129 134 bool m_wasShiftKeyDownOnMouseDown : 1; -
trunk/Source/WebCore/html/HTMLAreaElement.cpp
r94427 r98300 247 247 } 248 248 249 } 249 #if ENABLE(MICRODATA) 250 String HTMLAreaElement::itemValueText() const 251 { 252 return getURLAttribute(hrefAttr); 253 } 254 255 void HTMLAreaElement::setItemValueText(const String& value, ExceptionCode& ec) 256 { 257 setAttribute(hrefAttr, value, ec); 258 } 259 #endif 260 261 } -
trunk/Source/WebCore/html/HTMLAreaElement.h
r93279 r98300 59 59 virtual void updateFocusAppearance(bool /*restorePreviousSelection*/); 60 60 virtual void setFocus(bool); 61 61 62 #if ENABLE(MICRODATA) 63 virtual String itemValueText() const OVERRIDE; 64 virtual void setItemValueText(const String&, ExceptionCode&) OVERRIDE; 65 #endif 66 62 67 enum Shape { Default, Poly, Rect, Circle, Unknown }; 63 68 Path getRegion(const LayoutSize&) const; -
trunk/Source/WebCore/html/HTMLAttributeNames.in
r97471 r98300 124 124 itemid 125 125 itemprop 126 itemref 126 127 itemscope 127 128 itemtype -
trunk/Source/WebCore/html/HTMLElement.cpp
r98192 r98300 4 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 5 5 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/) 6 * Copyright (C) 2011 Motorola Mobility. All rights reserved. 6 7 * 7 8 * This library is free software; you can redistribute it and/or … … 51 52 #include <wtf/StdLibExtras.h> 52 53 #include <wtf/text/CString.h> 54 55 #if ENABLE(MICRODATA) 56 #include "MicroDataItemValue.h" 57 #endif 53 58 54 59 namespace WebCore { … … 198 203 addCSSProperty(attr, CSSPropertyWebkitUserDrag, CSSValueNone); 199 204 #if ENABLE(MICRODATA) 205 } else if (attr->name() == itempropAttr) { 206 setItemProp(attr->value()); 207 } else if (attr->name() == itemrefAttr) { 208 setItemRef(attr->value()); 200 209 } else if (attr->name() == itemtypeAttr) { 201 210 itemTypeAttributeChanged(); … … 985 994 } 986 995 996 #if ENABLE(MICRODATA) 997 PassRefPtr<DOMSettableTokenList> HTMLElement::itemProp() const 998 { 999 if (!m_itemProp) 1000 m_itemProp = DOMSettableTokenList::create(); 1001 1002 return m_itemProp; 1003 } 1004 1005 void HTMLElement::setItemProp(const String& value) 1006 { 1007 if (!m_itemProp) 1008 m_itemProp = DOMSettableTokenList::create(); 1009 1010 m_itemProp->setValue(value); 1011 } 1012 1013 PassRefPtr<DOMSettableTokenList> HTMLElement::itemRef() const 1014 { 1015 if (!m_itemRef) 1016 m_itemRef = DOMSettableTokenList::create(); 1017 1018 return m_itemRef; 1019 } 1020 1021 void HTMLElement::setItemRef(const String& value) 1022 { 1023 if (!m_itemRef) 1024 m_itemRef = DOMSettableTokenList::create(); 1025 1026 m_itemRef->setValue(value); 1027 } 1028 1029 void HTMLElement::setItemValue(const String& value, ExceptionCode& ec) 1030 { 1031 if (!hasAttribute(itempropAttr) || hasAttribute(itemscopeAttr)) { 1032 ec = INVALID_ACCESS_ERR; 1033 return; 1034 } 1035 1036 setItemValueText(value, ec); 1037 } 1038 1039 PassRefPtr<MicroDataItemValue> HTMLElement::itemValue() const 1040 { 1041 if (!hasAttribute(itempropAttr)) 1042 return 0; 1043 1044 if (hasAttribute(itemscopeAttr)) 1045 return MicroDataItemValue::createFromNode(const_cast<HTMLElement* const>(this)); 1046 1047 return MicroDataItemValue::createFromString(itemValueText()); 1048 } 1049 1050 String HTMLElement::itemValueText() const 1051 { 1052 return textContent(true); 1053 } 1054 1055 void HTMLElement::setItemValueText(const String& value, ExceptionCode& ec) 1056 { 1057 setTextContent(value, ec); 1058 } 1059 #endif 1060 987 1061 } // namespace WebCore 988 1062 -
trunk/Source/WebCore/html/HTMLElement.h
r97551 r98300 26 26 #include "StyledElement.h" 27 27 28 #if ENABLE(MICRODATA) 29 #include "DOMSettableTokenList.h" 30 #endif 31 28 32 namespace WebCore { 29 33 … … 31 35 class HTMLCollection; 32 36 class HTMLFormElement; 33 37 38 #if ENABLE(MICRODATA) 39 class MicroDataItemValue; 40 #endif 41 34 42 class HTMLElement : public StyledElement { 35 43 public: … … 82 90 TextDirection directionalityIfhasDirAutoAttribute(bool& isAuto) const; 83 91 92 #if ENABLE(MICRODATA) 93 PassRefPtr<DOMSettableTokenList> itemRef() const; 94 PassRefPtr<DOMSettableTokenList> itemProp() const; 95 96 void setItemValue(const String&, ExceptionCode&); 97 PassRefPtr<MicroDataItemValue> itemValue() const; 98 #endif 99 84 100 protected: 85 101 HTMLElement(const QualifiedName& tagName, Document*); … … 108 124 void adjustDirectionalityIfNeededAfterChildrenChanged(Node* beforeChange, int childCountDelta); 109 125 TextDirection directionality(Node** strongDirectionalityTextNode= 0) const; 126 127 #if ENABLE(MICRODATA) 128 void setItemProp(const String&); 129 void setItemRef(const String&); 130 131 virtual String itemValueText() const; 132 virtual void setItemValueText(const String&, ExceptionCode&); 133 134 mutable RefPtr<DOMSettableTokenList> m_itemProp; 135 mutable RefPtr<DOMSettableTokenList> m_itemRef; 136 #endif 110 137 }; 111 138 -
trunk/Source/WebCore/html/HTMLElement.idl
r97471 r98300 71 71 attribute [Conditional=MICRODATA, Reflect] DOMString itemId; 72 72 73 readonly attribute [Conditional=MICRODATA] DOMSettableTokenList itemRef; 74 readonly attribute [Conditional=MICRODATA] DOMSettableTokenList itemProp; 75 76 #if !defined(LANGUAGE_CPP) || !LANGUAGE_CPP 77 #if !defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C 78 attribute [Conditional=MICRODATA, Custom] DOMObject itemValue 79 setter raises(DOMException); 80 #endif 81 #endif 82 73 83 #if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C 74 84 readonly attribute DOMString titleDisplayString; -
trunk/Source/WebCore/html/HTMLEmbedElement.cpp
r95204 r98300 278 278 } 279 279 280 } 280 #if ENABLE(MICRODATA) 281 String HTMLEmbedElement::itemValueText() const 282 { 283 return getURLAttribute(srcAttr); 284 } 285 286 void HTMLEmbedElement::setItemValueText(const String& value, ExceptionCode& ec) 287 { 288 setAttribute(srcAttr, value, ec); 289 } 290 #endif 291 292 } -
trunk/Source/WebCore/html/HTMLEmbedElement.h
r91404 r98300 53 53 54 54 void parametersForPlugin(Vector<String>& paramNames, Vector<String>& paramValues); 55 56 #if ENABLE(MICRODATA) 57 virtual String itemValueText() const OVERRIDE; 58 virtual void setItemValueText(const String&, ExceptionCode&) OVERRIDE; 59 #endif 55 60 }; 56 61 -
trunk/Source/WebCore/html/HTMLIFrameElement.cpp
r87125 r98300 164 164 } 165 165 166 #if ENABLE(MICRODATA) 167 String HTMLIFrameElement::itemValueText() const 168 { 169 return getURLAttribute(srcAttr); 166 170 } 171 172 void HTMLIFrameElement::setItemValueText(const String& value, ExceptionCode& ec) 173 { 174 setAttribute(srcAttr, value, ec); 175 } 176 #endif 177 178 } -
trunk/Source/WebCore/html/HTMLIFrameElement.h
r87125 r98300 47 47 virtual bool isURLAttribute(Attribute*) const; 48 48 49 #if ENABLE(MICRODATA) 50 virtual String itemValueText() const OVERRIDE; 51 virtual void setItemValueText(const String&, ExceptionCode&) OVERRIDE; 52 #endif 53 49 54 AtomicString m_name; 50 55 }; -
trunk/Source/WebCore/html/HTMLImageElement.cpp
r97448 r98300 404 404 } 405 405 406 } 406 #if ENABLE(MICRODATA) 407 String HTMLImageElement::itemValueText() const 408 { 409 return getURLAttribute(srcAttr); 410 } 411 412 void HTMLImageElement::setItemValueText(const String& value, ExceptionCode& ec) 413 { 414 setAttribute(srcAttr, value, ec); 415 } 416 #endif 417 418 } -
trunk/Source/WebCore/html/HTMLImageElement.h
r94074 r98300 103 103 virtual void removedFromTree(bool deep); 104 104 105 #if ENABLE(MICRODATA) 106 virtual String itemValueText() const OVERRIDE; 107 virtual void setItemValueText(const String&, ExceptionCode&) OVERRIDE; 108 #endif 109 105 110 HTMLImageLoader m_imageLoader; 106 111 HTMLFormElement* m_form; -
trunk/Source/WebCore/html/HTMLLinkElement.cpp
r98208 r98300 449 449 } 450 450 451 #if ENABLE(MICRODATA) 452 String HTMLLinkElement::itemValueText() const 453 { 454 return getURLAttribute(hrefAttr); 455 } 456 457 void HTMLLinkElement::setItemValueText(const String& value, ExceptionCode& ec) 458 { 459 setAttribute(hrefAttr, value, ec); 460 } 461 #endif 462 451 463 } // namespace WebCore -
trunk/Source/WebCore/html/HTMLLinkElement.h
r98106 r98300 95 95 void removePendingSheet(); 96 96 97 #if ENABLE(MICRODATA) 98 virtual String itemValueText() const OVERRIDE; 99 virtual void setItemValueText(const String&, ExceptionCode&) OVERRIDE; 100 #endif 101 97 102 private: 98 103 HTMLLinkElement(const QualifiedName&, Document*, bool createdByParser); -
trunk/Source/WebCore/html/HTMLMediaElement.cpp
r98238 r98300 3069 3069 #endif 3070 3070 3071 } 3072 3073 #endif 3071 #if ENABLE(MICRODATA) 3072 String HTMLMediaElement::itemValueText() const 3073 { 3074 return getURLAttribute(srcAttr); 3075 } 3076 3077 void HTMLMediaElement::setItemValueText(const String& value, ExceptionCode& ec) 3078 { 3079 setAttribute(srcAttr, value, ec); 3080 } 3081 #endif 3082 3083 } 3084 3085 #endif -
trunk/Source/WebCore/html/HTMLMediaElement.h
r98238 r98300 403 403 virtual void* preDispatchEventHandler(Event*); 404 404 405 #if ENABLE(MICRODATA) 406 virtual String itemValueText() const; 407 virtual void setItemValueText(const String&, ExceptionCode&); 408 #endif 409 405 410 Timer<HTMLMediaElement> m_loadTimer; 406 411 Timer<HTMLMediaElement> m_asyncEventTimer; -
trunk/Source/WebCore/html/HTMLMetaElement.cpp
r94427 r98300 95 95 } 96 96 97 #if ENABLE(MICRODATA) 98 String HTMLMetaElement::itemValueText() const 99 { 100 return getAttribute(contentAttr); 97 101 } 102 103 void HTMLMetaElement::setItemValueText(const String& value, ExceptionCode& ec) 104 { 105 setAttribute(contentAttr, value, ec); 106 } 107 #endif 108 109 } -
trunk/Source/WebCore/html/HTMLMetaElement.h
r93884 r98300 43 43 44 44 void process(); 45 46 #if ENABLE(MICRODATA) 47 virtual String itemValueText() const OVERRIDE; 48 virtual void setItemValueText(const String&, ExceptionCode&) OVERRIDE; 49 #endif 50 45 51 }; 46 52 -
trunk/Source/WebCore/html/HTMLObjectElement.cpp
r95204 r98300 555 555 } 556 556 557 } 557 #if ENABLE(MICRODATA) 558 String HTMLObjectElement::itemValueText() const 559 { 560 return getURLAttribute(dataAttr); 561 } 562 563 void HTMLObjectElement::setItemValueText(const String& value, ExceptionCode& ec) 564 { 565 setAttribute(dataAttr, value, ec); 566 } 567 #endif 568 569 } -
trunk/Source/WebCore/html/HTMLObjectElement.h
r93292 r98300 103 103 virtual const AtomicString& formControlName() const; 104 104 105 #if ENABLE(MICRODATA) 106 virtual String itemValueText() const OVERRIDE; 107 virtual void setItemValueText(const String&, ExceptionCode&) OVERRIDE; 108 #endif 109 105 110 AtomicString m_id; 106 111 String m_classId; -
trunk/Source/WebCore/html/HTMLSourceElement.cpp
r94427 r98300 122 122 } 123 123 124 #if ENABLE(MICRODATA) 125 String HTMLSourceElement::itemValueText() const 126 { 127 return getURLAttribute(srcAttr); 128 } 129 130 void HTMLSourceElement::setItemValueText(const String& value, ExceptionCode& ec) 131 { 132 setAttribute(srcAttr, value, ec); 133 } 134 #endif 135 124 136 } 125 137 -
trunk/Source/WebCore/html/HTMLSourceElement.h
r70063 r98300 56 56 void errorEventTimerFired(Timer<HTMLSourceElement>*); 57 57 58 #if ENABLE(MICRODATA) 59 virtual String itemValueText() const OVERRIDE; 60 virtual void setItemValueText(const String&, ExceptionCode&) OVERRIDE; 61 #endif 62 58 63 Timer<HTMLSourceElement> m_errorEventTimer; 59 64 }; -
trunk/Source/WebCore/html/HTMLTrackElement.cpp
r97926 r98300 151 151 dispatchEvent(Event::create(loadingFailed ? eventNames().errorEvent : eventNames().loadEvent, false, false), ec); 152 152 } 153 153 154 #if ENABLE(MICRODATA) 155 String HTMLTrackElement::itemValueText() const 156 { 157 return getURLAttribute(srcAttr); 158 } 159 160 void HTMLTrackElement::setItemValueText(const String& value, ExceptionCode& ec) 161 { 162 setAttribute(srcAttr, value, ec); 163 } 164 #endif 165 154 166 } 155 167 -
trunk/Source/WebCore/html/HTMLTrackElement.h
r97926 r98300 64 64 virtual void willRemove(); 65 65 virtual bool isURLAttribute(Attribute*) const; 66 66 67 #if ENABLE(MICRODATA) 68 virtual String itemValueText() const OVERRIDE; 69 virtual void setItemValueText(const String&, ExceptionCode&) OVERRIDE; 70 #endif 71 67 72 RefPtr<LoadableTextTrack> m_track; 68 73 };
Note:
See TracChangeset
for help on using the changeset viewer.