Re: Let every element have a src attribute

Dao Gottwald wrote:
> Elliott Sprehn wrote:
>> 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?
> 
> The first replaces a paragraph by an external source, the latter 
> replaces, well ... anything (since div doesn't carry significant semantics.)

   That's interesting, because I thought it was the other way around.
The content is supposed to replace the image if the image doesn't load.

>> 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?
> 
> The image itself is the paragraph.

   I've heard that "a picture is worth a thousand words", but this is
ridiculous. In the current model, the image doesn't replace a paragraph;
the paragraph is fallback for the image in cases where the person either
can't obtain the image or can't see it. An image doesn't communicate a
paragraph of information. The paragraph is just there to give you a
vague sense of the image.

> Note that the same is possible with CSS3, e.g.
>    p { content: url(foo.png); }
> But that works with images only; a in-markup solution with the "type" 
> attribute can be more powerful.

   Then why not just use <object>?

>> Also, what benefit beyond slightly reducing the markup by removing the 
>> <object> tag does this provide?
> 
> It's more intuitive and links the external source with the semantics it 
> carries directly.

   I don't see it as more intuitive at all. What the heck is "src"
supposed to mean to anyone? Furthermore, the primary semantics are
supposed to be the image, not the paragraph, so you've turned the markup
on its head by the primary semantic an attribute while the secondary
fallback becomes the element. Remember that attributes are CHILDREN of
elements, not the other way around.

>>  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>.
> 
> <img> has much clearer semantics than what? It tells me as much as a 
> single text node does. That is, the surrounding markup carries the 
> semantics, but <img> itself doesn't.

   The image IS the semantics! If it wasn't, you could just use CSS. The
surrounding markup doesn't define the image any more than the
surrounding text defines a particular word.

Received on Monday, 2 April 2007 11:12:33 UTC