[whatwg] [HTML5] A content in <img> elements for ASCII art

Tab Atkins Jr. a ?crit :
> On Tue, Nov 24, 2009 at 11:50 PM, David Bruant
> <bruant at enseirb-matmeca.fr> wrote:
>   
>> => However, for this point, I am confused. It's true that currently,
>> <img> elements are not intended to have a content, but ASCII art, as
>> images, is probably the best (if not only ?) reason to allow text
>> content in img elements, thus naturally allowing the alt attribute which
>> doesn't exist in the "second-closest" semantic element.
>>     
>
> It's impossible at this point to make <img> elements take contents.
> They're void elements in every single browser in existence.
>   
=> I take this argument as a "pro" argument for two reasons :
- <img> are void elements in every single browser, so, if this "status"
changes in HTML5, they can all change the behavior of <img> element at
the same time (which would be harder if some browser had already given a
meaning to a <img> content)
- web developers know that so far, <img> elements were void elements, so
adding a content to <img> won't make the least retro-compatibility
problem with what already exists.

As a consequence, I propose that :
- the src attribute of the <img> element becomes optional.
- content is allowed in the <img> element and rendered if the src
attribute is not present.

David
> ~TJ
>   

Received on Tuesday, 24 November 2009 22:19:46 UTC