Changeset 98300 in webkit


Ignore:
Timestamp:
Oct 24, 2011, 5:13:34 PM (14 years ago)
Author:
rniwa@webkit.org
Message:

Microdata: Add itemprop, itemref, itemvalue attributes.
https://bugs.webkit.org/show_bug.cgi?id=69839

Patch by Arko Saha <arko@motorola.com> on 2011-10-24
Reviewed by Ryosuke Niwa.

Source/WebCore:

Tests: fast/dom/MicroData/itemprop-add-remove-tokens.html

fast/dom/MicroData/itemprop-for-an-element-must-be-correct.html
fast/dom/MicroData/itemprop-must-be-read-only.html
fast/dom/MicroData/itemprop-reflected-by-itemProp-property.html
fast/dom/MicroData/itemref-add-remove-tokens.html
fast/dom/MicroData/itemref-attribute-reflected-by-itemRef-property.html
fast/dom/MicroData/itemref-for-an-element-must-be-correct.html
fast/dom/MicroData/itemref-must-be-read-only.html
fast/dom/MicroData/itemvalue-reflects-data-attr-on-object-element.html
fast/dom/MicroData/itemvalue-reflects-href-attr.html
fast/dom/MicroData/itemvalue-reflects-src-attribute-on-img-element.html
fast/dom/MicroData/itemvalue-reflects-the-content-attr-on-meta-element.html
fast/dom/MicroData/itemvalue-reflects-the-src-attr.html
fast/dom/MicroData/itemvalue-returns-element-itself.html
fast/dom/MicroData/itemvalue-returns-null.html
fast/dom/MicroData/itemvalue-throws-excpetion-onsetting-001.html
fast/dom/MicroData/itemvalue-throws-excpetion-onsetting-002.html

  • CMakeLists.txt:
  • GNUmakefile.list.am:
  • WebCore.gypi:
  • WebCore.pro:
  • WebCore.vcproj/WebCore.vcproj:
  • bindings/js/JSHTMLElementCustom.cpp:

(WebCore::toJS):
(WebCore::JSHTMLElement::itemValue):
(WebCore::JSHTMLElement::setItemValue):

  • bindings/v8/custom/V8HTMLElementCustom.cpp:

(WebCore::toV8Object):
(WebCore::V8HTMLElement::itemValueAccessorGetter):
(WebCore::V8HTMLElement::itemValueAccessorSetter):

  • dom/MicroDataItemList.cpp:
  • html/HTMLAnchorElement.cpp:

(WebCore::HTMLAnchorElement::itemValueText):
(WebCore::HTMLAnchorElement::setItemValueText):

  • html/HTMLAnchorElement.h:
  • html/HTMLAreaElement.cpp:

(WebCore::HTMLAreaElement::itemValueText):
(WebCore::HTMLAreaElement::setItemValueText):

  • html/HTMLAreaElement.h:
  • html/HTMLAttributeNames.in:
  • html/HTMLElement.cpp:

(WebCore::HTMLElement::parseMappedAttribute):
(WebCore::HTMLElement::itemProp): Returns element's itemprop content attribute.
(WebCore::HTMLElement::setItemProp): Sets itemprop value on changing elemet's
itemprop attribute.
(WebCore::HTMLElement::itemRef): Returns element's itemref content attribute.
(WebCore::HTMLElement::setItemRef): Sets itemref value on changing elemet's
itemref attribute.
(WebCore::HTMLElement::setItemValue): Sets element's itemvalue. If the element has no
itemprop attribute or if element has an itemscope attribute, it throws INVALID_ACCESS_ERR
exception.
(WebCore::HTMLElement::itemValue): Returns the elements itemvalue.

If the element has no itemprop attribute it returns null.
If the element has an itemscope attribute, it returns the element itself.
If the element is a meta element: It acts as it would if it was reflecting the element's
content content attribute.
If the element is an audio, embed, iframe, img, source, track, or video element: It acts
as it would if it was reflecting the element's src content attribute.
If the element is an a, area, or link element: It act as it would if it was reflecting the
href content attribute.
If the element is an object element: It acts as it would if it was reflecting the element's
data content attribute.

(WebCore::HTMLElement::itemValueText):
(WebCore::HTMLElement::setItemValueText):

  • html/HTMLElement.h:
  • html/HTMLElement.idl:
  • html/HTMLEmbedElement.cpp:

(WebCore::HTMLEmbedElement::itemValueText):
(WebCore::HTMLEmbedElement::setItemValueText):

  • html/HTMLEmbedElement.h:
  • html/HTMLIFrameElement.cpp:

(WebCore::HTMLIFrameElement::itemValueText):
(WebCore::HTMLIFrameElement::setItemValueText):

  • html/HTMLIFrameElement.h:
  • html/HTMLImageElement.cpp:

