Skip to content

Commit 6864464

Browse files
committed
[css-layout-api] Add in positioning section.
1 parent b766894 commit 6864464

File tree

1 file changed

+56
-2
lines changed

1 file changed

+56
-2
lines changed

css-layout-api/Overview.bs

+56-2
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,11 @@ urlPrefix: https://drafts.csswg.org/css-sizing/#; type: dfn
7575
text: intrinsic sizes
7676
urlPrefix: https://drafts.csswg.org/css-break/#; type: dfn
7777
text: fragmentation break
78-
urlPrefix: https://www.w3.org/TR/CSS21/box.html#; type: dfn
79-
url: box-dimensions; text: box model edges
78+
urlPrefix: https://www.w3.org/TR/CSS21/; type:dfn
79+
urlPrefix: box.html#;
80+
url: box-dimensions; text: box model edges
81+
urlPrefix: visudet.html#;
82+
text: static position
8083
urlPrefix: https://html.spec.whatwg.org/#; type: dfn
8184
text: structuredserializeforstorage
8285
text: structureddeserialize
@@ -791,9 +794,60 @@ This section describes how other CSS modules interact with the CSS Layout API.
791794
Sizing {#interaction-sizing}
792795
----------------------------
793796

797+
798+
794799
Positioning {#interaction-positioning}
795800
--------------------------------------
796801

802+
All positioning in this level of the specification is handled by the user agent.
803+
804+
As a result:
805+
- Out-of-flow children do not appear as {{LayoutChild}}ren.
806+
807+
- <a>Layout API containers</a> establish <a>containing blocks</a> <a
808+
href="https://www.w3.org/TR/CSS2/visudet.html#containing-block-details">exactly like block
809+
containers do</a>. [[!CSS21]]
810+
811+
- The {{Fragment/inlineOffset}} and {{Fragment/blockOffset}} represent the position of the
812+
fragment before any positioning and transforms have occured.
813+
814+
- The <a>static position</a> of an absolutely-positioned child of a <a>layout API container</a> is
815+
set to the <a>inline-start</a>, <a>block-start</a> padding edge of the <a>layout API
816+
container</a>. Auto margins are treated as zero for the child.
817+
818+
<div class="note">
819+
Note: In the example below:
820+
- "child-relative" would be the only child passed to the author's layout. If it was positioned
821+
at ({{Fragment/inlineOffset}} <code>= 20</code>, {{Fragment/blockOffset}} <code> =
822+
30</code>), its final position would be (<code>25</code>, <code>40</code>) as the relative
823+
positioning was handled by the user agent.
824+
825+
- "child-absolute" would not appear as a {{LayoutChild}}, and instead would be laid out and
826+
positioned by the user agent.
827+
828+
- The examples above also apply in a similar way to sticky and fixed positioned children.
829+
830+
<pre class="lang-html">
831+
&lt;style>
832+
#container {
833+
display: layout(foo);
834+
position: relative; /* container is a containing block */
835+
width: 100px;
836+
height: 100px;
837+
}
838+
#child-relative {
839+
position: relative;
840+
left: 5px;
841+
top: 10px;
842+
}
843+
&lt;/style>
844+
&lt;div id="container">
845+
&lt;div id="child-relative">&lt;/div>
846+
&lt;div id="child-absolute">&lt;/div>
847+
&lt;/div>
848+
</pre>
849+
</div>
850+
797851
Overflow {#interaction-overflow}
798852
--------------------------------
799853

0 commit comments

Comments
 (0)