Re: Void elements in HTML (Was: ZIP-based packages and URI references into them ODF proposal)

On Wed, Dec 31, 2008 at 1:57 AM, Philip Taylor <pjt47@cam.ac.uk> wrote:
> Jonas Sicking wrote:
>>
>> [...]
>>
>> I actually think it would be great to support the ending-slash syntax
>> for all elements in HTML5. I have several times ended up writing
>> things like <div id=foo></div>, and having it consistently supported
>> in both HTML mode and foreign content mode would actually reduce the
>> differences between them which I think is a great thing.
>>
>> I have heard of some real world pages that would break if the empty
>> element syntax was supported everywhere, however I wonder if it's many
>> enough that we need to adjust HTML to accommodate them.
>
> There's millions - a quick search through some random pages gives lots of
> examples of <a ... />...</a>, which would clearly break, like:
>
> http://www.haliburtonrealestate.on.ca/ -- <li><a href="http://www.mls.ca"
> target="_blank" title="Multiple Listing Service" />MLS</a>
>
> http://www.ccitula.ru/ -- <a href="pages/virtv.htm"/> <img
> src=http://www.ruschamber.net/banner/VEru158x50.jpg border=0></a>
>
> http://takasago.shop-pro.jp/ -- <a href="?pid=1912944" /><img
> src="http://img05.shop-pro.jp/PA01015/854/product/1912944_th.jpg"
> class="border" /></a>
>
> http://www.alternativegreetingcards.com/ -- <a href="products.asp?id=57"
> class="submenu" />Wizard of Oz</a>

Ugh, that sucks (i'd be very interested to know how you found this data).

Maybe an alternative "fix" would be to allow the empty-element syntax
to be supported on all unknown elements. This would allow an author to
write "<killswitch />" to make down-level implementations create the
same DOM as implementations that know that <killswitch> is a void
element. Once enough browsers support the <killswitch> elements that
the author doesn't care about down-level support the ending '/' can be
dropped.

/ Jonas

Received on Wednesday, 31 December 2008 01:09:09 UTC