Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Intent to Ship: CSS 'stretch' sizing keyword

467 views
Skip to first unread message

David Grogan

unread,
Mar 7, 2025, 8:59:22 PMMar 7
to blink-dev

Contact emails

dgr...@chromium.org

Explainer

Behaves as 100%, except it sizes the margin box regardless of the value of box-sizing.

Specification

https://drafts.csswg.org/css-sizing-4/#sizing-values

Summary

A keyword for CSS sizing properties (e.g. 'width', 'height') that allows elements to grow to exactly fill their containing block's available space. It is similar to '100%', except the resulting size is applied to the element's margin box instead of the box indicated by 'box-sizing'. Using this keyword allows the element to keep its margins while still being as large as possible. An unprefixed version of '-webkit-fill-available'.



Blink component

Blink>Layout

Search tags

stretchfill

TAG review

None

TAG review status

Not applicable

Risks



Interoperability and Compatibility

Each of the three major engines already has a rough implementation of this feature from before it was specified. (Named -moz-available and -webkit-fill-available). The three behaviors are not interoperable. The intention of this new 'stretch' keyword is to align the engines on this specified behavior which differs slightly from each of the prefixed versions. We expect the behavior of this feature to be fully interoperable. Gecko has taken part in the specification discussions (e.g. https://github.com/w3c/csswg-drafts/issues/11044) and has contributed tests (https://bugzilla.mozilla.org/show_bug.cgi?id=1937624)



Gecko: Positive (https://github.com/mozilla/standards-positions/issues/1054)

WebKit: No signal (https://github.com/WebKit/standards-positions/issues/401)

Web developers: Positive (https://github.com/web-platform-tests/interop/issues/726) An author requested this to be part of Interop2025. Lots of +1 on the chrome bug.

Other signals:

Ergonomics

None



Activation

Nope. Will be usable immediately



WebView application risks

Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?

None



Debuggability

Existing CSS and layout devtools panel works fine.



Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, ChromeOS, Android, and Android WebView)?

Yes

Is this feature fully tested by web-platform-tests?

Yes

https://wpt.fyi/results/css/css-sizing/stretch?label=master&label=experimental&product=chrome&product=firefox&product=safari&aligned&view=subtest&q=sizing%2Fstretch



Flag name on about://flags

None

Finch feature name

LayoutStretch

Requires code in //chrome?

False

Tracking bug

https://crbug.com/41253915

Availability expectation

Gecko has started work and will probably finish in < 1 year.

Non-OSS dependencies

Does the feature depend on any code or APIs outside the Chromium open source repository and its open-source dependencies to function?

No

Estimated milestones

Shipping on desktop136
Shipping on Android136
Shipping on WebView136


Anticipated spec changes

Open questions about a feature may be a source of future web compat or interop issues. Please list open issues (e.g. links to known github issues in the project for the feature specification) whose resolution may introduce web compat/interop risk (e.g., changing to naming or structure of the API in a non-backward-compatible way).

https://github.com/w3c/csswg-drafts/issues/4028 -- There is consensus among members of Apple, Mozilla, and Google on the issue. No significant arguments against the proposal that we followed (https://github.com/w3c/csswg-drafts/issues/4028#issuecomment-2372348130)

Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/6176445286842368?gate=5489036266045440

Links to previous Intent discussions

Intent to Prototype: https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAOZbSt31nVWJNsfA0v30YGbceWr-M1sSYMoUFKBKMGw%2B7XzR%2BQ%40mail.gmail.com


This intent message was generated by Chrome Platform Status.

obr...@igalia.com

unread,
Mar 10, 2025, 8:45:04 AMMar 10
to blink-dev, David Grogan
I think it would be good to wait for the CSSWG to clarify things like https://github.com/w3c/csswg-drafts/issues/11784 before shipping.

El dia dissabte, 8 de març del 2025 a les 2:59:22 UTC+1, David Grogan va escriure:

Alex Russell

unread,
Apr 14, 2025, 2:13:25 PM (13 days ago) Apr 14
to blink-dev, obr...@igalia.com, David Grogan
I don't see progress in the linked bug from the CSS WG F2F in NY. Should we keep holding this? I'm inclined to get things into the world if they've been well-designed and there is developer interest.

Best,

Alex

David Grogan

unread,
Apr 16, 2025, 10:57:51 AM (11 days ago) Apr 16
to Alex Russell, blink-dev, obr...@igalia.com
FWIW, I intend to attempt to implement the behavior described in https://github.com/w3c/csswg-drafts/issues/11784#issuecomment-2734854579 real soon now. If implementing turns out to be feasible and doesn't uncover any inconsistencies then we're fine with switching to the new behavior.

Thanks for the prod,
David

obr...@igalia.com

unread,
Apr 16, 2025, 6:21:12 PM (11 days ago) Apr 16
to blink-dev, sligh...@chromium.org, obr...@igalia.com, David Grogan
> I'm inclined to get things into the world

I'm inclined to not hurry to get things into the world, specially since you warned the CSSWG that you may block refinements after shipping (https://groups.google.com/a/chromium.org/g/blink-dev/c/GISQbW0Xhxg/m/h4rarOM2BgAJ).

But well, let's see how David's attempt goes.

- Oriol Brufau
Reply all
Reply to author
Forward
0 new messages