[whatwg] href synonyms?

Nils Dagsson Moskopp nils-dagsson-moskopp at dieweltistgarnichtso.net
Thu Dec 9 06:00:39 PST 2010


Roger Hågensen <rescator at emsai.net> schrieb am Thu, 09 Dec 2010
14:24:05 +0100:

> This has irked me lately...
> 
>     * <a> uses /href/ (outbound)
>     * <link> uses /href/ (inbound and outbound)

Both refer to (mostly hypertext) documents.

>     * <img> uses /src/ (inbound)
>     * <iframe> uses /src/ (inbound)
>     * <script> uses /src/ (inbound)
>     * <embed> uses /src/ (inbound)

All refer to (opaque) blobs.

>     * <object> uses /data/ (inbound)
>     * <applet> uses /code/ (inbound)

Those are more and more obsolete.

>     *   css @import (inbound)

That is a different language than CSS.

>     * I'm sure I missed some more that should be listed here too.

<embed> ?

> 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).

Because the attribute name refers to the type of the resource, not the
type of the name of the location of the resource.

> 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.

What do you mean by inbound / outbound? In-band and out-of-band?

> 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?

What benefit would that have? State a possible use case.

Be aware that this change would be not backwards compatible.

Keep in mind that more possibilities may needlessly confuse authors.

> 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.

Whom would be helped by that?

> 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.

Same question as above.

> 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?

Solution C “Don't change anything” would 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.

Does that matter?

Also: Your suggestion is founded on aesthetical reasoning. HTML is ugly.

-- 
Nils Dagsson Moskopp // erlehmann
<http://dieweltistgarnichtso.net>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 230 bytes
Desc: not available
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20101209/fed81e3b/attachment-0002.pgp>


More information about the whatwg mailing list