block-step-size (CSS Rhythmic Sizing)
block-step-size rounds a block-level box's outer size up to a
multiple of a given step unit, so vertical rhythm survives content changes.
A box with a fixed step establishes an independent formatting context; a
block-level replaced child centers inside the extra space via its block-axis
margins. See
CSS Rhythmic Sizing Level 1.
This CL lands the block-step-size longhand behind the
CSSBlockStepSize flag. The siblings
(block-step-align, block-step-insert,
block-step-round) stay at their defaults (auto /
margin-box / up) and are not parsed yet.
Same demo, same headless_shell build, same window size. Only the
runtime flag differs:
--disable-blink-features=CSSBlockStepSize vs
--enable-blink-features=CSSBlockStepSize. The yellow ruler is a
100px scale with 10px ticks.
Each card renders live in your browser (Rendered) next to the
flag-off (Before) and flag-on (After) captures.









external/wpt/css/css-rhythm/ under the new virtual suite
virtual/css-block-step-size/:
| run | passed | failed |
|---|---|---|
before (flag off, same tests on main) | 22 | 13 |
| after (flag on, this CL) | 35 | 0 |
The 13 flipped tests are the two parsing files, the seven
replaced-elements/block-level-*-margins-affected-by-block-step-size
reftests, the computedstyle/block-level-replaced-elements-* test,
content-based-height-rounds-up-to-step-unit,
definite-height-rounds-up-to-step-unit,
definite-height-rounds-up-to-next-multiple-of-step-unit and
zero-outer-size-rounded-up-to-block-step-size.
<!-- flag: --enable-blink-features=CSSBlockStepSize -->
<div style="width:100px;background:green;display:flow-root">
<img src="60x60-green.png"
style="display:block;block-step-size:100px">
</div>
/* container renders 100px tall; img gets 20px top + 20px bottom margin */
Full demo: demo.html.
Issue 589684500 · Issue 626703 · CSS Rhythmic Sizing 1 - block-step-size · WPT css/css-rhythm