Closed Bug 1379373 Opened 7 years ago Closed 6 years ago

-moz-transform fancy matrices are too fancy for our own good

Categories

(Core :: CSS Parsing and Computation, defect, P3)

defect

Tracking

()

RESOLVED DUPLICATE of bug 1438297
Tracking Status
firefox56 --- wontfix
firefox57 --- wontfix
firefox58 --- affected

People

(Reporter: nox, Unassigned)

Details

The 'transform' property accepts these two syntaxes:

    matrix(<number>#{6})
    matrix3d(<number>#{16})

The '-moz-transform' fancy alias also accepts them, and these additional syntaxes:

    matrix(<number>#{4}, [<number> | <length-percentage>]#{2})
    matrix3d(<number>#{12}, [<number> | <length-percentage>]#{2}, [<number> | <percentage>], <number>)

This is not even documented on MDN, complicates code in Stylo, and I've found at least these inconsistencies:

 * calc(...) isn't accepted at all anywhere in 'transform' (Webkit-based browsers support calc(...) anywhere as they should);
 * calc(<number>) is accepted but parsed as '0' after the first 12 numbers in '-moz-transform';
 * specified numbers after the first 12 numbers are translated to lengths in Stylo instead of numbers, for some reason.
Priority: -- → P3
See also bug 770560, on removing support for -moz-transform entirely.  Might be worth investigating how feasible that is before worrying too much about these special cases.

I expect we'll need to support -webkit-transform forever, because -webkit prefixed CSS is stickier on the web due to early iOS webapps and such.  But that's OK from the perspective of this bug, because we don't seem to apply the same fancy special cases for -webkit-transform.

In the gecko CSS parser, we toggle the special cases for *moz* transform by having it be a shorthand:
https://dxr.mozilla.org/mozilla-central/rev/33b7b8e81b4befcba503c0e48cd5370aeb715085/layout/style/nsCSSPropList.h#4256-4264
...which lets us parse it differently (passing in aIsPrefixed='true' to its parser function rather than 'false' -- note that this param would be better-named aIsMozPrefixed at this point):
https://dxr.mozilla.org/mozilla-central/rev/33b7b8e81b4befcba503c0e48cd5370aeb715085/layout/style/nsCSSParser.cpp#11782-11783
We don't do any of this for -webkit-transform -- it's just a straight alias:
https://dxr.mozilla.org/mozilla-central/rev/33b7b8e81b4befcba503c0e48cd5370aeb715085/layout/style/nsCSSPropAliasList.h#332-336
Version: 1.0 Branch → Trunk
I unshipped this in bug 1438297.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.