<?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>16183</bug_id>
          
          <creation_ts>2012-03-01 18:27:51 +0000</creation_ts>
          <short_desc>Make parsing of non-positive perspectives consistent</short_desc>
          <delta_ts>2012-03-12 21:05:58 +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>Transforms</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</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="Aryeh Gregor">ayg</reporter>
          <assigned_to name="Simon Fraser">smfr</assigned_to>
          <cc>ayg</cc>
    
    <cc>cmarrin</cc>
    
    <cc>dino</cc>
    
    <cc>dschulze</cc>
    
    <cc>eoconnor</cc>
    
    <cc>smfr</cc>
          
          <qa_contact>public-css-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>64839</commentid>
    <comment_count>0</comment_count>
    <who name="Aryeh Gregor">ayg</who>
    <bug_when>2012-03-01 18:27:51 +0000</bug_when>
    <thetext>The spec now says for the &apos;perspective&apos; property

&quot;&quot;&quot;
If the value is ‘none’, less than or equal to 0 no perspective transform is applied.
&quot;&quot;&quot;
http://dev.w3.org/csswg/css3-transforms/#perspective-property

This means that nonpositive values are parsed as &quot;none&quot;.  On the other hand, for perspective() it says

&quot;The value for depth must be greater than zero, otherwise the function is invalid.&quot;
http://dev.w3.org/csswg/css3-transforms/#three-d-transform-functions

This means that nonpositive values are parse errors.  The behavior should be consistent.


Test-case for &apos;perspective&apos;:

data:text/html,&lt;!doctype html&gt;
&lt;body style=&quot;perspective:200px;perspective:0&quot;&gt;
&lt;script&gt;
document.body.textContent =
getComputedStyle(document.body).perspective
&lt;/script&gt;

Also test replacing &quot;0&quot; with &quot;-10px&quot;.  Results:

* In IE10 Developer Preview, &quot;0&quot; parses the same as &quot;none&quot;, but &quot;-10px&quot; doesn&apos;t parse.
* In Chrome 18 dev, &quot;0&quot; parses the same as &quot;none&quot;, but &quot;-10px&quot; doesn&apos;t parse.
* In mozilla-central (Firefox 13.0a1), &quot;0&quot; and &quot;-10px&quot; don&apos;t parse.

Testing with

data:text/html,&lt;!doctype html&gt;
&lt;body style=&quot;transform:scale(2);transform:perspective(0)&quot;&gt;
&lt;script&gt;
document.body.textContent =
getComputedStyle(document.body).transform
&lt;/script&gt;

* In IE10 Developer Preview, &quot;perspective(0)&quot; is parsed as the identity matrix, while &quot;perspective(-10px)&quot; is a parse error.
* In Chrome 18 dev, &quot;perspective(0)&quot; is parsed as the identity matrix, while &quot;perspective(-10px)&quot; is a parse error.
* In Firefox 13.0a1, &quot;perspective(0)&quot; and &quot;perspective(-10px)&quot; both don&apos;t parse.

Thus we have two behaviors: in IE/Chrome, negative values don&apos;t parse for either the property or the function, but 0 parses as &quot;none&quot;.  In Gecko, no nonpositive value parses.  The spec should match one or the other.

IMO, Gecko&apos;s behavior makes more sense.  A perspective of zero logically should result in everything disappearing; &apos;none&apos; is equivalent to a perspective of infinity.  Moreover, there are already other, clearer ways of achieving the same effect: instead of &quot;perspective: 0&quot; one can write &quot;perspective: none&quot;, and instead of &quot;perspective(0)&quot; one can omit the function from the transform list entirely.

However, Gecko is in the minority, and before Firefox 13 it behaved differently anyway (https://bugzilla.mozilla.org/show_bug.cgi?id=725036).  Does anyone think we should change the spec to match IE/Chrome?  If people feel strongly, I&apos;ll do that and patch Firefox and my tests so they match.  Otherwise, I&apos;ll change the spec so it matches Gecko, which also already matches the tests.  (I was just told I got my CVS access.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>64841</commentid>
    <comment_count>1</comment_count>
    <who name="Simon Fraser">smfr</who>
    <bug_when>2012-03-01 18:32:32 +0000</bug_when>
    <thetext>I think it would be OK to spec Gecko&apos;s behavior.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>65397</commentid>
    <comment_count>2</comment_count>
    <who name="Aryeh Gregor">ayg</who>
    <bug_when>2012-03-12 21:05:58 +0000</bug_when>
    <thetext>Done: http://dvcs.w3.org/hg/csswg/rev/23f80019fad0</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>