Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 8ce27174e473a6d7a53ce852e28035f0bbf15a90
      
https://github.com/WebKit/WebKit/commit/8ce27174e473a6d7a53ce852e28035f0bbf15a90
  Author: Sam Weinig <[email protected]>
  Date:   2025-06-13 (Fri, 13 Jun 2025)

  Changed paths:
    M Source/WebCore/css/CSSProperties.json
    M Source/WebCore/css/scripts/process-css-properties.py
    M Source/WebCore/style/StyleBuilderConverter.h
    M Source/WebCore/style/StyleBuilderCustom.h
    M Source/WebCore/style/StyleExtractorConverter.h
    M Source/WebCore/style/StyleExtractorCustom.h
    M Source/WebCore/style/StyleExtractorSerializer.h
    M Source/WebCore/style/values/StyleValueTypes.h
    M Source/WebCore/style/values/borders/StyleCornerShapeValue.cpp
    M Source/WebCore/style/values/borders/StyleCornerShapeValue.h
    M Source/WebCore/style/values/box/StyleMargin.cpp
    M Source/WebCore/style/values/box/StyleMargin.h
    M Source/WebCore/style/values/box/StylePadding.cpp
    M Source/WebCore/style/values/box/StylePadding.h
    M Source/WebCore/style/values/color-adjust/StyleColorScheme.cpp
    M Source/WebCore/style/values/color-adjust/StyleColorScheme.h
    M Source/WebCore/style/values/color/StyleDynamicRangeLimit.cpp
    M Source/WebCore/style/values/color/StyleDynamicRangeLimit.h
    M Source/WebCore/style/values/flexbox/StyleFlexBasis.cpp
    M Source/WebCore/style/values/flexbox/StyleFlexBasis.h
    M Source/WebCore/style/values/position/StyleInset.cpp
    M Source/WebCore/style/values/position/StyleInset.h
    M 
Source/WebCore/style/values/primitives/StylePrimitiveNumericTypes+CSSValueCreation.h
    M 
Source/WebCore/style/values/primitives/StylePrimitiveNumericTypes+Serialization.h
    M Source/WebCore/style/values/scroll-snap/StyleScrollMargin.cpp
    M Source/WebCore/style/values/scroll-snap/StyleScrollMargin.h
    M Source/WebCore/style/values/scroll-snap/StyleScrollPadding.cpp
    M Source/WebCore/style/values/scroll-snap/StyleScrollPadding.h
    M Source/WebCore/style/values/sizing/StyleMaximumSize.cpp
    M Source/WebCore/style/values/sizing/StyleMaximumSize.h
    M Source/WebCore/style/values/sizing/StyleMinimumSize.cpp
    M Source/WebCore/style/values/sizing/StyleMinimumSize.h
    M Source/WebCore/style/values/sizing/StylePreferredSize.cpp
    M Source/WebCore/style/values/sizing/StylePreferredSize.h

  Log Message:
  -----------
  [Style] Reduce duplication in style building/extraction/serialization when 
delegating to strong types
https://bugs.webkit.org/show_bug.cgi?id=294265

Reviewed by Darin Adler.

Uses a single template function in each of the style 
builder/extractor/serializer
for style value types to reduce unnecessary duplication and to allow types to 
define
their behaviors locally.

For Style::BuilderConverter, the function is 
Style::BuilderConverter::convertStyleType<T>().
For Style::ExtractorConverter, the function is 
Style::ExtractorConverter::convertStyleType<T>().
For Style::ExtractorSerializer, the function is 
Style::ExtractorSerializer::serializeStyleType<T>().

To allow delegation in Style::BuilderConverter, a new Style::CSSValueConversion 
interface
was added that allows types of specialize direct conversion from CSSValue to 
StyleType. This
replaces some of the adhoc `Style::{type name}FromCSSValue()` functions that 
had developed.

Delegation for Style::ExtractorConverter and Style::ExtractorSerializer 
continues to use
the Style::CSSValueCreation and Style::Serialize interfaces respectively.

* Source/WebCore/css/CSSProperties.json:
* Source/WebCore/css/scripts/process-css-properties.py:
* Source/WebCore/style/StyleBuilderConverter.h:
* Source/WebCore/style/StyleBuilderCustom.h:
* Source/WebCore/style/StyleExtractorConverter.h:
* Source/WebCore/style/StyleExtractorCustom.h:
* Source/WebCore/style/StyleExtractorSerializer.h:
* Source/WebCore/style/values/StyleValueTypes.h:
* Source/WebCore/style/values/borders/StyleCornerShapeValue.cpp:
* Source/WebCore/style/values/borders/StyleCornerShapeValue.h:
* Source/WebCore/style/values/box/StyleMargin.cpp:
* Source/WebCore/style/values/box/StyleMargin.h:
* Source/WebCore/style/values/box/StylePadding.cpp:
* Source/WebCore/style/values/box/StylePadding.h:
* Source/WebCore/style/values/color-adjust/StyleColorScheme.cpp:
* Source/WebCore/style/values/color-adjust/StyleColorScheme.h:
* Source/WebCore/style/values/color/StyleDynamicRangeLimit.cpp:
* Source/WebCore/style/values/color/StyleDynamicRangeLimit.h:
* Source/WebCore/style/values/flexbox/StyleFlexBasis.cpp:
* Source/WebCore/style/values/flexbox/StyleFlexBasis.h:
* Source/WebCore/style/values/position/StyleInset.cpp:
* Source/WebCore/style/values/position/StyleInset.h:
* 
Source/WebCore/style/values/primitives/StylePrimitiveNumericTypes+CSSValueCreation.h:
* 
Source/WebCore/style/values/primitives/StylePrimitiveNumericTypes+Serialization.h:
* Source/WebCore/style/values/scroll-snap/StyleScrollMargin.cpp:
* Source/WebCore/style/values/scroll-snap/StyleScrollMargin.h:
* Source/WebCore/style/values/scroll-snap/StyleScrollPadding.cpp:
* Source/WebCore/style/values/scroll-snap/StyleScrollPadding.h:
* Source/WebCore/style/values/sizing/StyleMaximumSize.cpp:
* Source/WebCore/style/values/sizing/StyleMaximumSize.h:
* Source/WebCore/style/values/sizing/StyleMinimumSize.cpp:
* Source/WebCore/style/values/sizing/StyleMinimumSize.h:
* Source/WebCore/style/values/sizing/StylePreferredSize.cpp:
* Source/WebCore/style/values/sizing/StylePreferredSize.h:

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to