<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>17509</bug_id>
          
          <creation_ts>2012-06-16 11:08:46 +0000</creation_ts>
          <short_desc>Include sign in NUMBER, PERCENTAGE, and DIMENSION tokens</short_desc>
          <delta_ts>2012-06-17 19:50:18 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>CSS</product>
          <component>CSS Level 2</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>ASSIGNED</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Anton P">antonsforums</reporter>
          <assigned_to name="Bert Bos">bert</assigned_to>
          <cc>kennyluck</cc>
          
          <qa_contact>public-css-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>69132</commentid>
    <comment_count>0</comment_count>
    <who name="Anton P">antonsforums</who>
    <bug_when>2012-06-16 11:08:46 +0000</bug_when>
    <thetext>Reported by Tab Atkins Jr. and fantasai

In 4.1 and G.2, the NUMBER, PERCENTAGE, and DIMENSION tokens (amongst others in G.2 such as LENGTH and ANGLE) depend on the {num} macro which is defined as

  # num 	[0-9]+|[0-9]*\.[0-9]+
in 4.2, and as

  # num 	[0-9]+|[0-9]*&quot;.&quot;[0-9]+
in G.2.

The optional leading + or - sign that can be used with these tokens is tokenized as a separated DELIM token, and is combined with the following token during parsing.

This implies that you can insert a comment between the sign and the number.  This is undesirable for the following reasons:

1. It&apos;s unintuitive and doesn&apos;t serve much useful purpose;
2. It&apos;s not interoperable, since Gecko and PrinceXML both parse the sign as 3. part of the NUMBER/etc token, whilst other UAs seem to follow the spec;
3. It makes it difficult for spec authors to talk about numbers and such in grammar terms, because they must always remember to also allow an optional + or - DELIM preceding the tokens.

Conversation begins:
Bug report:
http://lists.w3.org/Archives/Public/www-style/2012Apr/0639.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69133</commentid>
    <comment_count>1</comment_count>
    <who name="Anton P">antonsforums</who>
    <bug_when>2012-06-16 11:10:01 +0000</bug_when>
    <thetext>The WG resolved to include the sign in the NUMBER, PERCENTAGE, and DIMENSION tokens: http://lists.w3.org/Archives/Public/www-style/2012May/0235.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69134</commentid>
    <comment_count>2</comment_count>
    <who name="Anton P">antonsforums</who>
    <bug_when>2012-06-16 11:15:22 +0000</bug_when>
    <thetext>The wording proposed and added to the errata doc at http://www.w3.org/Style/css2-updates/REC-CSS2-20110607-errata.html is to clarify that neither comments nor spaces are allowed after the sign in property values that are defined as &lt;number&gt;, &lt;length&gt; or &lt;percentage&gt;:

In 4.3.1 (Integers and real numbers), insert the word &quot;immediately&quot; as follows:

  | Both integers and real numbers may immediately be preceded by a &quot;-&quot;
  | or &quot;+&quot; to indicate the sign. 


Proposal:
http://lists.w3.org/Archives/Public/www-style/2012May/0727.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69136</commentid>
    <comment_count>3</comment_count>
    <who name="Anton P">antonsforums</who>
    <bug_when>2012-06-16 11:18:09 +0000</bug_when>
    <thetext>The proposal and errata item in Comment 2 does not match the resolution made by the WG (see Comment 1).

Objection to proposed change: http://lists.w3.org/Archives/Public/www-style/2012May/0741.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69138</commentid>
    <comment_count>4</comment_count>
    <who name="Anton P">antonsforums</who>
    <bug_when>2012-06-16 11:26:39 +0000</bug_when>
    <thetext>Bjoern Hoehrman notes that 4.1.1 (Tokenization) says:

  # COMMENT tokens do not occur in the grammar (to keep it readable),
  # but any number of these tokens may appear anywhere outside other
  # tokens.

and so the proposal to add the word &quot;immediately&quot; is not sufficient to solve the problem in any case; although Kang-Hao (Kenny) Lu notes that 4.1 says:

  # In this specification, the expressions &quot;immediately before&quot; or
  # &quot;immediately after&quot; mean with no intervening white space or
  # comments.

It seems that editorial work is needed to remove the conflict between these two sentences if the proposal to solve the issue by inserting the word &quot;immediately&quot; is adopted.


Conversation begins: http://lists.w3.org/Archives/Public/www-style/2012May/0727.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69139</commentid>
    <comment_count>5</comment_count>
    <who name="Anton P">antonsforums</who>
    <bug_when>2012-06-16 11:31:18 +0000</bug_when>
    <thetext>Tab Atkins Jr. notes that to implement the resolution, it is instead necessary to change the {num} macro, and Kang-Hao (Kenny) Lu notes that it is also necessary to change the &apos;term&apos; production in G.1.

Conversation begins: http://lists.w3.org/Archives/Public/www-style/2012May/0727.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69152</commentid>
    <comment_count>6</comment_count>
    <who name="Anton P">antonsforums</who>
    <bug_when>2012-06-16 19:29:42 +0000</bug_when>
    <thetext>Proposal [http://lists.w3.org/Archives/Public/www-style/2012Jun/0410.html]:

1. In 4.1.1, change the &quot;num&quot; macro to:

  | num 	[&apos;+&apos;|&apos;-&apos;]?([0-9]+|[0-9]*\.[0-9]+)

2. In G.2, change the &quot;num&quot; macro to:

  | num		[&apos;+&apos;|&apos;-&apos;]?([0-9]+|[0-9]*&quot;.&quot;[0-9]+)

3. In G.2, remove the &quot;unary_operator&quot; production entirely.

4. In G.2, change the &quot;term&quot; production to:

  | term
  |   : NUMBER S* | PERCENTAGE S* | LENGTH S* | EMS S* | EXS S*
  |   | ANGLE S* | TIME S* | FREQ S*
  |   | STRING S* | IDENT S* | URI S* | hexcolor | function
  |   ;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69153</commentid>
    <comment_count>7</comment_count>
    <who name="Anton P">antonsforums</who>
    <bug_when>2012-06-16 19:35:20 +0000</bug_when>
    <thetext>Correction: steps 3 and 4 in the proposal in Comment 6 apply to G.1, not G.2.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69169</commentid>
    <comment_count>8</comment_count>
    <who name="Kang-Hao (Kenny) Lu">kennyluck</who>
    <bug_when>2012-06-17 19:50:18 +0000</bug_when>
    <thetext>(In reply to comment #0)
&gt; 2. It&apos;s not interoperable, since Gecko and PrinceXML both parse the sign as 3.
&gt; part of the NUMBER/etc token, whilst other UAs seem to follow the spec;

To make this data complete, I&apos;d note that IE9 is also Gecko-like from my testing. [1]

(In reply to comment #6)
&gt; Proposal [http://lists.w3.org/Archives/Public/www-style/2012Jun/0410.html]:

I&apos;d hope that this is fixed along with bug 17510 . They were in the same thread.

[1] http://lists.w3.org/Archives/Public/www-style/2012Apr/0082</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>