Re: Let every element have a src attribute

This would seem to complicate semantics to me. What's the difference  
between <p src=""> and <div src=""> in terms of the meaning of the  
replaced content?

If you think about how it is now <p><img></p> is an image inside the  
paragraph, but if we allow <p src=""> then is that an image inside  
the paragraph or is the image itself a paragraph or is it just an  
image unless it doesn't load and then its a paragraph?

Also, what benefit beyond slightly reducing the markup by removing  
the <object> tag does this provide?

 From what I see the only case for extending the existing behavior in  
a similar manner would be supplementing the alt attribute on the  
<img> element with the element contents since <img> has much clearer  
semantics, similar to the behavior of <video> or <audio>.

- Elliott

On Mar 29, 2007, at 11:32 AM, Dao Gottwald wrote:

>
> In order to avoid having to mess with a bunch of related attributes  
> as with "href", I'd allow "src" (or "data"?) and "type" only. I'd  
> see it as a <object> shorthand, thus it should behave the same when  
> it comes to events.
>
> Note that by "every element", I mean those who can have visible  
> child nodes. This way you automatically exclude elements that have  
> a src attribute today.
>
> That's all a bit tricky though, as it implies inconsistencies. E.g.  
> <img src="foo.png" alt="foo"> would differ from <span  
> src="foo.png">foo</span> in some non-obvious ways.
>
> --Dao
>
> Anne van Kesteren wrote:
>> On Wed, 28 Mar 2007 18:29:21 +0200, Dao Gottwald <dao@design- 
>> noir.de> wrote:
>>> .... which seems very plausible to me. Contrary to letting every  
>>> element have a href attribute, it's backwards-compatible by design.
>> Not really. <script src> has very different semantics from <img  
>> src>, <iframe src> and <embed src> for instance which have  
>> different semantics from <video src>, <event-source src> and  
>> <source src> (which also all differ from each other). The  
>> semantics of an element are in general decided by the element and  
>> after that by their attributes. This means that how the attribute  
>> functions depends on the element and not the other way around.
>> Exactly the same arguments as for href="" apply I would say. For  
>> src="" you have can think about how loading would happen for the  
>> element. When are the various events dispatched? Does the element  
>> delay the load event of the document? Does it start loading the  
>> monment it is inserted? Does mutating the src="" attribute affect  
>> any API (see <event-source>)? Et cetera.
>
>

Received on Monday, 2 April 2007 13:52:53 UTC