Title: [295050] trunk/Source/WebCore
Revision
295050
Author
[email protected]
Date
2022-05-31 06:39:54 -0700 (Tue, 31 May 2022)

Log Message

Ensure logical properties have skip-builder
https://bugs.webkit.org/show_bug.cgi?id=241105

Reviewed by Tim Nguyen.

Builder::applyProperty resolves logical properties into physical ones.
So there is no need to define BuilderCustom methods for them.
Thus, most already have skip-builder:true. This patch covers the only
two exceptions.

No test since there should be no change in behavior.

* Source/WebCore/css/CSSProperties.json:
Flag contain-intrinsic-block-size and contain-intrinsic-inline-size with
skip-builder:true.

* Source/WebCore/css/makeprop.pl:
Require logical properties to have skip-builder:true.

* Source/WebCore/style/StyleBuilderCustom.h:
(WebCore::Style::BuilderCustom::applyInitialContainIntrinsicBlockSize): Deleted.
(WebCore::Style::BuilderCustom::applyInheritContainIntrinsicBlockSize): Deleted.
(WebCore::Style::BuilderCustom::applyValueContainIntrinsicBlockSize): Deleted.
(WebCore::Style::BuilderCustom::applyInitialContainIntrinsicInlineSize): Deleted.
(WebCore::Style::BuilderCustom::applyInheritContainIntrinsicInlineSize): Deleted.
(WebCore::Style::BuilderCustom::applyValueContainIntrinsicInlineSize): Deleted.
Remove unnecessary logic.

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

Modified Paths

Diff

Modified: trunk/Source/WebCore/css/CSSProperties.json (295049 => 295050)


--- trunk/Source/WebCore/css/CSSProperties.json	2022-05-31 13:24:31 UTC (rev 295049)
+++ trunk/Source/WebCore/css/CSSProperties.json	2022-05-31 13:39:54 UTC (rev 295050)
@@ -5290,7 +5290,7 @@
         },
         "contain-intrinsic-block-size": {
             "codegen-properties": {
-                "custom": "All",
+                "skip-builder": true,
                 "settings-flag": "cssContainIntrinsicSizeEnabled",
                 "logical-property-group": {
                     "name": "contain-intrinsic-size",
@@ -5307,7 +5307,7 @@
         },
         "contain-intrinsic-inline-size": {
             "codegen-properties": {
-                "custom": "All",
+                "skip-builder": true,
                 "settings-flag": "cssContainIntrinsicSizeEnabled",
                 "logical-property-group": {
                     "name": "contain-intrinsic-size",

Modified: trunk/Source/WebCore/css/makeprop.pl (295049 => 295050)


--- trunk/Source/WebCore/css/makeprop.pl	2022-05-31 13:24:31 UTC (rev 295049)
+++ trunk/Source/WebCore/css/makeprop.pl	2022-05-31 13:39:54 UTC (rev 295050)
@@ -1482,6 +1482,7 @@
   next if (exists $propertiesWithStyleBuilderOptions{$name}{"longhands"});
   next if (exists $propertiesWithStyleBuilderOptions{$name}{"skip-builder"});
   next if (exists $synonyms{$name});
+  die "Property $name is logical but doesn't have skip-builder\n" if isLogical($name);
 
   my $indent = "    ";
   if (!$propertiesWithStyleBuilderOptions{$name}{"custom"}{"Initial"}) {

Modified: trunk/Source/WebCore/style/StyleBuilderCustom.h (295049 => 295050)


--- trunk/Source/WebCore/style/StyleBuilderCustom.h	2022-05-31 13:24:31 UTC (rev 295049)
+++ trunk/Source/WebCore/style/StyleBuilderCustom.h	2022-05-31 13:39:54 UTC (rev 295050)
@@ -87,8 +87,6 @@
     DECLARE_PROPERTY_CUSTOM_HANDLERS(Contain);
     DECLARE_PROPERTY_CUSTOM_HANDLERS(ContainIntrinsicWidth);
     DECLARE_PROPERTY_CUSTOM_HANDLERS(ContainIntrinsicHeight);
-    DECLARE_PROPERTY_CUSTOM_HANDLERS(ContainIntrinsicBlockSize);
-    DECLARE_PROPERTY_CUSTOM_HANDLERS(ContainIntrinsicInlineSize);
     DECLARE_PROPERTY_CUSTOM_HANDLERS(Content);
     DECLARE_PROPERTY_CUSTOM_HANDLERS(CounterIncrement);
     DECLARE_PROPERTY_CUSTOM_HANDLERS(CounterReset);
@@ -2169,57 +2167,5 @@
     style.setContainIntrinsicHeight(lengthValue);
 }
 
-inline void BuilderCustom::applyInitialContainIntrinsicBlockSize(BuilderState& builderState)
-{
-    auto& style = builderState.style();
-    auto resolvedID = CSSProperty::resolveDirectionAwareProperty(CSSPropertyContainIntrinsicBlockSize, style.direction(), style.writingMode());
-
-    if (resolvedID == CSSPropertyContainIntrinsicHeight)
-        applyInitialContainIntrinsicHeight(builderState);
-    else
-        applyInitialContainIntrinsicWidth(builderState);
 }
-
-inline void BuilderCustom::applyInheritContainIntrinsicBlockSize(BuilderState&)
-{
 }
-
-inline void BuilderCustom::applyValueContainIntrinsicBlockSize(BuilderState& builderState, CSSValue& value)
-{
-    auto& style = builderState.style();
-    auto resolvedID = CSSProperty::resolveDirectionAwareProperty(CSSPropertyContainIntrinsicBlockSize, style.direction(), style.writingMode());
-
-    if (resolvedID == CSSPropertyContainIntrinsicHeight)
-        applyValueContainIntrinsicHeight(builderState, value);
-    else
-        applyValueContainIntrinsicWidth(builderState, value);
-}
-
-inline void BuilderCustom::applyInitialContainIntrinsicInlineSize(BuilderState& builderState)
-{
-    auto& style = builderState.style();
-    auto resolvedID = CSSProperty::resolveDirectionAwareProperty(CSSPropertyContainIntrinsicBlockSize, style.direction(), style.writingMode());
-
-    if (resolvedID == CSSPropertyContainIntrinsicWidth)
-        applyInitialContainIntrinsicWidth(builderState);
-    else
-        applyInitialContainIntrinsicHeight(builderState);
-}
-
-inline void BuilderCustom::applyInheritContainIntrinsicInlineSize(BuilderState&)
-{
-}
-
-inline void BuilderCustom::applyValueContainIntrinsicInlineSize(BuilderState& builderState, CSSValue& value)
-{
-    auto& style = builderState.style();
-    auto resolvedID = CSSProperty::resolveDirectionAwareProperty(CSSPropertyContainIntrinsicBlockSize, style.direction(), style.writingMode());
-
-    if (resolvedID == CSSPropertyContainIntrinsicWidth)
-        applyValueContainIntrinsicWidth(builderState, value);
-    else
-        applyValueContainIntrinsicHeight(builderState, value);
-}
-
-}
-}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to