W3C home > Mailing lists > Public > www-style@w3.org > January 2016

Re: [css-transforms] editing issue with 0 value for 'perspective'

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Tue, 5 Jan 2016 13:14:04 -0800
Message-ID: <CAAWBYDCwgwmShJOhNr9FUWoxkU05rUba3=1SW_PgQq-zj-zcKQ@mail.gmail.com>
To: Daniel Glazman <daniel.glazman@disruptive-innovations.com>
Cc: www-style list <www-style@w3.org>
On Tue, Jan 5, 2016 at 8:27 AM, Daniel Glazman
<daniel.glazman@disruptive-innovations.com> wrote:
> I do have an interoperability - and spec clarification - issue about the
> 'perspective' property. [1] says all length values must be positive.
> I think a former version of the document was saying that 0 values were
> similar to "no perspective". If we made a decision about making 0-based
> values invalid, sorry, I missed it and in that case I suggest to revert
> that decision.
>
> I did test the three browsers I have here on OS X:
>
> - Gecko treats 'perspective: 0px' as a CSS error (46.0a1 (2016-01-04))
> - Blink does the same (47.0.2526.106 (64-bit))
> - WebKit does NOT treat it as an error.
>
> WebKit's behaviour is in my opinion the more reasonable one.
> This is an issue to me for BlueGriffon because all our positive valid
> value spaces are in the [somevalue, +∞[ form. This property introduces
> a ]somevalue, +∞[ interval and it's painful to have to write more
> validating code for a single property. It's also very convenient to
> offer an initial '0px'  value (meaning 'none') when the user wants to
> apply a perspective and let him/her increase it freely. This is
> impossible if '0px' is invalid.
>
> I recommend then a clarification of the specification making 0-based
> length values valid for 'perspective' and meaning the same as "none".
> If this is accepted, Gecko and Blink would have to fix their current
> behaviour.
>
> [1] https://drafts.csswg.org/css-transforms/#perspective-property

Per <https://wiki.csswg.org/spec/limited-ranges>, requiring a positive
length is a spec error.  0px must be valid.  Treating it as "none"
isn't ideal, tho, because it's extremely discontinuous (for
'perspective', "none" is equivalent to infinity).  Can we instead
floor the value, recommending 1px?

~TJ
Received on Tuesday, 5 January 2016 21:14:56 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:59 UTC