Re: [css-transforms] Transform functions should accept percentages

Hi,

I added support for percentages to all horizontal and vertical translation values of transform functions. I left it out for translations on the z-axis. (There is no clear reference for resolving percentages here.) This is also conform with the behavior of WebKit/Blink and Firefox. All percentage values are relative to the specified reference box[2].

Greetings,
Dirk

[1] http://dev.w3.org/csswg/css-transforms/#transform-functions
[2] http://dev.w3.org/csswg/css-transforms/#reference-box

On Nov 21, 2014, at 8:10 PM, Dirk Schulze <dschulze@adobe.com> wrote:

> Hi Boris,
> 
> This seems to be indeed the case. Must have been an oversight. I’ll add it to the spec after Thanksgiving.
> 
> Percentage values probably should be relative to the reference box specified by ’transform-box’[1] which we added after TPAC. This would solve your SVG case as well. The default differs for HTML elements and SVG elements.
> 
> Greetings,
> Dirk
> 
> [1] http://dev.w3.org/csswg/css-transforms/#transform-box
> 
> 
> On Nov 21, 2014, at 7:42 PM, Boris Zbarsky <bzbarsky@MIT.EDU> wrote:
> 
>> On 11/21/14, 1:36 PM, Tab Atkins Jr. wrote:
>>> On Fri, Nov 21, 2014 at 7:41 AM, Boris Zbarsky <bzbarsky@mit.edu> wrote:
>>>> For example, http://dev.w3.org/csswg/css-transforms/#funcdef-translatey
>>>> says:
>>>> 
>>>>  translateY() = translateY( <length> )
>>>> 
>>>> But in implementations, translateY accepts a length or a percentage.
>>> 
>>> And it's relative to, iirc, the width of the element's border box.
>> 
>> "It's complicated."  The testcase I was looking at that led me here was applying a percentage translate on an svg:path, for which it's not relative to the (nonexistent) border box.  But in any case, what it's relative to is defined in the transforms spec.  It's just claimed to not be possible.  ;)
>> 
>> -Boris
>> 
>> 
> 
> 

Received on Tuesday, 25 November 2014 08:11:13 UTC