W3C home > Mailing lists > Public > whatwg@whatwg.org > June 2010

[whatwg] Serialization of boolean content attributes

From: Alexey Proskuryakov <ap@webkit.org>
Date: Fri, 18 Jun 2010 10:15:15 -0700
Message-ID: <E7BD2E06-DA82-46A1-9B4C-C2CC50DD227C@webkit.org>

My reading of HTML5 is that boolean content attributes with no value  
are serialized as e.g. <option selected="">. That's not what shipping  
versions of Firefox or IE do, and this markup is invalid per HTML 4,  
which is a concern for some people.

Here are some examples of what Firefox 3.6.3 does, and what would be  
my preference for WebKit (which currently matches HTML5):

<option selected> -> <option selected="selected">
<option selected=""> -> <option selected="selected">
<option selected="foo"> -> <option selected="foo">

IE is different, and serializes all these examples as <option  
selected>. That wouldn't be my preference, since that's invalid XML,  
but at least it's valid HTML 4.
This is tracked as WebKit bug <https://bugs.webkit.org/show_bug.cgi?id=22678 

- WBR, Alexey Proskuryakov
Received on Friday, 18 June 2010 10:15:15 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:24 UTC