[whatwg] href synonyms?

Roger Hågensen rescator at emsai.net
Thu Dec 9 05:24:05 PST 2010


This has irked me lately...

    * <a> uses /href/ (outbound)
    * <link> uses /href/ (inbound and outbound)
    * <img> uses /src/ (inbound)
    * <iframe> uses /src/ (inbound)
    * <script> uses /src/ (inbound)
    * <embed> uses /src/ (inbound)
    * <object> uses /data/ (inbound)
    * <applet> uses /code/ (inbound)
    *   css @import (inbound)
    * I'm sure I missed some more that should be listed here too.

It seems like in all cases these are simply a URI, and whether it takes 
you to some place or if it loads in something is purely contextual.
So why not spec all those to simply be synonyms for href (which is used 
both for inbound and outbound).

I assume that pretty much all browsers do treat these as pretty much the 
same anyway or? (i mean code/parsing wise)
None of the above supports both inbound and outbound at the same time, 
they are either/or instead, or context dependent.
So if href src data and code and @import all mostly overlap their 
implementations, why not spec them to be synonyms and point to the href 
spec?
Eventually the synonyms will die out and href and src may just end up as 
a visual hint to the author about which direction something goes.

The alternative is to go through all those and ensure that href is 
always outbound and src is always inbound everywhere in the spec and 
that data and code and @import is replaced by src.

I could care less which is the best solution of these two alternatives.
A. Everything is a synonym for href, and tag or context determines 
inbound/outbound.
or
B. Everything is a synonym for href or src, and href determines outbound 
and src determines inbound.

How does the browsers currently handle this internally? And would 
solution A or B require the least changes?

When using view as source (at least in Firefox and Chrome) and then 
clicking on say a src uri will treat it as if it was href, so here src 
and href are synonymous and context determines behavior. Though one 
could argue the document source has been transformed into a new document 
for display.

-- 
Roger "Rescator" Hågensen.
Freelancer - http://EmSai.net/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20101209/96777a64/attachment.htm>


More information about the whatwg mailing list