Skip to content

[Style] Move shadow extent functions out of RenderStyle #47355

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

weinig
Copy link
Contributor

@weinig weinig commented Jun 29, 2025

9c0ad02

[Style] Move shadow extent functions out of RenderStyle
https://bugs.webkit.org/show_bug.cgi?id=295181

Reviewed by Simon Fraser.

RenderStyle already has enough going on, it doesn't need random extent
calculation functions.

Removes all the `RenderStyle::get*Shadow*Extent()` functions and replaces
them with Style::shadowBlockDirectionExtent/Style::shadowInlineDirectionExtent
which take any shadow type and a writing direction and compute the pair of
extents. While doing this, we also remove the "get" prefixes and switch to
pair return values rather than passing the output by reference.

* Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp:
* Source/WebCore/rendering/LegacyInlineFlowBox.cpp:
* Source/WebCore/rendering/RenderBox.cpp:
* Source/WebCore/rendering/RenderElement.cpp:
* Source/WebCore/rendering/style/RenderStyle.h:
* Source/WebCore/rendering/style/RenderStyleInlines.h:
(WebCore::RenderStyle::boxShadowExtent const): Deleted.
(WebCore::RenderStyle::boxShadowInsetExtent const): Deleted.
(WebCore::RenderStyle::getBoxShadowBlockDirectionExtent const): Deleted.
(WebCore::RenderStyle::getBoxShadowHorizontalExtent const): Deleted.
(WebCore::RenderStyle::getBoxShadowInlineDirectionExtent const): Deleted.
(WebCore::RenderStyle::getBoxShadowVerticalExtent const): Deleted.
(WebCore::RenderStyle::getTextShadowBlockDirectionExtent const): Deleted.
(WebCore::RenderStyle::getTextShadowHorizontalExtent const): Deleted.
(WebCore::RenderStyle::getTextShadowInlineDirectionExtent const): Deleted.
(WebCore::RenderStyle::getTextShadowVerticalExtent const): Deleted.
(WebCore::RenderStyle::textShadowExtent const): Deleted.
(WebCore::RenderStyle::getShadowHorizontalExtent): Deleted.
(WebCore::RenderStyle::getShadowVerticalExtent): Deleted.
(WebCore::RenderStyle::getShadowInlineDirectionExtent const): Deleted.
(WebCore::RenderStyle::getShadowBlockDirectionExtent const): Deleted.
* Source/WebCore/style/values/borders/StyleShadow.h:
(WebCore::Style::shadowHorizontalExtent):
(WebCore::Style::shadowVerticalExtent):
(WebCore::Style::shadowBlockDirectionExtent): Added.
(WebCore::Style::shadowInlineDirectionExtent): Added.
(WebCore::Style::getShadowHorizontalExtent): Renamed to shadowHorizontalExtent.
(WebCore::Style::getShadowVerticalExtent): Renamed to shadowVerticalExtent.

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

c0bd588

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

@weinig weinig self-assigned this Jun 29, 2025
@weinig weinig added the CSS Cascading Style Sheets implementation label Jun 29, 2025
@weinig weinig force-pushed the eng/Style-Move-shadow-extent-functions-out-of-RenderStyle branch from c2beb61 to c0bd588 Compare June 30, 2025 03:26
@weinig weinig marked this pull request as ready for review June 30, 2025 03:27
@weinig weinig added the merge-queue Applied to send a pull request to merge-queue label Jun 30, 2025
https://bugs.webkit.org/show_bug.cgi?id=295181

Reviewed by Simon Fraser.

RenderStyle already has enough going on, it doesn't need random extent
calculation functions.

Removes all the `RenderStyle::get*Shadow*Extent()` functions and replaces
them with Style::shadowBlockDirectionExtent/Style::shadowInlineDirectionExtent
which take any shadow type and a writing direction and compute the pair of
extents. While doing this, we also remove the "get" prefixes and switch to
pair return values rather than passing the output by reference.

* Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp:
* Source/WebCore/rendering/LegacyInlineFlowBox.cpp:
* Source/WebCore/rendering/RenderBox.cpp:
* Source/WebCore/rendering/RenderElement.cpp:
* Source/WebCore/rendering/style/RenderStyle.h:
* Source/WebCore/rendering/style/RenderStyleInlines.h:
(WebCore::RenderStyle::boxShadowExtent const): Deleted.
(WebCore::RenderStyle::boxShadowInsetExtent const): Deleted.
(WebCore::RenderStyle::getBoxShadowBlockDirectionExtent const): Deleted.
(WebCore::RenderStyle::getBoxShadowHorizontalExtent const): Deleted.
(WebCore::RenderStyle::getBoxShadowInlineDirectionExtent const): Deleted.
(WebCore::RenderStyle::getBoxShadowVerticalExtent const): Deleted.
(WebCore::RenderStyle::getTextShadowBlockDirectionExtent const): Deleted.
(WebCore::RenderStyle::getTextShadowHorizontalExtent const): Deleted.
(WebCore::RenderStyle::getTextShadowInlineDirectionExtent const): Deleted.
(WebCore::RenderStyle::getTextShadowVerticalExtent const): Deleted.
(WebCore::RenderStyle::textShadowExtent const): Deleted.
(WebCore::RenderStyle::getShadowHorizontalExtent): Deleted.
(WebCore::RenderStyle::getShadowVerticalExtent): Deleted.
(WebCore::RenderStyle::getShadowInlineDirectionExtent const): Deleted.
(WebCore::RenderStyle::getShadowBlockDirectionExtent const): Deleted.
* Source/WebCore/style/values/borders/StyleShadow.h:
(WebCore::Style::shadowHorizontalExtent):
(WebCore::Style::shadowVerticalExtent):
(WebCore::Style::shadowBlockDirectionExtent): Added.
(WebCore::Style::shadowInlineDirectionExtent): Added.
(WebCore::Style::getShadowHorizontalExtent): Renamed to shadowHorizontalExtent.
(WebCore::Style::getShadowVerticalExtent): Renamed to shadowVerticalExtent.

Canonical link: https://commits.webkit.org/296818@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/Style-Move-shadow-extent-functions-out-of-RenderStyle branch from c0bd588 to 9c0ad02 Compare June 30, 2025 19:39
@webkit-commit-queue
Copy link
Collaborator

Committed 296818@main (9c0ad02): https://commits.webkit.org/296818@main

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

@webkit-commit-queue webkit-commit-queue merged commit 9c0ad02 into WebKit:main Jun 30, 2025
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Jun 30, 2025
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.

4 participants