This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 10380 - Description of IDL sets for enumerated attributes does not appear to match reality
Summary: Description of IDL sets for enumerated attributes does not appear to match re...
Status: CLOSED FIXED
Alias: None
Product: HTML WG
Classification: Unclassified
Component: pre-LC1 HTML5 spec (editor: Ian Hickson) (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: HTML WG Bugzilla archive list
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-16 23:19 UTC by contributor
Modified: 2010-10-04 14:46 UTC (History)
5 users (show)

See Also:


Attachments

Description contributor 2010-08-16 23:19:52 UTC
Section: http://www.whatwg.org/specs/web-apps/current-work/#reflecting-content-attributes-in-idl-attributes

Comment:
"the content attribute must be set to the conforming value associated with the
state that the attribute would be in if set to the given new value".  Does
this imply in canonical case?  Browsers seem to preserve the case when you do
an IDL set.  This alerts "tExT" in Firefox, Chrome, and Opera:
data:text/html,<!doctype html><script>var el =
document.createElement("input"); el.type = "tExT";
alert(el.getAttribute("type"));</script>

Posted from: 68.175.61.233
Comment 1 Aryeh Gregor 2010-08-16 23:26:52 UTC
Don't forget to say what happens to case if you set the IDL attribute to a non-conforming value.  Then presumably you'd need to use canonical case.  I don't think any browser actually limits any enum with non-conforming values to known values only -- the only one of those seems to be area.shape, and Firefox/Chrome/Opera seem not to limit it to known values -- so I guess you'll have to make something up there.
Comment 2 Aryeh Gregor 2010-09-17 18:01:35 UTC
The simple way to fix this would be to just change

"""
on setting, if the new value is an ASCII case-insensitive match for one of the keywords given for that attribute, then the content attribute must be set to the conforming value associated with the state that the attribute would be in if set to the given new value, otherwise, if the new value is the empty string, then the content attribute must be removed, otherwise, the content attribute must be set to the given new value.
"""

to

"""
on setting, the content attribute must be set to the given new value.
"""

This seems to match what browsers do a lot more closely.  I don't notice browsers implementing the magic behavior required for the empty string, either.
Comment 3 Ian 'Hixie' Hickson 2010-09-28 23:10:45 UTC
Looks like you're right. The only browser I could find that does the empty string thing is Chrome, which removes the attribute for <input type> and e.type = ''. Other than that you seem right.

EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Accepted
Change Description: see diff given below
Rationale: Concurred with reporter's comments.
Comment 4 contributor 2010-09-28 23:11:24 UTC
Checked in as WHATWG revision r5537.
Check-in comment: Match UAs better for 'limited to known values' reflection.
http://html5.org/tools/web-apps-tracker?from=5536&to=5537