[whatwg] Case canonicalization for reflected enumerated attributes limited to known values

Aryeh Gregor Simetrical+w3c at gmail.com
Tue Aug 17 12:08:34 PDT 2010


Test case:

<!doctype html>
<script>
   var el = document.createElement("form");
   el.setAttribute("method", "get");
   alert(el.method);
   el.setAttribute("method", "GET");
   alert(el.method);
</script>

Spec:

"""
If a reflecting IDL attribute is a DOMString whose content attribute
is an enumerated attribute, and the IDL attribute is limited to only
known values, then, on getting, the IDL attribute must return the
conforming value associated with the state the attribute is in (in its
canonical case) . . .
"""
http://www.whatwg.org/specs/web-apps/current-work/multipage/urls.html#reflecting-content-attributes-in-idl-attributes

This says it should echo "GET" twice.  Four out of the five browsers I
tested in (Firefox 4 beta, Chrome dev, Safari 5, Opera 10.60) echo
"get" and then "GET".  IE8 and IE9PP4 echo "get" twice.  I think the
spec and IE are right here -- you should be able to test form.method
== "GET" (or == "get", whichever) and have it work whenever it's in
the GET state.  However, since 4/5 of browsers disagree, I'm asking if
anyone thinks the spec should be changed, before I file browser bugs.

(I've also filed a bug suggesting that the canonical case for this
keyword be lowercase:
http://www.w3.org/Bugs/Public/show_bug.cgi?id=10388 )



More information about the whatwg mailing list