Skip to content

[CSS-Flexbox] Fallback to 'safe center' for 'align-content'#46763

Merged
webkit-commit-queue merged 1 commit intoWebKit:mainfrom
Ahmad-S792:eng/CSS-Flexbox-Fallback-to-safe-center-for-align-content
Jun 15, 2025
Merged

[CSS-Flexbox] Fallback to 'safe center' for 'align-content'#46763
webkit-commit-queue merged 1 commit intoWebKit:mainfrom
Ahmad-S792:eng/CSS-Flexbox-Fallback-to-safe-center-for-align-content

Conversation

@Ahmad-S792
Copy link
Contributor

@Ahmad-S792 Ahmad-S792 commented Jun 14, 2025

95238f7

[CSS-Flexbox] Fallback to 'safe center' for 'align-content'
https://bugs.webkit.org/show_bug.cgi?id=294506
rdar://153403381

Reviewed by Alan Baradlay.

This patch aligns WebKit with Web Specification [1] & [2]:

[1] https://www.w3.org/TR/css-align-3/#valdef-align-content-space-around
[2] https://www.w3.org/TR/css-align-3/#valdef-align-content-space-evenly

For both 'space-around' and 'space-evenly', the default fallback alignment
is 'space center'.

This patch clamps the value to 'non-negative' by using `std::max`.

* Source/WebCore/rendering/RenderFlexibleBox.cpp:
(WebCore::initialAlignContentOffset):
* LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/align-content-wrap-003-expected.txt: Progression

Canonical link: https://commits.webkit.org/296239@main

5df82f2

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 win
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2 ⏳ 🧪 win-tests
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🧪 api-wpe
✅ 🧪 ios-wk2-wpt ✅ 🧪 mac-wk1 ✅ 🛠 wpe-cairo
✅ 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🛠 gtk
✅ 🛠 vision 🧪 mac-AS-debug-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 vision-sim ✅ 🧪 mac-wk2-stress ✅ 🧪 api-gtk
✅ 🛠 🧪 merge ✅ 🧪 vision-wk2 ✅ 🧪 mac-intel-wk2 ✅ 🛠 playstation
✅ 🛠 tv ✅ 🛠 mac-safer-cpp
✅ 🛠 tv-sim
✅ 🛠 watch
✅ 🛠 watch-sim

@Ahmad-S792 Ahmad-S792 self-assigned this Jun 14, 2025
@Ahmad-S792 Ahmad-S792 added the CSS Cascading Style Sheets implementation label Jun 14, 2025
@webkit-early-warning-system
Copy link
Collaborator

Starting EWS tests for 7a39f35. Live statuses available at the PR page, #46763

@Ahmad-S792 Ahmad-S792 requested a review from alanbaradlay June 14, 2025 18:52
@nt1m nt1m requested a review from sammygill June 14, 2025 18:56
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Jun 14, 2025
@Ahmad-S792 Ahmad-S792 removed the merging-blocked Applied to prevent a change from being merged label Jun 14, 2025
@Ahmad-S792 Ahmad-S792 force-pushed the eng/CSS-Flexbox-Fallback-to-safe-center-for-align-content branch from 7a39f35 to 5df82f2 Compare June 15, 2025 03:17
@Ahmad-S792 Ahmad-S792 added safe-merge-queue Applied to automatically send a pull-request to merge-queue after passing EWS checks merge-queue Applied to send a pull request to merge-queue and removed safe-merge-queue Applied to automatically send a pull-request to merge-queue after passing EWS checks labels Jun 15, 2025
https://bugs.webkit.org/show_bug.cgi?id=294506
rdar://153403381

Reviewed by Alan Baradlay.

This patch aligns WebKit with Web Specification [1] & [2]:

[1] https://www.w3.org/TR/css-align-3/#valdef-align-content-space-around
[2] https://www.w3.org/TR/css-align-3/#valdef-align-content-space-evenly

For both 'space-around' and 'space-evenly', the default fallback alignment
is 'space center'.

This patch clamps the value to 'non-negative' by using `std::max`.

* Source/WebCore/rendering/RenderFlexibleBox.cpp:
(WebCore::initialAlignContentOffset):
* LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/align-content-wrap-003-expected.txt: Progression

Canonical link: https://commits.webkit.org/296239@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/CSS-Flexbox-Fallback-to-safe-center-for-align-content branch from 5df82f2 to 95238f7 Compare June 15, 2025 05:08
@webkit-commit-queue
Copy link
Collaborator

Committed 296239@main (95238f7): https://commits.webkit.org/296239@main

Reviewed commits have been landed. Closing PR #46763 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit 95238f7 into WebKit:main Jun 15, 2025
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Jun 15, 2025
@Ahmad-S792 Ahmad-S792 deleted the eng/CSS-Flexbox-Fallback-to-safe-center-for-align-content branch June 15, 2025 05:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CSS Cascading Style Sheets implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants