#HTML5 elp #CSS3 #EricMeyer Back to Future #Premailer Jungle http://t.co/zchNF89 SORRY EM--Just testing out my delicate vectorgraphs @mrjyn
Back in 2002, In The Hague, Netherlands, Mr. Visscher was attempting to improve the performance of his XSL output. He switched from
Fast forward to 2008, HTML5 is gaining momentum. New elements have been specified, however in practice, Internet Explorer 6-8 pose a problem as they do not recognize unknown elements; the new elements cannot hold children and are unaffected by CSS. This sad fact was posing quite a big hinderance to HTML5 adoption.
And it's now, half a decade after his discovery that Sjoerd innocently mentions this trick in a comment on the blog of the W3C HTML WG co-chair, Sam Ruby:
John Resig, one day later, wrote the post that coined the term "HTML5 Shiv". While it technically is a "shim" and John admitted this later, the proliferation of assorted HTML5 shims nowadays makes a good case for us to continue using "shiv" for this solution. Chris Wilson, then of the IE Team, said “I want to jam standards support into (this and future versions of) Internet Explorer. If a shiv is the only pragmatic tool I can use to do so, shouldn’t I be using it?”
Now, from here, a quick timeline:
This is what the HTML5 community is all about to me: distributed folks, working collaboratively, to bring the promise and potential of HTML5 into reality.
Just for emphasis on all the bright minds that engaged on this one.. Here are the people who worked on the HTML5 Shiv: Sjoerd Visscher, Sam Ruby, John Resig, Remy Sharp, JD Bartlett, Faruk Ateş, Kangax, John-David Dalton, PorneL, Mathias Bynens, me and last but certainly not least, Jonathan Neal and Alexander Farkas.
The narrative above appears in my foreword for the book HTML5 & CSS3 for The Real World by Estelle Weyl, Louis Lazaris, and Alexis Goldstein.
It's a very good book on practical HTML5 and CSS3 development with a lovely learning curve. Buy it
HTML5 Shiv
May 24th, 2011
Heard of Sjoerd Visscher? I would venture to guess you have not; however, what he considered a minor discovery of his is at the foundation of our ability to use HTML5 today.Back in 2002, In The Hague, Netherlands, Mr. Visscher was attempting to improve the performance of his XSL output. He switched from
createElement
calls to setting the innerHTML
property, and then realized all the unknown non-HTML elements were no longer styleable by CSS.Fast forward to 2008, HTML5 is gaining momentum. New elements have been specified, however in practice, Internet Explorer 6-8 pose a problem as they do not recognize unknown elements; the new elements cannot hold children and are unaffected by CSS. This sad fact was posing quite a big hinderance to HTML5 adoption.
And it's now, half a decade after his discovery that Sjoerd innocently mentions this trick in a comment on the blog of the W3C HTML WG co-chair, Sam Ruby:
Btw, if you want CSS rules to apply to unknown elements in IE, you just have to do document.createElement(elementName)
. This somehow lets the CSS engine know that elements with that name exist
Ian Hickson, lead editor of the HTML5 spec, stood surprised, along the rest of the web, that he had never heard this trick before and was happy to report: "This piece of information makes building an HTML5 compatibility shim for IE7 far easier than had previously been assumed."John Resig, one day later, wrote the post that coined the term "HTML5 Shiv". While it technically is a "shim" and John admitted this later, the proliferation of assorted HTML5 shims nowadays makes a good case for us to continue using "shiv" for this solution. Chris Wilson, then of the IE Team, said “I want to jam standards support into (this and future versions of) Internet Explorer. If a shiv is the only pragmatic tool I can use to do so, shouldn’t I be using it?”
Now, from here, a quick timeline:
- January 2009: Remy Sharp creates the first distributable script for enabling HTML5 element use in IE.
- June 2009: Faruk Ateş includes the html5shiv in Modernizr's initial release.
- February 2010: A ragtag team of superstar JavaScript developers including Remy, Kangax, John-David Dalton, and PorneL collaborate and drop the filesize of the script.
- March 2010: Mathias Bynens and others notice the shiv doesn't affect pages printed from IE. It was a sad day.
- April 2010: Jonathan Neal answers the challenge with the IE Print Protector (IEPP), which captured the scope of the html5shiv but also added in support for printing the elements as well, through clever use of the
onbeforeprint
&onafterprint
events, along with a faux DOM reconstruction. - April 2010: Remy replaces the legacy html5shiv solution with the new IEPP.
- August 2010: JD Bartlett introduced the innerShiv, which is necessary for shiv'ing content going in via
innerHTML
. - February 2011: Alexander Farkas carries the torch, moving the IEPP project to github, adding a test suite, fixing bugs, and improving performance.
- April 2011: IEPP v2 comes out. Modernizr and the html5shiv inherit the latest code. Meanwhile developers everywhere continue to use HTML5 elements in a cross-browser fashion without worry.
This is what the HTML5 community is all about to me: distributed folks, working collaboratively, to bring the promise and potential of HTML5 into reality.
Just for emphasis on all the bright minds that engaged on this one.. Here are the people who worked on the HTML5 Shiv: Sjoerd Visscher, Sam Ruby, John Resig, Remy Sharp, JD Bartlett, Faruk Ateş, Kangax, John-David Dalton, PorneL, Mathias Bynens, me and last but certainly not least, Jonathan Neal and Alexander Farkas.
The narrative above appears in my foreword for the book HTML5 & CSS3 for The Real World by Estelle Weyl, Louis Lazaris, and Alexis Goldstein.
It's a very good book on practical HTML5 and CSS3 development with a lovely learning curve. Buy it
The general situation here is: there are many instances where making element content link to other content via HTML requires clumsy structures, and others where it is basically impossible. One example of clumsiness is linking images, which requires wrapping an
a
element around an img
element just to make the latter "clickable". One example of impossibility is linking an entire table row.Some possible solutions:
- Leave things as they are and stick with DOM events to recreate this ability
- Pros:
- Works today and should continue to work into the future
- Cons:
- Fails in non-JS situations
- Is substantially more complicated for authors (JS frameworks can lessen but do not eliminate the complexity, and their use balloons page weight)
- Does not allow the added semantics of
hreflang
,media
,ping
,rel
,target
, andtype
- Pros:
- Add
href
,hreflang
,media
,ping
,rel
,target
, andtype
to a number of elements in HTML5 - Pros:
- Leverages known attribute semantics
- Very simple for authors to understand, recycling as it does attributes with which they are already familiar
- Leaner markup
- Cons:
- Will not be understood by legacy user agents (this can be ameliorated with JS)
- Adds a number of attributes to a number of elements
- Pros:
- Devise some other attribute, such as
link
, which has the same basic effect - Pros:
- Fairly simple for authors to learn and understand, given its similarity to an attribute with which they are familiar
- Leaner markup
- Cons:
- Will not be understood by legacy user agents (this may be amenable to JS amelioration in said UAs, depending on their tolerance of unrecognized attributes)
- Adds a number of attributes to a number of elements
- Means inventing a new attribute that is very similar to an existing attribute
- Requires the invention of (e.g.)
linklang
to add the semantics ofhreflang
(the other attributes can still be added as is)
- Pros:
- Change
a
so that it can wrap around any arbitrary collection of elements - Pros:
- Makes linking much more flexible
- Very simple for authors to understand, based as it is on an element with which they are familiar
- Cons:
- May not be understood properly by legacy user agents, possibly resulting in failure to link (due to HTML4/XHTML1 element-termination rules) or in failure to display portions of a document (due to parsing bugs)
- Still requires wrapping a link-specific element around other elements, which does not result in leaner markup
- Pros:
- Devise some new element like
hlink
that can wrap around any arbitrary collection of elements - Pros:
- Makes linking much more flexible
- Cons:
- Will not be understood by legacy user agents (this may be amenable to JS amelioration in said UAs, depending on their tolerance of unrecognized elements)
- Still requires wrapping a link-specific element around other elements, which does not result in leaner markup
- Pros:
Case By Case
Beyond the general case, it is very helpful to look at individual elements that would benefit from being linkable and demonstrate the reasons why this capability would be helpful.
The Holdover
Just to make clear that there are strong reasons to keep the traditional linking element as a member of the firmament.
a
- Existing attributes
href
hreflang
media
ping
rel
target
type
- Rationale for element preservation
- Not every instance of a hyperlink will be centered on some non-
a
element. Having a generic hyperlink element is still just as valuable as the day the web was invented. Furthermore, there would be something of a backwards-compatibility issue if the element were dropped.
New Additions
The elements for which I felt able to justify calling for addition of linking ability. The general guiding principle is that any case where it would be reasonable to wrap an
a
element around an element, or have an a
element be the sole child of an element, indicates strong potential for a valid use case.In my examples I use the
href
attribute because it makes the most sense to me, but in all cases I considered foremost whether it made sense to have an element become linkable as orthogonal to the exact method of achieving that linkage. Collectively, these form an argument for allowing a more robust and flexible linking mechanism, regardless of its specific form. Note too that I am assuming that adding href
also means adding hreflang
, media
, ping
, rel
, target
, and type
, for all the reasons those attributes are useful for the a
element.
abbr
- Existing attributes
title
- Rationale for addition
- There are two primary situations where an abbreviation should be linked elsewhere: when linking to an organization whose name is an abbreviation; and when linking to a
dfn
-enclosed definition of the abbreviation elsewhere in the document.Note: ifacronym
is ever restored to HTML5, the same rationale and use cases given here would apply for that element. I'm not holding my breath. - Example(s)
<p>The <dfn id="whatwg"><abbr title="Web Hypertext Application Technology Working Group" href="http://whatwg.org/">WHATWG</abbr></dfn> is a loose unofficial collaboration of Web browser manufacturers and interested parties who wish to develop new technologies designed to allow authors to write and deploy Applications over the World Wide Web.</p> <p>The <abbr title="Web Hypertext Application Technology Working Group" href="#whatwg">WHATWG</abbr> community does not have much representation from Asia.</p>
address
- Rationale for addition
- Linked author contact information is generally more useful than unlinked author contact information.
- Example(s)
<address href="mailto:emeyer@example.com">Eric A. Meyer</address> <address href="http://meyerweb.com/eric/">Eric A. Meyer</address> <address href="http://mag.example.com/article/132/authors/">Ian Hickson, David Baron, and the Dalai Lama</address>
aside
- Rationale for addition
- In cases where an aside is a pullquote, it makes sense to link to the source of the quote that's been pulled. It may also be the case that an aside references an external resource and that linking the entire aside to that resource is a better user experience than linking a subset of the aside's text with an
a
element. - Example(s)
<aside href="http://guide.example.org/">Want to learn more? Our Giving Guide has the answers you seek!</aside> <p>He later joined a large company, continuing on the same work. <q>I love my job. <span id="aside-03">People ask me what I do for fun when I'm not at work. But I'm paid to do my hobby, so I never know what to answer.</span> Some people wonder what they would do if they didn't have to work... but I know what I would do, because I was unemployed for a year, and I filled that time doing exactly what I do now.</q></p> <aside href="#aside-03"> <q> People ask me what I do for fun when I'm not at work. But I'm paid to do my hobby, so I never know what to answer. </q> </aside>
blockquote
- Existing attributes
cite
- Rationale for addition
- To create a link to the source of the quoted material. This alone could be handled by the
cite
attribute, but the problem is that all of the linking semantics offered by thea
element's attributes are lost here. Thus, for example, it is impossible to indicate the media type of a podcast, or the base language of a quoted article.It is possible that bothcite
andhref
could be present with differing values. This would permit a citation of the whole work while linking to a section of the work, for example. In cases where ablockquote
has differing values forcite
andhref
, thehref
value should be used when the user activates the element. - Example(s)
<blockquote href="http://podcast.example.net/42" media="audio/x-mp3"> <p>So I told him I wasn't interested unless he threw in a Coney Island hot dog.</p> </blockquote> <blockquote cite="http://www.whatwg.org/specs/web-apps/current-work/" href="http://www.whatwg.org/specs/web-apps/current-work/#the-blockquote"> <p>The best way to represent a conversation is not with the cite and blockquote elements, but with the dialog element.</p> </blockquote>
cite
- Rationale for addition
- To create a link to the cited resource. With the various attributes, it becomes possible to indicate the media type of cited a podcast, or the base language of a cited article.
- Example(s)
<p><cite href="http://www.whatwg.org/specs/web-apps/current-work/">HTML5</cite> is a work in progress.</p> <p>I found <cite href="http://podcast.example.net/42" media="audio/x-mp3">Episode 42 of the "Frank 'n' Beans Hour"</cite> to be less amusing than previous entries.</p>
code
- Rationale for addition
- A fragment of code may need to be linked to the program from which it has been excerpted, or to documentation on that bit of code.
- Example(s)
<p>In WordPress, information about the blog installation can be retrieved using the <code href="http://codex.wordpress.org/Template_Tags/bloginfo">bloginfo()</code> function.</p>
del
- Existing attributes
cite
datetime
- Rationale for addition
- Providing a link to more detailed reasoning about the deletion. This alone could be handled by the
cite
attribute, but the problem is that all of the linking semantics offered by thea
element's attributes are lost.It is possible that bothcite
andhref
could be present with differing values. This would permit a citation of the whole work while linking to a section of the work, for example. In cases where adel
has differing values forcite
andhref
, thehref
value should be used when the user activates the element. - Example(s)
<del cite="http://blog.example.com/2008/06/04/sorry-hixie-i-was-on-drugs" href="http://blog.example.com/2008/06/04/sorry-hixie-i-was-on-drugs#p5" datetime="2008-06-04T23:45-04:00">I really hate cats.</del>
dfn
- Existing attributes
title
- Rationale for addition
- While there can be provision of an in-document definition, it is often useful to link to a more detailed or extended definition.
- Example(s)
<p>The <dfn href="http://www.gateworld.net/omnipedia/technology/links/g.d.o..shtml"> <abbr title="Garage Door Opener">GDO</abbr></dfn> is a device that allows off-world teams to open the iris.</p>
dialog
- Rationale for addition
- In cases where a fragment of a longer dialog is presented, it is useful to be able to link back to the original source dialog, so as to provide the context for the provided fragment.Note: it may be argued that this can be made unnecessary by wrapping the
dialog
element in a linkedblockquote
element. - Example(s)
<dialog href="http://meyerweb.com/eric/thoughts/2006/11/19/thats-pretty-old/"> <dt>Carolyn</dt> <dd>Daddy, what old is Bear?</dd> <dt>Eric</dt> <dd>Do you mean how old is Bear?</dd> <dt>Carolyn</dt> <dd>How old is Bear, yes.</dd> <dt>Eric</dt> <dd>I don't know, sweetie. How old do you think he is?</dd> </dialog>
div
- Rationale for addition
- There are times when a flow element is needed to contain a few bits of information that are all related, and could all benefit from being linked to an in-depth resource. Examples include error messages, portal boxes, and artistic gallery pages.
- Example(s)
<div id="error_note" href="/error-list.html"> <h3>Errors</h3> <p>No errors.</p> </div> <div class="photo" href="19823-detail.html"> <img src="pix/19283.jpg" alt="" /> 19283. Lady in waiting. </div>
figure
- Rationale for addition
- A figure may properly link to more information or an alternate view of the content(s) enclosed in the figure. Examples include high-resolution versions of displayed images, pages which provide more detailed information about the figure, and so on.
- Example(s)
<figure href="bubbles-work-hires.jpg"> <img src="bubbles-work.jpeg" alt="Bubbles, sitting in his office chair, works on his latest project intently."> <legend>Bubbles at work</legend> </figure> <figure href="castle-history.html"> <img src="castle1423.jpeg" title="Etching. Anonymous, ca. 1423." alt="The castle has one tower, and a tall wall around it."> <img src="castle1858.jpeg" title="Oil-based paint on canvas. Maria Towle, 1858." alt="The castle now has two towers and two walls."> <img src="castle1999.jpeg" title="Film photograph. Peter Jankle, 1999." alt="The castle lies in ruins, the original tower all that remains in one piece."> <legend>The castle through the ages: 1423, 1858, and 1999 respectively.</legend> </figure>
footer
- Rationale for addition
- While footers may contain multiple pieces of information, in many cases they will be used to provide "back to top" or "back to table of contents" functionality. It is also possible that a footer containing a quick notice of ownership would need to link to a more detailed page containing terms of use, privacy policies, and more.
- Example(s)
<footer href="../">Back to index...</footer> <h1>Lorem ipsum</h1> <p>A dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip xea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> <footer href="../">Back to index...</footer>
h1
- Rationale for addition
- Headings are sometimes linked to other resources. One example would be linking a site-identifying
h1
to the home page of the site. - Example(s)
<h1 href="/index.html">ConHugeCo Inc.</h1>
h2
- Rationale for addition
- Headings are sometimes linked to other resources. One example would be linking the chapter titles in a table of contents to the actual chapter documents.
- Example(s)
<h1>Table of Contents</h1> <h2 href="ch1.html">Chapter 1. Introduction</h2> <h2 href="ch2.html">Chapter 2. Tea For Two</h2> <h2 href="ch3.html">Chapter 3. Thrice the Price</h2> <h2 href="ch4.html">Chapter 4. The Larch</h2>
h3
- Rationale for addition
- Headings are sometimes linked to other resources. One example would be linking the section and subsection headings of a particularly long document back to the top of the page.
- Example(s)
<h3 href="#top">Enjoying the sun</h3>
h4
- Rationale for addition
- Headings are sometimes linked to other resources.
- Example(s)
- See the examples for
h1
,h2
, andh3
.
h5
- Rationale for addition
- Headings are sometimes linked to other resources.
- Example(s)
- See the examples for
h1
,h2
, andh3
.
h6
- Rationale for addition
- Headings are sometimes linked to other resources.
- Example(s)
- See the examples for
h1
,h2
, andh3
.
img
- Existing attributes
alt
height
ismap
src
usemap
width
- Rationale for addition
- It is incredibly common to have an image link to some other resource-a higher-resolution version, a resource of another medium (such as an image of a speaker linking to an audio file), or another web page.
- Example(s)
<img src="picture22.gif" href="picture22-hires.gif" alt="A picture of my face"> <img src="audio.gif" alt="Audio file (822KB)" href="ringtone.mp3"> <img href="page27.html" src="next.gif" alt="Next page">
ins
- Existing attributes
cite
datetime
- Rationale for addition
- Providing a link to more detailed reasoning about the insertion. This alone could be handled by the
cite
attribute, but the problem is that all of the linking semantics offered by thea
element's attributes are lost.It is possible that bothcite
andhref
could be present with differing values. This would permit a citation of the whole work while linking to a section of the work, for example. In cases where ains
has differing values forcite
andhref
, thehref
value should be used when the user activates the element. - Example(s)
<ins cite="http://blog.example.com/2008/06/04/sorry-hixie-i-was-on-drugs" href="http://blog.example.com/2008/06/04/sorry-hixie-i-was-on-drugs#p8" datetime="2008-06-04T23:45-04:00">I just lurrrve cats, especially little kitties.</ins>
kbd
- Rationale for addition
- There are circumstances in which a bit of keyboard input needs to be linked to explanatory information. This would be especially useful in "help" systems and tutorials for newcomers to a program (or computing in general).
- Example(s)
If you want to access the console press <kbd href="where-is-the-tilde-key.htm">Tilde</kbd>
legend
- Rationale for addition
- There are circumstances in which the legend of a
figure
,fieldset
, or other containing object should link to more information or a related resource. - Example(s)
<fieldset> <legend href="/help/personalinfo.html">Personal information</legend> ... </fieldset> <figure> <object type="application/x-java-applet"> <param name="code" value="MyJavaClass"> <p>You do not have Java available, or it is disabled.</p> </object> <legend href="/proj/java/clock.html">My Java Clock</legend> </figure>
li
- Existing attributes
value
- Rationale for addition
- In many cases, most obviously the use of a list to contain a set of navigation links, list items are entirely filled by hyperlinks and no other content. Although the
a
elements may sometimes be useful for styling purposes, they are superfluous structural elements and could in some cases be replaced by linked list items. - Example(s)
<nav> <h1>Navigation</h1> <ul> <li href="articles.html">Index of all articles<li> <li href="today.html">Things sheeple need to wake up for today<li> <li href="successes.html">Sheeple we have managed to wake<li> </ul> </nav>
mark
- Rationale for addition
- Content which has been highlighted using
mark
may be served by creating a link to some resource which explains in more detail the reason for the highlighting. It also provides a method by which highlighting marks can refer to other parts of the same document. - Example(s)
<p><mark href="#notes">An obstruction in a gate will prevent it from accepting a wormhole connection.</mark></p>
meter
- Existing attributes
high
low
max
min
optimum
value
- Rationale for addition
- Meters will often benefit from being linked to resources which explain how the metered levels are determined, or to give more detailed information about the specific metering level being displayed.
- Example(s)
<p><meter value="0.25" href="/ranking.html#low">Low activity,</meter> Usenet, 66 subscribers</p> <meter href="/how-we-measure.html" min=0 max=20 value=12 title="centimeters">12cm</meter>
progress
- Existing attributes
max
value
- Rationale for addition
- In a fashion similar to
meter
,progress
indicators will in some cases need to be linked to more details about the thing whose progress is being tracked. This would be especially helpful in cases where there are multiple progress indicators on a single page, such as a download tracker. - Example(s)
<progress href="details?thing=7">21%</progress>
q
- Existing attributes
cite
- Rationale for addition
- To create a link to the source of the quoted material. This alone could be handled by the
cite
attribute, but the problem is that all of the linking semantics offered by thea
element's attributes are lost here. Thus, for example, it is impossible to indicate the media type of a podcast, or the base language of a quoted article.It is possible that bothcite
andhref
could be present with differing values. This would permit a citation of the whole work while linking to a section of the work, for example. In cases where aq
has differing values forcite
andhref
, thehref
value should be used when the user activates the element. - Example(s)
<p>As Tim Berners-Lee said, <q href="http://example.com/quotes/tbl33.html"> "That idea of URL was the basic clue to the universality of the Web. That was the only thing I insisted upon."</q></p> <p>His best argument: <q href="http://lists.example.org/Archives/2008/Mar/71193#p22" cite="http://lists.example.org/Archives/2008/Mar/71193">I disagree!</q></p>
samp
- Rationale for addition
- Samples of output are often not enough to provide a full working knowledge of their causes and resolution. Linking to more information is often desirable in these circumstances.
- Example(s)
The program responded with <samp href="manual-error500.html">Error 500: Program had an error!</samp>, so I reverted the config file.
sub
- Rationale for addition
- Subscript elements often represent terms or concepts which may be unfamiliar to the reader; for example, in formulas. They can also be used to denote numeric systems which would benefit from being linked to more detailed explanations.
- Example(s)
V = <sub href="transverse.html">T</sub> - <sub href="radial.html">r</sub> 100<sub href="binary.html">bin</sub> = 4<sub href="decimal.html">dec</sub></pre>
sup
- Rationale for addition
- Superscript elements are used to create footnote references, and those references are usually linked to the actual footnotes (with corresponding superscripted numbers in the footnotes that link back to the referencing text). Rather than having a
sup
wrapping ana
element, it would make more sense to link the superscript itself. - Example(s)
<p>It has been shown that the decline in pirates is directly correlated to the rise in global temperatures.<sup href="#footnote-003">[3]</sup></p>
td
- Existing attributes
colspan
rowspan
- Rationale for addition
- In tables of data, each cell is often a small fragment of content summarizes more in-depth data. For example, a cell might contain a total dollar amount for a certain product or period of time (or both), or test results, or any number of other things. The ability to click on that cell and get a detailed breakdown of the figures that went into the presented content is highly valuable.
- Example(s)
<td href="sales?product=a44">$27,924</td> <td href="benchmark?ua=ff&t=7">244ms</td>
th
- Existing attributes
colspan
rowspan
scope
- Rationale for addition
- Table headers can be cryptic in the interests of having small amounts of content. Being able to link from those cells directly to a legend (or key) explaining what they mean improves the usefulness of the table.
- Example(s)
<th href="legend.html#PHA">PHA</th> <th href="legend.html#O2V%">O2V %</th>
time
- Existing attributes
datetime
- Rationale for addition
- There are two use cases here. The first is where time-based information may need to link to more detailed information; for example, the times in a public transportation schedule linking to more information about that route, station, or bit of the schedule. The other, which is already widespread, is the use of posting times as "permalinks" for both blog posts and comments on them.
- Example(s)
<time datetime="2008-06-05T16:50:37-00:00" href="http://meyerweb.com/eric/thoughts/2008/06/05/strengthening-links/">Thu 5 Jun 2008 1250</time>
tr
- Rationale for addition
- In tables of data, each row is often a grouping of information that summarizes more in-depth data. For example, a row of numbers showing income and expense totals for one month of the year could link to a detailed breakdown of that month's activity. The ability to click on the row to get to that information is highly valuable.
- Example(s)
<tr href="show_flow.php?month=200805"> ... </tr> <tr href="sales?state=OH&product=722"> ... </tr>
var
- Rationale for addition
- A variable may be defined (in the sense of its role in a program being explained) away from mention of the variable, so linking to the definition assists in recall and learning. Less commonly, there may be a need to link to related material which explains the use of variables in general.
- Example(s)
<p>Here we pass the variable <var href="#var-loop">loop</var> to the function.</p> <p>If there are <var href="what-is-n.html">n</var> pipes leading to the ice cream factory then I expect at <em>least</em> <var>n</var> flavours of ice cream to be available for purchase!</p>
video
- Rationale for addition
- It is a widespread convention that embedded video leads back to a main page or other resource describing more about the video (see, for example, any embedded YouTube or Vimeo video).
- Example(s)
<video src="bigdog.mov" href="http://bostondynamics.com/content/sec.php?section=BigDog" autoplay controls>
Possible Additions
These are the elements that seemed to be good candidates on the first pass, but upon further reflection failed to present obvious use cases. I'm open to suggestions.
article
- Rationale for addition
- I'm not sure there's any reasonable case for linking an entire article.
- Example(s)
???
caption
- Rationale for addition
- I had thought that a caption could link to more information about the table in question, but that seemed better handled by linking the actual table itself.
- Example(s)
???
dd
- Rationale for addition
- Sort of by definition (ah ha ha), the contents of this element should provide whatever information is needed-in other words, there shouldn't be a need to link to more detailed information.
- Example(s)
???
details
- Existing attributes
open
- Rationale for addition
- I'm not even 100% sure I get what this element is meant to do, so it was hard to find a use case for linking it.
- Example(s)
???
dt
- Rationale for addition
- The only thing this would seem to need to link to is the associated
dd
, which is right there in the markup (as in adjacent) so attribute-based linking doesn't seem to make much sense. On the other hand, should this be added as a machinie-parseable way of associating a definition with the term? Or do we rely on the structural adjacency for that? - Example(s)
???
header
- Rationale for addition
- There was a fairly straightforward use case for
footer
, but this didn't have the same ease of casing. - Example(s)
???
p
- Rationale for addition
- A whole paragraph as a link... hmmm. This didn't seem too likely a scenario.
- Example(s)
???
pre
- Rationale for addition
- Like
p
, it was hard to think of a reason to need to link an entirepre
. - Example(s)
???
span
- Rationale for addition
- It really seemed like if you needed a generic inline element to create a hyperlink, you'd use
a
, notspan
. - Example(s)
???
table
- Rationale for addition
- Do the rationales presented for
tr
,th
, andtd
make sense when applied to the whole table? Are there other rationales for full-table linking? - Example(s)
???
tbody
- Rationale for addition
- Though it seemed obvious that one would extrapolate from cell linking to row linking to table-sectional linking, no specific use cases came to mind when actually faced with
tbody
. If it's possible to have multipletbody
elements in the same table, then use cases are much easier to imagine, but the specification doesn't make clear whether or not this is the case. If multiples are not allowed, then is there any reason to make this element linkable? (The same questions and thinking hold fortfoot
andthead
.) - Example(s)
???
tfoot
- Rationale for addition
- See
tbody
. - Example(s)
???
thead
- Rationale for addition
- See
tbody
. - Example(s)
???
(Possibly) Unsuitable Elements
These are the elements that did not seem to have use cases when I first went through the list. They are included here to round out the list of HTML5 elements, and also as a resource for reconsidering whether any of them would benefit from being linkable.
audio
b
bdo
body
br
canvas
col
colgroup
command
datagrid
datatemplate
dl
em
embed
event-source
hr
html
i
iframe
mark
map
menu
meta
nav
nest
noscript
object
ol
param
rule
script
section
small
source
strong
style
title
ul
Elements That Already Link
Those elements that already provide some form of linking via the
href
attribute, and so don't need extra linkability. Two-a
and area
-also have the attributes hreflang
, media
, ping
, rel
, target
, and type
.a
area
base
link
- Published Thursday 5 June 2008 16:09:18 UTC - Last updated Thursday 12 June 2008 19:00:57 UTC