Skip to content

Commit c4ef9c9

Browse files
committed
[css-tables] Added abspos clarifications
1 parent 28bc8bb commit c4ef9c9

File tree

2 files changed

+314
-0
lines changed

2 files changed

+314
-0
lines changed

css-tables-3/Overview.bs

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2282,6 +2282,79 @@ spec:css22; type:property; text:display
22822282
<a class="hint" href="https://jsfiddle.net/3pox7b4f/5/">Testcase</a>
22832283
</div>
22842284

2285+
<!--
2286+
███ ████████ ██████ ████████ ███████ ██████
2287+
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
2288+
██ ██ ██ ██ ██ ██ ██ ██ ██ ██
2289+
██ ██ ████████ ██████ ████████ ██ ██ ██████
2290+
█████████ ██ ██ ██ ██ ██ ██ ██
2291+
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
2292+
██ ██ ████████ ██████ ██ ███████ ██████
2293+
-->
2294+
2295+
<h2 id="abspos">
2296+
Absolute Positioning</h2>
2297+
2298+
<h3 id="abspos-boxes-in-table-root">
2299+
With a table-root as containing block</h3>
2300+
2301+
If an absolutely positioned element's <a>containing block</a>
2302+
is generated by a <a>table-wrapper</a> box,
2303+
the containing block corresponds to the area around which the table margins are applied,
2304+
including the area where the table border is drawn and the margin area of any table-caption.
2305+
The offset properties ('top'/'right'/'bottom'/'left')
2306+
then indicate offsets inwards from the corresponding edges
2307+
of this <a>containing block</a>, as normal.
2308+
2309+
Absolute positioning occurs after layout of the <a>table</a> and its in-flow contents,
2310+
and does not contribute to the sizing of any table grid tracks
2311+
or affect the size/configuration of the table grid in any way.
2312+
2313+
<div class='example'>
2314+
2315+
<figure style="margin: 0">
2316+
<figcaption style="text-align: left; font-style: normal;">
2317+
The figure below shows how a box absolutely-positioned relative to a table should be rendred. <br/><br>
2318+
The <b>yellow</b> area is the table content edge, yellow arrows the table margins. <br/>
2319+
The <b>green</b> area is the table caption, green arrows the caption margins. <br/>
2320+
The <b>blue</b> area is the table background area, and the darker blue area where the table border area. <br/>
2321+
The <b>black</b> area is the descendant positioned relative to the table, the arrows represent the top/left/bottom/right displacements.
2322+
</figcaption>
2323+
<img src="images/css-tables-abspos.svg" width="702" height="402" alt=''>
2324+
</figure>
2325+
2326+
</div>
2327+
2328+
<h3 id="abspos-boxes-in-table-internal">
2329+
With a table-track or table-track-group as containing block</h3>
2330+
2331+
If an absolutely positioned element's <a>containing block</a>
2332+
is generated by a <a>table-internal</a>,
2333+
the containing block corresponds to <a href="#bounding-box-assignment">the area defined for the box during layout</a>,
2334+
(these elements cannot have a border or padding, so they always refer to that area in its entirety).
2335+
2336+
The offset properties ('top'/'right'/'bottom'/'left')
2337+
then indicate offsets inwards from the corresponding edges
2338+
of this <a>containing block</a>, as normal.
2339+
2340+
ISSUE(858): This only works in Firefox. It would make it easier to implement position:sticky in the future, though.
2341+
<a href="https://bugs.chromium.org/p/chromium/issues/detail?id=417223">[Chrome bug]</a>
2342+
<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1289682">[Interop risk: Firefox bug]</a>
2343+
2344+
2345+
<h3 id="static-position">
2346+
With a table-internal box as non-containing block parent</h3>
2347+
2348+
The only influence of non-containing block parent of an absolutely-positioned box is to define its static position,
2349+
in case both top+bottom and/or left+right end up being auto.
2350+
2351+
For table-cells, the absolutely-positioned content is positioned follows the rules for block layout as usual.
2352+
2353+
Due to <a href="#fixup">table fixup</a>,
2354+
it is not possible to create an absolutely-positioned box
2355+
that is the child of a table-internal box that is not a table-cell
2356+
(see note about float and position for more details).
2357+
22852358
<!--
22862359
████████ ████████ ██ ██ ████████ ████████ ████████ ████ ██ ██ ██████
22872360
██ ██ ██ ███ ██ ██ ██ ██ ██ ██ ██ ███ ██ ██ ██
Lines changed: 241 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)