Warning:
This wiki has been archived and is now read-only.

SemanticPresentationLegendCSS

From HTML WG Wiki
Jump to: navigation, search

Liaison with CSS WG regarding semantic-presentation legend

Problem statement / use cases

  • While some presentational properties are purely presentational, others convey semantic information (e.g., italics or bold text may convey emphasis)
  • Authors need a way to convey the semantic meaning of presentational properties
  • Users of unconventional media require a way to patch the presentational gaps left by authors focussed on other media (such as focussed only on visual interactive screen rendering)

Proposed solutions

Establish a new legend module through a liaison with the CSS WG. The legend module would introduce new properties and new keywords to CSS to permit authors to convey the underlying semantics of presentational idioms.

legend property

[Note: Readers should not confuse the CSS ‘legend’ property proposed here with the HTML legend element used for fieldset, lists, and as a figure element caption; rather the term legend is used here as “the wording on a map or diagram explaining the symbols used”. In this case the wording provided by authors explaining the meaning of the presentational properties.]

A legend property that accepts either a string or a URI referencing a document or document fragment. The string or referenced document fragment should provide a description of the meaning conveyed by the declaration block.

For example:

.jesus {
      color: red
      legend: "the words of Jesus"
}

When encountering legend declaration blocks failing to define distinguishing properties for the user’s current targeted media, UAs should notify users of the omission and provide a mechanism for the user to assign presentational properties. Also when encountering class selectors or compound selectors involving class selectors, and those declaration blocks include no legend property, UAs may also notify users of the omission and provide a mechanism for the user to assign presentational properties for a particular class.

For example, an aural UA encountering the above block should notify the user that "the words of Jesus" requires a distinct presentational mechanism. The user may then select a different voice or an adjusted volume for the presentation of selectors associated with that declaration block.

UAs encountering inadequate legend properties in the media specific stylesheet may retrieve alternate stylesheets and parse other portions of the stylesheet to compile legend information.

[the idea here is that declaration blocks with legend provide information for presentation regardless of whether the author included complete presentation properties for every media; also that authors often use class attributes in semantic and human comprehendible ways but may not also use the new legend property]

For added flexibility, the possibility of semantically rich legends, and also to facilitate easy localization of legends using HTTP content-negotiation, authors may use a URI to indicate a resource or document fragment for legend information.

For example:

.jesus {
      color: red;
      legend: uri(http://www.example.com/styles/legend-information.xhtml#jesus);
     legend-presentation: "red letters";
}

where the server “http://www.example.com” has a file at path “styles/legend-information.xhtml.en”

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xml:lang="en" xmlns='http://www.w3.org/1999/xhtml'  >
<head>
...
</head>
<body>
...
<p id='jesus'>
the words of Jesus
</p>
...
</body>
</html>

and another document at the path “styles/legend-information.xhtml.fr”:

...
<p id='jesus'>
les mots de Jesus
</p>
...

and another document at the path “styles/legend-information.xhtml.ar”:

...
<p id='jesus'>
الكلمات يسوع
</p>
...

...and so on.

The use of URI value for the legend property also permits authors to include the legend description within the HTML document itself — providing further separation of concerns and authoring flexibility.

legend-presentation property

Authors may also include the legend-presentation property to indicate the expression describing the presentational properties of the declaration block.


.jesus {
      color: red;
      legend: "the words of Jesus";
     legend-presentation: "red letters";
}

When the legend property is included in a declaration block, but the legend-presentation property is omitted, the UA must automatically provide a localized description of the presentation properties contained in the CSS declaration block.

Like the legend property, authors may also specify a URI for the legend-presentation property for added flexibility, localization, semantically rich description of styling, etc.

Using the properties together

Together, authors should think of the legend and legend-presentation properties as serving as components for the phrase: <legend-presentation> indicates <legend>, though UAs may choose other ways to present this information.

Generated content

Also the legend module includes keywords for generated content to generate the legend.

#legend { 
       content: legend
/* perhaps some properties or keywords to control verbosity or even from which stylesheet to include legend information  */
}

Authors may also want to control which declaration blocks are included or the form of the legend. for example:

  • what connective language is used
  • the order of the legend semantics and legend-presentation language
  • whether to apply the presentation properties to the legend semantic phrase or the legend-presentation

Discussion and evaluation

Email

WG members should post feedback and other discussion to the WG’s list serve (the URI for the links below provides date information). Search on this email subject.

See also