Selectors Serialization Format for Testing (SSFT) Specification

Working Draft 25 September 2007

This Version
<http://suika.fam.cx/www/markup/selectors/ssft/ssft>
Latest Version
<http://suika.fam.cx/www/markup/selectors/ssft/ssft>
Author
<>

Abstract

...

Status of This Document

This section describes the status of this document at the time of its publication. Other documents might supersede this document.

This document is a working draft. It might be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.

Comments on this document are welcome and may be sent to the author.

Translations of thie document might be available. The English version of the document is the only normative version.

Introduction

This section is informative.

...

The CSSOM specification [CSSOM] is trying to define an algorithm to serialize a group of selectors for the purpose of selectorText attribute. However, the algorithm is incomplete at the time of the writing. Note that current Web browser implementations of the selectorText attribute are consistently broken in not escaping unsafe identifiers.

Terminology

The key words MUST, MUST NOT, SHOULD, SHOULD NOT, and MAY in this document are to be interpreted as described in RFC 2119 [KEYWORDS].

Serializing Groups of Selectors

See the reference implementation for now.

Newline is U+000A LINE FEED or U+000D U+000A or U+000A ??.

  1. Let result an empty string.
  2. For each selector (selector) in the group of selectors:
    1. If selector is not the first selector in the group of selectors, then append a U+002C COMMA followed by a newline to result.
    2. Append four U+0020 SPACE characters to result.
    3. Process each sequence of simple selectors or combinator in selector by following algorithm:
      If it is a sequence of simle selector (sss)
      @@
      If it is a combinator (c)
      1. Append two U+0020 SPACE characters to result.
      2. If c is descendant combinator (white space)
        Append a U+0020 SPACE character to result.
        If c is child combinator (>)
        Append a U+003E GREATER-THAN SIGN character to result.
        If c is adjacent sibling combinator (+)
        Append a U+0020 SPACE character to result.
        If c is general sibling combinator (~)
        Append a U+007E TILDE character to result.
      3. Append a U+0020 SPACE character to result.
  3. Then, result is the SFFT representation of the group of selectors.

Parsing SFFT Groups of Selectors

Since the serializing algorithm is so designed that it always output a valid group of selectors, no special parser for SFFT is necessary. Any conforming group of selectors parser MAY be used to parse SFFT groups of selectors.

Examples

This section is informative.

Try demo, by choosing Selectors radio button.

...
...

References

Normative References

KEYWORDS
Key words for use in RFCs to Indicate Requirement Levels, IETF BCP 14, RFC 2119, March 1997. This version of the specification is referenced
SELECTORS
Selectors, W3C Working Draft, 15 December 2005. Work in progress. The latest version of the specification is referenced.

Informative References

CSSOM
Cascading Style Sheets Object Model (CSSOM), W3C Editor's Draft, 18 June 2007. Work in progress. The latest Editor's Draft of the specification is available at <http://dev.w3.org/csswg/cssom/Overview.html>.