(WebCore::HTMLImageElement::itemValueText):
(WebCore::HTMLImageElement::setItemValueText):

  • html/HTMLImageElement.h:
  • html/HTMLLinkElement.cpp:

(WebCore::HTMLLinkElement::itemValueText):
(WebCore::HTMLLinkElement::setItemValueText):

  • html/HTMLLinkElement.h:
  • html/HTMLMediaElement.cpp:

(WebCore::HTMLMediaElement::itemValueText):
(WebCore::HTMLMediaElement::setItemValueText):

  • html/HTMLMediaElement.h:
  • html/HTMLMetaElement.cpp:

(WebCore::HTMLMetaElement::itemValueText):
(WebCore::HTMLMetaElement::setItemValueText):

  • html/HTMLMetaElement.h:
  • html/HTMLObjectElement.cpp:

(WebCore::HTMLObjectElement::itemValueText):
(WebCore::HTMLObjectElement::setItemValueText):

  • html/HTMLObjectElement.h:
  • html/HTMLSourceElement.cpp:

(WebCore::HTMLSourceElement::itemValueText):
(WebCore::HTMLSourceElement::setItemValueText):

  • html/HTMLSourceElement.h:
  • html/HTMLTrackElement.cpp:

(WebCore::HTMLTrackElement::itemValueText):
(WebCore::HTMLTrackElement::setItemValueText):

  • html/HTMLTrackElement.h:
  • html/MicroDataItemValue.cpp: Added.

(WebCore::MicroDataItemValue::MicroDataItemValue):
(WebCore::MicroDataItemValue::createFromString):
(WebCore::MicroDataItemValue::createFromNode):

  • html/MicroDataItemValue.h: Added.

(WebCore::MicroDataItemValue::isNode):
(WebCore::MicroDataItemValue::getNode):
(WebCore::MicroDataItemValue::getString):

LayoutTests:

Added test-cases for Microdata itemprop, itemref, itemvalue attributes.

  • fast/dom/MicroData/002-expected.txt:
  • fast/dom/MicroData/002.html:
  • fast/dom/MicroData/003-expected.txt:
  • fast/dom/MicroData/003.html:
  • fast/dom/MicroData/005-expected.txt:
  • fast/dom/MicroData/005.html:
  • fast/dom/MicroData/006-expected.txt:
  • fast/dom/MicroData/009.html:
  • fast/dom/MicroData/itemprop-add-remove-tokens-expected.txt: Added.
  • fast/dom/MicroData/itemprop-add-remove-tokens.html: Added.
  • fast/dom/MicroData/itemprop-for-an-element-must-be-correct-expected.txt: Added.
  • fast/dom/MicroData/itemprop-for-an-element-must-be-correct.html: Added.
  • fast/dom/MicroData/itemprop-must-be-read-only-expected.txt: Added.
  • fast/dom/MicroData/itemprop-must-be-read-only.html: Added.
  • fast/dom/MicroData/itemprop-reflected-by-itemProp-property-expected.txt: Added.
  • fast/dom/MicroData/itemprop-reflected-by-itemProp-property.html: Added.
  • fast/dom/MicroData/itemref-add-remove-tokens-expected.txt: Added.
  • fast/dom/MicroData/itemref-add-remove-tokens.html: Added.
  • fast/dom/MicroData/itemref-attribute-reflected-by-itemRef-property-expected.txt: Added.
  • fast/dom/MicroData/itemref-attribute-reflected-by-itemRef-property.html: Added.
  • fast/dom/MicroData/itemref-for-an-element-must-be-correct-expected.txt: Added.
  • fast/dom/MicroData/itemref-for-an-element-must-be-correct.html: Added.
  • fast/dom/MicroData/itemref-must-be-read-only-expected.txt: Added.
  • fast/dom/MicroData/itemref-must-be-read-only.html: Added.
  • fast/dom/MicroData/itemvalue-reflects-data-attr-on-object-element-expected.txt: Added.
  • fast/dom/MicroData/itemvalue-reflects-data-attr-on-object-element.html: Added.
  • fast/dom/MicroData/itemvalue-reflects-href-attr-expected.txt: Added.
  • fast/dom/MicroData/itemvalue-reflects-href-attr.html: Added.
  • fast/dom/MicroData/itemvalue-reflects-src-attribute-on-img-element-expected.txt: Added.
  • fast/dom/MicroData/itemvalue-reflects-src-attribute-on-img-element.html: Added.
  • fast/dom/MicroData/itemvalue-reflects-the-content-attr-on-meta-element-expected.txt: Added.
  • fast/dom/MicroData/itemvalue-reflects-the-content-attr-on-meta-element.html: Added.
  • fast/dom/MicroData/itemvalue-reflects-the-src-attr-expected.txt: Added.
  • fast/dom/MicroData/itemvalue-reflects-the-src-attr.html: Added.
  • fast/dom/MicroData/itemvalue-returns-element-itself-expected.txt: Added.
  • fast/dom/MicroData/itemvalue-returns-element-itself.html: Added.
  • fast/dom/MicroData/itemvalue-returns-null-expected.txt: Added.
  • fast/dom/MicroData/itemvalue-returns-null.html: Added.
  • fast/dom/MicroData/itemvalue-throws-excpetion-onsetting-001-expected.txt: Added.
  • fast/dom/MicroData/itemvalue-throws-excpetion-onsetting-001.html: Added.
  • fast/dom/MicroData/itemvalue-throws-excpetion-onsetting-002-expected.txt: Added.
  • fast/dom/MicroData/itemvalue-throws-excpetion-onsetting-002.html: Added.
  • fast/dom/MicroData/resources/microdata-common.js:

(createElement):
(runTest):

Location:
trunk
Files:
36 added
46 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r98299 r98300  
     12011-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
    1562011-10-24  Filip Pizlo  <fpizlo@apple.com>
    257
  • trunk/LayoutTests/fast/dom/MicroData/002-expected.txt

    r97471 r98300  
    77document.getItems() with 'http://example.com/bar' itemtype in the aurgument: PASS
    88document.getItems() with 'http://example.com/f1' itemtype in the aurgument: PASS
     9Created element of type: div
     10Set attribute: itemscope, value: itemscope
    911Newly appended item should be noticed in the NodeList: PASS
    1012Removing item should be noticed in the NodeList: PASS
     13PASS successfullyParsed is true
    1114
    1215TEST COMPLETE
     16
  • trunk/LayoutTests/fast/dom/MicroData/002.html

    r97471 r98300  
    22<html>
    33<head>
     4<script src="../../js/resources/js-test-pre.js"></script>
    45<script src="resources/microdata-common.js"></script>
    56</head>
     
    1415<div itemscope itemtype="http://example.com/f1" id="four"></div>
    1516</div>
    16 
     17<div id="console"></div>
    1718<script>
    1819var one = document.getElementById('one');
     
    2728runTest(document.getItems('http://example.com/f1'), [four], "document.getItems() with 'http://example.com/f1' itemtype in the aurgument");
    2829
    29 var element = createElem('div', {itemscope:'itemscope'});
     30var element = createElement('div', {itemscope:'itemscope'});
    3031
    3132// Append newly created item to body
     
    3738runTest(document.getItems(), [one, two, three, four], "Removing item should be noticed in the NodeList");
    3839
    39 document.write("<br>TEST COMPLETE");
     40var successfullyParsed = true;
    4041</script>
     42<script src="../../js/resources/js-test-post.js"></script>
    4143</body>
    4244</html>
  • trunk/LayoutTests/fast/dom/MicroData/003-expected.txt

    r97471 r98300  
    66Set element.itemScope to false should notice in the NodeList: PASS
    77Set element.itemScope to true should notice in the NodeList: PASS
     8PASS successfullyParsed is true
    89
    910TEST COMPLETE
     11
  • trunk/LayoutTests/fast/dom/MicroData/003.html

    r97471 r98300  
    22<html>
    33<head>
     4<script src="../../js/resources/js-test-pre.js"></script>
    45<script src="resources/microdata-common.js"></script>
    56</head>
     
    89<div itemscope itemtype="http://example.com/foo" id="one"></div>
    910<div itemscope itemtype="http://example.com/bar" id="two"></div>
     11<div id="console"></div>
    1012<script>
    1113var one = document.getElementById('one');
     
    3032runTest(document.getItems(), [one, two], "Set element.itemScope to true should notice in the NodeList");
    3133
    32 document.write("<br>TEST COMPLETE");
     34var successfullyParsed = true;
    3335</script>
     36<script src="../../js/resources/js-test-post.js"></script>
    3437</body>
    3538</html>
  • trunk/LayoutTests/fast/dom/MicroData/005-expected.txt

    r97471 r98300  
    44NodeList must notice on remove attribute itemtype: PASS
    55NodeList must notice on set attribute itemtype: PASS
     6PASS successfullyParsed is true
    67
    78TEST COMPLETE
     9
  • trunk/LayoutTests/fast/dom/MicroData/005.html

    r97471 r98300  
    22<html>
    33<head>
     4<script src="../../js/resources/js-test-pre.js"></script>
    45<script src="resources/microdata-common.js"></script>
    56</head>
     
    89<div itemscope itemtype="http://example.com/foo" id="one"></div>
    910<div itemscope itemtype="http://example.com/foo" id="two"></div>
    10 
     11<div id="console"></div>
    1112<script>
    1213var one = document.getElementById('one');
     
    2324runTest(document.getItems('http://example.com/foo'), [one, two], "NodeList must notice on set attribute itemtype");
    2425
    25 document.write("<br>TEST COMPLETE");
     26var successfullyParsed = true;
    2627</script>
     28<script src="../../js/resources/js-test-post.js"></script>
    2729</body>
    2830</html>
  • trunk/LayoutTests/fast/dom/MicroData/006-expected.txt

    r97471 r98300  
    33
    44PASS 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 true
    6 PASS document.getItems(' http://example.com/foo data:text/plain http://example.com/foo').length == 2 is true
     5PASS document.getItems(' http://example.com/foo  data:text/plain ').length == 2 is true
     6PASS document.getItems('  http://example.com/foo  data:text/plain http://example.com/foo').length == 2 is true
    77PASS successfullyParsed is true
    88
  • trunk/LayoutTests/fast/dom/MicroData/009.html

    r97471 r98300  
     1<!DOCTYPE html>
    12<html>
    23<head>
  • trunk/LayoutTests/fast/dom/MicroData/resources/microdata-common.js

    r97471 r98300  
    11// this function creates element with specified property and contents.
    2 function createElem(type,props,contents) {
     2function createElement(type, props, contents) {
    33    if (window.layoutTestController)
    44      layoutTestController.dumpAsText();
    55
    6     var elem = document.createElement(type);
     6    var element = document.createElement(type);
    77
    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]);
    1113      }
    1214    }
    13     if( contents ) {
    14       elem.innerHTML = contents;
     15    if (contents) {
     16      element.innerHTML = contents;
    1517    }
    16     return elem;
     18    return element;
    1719}
    1820
     
    2325    layoutTestController.dumpAsText();
    2426
    25   document.write(title + ': ');
    2627  pass = true;
    2728
    2829  if (collection.length != elements.length) {
    2930    pass = false
    30     document.write('FAIL - expected ' + elements.length + ' elements but got ' + collection.length + " elements. ");
     31    debug('FAIL - expected ' + elements.length + ' elements but got ' + collection.length + " elements. ");
    3132  }
    3233  for(var i = 0, max = collection.length > elements.length ? elements.length : collection.length; i < max; i++) {
    3334    if(collection[i] != elements[i]) {
     35      debug(title);
    3436      pass = false
    35       document.write('FAIL - expected element : ' + elements[i].tagName + " but got element :" + collection[i].tagName);
    36       document.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);
    3739    }
    3840  }
    3941  if (pass)
    40     document.write('PASS');
    41   document.write('<br>');
     42    debug(title + ': PASS');
    4243}
  • trunk/Source/WebCore/CMakeLists.txt

    r98238 r98300  
    804804    html/LinkRelAttribute.cpp
    805805    html/MediaDocument.cpp
     806    html/MicroDataItemValue.cpp
    806807    html/MonthInputType.cpp
    807808    html/NumberInputType.cpp
  • trunk/Source/WebCore/ChangeLog

    r98295 r98300  
     12011-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
    11222011-10-24  Joseph Pecoraro  <joepeck@webkit.org>
    2123
  • trunk/Source/WebCore/GNUmakefile.list.am

    r98250 r98300  
    18531853        Source/WebCore/html/MediaDocument.h \
    18541854        Source/WebCore/html/MediaError.h \
     1855        Source/WebCore/html/MicroDataItemValue.cpp \
     1856        Source/WebCore/html/MicroDataItemValue.h \
    18551857        Source/WebCore/html/MonthInputType.cpp \
    18561858        Source/WebCore/html/MonthInputType.h \
  • trunk/Source/WebCore/WebCore.gypi

    r98238 r98300  
    55585558            'html/MediaDocument.h',
    55595559            'html/MediaError.h',
     5560            'html/MicroDataItemValue.cpp',
     5561            'html/MicroDataItemValue.h',
     5562            'html/MutableTextTrack.cpp',
     5563            'html/MutableTextTrack.h',
    55605564            'html/MonthInputType.cpp',
    55615565            'html/MonthInputType.h',
  • trunk/Source/WebCore/WebCore.pro

    r98238 r98300  
    759759    html/LinkRelAttribute.cpp \
    760760    html/MediaDocument.cpp \
     761    html/MicroDataItemValue.cpp \
    761762    html/MonthInputType.cpp \
    762763    html/NumberInputType.cpp \
     
    18111812    html/LoadableTextTrack.h \
    18121813    html/MediaDocument.h \
     1814    html/MicroDataItemValue.h \
     1815    html/MutableTextTrack.h \
    18131816    html/PluginDocument.h \
    18141817    html/StepRange.h \
  • trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj

    r98228 r98300  
    5740757407                        </File>
    5740857408                        <File
     57409                                RelativePath="..\html\MicroDataItemValue.cpp"
     57410                                >
     57411                        </File>
     57412                        <File
     57413                                RelativePath="..\html\MicroDataItemValue.h"
     57414                                >
     57415                        </File>
     57416                        <File
    5740957417                                RelativePath="..\fileapi\Metadata.h"
    5741057418                                >
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r98238 r98300  
    12941294                4ACBC0BF12713CBD0094F9B2 /* ClassList.h in Headers */ = {isa = PBXBuildFile; fileRef = 4ACBC0BD12713CBD0094F9B2 /* ClassList.h */; };
    12951295                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, ); }; };
    12971297                4ACBC0CA12713D0A0094F9B2 /* JSDOMSettableTokenList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4ACBC0C812713D0A0094F9B2 /* JSDOMSettableTokenList.cpp */; };
    12981298                4ACBC0CB12713D0A0094F9B2 /* JSDOMSettableTokenList.h in Headers */ = {isa = PBXBuildFile; fileRef = 4ACBC0C912713D0A0094F9B2 /* JSDOMSettableTokenList.h */; };
     
    33003300                9B375EDA14478A0100F3CAE5 /* MicroDataItemList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9B375ED814478A0100F3CAE5 /* MicroDataItemList.cpp */; };
    33013301                9B375EDB14478A0100F3CAE5 /* MicroDataItemList.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B375ED914478A0100F3CAE5 /* MicroDataItemList.h */; };
     3302                9B3A8872145632F9003AE8F5 /* DOMDOMSettableTokenList.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B3A8871145632F9003AE8F5 /* DOMDOMSettableTokenList.h */; };
    33023303                9B417064125662B3006B28FC /* ApplyBlockElementCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B417062125662B3006B28FC /* ApplyBlockElementCommand.h */; settings = {ATTRIBUTES = (Private, ); }; };
    33033304                9B417065125662B3006B28FC /* ApplyBlockElementCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9B417063125662B3006B28FC /* ApplyBlockElementCommand.cpp */; };
     
    1042610427                9B0FB18F140DB5790022588F /* HTTPValidation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTTPValidation.cpp; sourceTree = "<group>"; };
    1042710428                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>"; };
    1042810431                9B32CDA713DF7FA900F34D13 /* RenderedPosition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderedPosition.h; sourceTree = "<group>"; };
    1042910432                9B32CDA813DF7FA900F34D13 /* RenderedPosition.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderedPosition.cpp; sourceTree = "<group>"; };
    1043010433                9B375ED814478A0100F3CAE5 /* MicroDataItemList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MicroDataItemList.cpp; sourceTree = "<group>"; };
    1043110434                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>"; };
    1043210436                9B417062125662B3006B28FC /* ApplyBlockElementCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ApplyBlockElementCommand.h; sourceTree = "<group>"; };
    1043310437                9B417063125662B3006B28FC /* ApplyBlockElementCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ApplyBlockElementCommand.cpp; sourceTree = "<group>"; };
     
    1512815132                        isa = PBXGroup;
    1512915133                        children = (
    15130                                 1A1414B313A0F0500019996C /* WebKitFontFamilyNames.cpp */,
    15131                                 1A1414B413A0F0500019996C /* WebKitFontFamilyNames.h */,
    1513215134                                656581AC09D14EE6000E61D7 /* CharsetData.cpp */,
    1513315135                                E406F3FB1198307D009D59D6 /* ColorData.cpp */,
     
    1514015142                                6565814709D13043000E61D7 /* CSSValueKeywords.gperf */,
    1514115143                                6565814809D13043000E61D7 /* CSSValueKeywords.h */,
     15144                                9B3A8871145632F9003AE8F5 /* DOMDOMSettableTokenList.h */,
    1514215145                                9766504E144FBFFE00F6BB51 /* EventFactory.cpp */,
    1514315146                                970B72A5145008EB00F00A37 /* EventHeaders.h */,
     
    1516315166                                656581AE09D14EE6000E61D7 /* UserAgentStyleSheets.h */,
    1516415167                                656581AF09D14EE6000E61D7 /* UserAgentStyleSheetsData.cpp */,
     15168                                1A1414B313A0F0500019996C /* WebKitFontFamilyNames.cpp */,
     15169                                1A1414B413A0F0500019996C /* WebKitFontFamilyNames.h */,
    1516515170                                656581EA09D1508D000E61D7 /* XLinkNames.cpp */,
    1516615171                                656581EB09D1508D000E61D7 /* XLinkNames.h */,
     
    1720917214                                E446139B0CD6331000FADA75 /* MediaError.h */,
    1721017215                                E446139C0CD6331000FADA75 /* MediaError.idl */,
     17216                                9B2F7CF714562120007F8B50 /* MicroDataItemValue.cpp */,
     17217                                9B2F7CF814562120007F8B50 /* MicroDataItemValue.h */,
    1721117218                                F55B3D911251F12D003EF269 /* MonthInputType.cpp */,
    1721217219                                F55B3D921251F12D003EF269 /* MonthInputType.h */,
     
    2447524482                                970B728A144FFAC600F00A37 /* EventInterfaces.h in Headers */,
    2447624483                                970B72A6145008EB00F00A37 /* EventHeaders.h in Headers */,
     24484                                9B3A8872145632F9003AE8F5 /* DOMDOMSettableTokenList.h in Headers */,
    2447724485                        );
    2447824486                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/Source/WebCore/bindings/js/JSHTMLElementCustom.cpp

    r79904 r98300  
    3030#include "HTMLFormElement.h"
    3131
     32#if ENABLE(MICRODATA)
     33#include "MicroDataItemValue.h"
     34#endif
     35
    3236namespace WebCore {
    3337
    3438using namespace JSC;
     39
     40#if ENABLE(MICRODATA)
     41static 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
    3550
    3651ScopeChainNode* JSHTMLElement::pushEventHandlerScope(ExecState* exec, ScopeChainNode* scope) const
     
    4964}
    5065
     66#if ENABLE(MICRODATA)
     67JSValue JSHTMLElement::itemValue(ExecState* exec) const
     68{
     69    HTMLElement* element = impl();
     70    return toJS(exec, globalObject(), WTF::getPtr(element->itemValue()));
     71}
     72
     73void 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
    5182} // namespace WebCore
  • trunk/Source/WebCore/bindings/v8/custom/V8HTMLElementCustom.cpp

    r95901 r98300  
    3434#include "V8HTMLElementWrapperFactory.h"
    3535
     36#if ENABLE(MICRODATA)
     37#include "MicroDataItemValue.h"
     38#include "V8Binding.h"
     39#endif
     40
    3641namespace WebCore {
     42
     43#if ENABLE(MICRODATA)
     44static 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
    3755
    3856v8::Handle<v8::Value> toV8(HTMLElement* impl, bool forceNewObject)
     
    4361}
    4462
     63#if ENABLE(MICRODATA)
     64v8::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
     70void 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
    4580} // namespace WebCore
  • trunk/Source/WebCore/dom/MicroDataItemList.cpp

    r97551 r98300  
    3333#include "HTMLNames.h"
    3434
     35namespace WebCore {
     36
    3537using namespace HTMLNames;
    36 
    37 namespace WebCore {
    3838
    3939MicroDataItemList::MicroDataItemList(PassRefPtr<Node> rootNode, const String& typeNames)
  • trunk/Source/WebCore/html/HTMLAnchorElement.cpp

    r94427 r98300  
    587587}
    588588
    589 }
     589#if ENABLE(MICRODATA)
     590String HTMLAnchorElement::itemValueText() const
     591{
     592    return getURLAttribute(hrefAttr);
     593}
     594
     595void 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  
    126126    bool treatLinkAsLiveForEventType(EventType) const;
    127127
     128#if ENABLE(MICRODATA)
     129    virtual String itemValueText() const OVERRIDE;
     130    virtual void setItemValueText(const String&, ExceptionCode&) OVERRIDE;
     131#endif
     132
    128133    RefPtr<Element> m_rootEditableElementForSelectionOnMouseDown;
    129134    bool m_wasShiftKeyDownOnMouseDown : 1;
  • trunk/Source/WebCore/html/HTMLAreaElement.cpp

    r94427 r98300  
    247247}
    248248
    249 }
     249#if ENABLE(MICRODATA)
     250String HTMLAreaElement::itemValueText() const
     251{
     252    return getURLAttribute(hrefAttr);
     253}
     254
     255void 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  
    5959    virtual void updateFocusAppearance(bool /*restorePreviousSelection*/);
    6060    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
    6267    enum Shape { Default, Poly, Rect, Circle, Unknown };
    6368    Path getRegion(const LayoutSize&) const;
  • trunk/Source/WebCore/html/HTMLAttributeNames.in

    r97471 r98300  
    124124itemid
    125125itemprop
     126itemref
    126127itemscope
    127128itemtype
  • trunk/Source/WebCore/html/HTMLElement.cpp

    r98192 r98300  
    44 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
    55 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
     6 * Copyright (C) 2011 Motorola Mobility. All rights reserved.
    67 *
    78 * This library is free software; you can redistribute it and/or
     
    5152#include <wtf/StdLibExtras.h>
    5253#include <wtf/text/CString.h>
     54
     55#if ENABLE(MICRODATA)
     56#include "MicroDataItemValue.h"
     57#endif
    5358
    5459namespace WebCore {
     
    198203            addCSSProperty(attr, CSSPropertyWebkitUserDrag, CSSValueNone);
    199204#if ENABLE(MICRODATA)
     205    } else if (attr->name() == itempropAttr) {
     206        setItemProp(attr->value());
     207    } else if (attr->name() == itemrefAttr) {
     208        setItemRef(attr->value());
    200209    } else if (attr->name() == itemtypeAttr) {
    201210        itemTypeAttributeChanged();
     
    985994}
    986995
     996#if ENABLE(MICRODATA)
     997PassRefPtr<DOMSettableTokenList> HTMLElement::itemProp() const
     998{
     999    if (!m_itemProp)
     1000        m_itemProp = DOMSettableTokenList::create();
     1001
     1002    return m_itemProp;
     1003}
     1004
     1005void HTMLElement::setItemProp(const String& value)
     1006{
     1007    if (!m_itemProp)
     1008        m_itemProp = DOMSettableTokenList::create();
     1009
     1010    m_itemProp->setValue(value);
     1011}
     1012
     1013PassRefPtr<DOMSettableTokenList> HTMLElement::itemRef() const
     1014{
     1015    if (!m_itemRef)
     1016        m_itemRef = DOMSettableTokenList::create();
     1017
     1018    return m_itemRef;
     1019}
     1020
     1021void HTMLElement::setItemRef(const String& value)
     1022{
     1023    if (!m_itemRef)
     1024        m_itemRef = DOMSettableTokenList::create();
     1025
     1026    m_itemRef->setValue(value);
     1027}
     1028
     1029void 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
     1039PassRefPtr<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
     1050String HTMLElement::itemValueText() const
     1051{
     1052    return textContent(true);
     1053}
     1054
     1055void HTMLElement::setItemValueText(const String& value, ExceptionCode& ec)
     1056{
     1057    setTextContent(value, ec);
     1058}
     1059#endif
     1060
    9871061} // namespace WebCore
    9881062
  • trunk/Source/WebCore/html/HTMLElement.h

    r97551 r98300  
    2626#include "StyledElement.h"
    2727
     28#if ENABLE(MICRODATA)
     29#include "DOMSettableTokenList.h"
     30#endif
     31
    2832namespace WebCore {
    2933
     
    3135class HTMLCollection;
    3236class HTMLFormElement;
    33                        
     37
     38#if ENABLE(MICRODATA)
     39class MicroDataItemValue;
     40#endif
     41
    3442class HTMLElement : public StyledElement {
    3543public:
     
    8290    TextDirection directionalityIfhasDirAutoAttribute(bool& isAuto) const;
    8391
     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
    84100protected:
    85101    HTMLElement(const QualifiedName& tagName, Document*);
     
    108124    void adjustDirectionalityIfNeededAfterChildrenChanged(Node* beforeChange, int childCountDelta);
    109125    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
    110137};
    111138
  • trunk/Source/WebCore/html/HTMLElement.idl

    r97471 r98300  
    7171                 attribute [Conditional=MICRODATA, Reflect] DOMString itemId;
    7272
     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
    7383#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
    7484        readonly attribute DOMString titleDisplayString;
  • trunk/Source/WebCore/html/HTMLEmbedElement.cpp

    r95204 r98300  
    278278}
    279279
    280 }
     280#if ENABLE(MICRODATA)
     281String HTMLEmbedElement::itemValueText() const
     282{
     283    return getURLAttribute(srcAttr);
     284}
     285
     286void 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  
    5353
    5454    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
    5560};
    5661
  • trunk/Source/WebCore/html/HTMLIFrameElement.cpp

    r87125 r98300  
    164164}
    165165
     166#if ENABLE(MICRODATA)
     167String HTMLIFrameElement::itemValueText() const
     168{
     169    return getURLAttribute(srcAttr);
    166170}
     171
     172void 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  
    4747    virtual bool isURLAttribute(Attribute*) const;
    4848
     49#if ENABLE(MICRODATA)
     50    virtual String itemValueText() const OVERRIDE;
     51    virtual void setItemValueText(const String&, ExceptionCode&) OVERRIDE;
     52#endif
     53
    4954    AtomicString m_name;
    5055};
  • trunk/Source/WebCore/html/HTMLImageElement.cpp

    r97448 r98300  
    404404}
    405405
    406 }
     406#if ENABLE(MICRODATA)
     407String HTMLImageElement::itemValueText() const
     408{
     409    return getURLAttribute(srcAttr);
     410}
     411
     412void 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  
    103103    virtual void removedFromTree(bool deep);
    104104
     105#if ENABLE(MICRODATA)
     106    virtual String itemValueText() const OVERRIDE;
     107    virtual void setItemValueText(const String&, ExceptionCode&) OVERRIDE;
     108#endif
     109
    105110    HTMLImageLoader m_imageLoader;
    106111    HTMLFormElement* m_form;
  • trunk/Source/WebCore/html/HTMLLinkElement.cpp

    r98208 r98300  
    449449}
    450450
     451#if ENABLE(MICRODATA)
     452String HTMLLinkElement::itemValueText() const
     453{
     454    return getURLAttribute(hrefAttr);
     455}
     456
     457void HTMLLinkElement::setItemValueText(const String& value, ExceptionCode& ec)
     458{
     459    setAttribute(hrefAttr, value, ec);
     460}
     461#endif
     462
    451463} // namespace WebCore
  • trunk/Source/WebCore/html/HTMLLinkElement.h

    r98106 r98300  
    9595    void removePendingSheet();
    9696
     97#if ENABLE(MICRODATA)
     98    virtual String itemValueText() const OVERRIDE;
     99    virtual void setItemValueText(const String&, ExceptionCode&) OVERRIDE;
     100#endif
     101
    97102private:
    98103    HTMLLinkElement(const QualifiedName&, Document*, bool createdByParser);
  • trunk/Source/WebCore/html/HTMLMediaElement.cpp

    r98238 r98300  
    30693069#endif
    30703070
    3071 }
    3072 
    3073 #endif
     3071#if ENABLE(MICRODATA)
     3072String HTMLMediaElement::itemValueText() const
     3073{
     3074    return getURLAttribute(srcAttr);
     3075}
     3076
     3077void 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  
    403403    virtual void* preDispatchEventHandler(Event*);
    404404
     405#if ENABLE(MICRODATA)
     406    virtual String itemValueText() const;
     407    virtual void setItemValueText(const String&, ExceptionCode&);
     408#endif
     409
    405410    Timer<HTMLMediaElement> m_loadTimer;
    406411    Timer<HTMLMediaElement> m_asyncEventTimer;
  • trunk/Source/WebCore/html/HTMLMetaElement.cpp

    r94427 r98300  
    9595}
    9696
     97#if ENABLE(MICRODATA)
     98String HTMLMetaElement::itemValueText() const
     99{
     100    return getAttribute(contentAttr);
    97101}
     102
     103void 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  
    4343
    4444    void process();
     45
     46#if ENABLE(MICRODATA)
     47    virtual String itemValueText() const OVERRIDE;
     48    virtual void setItemValueText(const String&, ExceptionCode&) OVERRIDE;
     49#endif
     50
    4551};
    4652
  • trunk/Source/WebCore/html/HTMLObjectElement.cpp

    r95204 r98300  
    555555}
    556556
    557 }
     557#if ENABLE(MICRODATA)
     558String HTMLObjectElement::itemValueText() const
     559{
     560    return getURLAttribute(dataAttr);
     561}
     562
     563void 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  
    103103    virtual const AtomicString& formControlName() const;
    104104
     105#if ENABLE(MICRODATA)
     106    virtual String itemValueText() const OVERRIDE;
     107    virtual void setItemValueText(const String&, ExceptionCode&) OVERRIDE;
     108#endif
     109
    105110    AtomicString m_id;
    106111    String m_classId;
  • trunk/Source/WebCore/html/HTMLSourceElement.cpp

    r94427 r98300  
    122122}
    123123
     124#if ENABLE(MICRODATA)
     125String HTMLSourceElement::itemValueText() const
     126{
     127    return getURLAttribute(srcAttr);
     128}
     129
     130void HTMLSourceElement::setItemValueText(const String& value, ExceptionCode& ec)
     131{
     132    setAttribute(srcAttr, value, ec);
     133}
     134#endif
     135
    124136}
    125137
  • trunk/Source/WebCore/html/HTMLSourceElement.h

    r70063 r98300  
    5656    void errorEventTimerFired(Timer<HTMLSourceElement>*);
    5757
     58#if ENABLE(MICRODATA)
     59    virtual String itemValueText() const OVERRIDE;
     60    virtual void setItemValueText(const String&, ExceptionCode&) OVERRIDE;
     61#endif
     62
    5863    Timer<HTMLSourceElement> m_errorEventTimer;
    5964};
  • trunk/Source/WebCore/html/HTMLTrackElement.cpp

    r97926 r98300  
    151151    dispatchEvent(Event::create(loadingFailed ? eventNames().errorEvent : eventNames().loadEvent, false, false), ec);
    152152}
    153    
     153
     154#if ENABLE(MICRODATA)
     155String HTMLTrackElement::itemValueText() const
     156{
     157    return getURLAttribute(srcAttr);
     158}
     159
     160void HTMLTrackElement::setItemValueText(const String& value, ExceptionCode& ec)
     161{
     162    setAttribute(srcAttr, value, ec);
     163}
     164#endif
     165
    154166}
    155167
  • trunk/Source/WebCore/html/HTMLTrackElement.h

    r97926 r98300  
    6464    virtual void willRemove();
    6565    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
    6772    RefPtr<LoadableTextTrack> m_track;
    6873};
Note: See TracChangeset for help on using the changeset viewer.