User:Pwinnber/content attribute

From W3C Wiki
Jump to: navigation, search


<data> element counter proposal / content attribute change proposal

Summary

There is no need to add a new element to hold machine readable data. Instead of doing that this proposal suggests a attribute is used on the <span> element and the >time< element to achieve the same thing.

Rationale

In the <data> element change proposal a new data element is proposed along with a value attribute that would hold a machine readable version of the data. The reason that is given for why a new element is needed is to make it explicit that this is machine readable data and not human readable data.

The change proposal argues that there is no need to have a new element. Only an attribute is needed to hold this machine readable data and by checking if this attribute is present or not is enough to see if the element holds machine readable data or not. The name of the <data> element can also be confusing given the data-* attributes that are used for a different purpose. The semantics of the <data> element is also very similar compared to the semantics of the <span> element.

RDFa already uses the content attribute to hold machine readable data. This change proposal suggests that allowing the content attribute on the <span> element should be sufficient to fulfill the use case presented for the <data>. It also suggests that the name of the datetime attribute on the time element should be changed to content for the sake of consistency.

Details

  • Allow the content attribute on the <span> element.
  • When the content attribute is used on the <span> element there should not be any restrictions on what type of data it can hold.
  • Rename the datetime attribute on the <time> element to content.
  • Given that the <time> element is more specific than the <span> element when the content attribute is used on the <time> element it should be restricted to date time strings just like the datetime attribute already is ( this could include the changes found in User:Tantekelik/time_element ).
  • Nested <span>/<time> elements that have the content attribute should not be allowed.
  • This propsal agrees with User:Tantekelik/data_element how the examples should be done.
  • Authors should be encouraged to use the time element over the span element when providing time data even if both ways would be valid.

Impact

Positive Effects

  • Provides a way to provide machine readable data by using existing attributes and elements that already is used in this way in RDFa.

Negative Effects

  • Changing the name of the datetime attribute could cause problems for authors that have started to use the time element with this attribute.

References

References are inline.