Skip to content

[Style] Convert some OptionSet based properties to strong style types - #48480

Closed
weinig wants to merge 1 commit into
WebKit:mainfrom
weinig:eng/keyword-set-breakup
Closed

weinig wants to merge 1 commit into
WebKit:mainfrom
weinig:eng/keyword-set-breakup

Conversation

@weinig

@weinig weinig commented Jul 24, 2025 •

Copy link
Copy Markdown
Contributor

e392d8b

[Style] Convert some OptionSet based properties to strong style types
https://bugs.webkit.org/show_bug.cgi?id=296333

Reviewed by NOBODY (OOPS!).

Adds a new aggregate, `CSS::PrimitiveKeywordSet`, that acts just like
an OptionSet, but instead of using an `enum`, it uses a set of CSS::Keyword
constants. This allows for completely generating the conversion and
serialization in the general case.

Adopts new type for `text-decoration-line`, `position-visibility`,
and `-webkit-line-box-contain`.

* Source/WebCore/Headers.cmake:
* Source/WebCore/SaferCPPExpectations/UnretainedLambdaCapturesCheckerExpectations:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/accessibility/AXCoreObject.cpp:
* Source/WebCore/accessibility/AXObjectCache.cpp:
* Source/WebCore/accessibility/AccessibilityRenderObject.cpp:
* Source/WebCore/accessibility/atspi/AccessibilityObjectTextAtspi.cpp:
* Source/WebCore/accessibility/ios/AccessibilityObjectIOS.mm:
* Source/WebCore/css/CSSPrimitiveValueMappings.h:
* Source/WebCore/css/CSSProperties.json:
* Source/WebCore/css/scripts/process-css-values.py:
* Source/WebCore/css/values/primitives/CSSPrimitiveKeywordSet.h: Added.
* Source/WebCore/editing/Editor.cpp:
* Source/WebCore/editing/cocoa/EditingHTMLConverter.mm:
* Source/WebCore/layout/formattingContexts/inline/InlineLevelBox.h:
* Source/WebCore/layout/formattingContexts/inline/InlineLevelBoxInlines.h:
* Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp:
* Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp:
* Source/WebCore/layout/formattingContexts/inline/InlineQuirks.cpp:
* Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp:
* Source/WebCore/rendering/StyledMarkedText.cpp:
* Source/WebCore/rendering/TextBoxPainter.cpp:
* Source/WebCore/rendering/TextDecorationPainter.cpp:
* Source/WebCore/rendering/TextDecorationPainter.h:
* Source/WebCore/rendering/style/RenderStyle.cpp:
* Source/WebCore/rendering/style/RenderStyle.h:
* Source/WebCore/rendering/style/RenderStyleConstants.cpp:
* Source/WebCore/rendering/style/RenderStyleConstants.h:
* Source/WebCore/rendering/style/RenderStyleDifference.h:
* Source/WebCore/rendering/style/RenderStyleInlines.h:
* Source/WebCore/rendering/style/RenderStyleSetters.h:
* Source/WebCore/rendering/style/StyleRareInheritedData.cpp:
* Source/WebCore/rendering/style/StyleRareInheritedData.h:
* Source/WebCore/rendering/style/StyleRareNonInheritedData.h:
* Source/WebCore/rendering/svg/SVGTextBoxPainter.cpp:
* Source/WebCore/rendering/svg/SVGTextBoxPainter.h:
* Source/WebCore/rendering/updating/RenderTreeBuilderFirstLetter.cpp:
* Source/WebCore/style/InlineTextBoxStyle.cpp:
* Source/WebCore/style/StyleBuilderConverter.h:
* Source/WebCore/style/StyleExtractorConverter.h:
* Source/WebCore/style/StyleExtractorSerializer.h:
* Source/WebCore/style/StyleInterpolationWrappers.h:
* Source/WebCore/style/StyleTreeResolver.cpp:
* Source/WebCore/style/values/anchor-position/StylePositionVisibility.h: Added.
* Source/WebCore/style/values/inline/StyleLineBoxContain.h:
* Source/WebCore/style/values/primitives/StylePrimitiveKeyword+CSSValueConversion.h:
* Source/WebCore/style/values/primitives/StylePrimitiveKeywordSet+CSSValueConversion.h: Added.
* Source/WebCore/style/values/primitives/StylePrimitiveKeywordSet+CSSValueCreation.h: Added.
* Source/WebCore/style/values/primitives/StylePrimitiveKeywordSet+Logging.h: Added.
* Source/WebCore/style/values/primitives/StylePrimitiveKeywordSet+Serialization.h: Added.
* Source/WebCore/style/values/text-decoration/StyleTextDecorationLine.h: Added.
* Source/WebKitLegacy/mac/WebView/WebView.mm:

