Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Intent to Ship: CSS 'stretch' sizing keyword

355 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 AM (12 days ago) Mar 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:
Reply all
Reply to author
Forward
0 new messages