[whatwg] href synonyms?

On Thu, Dec 9, 2010 at 8:24 AM, Roger H?gensen <rescator at emsai.net> wrote:
> 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).

You mean <img href="foo"> and/or <a src="foo"> should work?  That
would be very confusing.  What happens if you have <img href="foo"
src="bar">?  In particular, will code like

    document.getElementsByTagName("img")[0].src = "foo";

still work even if there's also an href attribute?  Or what about

    document.getElementsByTagName("img").removeAttribute("src");

to hide the image?  That will suddenly fail if there's an href
attribute.  This is not, in effect, a backwards-compatible change.
(Although it would be nice if <link rel="stylesheet" href="foo"> and
<script src="foo"></script> worked the same way, like <style
src="foo"></style> or such . . .)

Or am I misunderstanding you?

Received on Thursday, 9 December 2010 09:57:18 UTC