e392d8b

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
⏳ 🧪 vision-wk2 ❌ 🧪 mac-intel-wk2 ❌ 🛠 playstation
❌ 🛠 tv ❌ 🛠 mac-safer-cpp
❌ 🛠 tv-sim
❌ 🛠 watch
❌ 🛠 watch-sim

https://bugs.webkit.org/show_bug.cgi?id=296333

Reviewed by NOBODY (OOPS!).

Adds a new aggregate, `CSS::PrimitiveKeywordSet`, that acts just like
an OptionSet, but instead of using an `enum`, it uses a set of CSS::Keyword
constants. This allows for completely generating the conversion and
serialization in the general case.

Adopts new type for `text-decoration-line`, `position-visibility`,
and `-webkit-line-box-contain`.

* Source/WebCore/Headers.cmake:
* Source/WebCore/SaferCPPExpectations/UnretainedLambdaCapturesCheckerExpectations:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/accessibility/AXCoreObject.cpp:
* Source/WebCore/accessibility/AXObjectCache.cpp:
* Source/WebCore/accessibility/AccessibilityRenderObject.cpp:
* Source/WebCore/accessibility/atspi/AccessibilityObjectTextAtspi.cpp:
* Source/WebCore/accessibility/ios/AccessibilityObjectIOS.mm:
* Source/WebCore/css/CSSPrimitiveValueMappings.h:
* Source/WebCore/css/CSSProperties.json:
* Source/WebCore/css/scripts/process-css-values.py:
* Source/WebCore/css/values/primitives/CSSPrimitiveKeywordSet.h: Added.
* Source/WebCore/editing/Editor.cpp:
* Source/WebCore/editing/cocoa/EditingHTMLConverter.mm:
* Source/WebCore/layout/formattingContexts/inline/InlineLevelBox.h:
* Source/WebCore/layout/formattingContexts/inline/InlineLevelBoxInlines.h:
* Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp:
* Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp:
* Source/WebCore/layout/formattingContexts/inline/InlineQuirks.cpp:
* Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp:
* Source/WebCore/rendering/StyledMarkedText.cpp:
* Source/WebCore/rendering/TextBoxPainter.cpp:
* Source/WebCore/rendering/TextDecorationPainter.cpp:
* Source/WebCore/rendering/TextDecorationPainter.h:
* Source/WebCore/rendering/style/RenderStyle.cpp:
* Source/WebCore/rendering/style/RenderStyle.h:
* Source/WebCore/rendering/style/RenderStyleConstants.cpp:
* Source/WebCore/rendering/style/RenderStyleConstants.h:
* Source/WebCore/rendering/style/RenderStyleDifference.h:
* Source/WebCore/rendering/style/RenderStyleInlines.h:
* Source/WebCore/rendering/style/RenderStyleSetters.h:
* Source/WebCore/rendering/style/StyleRareInheritedData.cpp:
* Source/WebCore/rendering/style/StyleRareInheritedData.h:
* Source/WebCore/rendering/style/StyleRareNonInheritedData.h:
* Source/WebCore/rendering/svg/SVGTextBoxPainter.cpp:
* Source/WebCore/rendering/svg/SVGTextBoxPainter.h:
* Source/WebCore/rendering/updating/RenderTreeBuilderFirstLetter.cpp:
* Source/WebCore/style/InlineTextBoxStyle.cpp:
* Source/WebCore/style/StyleBuilderConverter.h:
* Source/WebCore/style/StyleExtractorConverter.h:
* Source/WebCore/style/StyleExtractorSerializer.h:
* Source/WebCore/style/StyleInterpolationWrappers.h:
* Source/WebCore/style/StyleTreeResolver.cpp:
* Source/WebCore/style/values/anchor-position/StylePositionVisibility.h: Added.
* Source/WebCore/style/values/inline/StyleLineBoxContain.h:
* Source/WebCore/style/values/primitives/StylePrimitiveKeyword+CSSValueConversion.h:
* Source/WebCore/style/values/primitives/StylePrimitiveKeywordSet+CSSValueConversion.h: Added.
* Source/WebCore/style/values/primitives/StylePrimitiveKeywordSet+CSSValueCreation.h: Added.
* Source/WebCore/style/values/primitives/StylePrimitiveKeywordSet+Logging.h: Added.
* Source/WebCore/style/values/primitives/StylePrimitiveKeywordSet+Serialization.h: Added.
* Source/WebCore/style/values/text-decoration/StyleTextDecorationLine.h: Added.
* Source/WebKitLegacy/mac/WebView/WebView.mm:
@weinig weinig self-assigned this Jul 24, 2025
@weinig weinig added the CSS Cascading Style Sheets implementation label Jul 24, 2025
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Jul 24, 2025
@weinig
weinig marked this pull request as draft July 24, 2025 20:30
@weinig weinig closed this Dec 2, 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 merging-blocked Applied to prevent a change from being merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants