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 24661 - Consume a numeric token misses the first digit
Summary: Consume a numeric token misses the first digit
Status: RESOLVED FIXED
Alias: None
Product: CSS
Classification: Unclassified
Component: Syntax (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Tab Atkins Jr.
QA Contact: public-css-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-14 12:55 UTC by Yoav Weiss
Modified: 2014-02-14 16:02 UTC (History)
1 user (show)

See Also:


Attachments

Description Yoav Weiss 2014-02-14 12:55:41 UTC
In http://dev.w3.org/csswg/css-syntax/#consume-a-token , when the input code point consumed is a digit, the spec indicates: "Consume a numeric token, and return it."
The numeric token consumption starts from the next unconsumed input code point, resulting in the first digit being discarded and not added to the numeric token.

Other code points that lead to "consume a numeric token" (e.g. '+', '-', '.') indicate to reconsume the current code point before calling "consume a numeric token". I think that the "digit" code point should include similar instructions.
Comment 1 Simon Sapin 2014-02-14 16:02:49 UTC
Thanks for reporting! This was a spec bug, fixed in
https://dvcs.w3.org/hg/csswg/rev/8663b0d5bbf0

This is a nice example of why we want *independent* implementations to validate the spec. I implemented this twice without noticing the bug, because I knew what the spec was supposed to say.