W3C home > Mailing lists > Public > www-style@w3.org > February 2014

[css-transforms] Initial value of transform-style

From: Matt Rakow <marakow@microsoft.com>
Date: Mon, 24 Feb 2014 23:33:50 +0000
To: "www-style@w3.org" <www-style@w3.org>
Message-ID: <028e0b56bc2842c1914428430b08341c@BL2PR03MB260.namprd03.prod.outlook.com>
Hi all,

I've been looking into the mailing archives for history on the design of transform-style: preserve-3d.  I found one thread [1] that was discussing the usage of preserve-3d and requirement for opt-in.  However, it doesn't look like the issue was fully resolved (apologies if I've missed it somewhere else).

I definitely agree that there are scenarios for 'flat' as Simon mentioned in his mail [2], but I think these represent the minority case.  It seems to me that the only scenario where 'flat' is the desired value is that scenario where the author wants to explicitly flatten a subtree of a 3d model.

Has thought been given to making 'preserve-3d' the initial value for transform-style?  I recognize the performance impact that preserve-3d support entails when it is actually necessitated, but it seems to me that UAs should be able to detect and optimize for truly 2d scenarios similar to what Aryeh was saying in his mail [1].

In particular, this would allow for cleaner CSS in Simon's scenario -- consider the following HTML:

    <div class="three-d-root">
        <div class="transformed-element">
            <div class="transformed-element">
                <div class="transformed-element">
                    <div class="scene-flattener">
                        <div class="three-d-root">
                            <div class="transformed-element">
                                <div class="transformed-element">
                                    <div class="transformed-element">

Under the current spec, the CSS required to make this work as intended would look something like:

    /* option 1 - the author effectively does a CSS reset */
    * { transform-style: preserve-3d; }
    .scene-flattener { transform-style: flat; }

    /* option 2 - altering the transform-style on fewer elements, but risking a specificity war */
    .three-d-root * { transform-style: preserve-3d; }
    .scene-flattener { transform-style: flat !important; }

By comparison, if preserve-3d were the initial value:

    .scene-flattener { transform-style: flat; }

Again, apologies if this has already been resolved somewhere and I've simply missed it.


[1] http://lists.w3.org/Archives/Public/www-style/2012Feb/0296.html
[2] http://lists.w3.org/Archives/Public/www-style/2012Feb/0305.html
Received on Monday, 24 February 2014 23:34:20 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:19 UTC