You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[css-transform] Define "containing block for all descendants"
Add a new definition "containing block for all descendants" and specify
that values other than 'none' on 'transform', 'transform-style',
'perspective' will cause an element to establish a containg block for
all descendants.
Copy file name to clipboardExpand all lines: css-transforms-1/Overview.bs
+39-2Lines changed: 39 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -316,9 +316,46 @@ For elements whose layout is governed by the CSS box model, the transform proper
316
316
317
317
For elements whose layout is governed by the CSS box model, any value other than ''transform/none'' for the transform results in the creation of a stacking context. Implementations must paint the layer it creates, within its parent stacking context, at the same stacking order that would be used if it were a positioned element with ''z-index: 0''. If an element with a transform is positioned, the 'z-index' property applies as described in [[!CSS2]], except that ''z-index/auto'' is treated as ''0'' since a new stacking context is always created.
318
318
319
-
For elements whose layout is governed by the CSS box model, any value other than ''transform/none'' for the transform also causes the elementto become a containing block, and the object acts as a containing block for fixed positioned descendants.
319
+
For elements whose layout is governed by the CSS box model, any value other than ''transform/none'' for the transform also causes the element's padding box to form a containing block for all of its out-of-flow descendants, including both absolute-position and fixed-position descendants, and fixed background attachments on descendants and itself.
320
320
321
-
Issue(w3c/csswg-drafts#913): Is this effect on ''position: fixed'' necessary? If so, need to go into more detail here about why fixed positioned objects should do this, i.e., that it's much harder to implement otherwise.
321
+
<div class="example">
322
+
An element with 'transform' other than ''transform/none'' establishes <dfn export>containing block for all descendants</dfn>. To demostrate the effect on fixed-position descendants, the following code snippets should behave identically:
<a href="https://www.w3.org/TR/css3-background/#fixed0">Fixed backgrounds</a> on the root element are affected by any transform specified for that element. For all other elements that are effected by a transform (i.e. have a transform applied to them, or to any of their ancestor elements), a value of ''fixed'' for the 'background-attachment' property is treated as if it had a value of ''background-attachment/scroll''. The computed value of 'background-attachment' is not affected.
The <a>3D transform functions</a> here extend the set of functions for the 'transform' property.
64
64
65
-
Some values of 'perspective', 'transform-style' and 'backface-visibility' result in the creation of a <a href="https://www.w3.org/TR/CSS2/visuren.html#containing-block">containing block</a>, and/or the creation of a <a spec="css2">stacking context</a>.
65
+
Some values of 'perspective', 'transform-style' and 'backface-visibility' result in the creation of a [=containing block for all descendants=], and/or the creation of a <a spec="css21">stacking context</a>.
66
66
67
67
Three-dimensional transforms affect the visual layering of elements, and thus override the back-to-front painting order described in <a href="https://www.w3.org/TR/CSS2/zindex.html">Appendix E</a> of [[!CSS21]].
68
68
@@ -625,10 +625,10 @@ All three properties accept
625
625
the value <dfn value for="translate, rotate, scale">none</dfn>,
626
626
which produces no transform at all.
627
627
In particular,
628
-
this value does <em>not</em> trigger the creation of a stacking context or containing block,
628
+
this value does <em>not</em> trigger the creation of a stacking context or [=containing block for all descendants=],
629
629
while all other values
630
630
(including identity transforms like ''translate: 0px'')
631
-
create a stacking context and containing block,
631
+
create a stacking context and [=containing block for all descendants=],
632
632
per usual for transforms.
633
633
634
634
When 'translate', 'rotate' or 'scale' are animating or transitioning, and the from value or to
@@ -666,7 +666,7 @@ Computed value: Same as specified value.
666
666
Animatable: no
667
667
</pre>
668
668
669
-
A value of "flat" for 'transform-style' establishes a stacking context, and establishes a <a>3D rendering context</a>. Elements with a used value of "auto" are ignored for the purposes of 3D rendering context computation, and those with a used value of "preserve-3d" extend the 3D rendering context to which they belong, even if values for the ''transform'' or ''perspective'' properties would otherwise cause flattening. A value of "preserve-3d" establishes a stacking context, and a containing block.
669
+
A value of "flat" for 'transform-style' establishes a stacking context, and establishes a <a>3D rendering context</a>. Elements with a used value of "auto" are ignored for the purposes of 3D rendering context computation, and those with a used value of "preserve-3d" extend the 3D rendering context to which they belong, even if values for the ''transform'' or ''perspective'' properties would otherwise cause flattening. A value of "preserve-3d" establishes a stacking context, and a [=containing block for all descendants=].
@@ -721,7 +721,7 @@ Where <<length>> values must be positive.
721
721
722
722
</dl>
723
723
724
-
The use of this property with any value other than ''perspective/none'' establishes a stacking context. It also establishes a containing block (somewhat similar to ''position: relative''), just like the 'transform' property does.
724
+
The use of this property with any value other than ''perspective/none'' establishes a stacking context. It also establishes a [=containing block for all descendants=], just like the 'transform' property does.
725
725
726
726
The values of the 'perspective' and 'perspective-origin' properties are used to compute the <a>perspective matrix</a>, as described above.
0 commit comments