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 9847 - legacy color value parsing algorithm should trim whitespace
Summary: legacy color value parsing algorithm should trim whitespace
Status: RESOLVED 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-06-03 23:09 UTC by contributor
Modified: 2011-05-08 00:40 UTC (History)
5 users (show)

See Also:


Attachments

Description contributor 2010-06-03 23:09:38 UTC
Section: http://www.whatwg.org/specs/web-apps/current-work/#colors

Comment:
I think the rules for parsing a legacy color value should specify that
whitespace at the edges of the string is removed before running the rest of
the algorithm.	Gecko and (if my memory is correct) WebKit both do this, so
it's certainly Web-compatible behavior.  And it seems quite odd for <body
bgcolor=" red"> to fall through to the legacy color parsing algorithm rather
than producing the obvious result.

Posted from: 63.245.220.240
Comment 1 L. David Baron (Mozilla) 2010-06-03 23:15:22 UTC
That was me reporting this.  Now I know what happens when I use the comment UI on the spec.
Comment 2 L. David Baron (Mozilla) 2010-06-03 23:17:08 UTC
And a better URL is:
http://www.w3.org/TR/html5/infrastructure.html#rules-for-parsing-a-legacy-color-value
Comment 3 Ian 'Hixie' Hickson 2010-08-26 05:02:36 UTC
The TR/ page is rarely a better URL, but the fragment identifier in question might be better. :-)

BTW if you log in using the login button at the top right of the spec, you'll get CC'ed automatically on Bugzilla bugs (assuming you use the same e-mail address for both).
Comment 4 Ian 'Hixie' Hickson 2010-08-26 05:48:12 UTC
How about <body bgcolor=" #f00"> ? or <body bgcolor=" #f00000">? or <body bgcolor=" f00">? I'm not clear on when we stop having to produce the "obvious" result here.

WebKit, Opera, and Firefox (the browsers I could easily test here) all have different boundaries with respect to how far they're willing to go.
Comment 5 Ian 'Hixie' Hickson 2010-08-26 05:50:20 UTC
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: Done as requested for now. I'm concerned that this will lead to a slippery slope of further requests, in which case I will ask for data showing how this is handled in legacy browsers.
Comment 6 contributor 2010-08-26 05:50:37 UTC
Checked in as WHATWG revision r5359.
Check-in comment: Make ' red' parse as 'red' for legacy colours.
http://html5.org/tools/web-apps-tracker?from=5358&to=5359
Comment 7 Ian 'Hixie' Hickson 2010-08-26 05:55:01 UTC
(According to Paul Irish, IE (6, 8, 9) doesn't ignore spaces here, by the way.)
Comment 8 Ian 'Hixie' Hickson 2011-05-08 00:40:26 UTC
Follow-up in bug 12372.