targetsheet documentation

Purpose

Style hyperlink elements with window targetting behavior based on their semantic 'rel' and sub-semantic 'class' attributes.

AKA sneak 'target' attributes past the validator.

Validity

Note: despite my use of the mischief-implying term 'sneak', there is nothing invalid (in letter or spirit) in this technique, in spite of how much certain well-respected fanatics[1] (as Mr. Glazman describes[2]) may object.

I shall quote a couple of sentences from the intro of the W3C Proposed Recommendation DOM Level 2 HTML[3].

"The transitional or frameset DTD for HTML 4.01, or the XHTML 1.0 DTDs are assumed. "

...

"The interfaces in this specification are designed for [HTML 4.01] documents, as well as for [XHTML 1.0] documents."

Essentially, this means first, that the HTML DOM applies to all HTML4/XHTML1 documents, independent of document type (note complete lack of any mention of document types in the second sentence that I quoted from the spec).

Second, it means that the interfaces defined therein assume, and thus provide access to, the functionality defined by the transitional or frameset DTDs.

Therefore it can be expected that the properties defined (which reflect the attributes defined by the transitional and frameset DTDs) in the HTML DOM apply to and are supported by all HTML4.01 and XHTML1.0 documents, regardless of their particular document type.

Some might say that this is a loophole, but if so, it is so huge and obvious, that it is far more likely intentional (perhaps well negotiated) design rather than an accidental side-effect.

Details

'links' collection:
http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-7068919
'className' property
http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-95362176
'target' property
http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-6414197
'rel' property
http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-3815891

Afterword

Since this hyperlink window targeting behavior is purely presentational, I would much rather write something like this in a style sheet:


 :link.photo,:visited.photo { target:'z' window above }
 :link.local,:visited.local { target:current }
 :link:not([rel='bookmark']):not(.plink),
 :visited:not([rel='bookmark']):not(.plink) { target:'lockon' window above }

The advantage that using CSS over scripting would provide is the ability to override the presentation via the cascade. Many users prefer that all hyperlinks open in the current window, and never open a new window.

If CSS properties were used to determine the presentation of hyperlinks rather than scripting (or markup for that matter), then the abovementioned users could place a rule in their user style sheet to always override the author's suggested presentation:


 :link,:visited { target-position:current ! important }

The 'target' shorthand property (and its implied individual properties) are currently being discussed by certain troublemakers as one way to encourage the separation of linking presentation from linking semantics, a heretofore unsolved problem at W3C.

References:

  1. [1] http://ln.hixie.ch/?start=1037202166&count=1
  2. [2] http://daniel.glazman.free.fr/weblog/archived/2002_11_10_glazblogarc.html#84479758
  3. [3] http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-1176245063

Tantek Çelik - 20021121