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
@@ -226,9 +226,46 @@ For elements whose layout is governed by the CSS box model, the transform proper
226
226
227
227
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 ‘auto’ is treated as ‘0’ since a new stacking context is always created
228
228
229
-
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.
229
+
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.
230
230
231
-
Issue(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.
231
+
<div class="example">
232
+
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.
63
63
64
-
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="css21">stacking context</a>.
64
+
Some values of 'perspective' and 'transform-style' result in the creation of a [=containing block for all descendants=], and/or the creation of a <a spec="css21">stacking context</a>.
65
65
66
66
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]].
67
67
@@ -596,10 +596,10 @@ All three properties accept
596
596
the value <dfn value for="translate, rotate, scale">none</dfn>,
597
597
which produces no transform at all.
598
598
In particular,
599
-
this value does <em>not</em> trigger the creation of a stacking context or containing block,
599
+
this value does <em>not</em> trigger the creation of a stacking context or [=containing block for all descendants=],
600
600
while all other values
601
601
(including identity transforms like ''translate: 0px'')
602
-
create a stacking context and containing block,
602
+
create a stacking context and [=containing block for all descendants=],
603
603
per usual for transforms.
604
604
605
605
When 'translate', 'rotate' or 'scale' are animating or transitioning, and the from value or to
@@ -638,7 +638,7 @@ Media: visual
638
638
Animatable: no
639
639
</pre>
640
640
641
-
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.
641
+
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=].
@@ -694,7 +694,7 @@ Where <<length>> values must be positive.
694
694
695
695
</dl>
696
696
697
-
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.
697
+
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.
698
698
699
699
The values of the 'perspective' and 'perspective-origin' properties are used to compute the <a>perspective matrix</a>, as described above.
0 commit comments