Title: [285709] trunk
Revision
285709
Author
[email protected]
Date
2021-11-12 02:17:21 -0800 (Fri, 12 Nov 2021)

Log Message

[css-flexbox] Add flex-basis: content support
https://bugs.webkit.org/show_bug.cgi?id=221479

Reviewed by Javier Fernandez.

LayoutTests/imported/w3c:

* web-platform-tests/css/css-flexbox/parsing/flex-basis-computed-expected.txt: Replaced FAIL
by PASS expectations.
* web-platform-tests/css/css-flexbox/parsing/flex-basis-valid-expected.txt: Ditto.
* web-platform-tests/css/css-flexbox/parsing/flex-shorthand-expected.txt: Ditto.

Source/WebCore:

Add support for the content keyword as a valid value for the flex-basis property.
It indicates an automated size based on the contents of the flex item. It's typically
equivalent to the max-content size but it has some adjustments for aspect ratios,
orthogonal flows and intrinsic sizing constraints.

Apart from adding the parsing support, it required very little adjustments in the
flexbox code after the refactoring in r284359.

This makes WebKit pass all of the flex-basis:content tests in WPT. We're talking
about 6 tests testing the feature and 6 subtests related to parsing.

* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Handle Content in switch.
(WebCore::CSSPrimitiveValue::init): Initialization for content CSS value.
* css/CSSProperties.json:
* css/LengthFunctions.cpp: Replaced LengthOrAuto by LengthSizing.
(WebCore::valueForLength): Handle Content in switch.
(WebCore::floatValueForLength): Ditto.
* css/LengthFunctions.h:
(WebCore::minimumValueForLength): Ditto.
* css/calc/CSSCalcValue.cpp:
(WebCore::createCSS): Ditto.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeFlexBasis): Consume CSSValueContent.
(WebCore::CSSPropertyParser::consumeFlex): Ditto.
* platform/Length.cpp:
(WebCore::operator<<): Added printing support for content.
* platform/Length.h:
(WebCore::Length::initialize): Added enum for content.
(WebCore::Length::isContent const): New method.
* rendering/RenderBox.cpp:
(WebCore::RenderBox::computeReplacedLogicalWidthUsing const): Handle content in switch.
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::childMainSizeIsDefinite): Treat content as indefinite lenght.
(WebCore::RenderFlexibleBox::computeFlexBaseSizeForChild): Compute flex-basis using max-content
if flex-basis:content is specified.
* style/StyleBuilderConverter.h:
(WebCore::Style::BuilderConverter::convertLengthSizing): Handle content in switch.

Source/WebKit:

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<Length>::encode): Handle content in switch.
(IPC::ArgumentCoder<Length>::decode): Ditto.

LayoutTests:

* TestExpectations: Unskipped all the flexbox-flex-basis-content tests that work fine now.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (285708 => 285709)


--- trunk/LayoutTests/ChangeLog	2021-11-12 08:59:44 UTC (rev 285708)
+++ trunk/LayoutTests/ChangeLog	2021-11-12 10:17:21 UTC (rev 285709)
@@ -1,3 +1,12 @@
+2021-11-11  Sergio Villar Senin  <[email protected]>
+
+        [css-flexbox] Add flex-basis: content support
+        https://bugs.webkit.org/show_bug.cgi?id=221479
+
+        Reviewed by Javier Fernandez.
+
+        * TestExpectations: Unskipped all the flexbox-flex-basis-content tests that work fine now.
+
 2021-11-12  Arcady Goldmints-Orlov  <[email protected]>
 
         [GLIB] Update test expectations and baselines. Unreviewed test gardening.

Modified: trunk/LayoutTests/TestExpectations (285708 => 285709)


--- trunk/LayoutTests/TestExpectations	2021-11-12 08:59:44 UTC (rev 285708)
+++ trunk/LayoutTests/TestExpectations	2021-11-12 10:17:21 UTC (rev 285709)
@@ -4261,14 +4261,6 @@
 webkit.org/b/221478 imported/w3c/web-platform-tests/css/css-flexbox/dynamic-baseline-change.html [ ImageOnlyFailure ]
 webkit.org/b/221478 imported/w3c/web-platform-tests/css/css-flexbox/synthesize-vrl-baseline.html [ ImageOnlyFailure ]
 
-# flex-basis:content.
-webkit.org/b/221479 imported/w3c/web-platform-tests/css/css-flexbox/flexbox-flex-basis-content-001a.html [ ImageOnlyFailure ]
-webkit.org/b/221479 imported/w3c/web-platform-tests/css/css-flexbox/flexbox-flex-basis-content-001b.html [ ImageOnlyFailure ]
-webkit.org/b/221479 imported/w3c/web-platform-tests/css/css-flexbox/flexbox-flex-basis-content-002a.html [ ImageOnlyFailure ]
-webkit.org/b/221479 imported/w3c/web-platform-tests/css/css-flexbox/flexbox-flex-basis-content-002b.html [ ImageOnlyFailure ]
-webkit.org/b/221479 imported/w3c/web-platform-tests/css/css-flexbox/flexbox-flex-basis-content-003a.html [ ImageOnlyFailure ]
-webkit.org/b/221479 imported/w3c/web-platform-tests/css/css-flexbox/flexbox-flex-basis-content-004a.html [ ImageOnlyFailure ]
-
 # Flex item's min|max content contributions
 webkit.org/b/230747 imported/w3c/web-platform-tests/css/css-flexbox/flex-container-max-content-001.html [ ImageOnlyFailure ]
 webkit.org/b/230747 imported/w3c/web-platform-tests/css/css-flexbox/flex-container-min-content-001.html [ ImageOnlyFailure ]

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (285708 => 285709)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2021-11-12 08:59:44 UTC (rev 285708)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2021-11-12 10:17:21 UTC (rev 285709)
@@ -1,3 +1,15 @@
+2021-11-11  Sergio Villar Senin  <[email protected]>
+
+        [css-flexbox] Add flex-basis: content support
+        https://bugs.webkit.org/show_bug.cgi?id=221479
+
+        Reviewed by Javier Fernandez.
+
+        * web-platform-tests/css/css-flexbox/parsing/flex-basis-computed-expected.txt: Replaced FAIL
+        by PASS expectations.
+        * web-platform-tests/css/css-flexbox/parsing/flex-basis-valid-expected.txt: Ditto.
+        * web-platform-tests/css/css-flexbox/parsing/flex-shorthand-expected.txt: Ditto.
+
 2021-11-11  Alexey Shvayka  <[email protected]>
 
         JSCallbackData should use lexical global object for errors and lifecycle

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/parsing/flex-basis-computed-expected.txt (285708 => 285709)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/parsing/flex-basis-computed-expected.txt	2021-11-12 08:59:44 UTC (rev 285708)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/parsing/flex-basis-computed-expected.txt	2021-11-12 10:17:21 UTC (rev 285709)
@@ -2,7 +2,7 @@
 PASS Property flex-basis value '1px'
 PASS Property flex-basis value '400%'
 PASS Property flex-basis value 'auto'
-FAIL Property flex-basis value 'content' assert_true: 'content' is a supported value for flex-basis. expected true got false
+PASS Property flex-basis value 'content'
 FAIL Property flex-basis value 'fit-content' assert_true: 'fit-content' is a supported value for flex-basis. expected true got false
 FAIL Property flex-basis value 'min-content' assert_true: 'min-content' is a supported value for flex-basis. expected true got false
 FAIL Property flex-basis value 'max-content' assert_true: 'max-content' is a supported value for flex-basis. expected true got false

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/parsing/flex-basis-valid-expected.txt (285708 => 285709)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/parsing/flex-basis-valid-expected.txt	2021-11-12 08:59:44 UTC (rev 285708)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/parsing/flex-basis-valid-expected.txt	2021-11-12 10:17:21 UTC (rev 285709)
@@ -6,5 +6,5 @@
 FAIL e.style['flex-basis'] = "fit-content" should set the property value assert_not_equals: property should be set got disallowed value ""
 FAIL e.style['flex-basis'] = "min-content" should set the property value assert_not_equals: property should be set got disallowed value ""
 FAIL e.style['flex-basis'] = "max-content" should set the property value assert_not_equals: property should be set got disallowed value ""
-FAIL e.style['flex-basis'] = "content" should set the property value assert_not_equals: property should be set got disallowed value ""
+PASS e.style['flex-basis'] = "content" should set the property value
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/parsing/flex-shorthand-expected.txt (285708 => 285709)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/parsing/flex-shorthand-expected.txt	2021-11-12 08:59:44 UTC (rev 285708)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/parsing/flex-shorthand-expected.txt	2021-11-12 10:17:21 UTC (rev 285709)
@@ -23,10 +23,10 @@
 PASS e.style['flex'] = "8 auto" should set flex-grow
 PASS e.style['flex'] = "8 auto" should set flex-shrink
 PASS e.style['flex'] = "8 auto" should not set unrelated longhands
-FAIL e.style['flex'] = "content" should set flex-basis assert_equals: flex-basis should be canonical expected "content" but got ""
-FAIL e.style['flex'] = "content" should set flex-grow assert_equals: flex-grow should be canonical expected "1" but got ""
-FAIL e.style['flex'] = "content" should set flex-shrink assert_equals: flex-shrink should be canonical expected "1" but got ""
-FAIL e.style['flex'] = "content" should not set unrelated longhands assert_true: expected true got false
+PASS e.style['flex'] = "content" should set flex-basis
+PASS e.style['flex'] = "content" should set flex-grow
+PASS e.style['flex'] = "content" should set flex-shrink
+PASS e.style['flex'] = "content" should not set unrelated longhands
 FAIL e.style['flex'] = "0 fit-content" should set flex-basis assert_equals: flex-basis should be canonical expected "fit-content" but got ""
 FAIL e.style['flex'] = "0 fit-content" should set flex-grow assert_equals: flex-grow should be canonical expected "0" but got ""
 FAIL e.style['flex'] = "0 fit-content" should set flex-shrink assert_equals: flex-shrink should be canonical expected "1" but got ""

Modified: trunk/Source/WebCore/ChangeLog (285708 => 285709)


--- trunk/Source/WebCore/ChangeLog	2021-11-12 08:59:44 UTC (rev 285708)
+++ trunk/Source/WebCore/ChangeLog	2021-11-12 10:17:21 UTC (rev 285709)
@@ -1,3 +1,49 @@
+2021-11-11  Sergio Villar Senin  <[email protected]>
+
+        [css-flexbox] Add flex-basis: content support
+        https://bugs.webkit.org/show_bug.cgi?id=221479
+
+        Reviewed by Javier Fernandez.
+
+        Add support for the content keyword as a valid value for the flex-basis property.
+        It indicates an automated size based on the contents of the flex item. It's typically
+        equivalent to the max-content size but it has some adjustments for aspect ratios,
+        orthogonal flows and intrinsic sizing constraints.
+
+        Apart from adding the parsing support, it required very little adjustments in the
+        flexbox code after the refactoring in r284359.
+
+        This makes WebKit pass all of the flex-basis:content tests in WPT. We're talking
+        about 6 tests testing the feature and 6 subtests related to parsing.
+
+        * css/CSSPrimitiveValue.cpp:
+        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Handle Content in switch.
+        (WebCore::CSSPrimitiveValue::init): Initialization for content CSS value.
+        * css/CSSProperties.json:
+        * css/LengthFunctions.cpp: Replaced LengthOrAuto by LengthSizing.
+        (WebCore::valueForLength): Handle Content in switch.
+        (WebCore::floatValueForLength): Ditto.
+        * css/LengthFunctions.h:
+        (WebCore::minimumValueForLength): Ditto.
+        * css/calc/CSSCalcValue.cpp:
+        (WebCore::createCSS): Ditto.
+        * css/parser/CSSPropertyParser.cpp:
+        (WebCore::consumeFlexBasis): Consume CSSValueContent.
+        (WebCore::CSSPropertyParser::consumeFlex): Ditto.
+        * platform/Length.cpp:
+        (WebCore::operator<<): Added printing support for content.
+        * platform/Length.h:
+        (WebCore::Length::initialize): Added enum for content.
+        (WebCore::Length::isContent const): New method.
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::computeReplacedLogicalWidthUsing const): Handle content in switch.
+        * rendering/RenderFlexibleBox.cpp:
+        (WebCore::RenderFlexibleBox::childMainSizeIsDefinite): Treat content as indefinite lenght.
+        (WebCore::RenderFlexibleBox::computeFlexBaseSizeForChild): Compute flex-basis using max-content
+        if flex-basis:content is specified.
+        * style/StyleBuilderConverter.h:
+        (WebCore::Style::BuilderConverter::convertLengthSizing): Handle content in switch.
+
 2021-11-11  Brent Fulgham  <[email protected]>
 
         [WebAuthn] Stop serializing BufferSource and Vector<uint8_t> duplicates of identifiers

Modified: trunk/Source/WebCore/css/CSSPrimitiveValue.cpp (285708 => 285709)


--- trunk/Source/WebCore/css/CSSPrimitiveValue.cpp	2021-11-12 08:59:44 UTC (rev 285708)
+++ trunk/Source/WebCore/css/CSSPrimitiveValue.cpp	2021-11-12 10:17:21 UTC (rev 285709)
@@ -38,6 +38,7 @@
 #include "Counter.h"
 #include "DeprecatedCSSOMPrimitiveValue.h"
 #include "FontCascade.h"
+#include "Length.h"
 #include "Node.h"
 #include "Pair.h"
 #include "Rect.h"
@@ -315,6 +316,7 @@
 {
     switch (length.type()) {
     case LengthType::Auto:
+    case LengthType::Content:
     case LengthType::Intrinsic:
     case LengthType::MinIntrinsic:
     case LengthType::MinContent:
@@ -377,6 +379,10 @@
         setPrimitiveUnitType(CSSUnitType::CSS_VALUE_ID);
         m_value.valueID = CSSValueAuto;
         return;
+    case LengthType::Content:
+        setPrimitiveUnitType(CSSUnitType::CSS_VALUE_ID);
+        m_value.valueID = CSSValueContent;
+        return;
     case LengthType::Fixed:
         setPrimitiveUnitType(CSSUnitType::CSS_PX);
         m_value.num = length.value();

Modified: trunk/Source/WebCore/css/CSSProperties.json (285708 => 285709)


--- trunk/Source/WebCore/css/CSSProperties.json	2021-11-12 08:59:44 UTC (rev 285708)
+++ trunk/Source/WebCore/css/CSSProperties.json	2021-11-12 10:17:21 UTC (rev 285709)
@@ -5633,7 +5633,7 @@
                 "aliases": [
                     "-webkit-flex-basis"
                 ],
-                "converter": "LengthOrAuto"
+                "converter": "LengthSizing"
             },
             "specification": {
                 "category": "css-flexbox",

Modified: trunk/Source/WebCore/css/LengthFunctions.cpp (285708 => 285709)


--- trunk/Source/WebCore/css/LengthFunctions.cpp	2021-11-12 08:59:44 UTC (rev 285708)
+++ trunk/Source/WebCore/css/LengthFunctions.cpp	2021-11-12 10:17:21 UTC (rev 285709)
@@ -49,6 +49,7 @@
     case LengthType::Relative:
     case LengthType::Intrinsic:
     case LengthType::MinIntrinsic:
+    case LengthType::Content:
     case LengthType::MinContent:
     case LengthType::MaxContent:
     case LengthType::FitContent:
@@ -76,6 +77,7 @@
     case LengthType::Relative:
     case LengthType::Intrinsic:
     case LengthType::MinIntrinsic:
+    case LengthType::Content:
     case LengthType::MinContent:
     case LengthType::MaxContent:
     case LengthType::FitContent:
@@ -102,6 +104,7 @@
     case LengthType::Relative:
     case LengthType::Intrinsic:
     case LengthType::MinIntrinsic:
+    case LengthType::Content:
     case LengthType::MinContent:
     case LengthType::MaxContent:
     case LengthType::FitContent:

Modified: trunk/Source/WebCore/css/LengthFunctions.h (285708 => 285709)


--- trunk/Source/WebCore/css/LengthFunctions.h	2021-11-12 08:59:44 UTC (rev 285708)
+++ trunk/Source/WebCore/css/LengthFunctions.h	2021-11-12 10:17:21 UTC (rev 285709)
@@ -59,6 +59,7 @@
         return LayoutUnit(length.nonNanCalculatedValue(maximumValue));
     case LengthType::FillAvailable:
     case LengthType::Auto:
+    case LengthType::Content:
         return 0;
     case LengthType::Relative:
     case LengthType::Intrinsic:

Modified: trunk/Source/WebCore/css/calc/CSSCalcValue.cpp (285708 => 285709)


--- trunk/Source/WebCore/css/calc/CSSCalcValue.cpp	2021-11-12 08:59:44 UTC (rev 285708)
+++ trunk/Source/WebCore/css/calc/CSSCalcValue.cpp	2021-11-12 10:17:21 UTC (rev 285709)
@@ -264,6 +264,7 @@
     case LengthType::Calculated:
         return createCSS(length.calculationValue()._expression_(), style);
     case LengthType::Auto:
+    case LengthType::Content:
     case LengthType::Intrinsic:
     case LengthType::MinIntrinsic:
     case LengthType::MinContent:

Modified: trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp (285708 => 285709)


--- trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp	2021-11-12 08:59:44 UTC (rev 285708)
+++ trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp	2021-11-12 10:17:21 UTC (rev 285709)
@@ -2269,7 +2269,7 @@
 static RefPtr<CSSValue> consumeFlexBasis(CSSParserTokenRange& range, CSSParserMode cssParserMode)
 {
     // FIXME: Support intrinsic dimensions too.
-    if (range.peek().id() == CSSValueAuto)
+    if (range.peek().id() == CSSValueAuto || range.peek().id() == CSSValueContent)
         return consumeIdent(range);
     return consumeLengthOrPercent(range, cssParserMode, ValueRange::NonNegative);
 }
@@ -5268,7 +5268,7 @@
                 else
                     return false;
             } else if (!flexBasis) {
-                if (m_range.peek().id() == CSSValueAuto)
+                if (m_range.peek().id() == CSSValueAuto || m_range.peek().id() == CSSValueContent)
                     flexBasis = consumeIdent(m_range);
                 if (!flexBasis)
                     flexBasis = consumeLengthOrPercent(m_range, m_context.mode, ValueRange::NonNegative);

Modified: trunk/Source/WebCore/platform/Length.cpp (285708 => 285709)


--- trunk/Source/WebCore/platform/Length.cpp	2021-11-12 08:59:44 UTC (rev 285708)
+++ trunk/Source/WebCore/platform/Length.cpp	2021-11-12 10:17:21 UTC (rev 285709)
@@ -378,6 +378,7 @@
     case LengthType::FillAvailable: ts << "fill-available"; break;
     case LengthType::FitContent: ts << "fit-content"; break;
     case LengthType::Calculated: ts << "calc"; break;
+    case LengthType::Content: ts << "content"; break;
     case LengthType::Undefined: ts << "undefined"; break;
     }
     return ts;
@@ -387,6 +388,7 @@
 {
     switch (length.type()) {
     case LengthType::Auto:
+    case LengthType::Content:
     case LengthType::Undefined:
         ts << length.type();
         break;

Modified: trunk/Source/WebCore/platform/Length.h (285708 => 285709)


--- trunk/Source/WebCore/platform/Length.h	2021-11-12 08:59:44 UTC (rev 285708)
+++ trunk/Source/WebCore/platform/Length.h	2021-11-12 10:17:21 UTC (rev 285709)
@@ -47,6 +47,7 @@
     FillAvailable,
     FitContent,
     Calculated,
+    Content,
     Undefined
 };
 
@@ -103,6 +104,7 @@
     bool isFillAvailable() const;
     bool isFitContent() const;
     bool isMinIntrinsic() const;
+    bool isContent() const;
 
     bool hasQuirk() const;
     void setHasQuirk(bool);
@@ -236,6 +238,7 @@
 
     switch (m_type) {
     case LengthType::Auto:
+    case LengthType::Content:
     case LengthType::Undefined:
         m_intValue = 0;
         break;
@@ -268,6 +271,7 @@
 
     switch (m_type) {
     case LengthType::Auto:
+    case LengthType::Content:
     case LengthType::Undefined:
         m_intValue = 0;
         break;
@@ -511,6 +515,11 @@
     return type() == LengthType::MinIntrinsic;
 }
 
+inline bool Length::isContent() const
+{
+    return type() == LengthType::Content;
+}
+
 Length convertTo100PercentMinusLength(const Length&);
 
 WTF::TextStream& operator<<(WTF::TextStream&, Length);

Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (285708 => 285709)


--- trunk/Source/WebCore/rendering/RenderBox.cpp	2021-11-12 08:59:44 UTC (rev 285708)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp	2021-11-12 10:17:21 UTC (rev 285709)
@@ -3403,6 +3403,7 @@
     case LengthType::Intrinsic:
     case LengthType::MinIntrinsic:
     case LengthType::Auto:
+    case LengthType::Content:
     case LengthType::Relative:
     case LengthType::Undefined:
         return intrinsicLogicalWidth();

Modified: trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp (285708 => 285709)


--- trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp	2021-11-12 08:59:44 UTC (rev 285708)
+++ trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp	2021-11-12 10:17:21 UTC (rev 285709)
@@ -921,7 +921,7 @@
 
 bool RenderFlexibleBox::childMainSizeIsDefinite(const RenderBox& child, const Length& flexBasis)
 {
-    if (flexBasis.isAuto())
+    if (flexBasis.isAuto() || flexBasis.isContent())
         return false;
     if (isColumnFlow() && (flexBasis.isIntrinsic() || flexBasis.type() == LengthType::Intrinsic))
         return false;
@@ -1029,7 +1029,7 @@
 LayoutUnit RenderFlexibleBox::computeFlexBaseSizeForChild(RenderBox& child, LayoutUnit mainAxisBorderAndPadding, bool relayoutChildren)
 {
     Length flexBasis = flexBasisForChild(child);
-    ScopedFlexBasisAsChildMainSize scoped(child, flexBasisForChild(child), mainAxisIsChildInlineAxis(child));
+    ScopedFlexBasisAsChildMainSize scoped(child, flexBasis.isContent() ? Length(LengthType::MaxContent) : flexBasis, mainAxisIsChildInlineAxis(child));
 
     maybeCacheChildMainIntrinsicSize(child, relayoutChildren);
 

Modified: trunk/Source/WebCore/style/StyleBuilderConverter.h (285708 => 285709)


--- trunk/Source/WebCore/style/StyleBuilderConverter.h	2021-11-12 08:59:44 UTC (rev 285708)
+++ trunk/Source/WebCore/style/StyleBuilderConverter.h	2021-11-12 10:17:21 UTC (rev 285709)
@@ -68,6 +68,7 @@
 public:
     static Length convertLength(const BuilderState&, const CSSValue&);
     static Length convertLengthOrAuto(const BuilderState&, const CSSValue&);
+    static Length convertLengthOrAutoOrContent(const BuilderState&, const CSSValue&);
     static Length convertLengthSizing(const BuilderState&, const CSSValue&);
     static Length convertLengthMaxSizing(const BuilderState&, const CSSValue&);
     static TabSize convertTabSize(const BuilderState&, const CSSValue&);
@@ -244,6 +245,8 @@
         return Length(LengthType::FitContent);
     case CSSValueAuto:
         return Length(LengthType::Auto);
+    case CSSValueContent:
+        return Length(LengthType::Content);
     default:
         ASSERT_NOT_REACHED();
         return Length();

Modified: trunk/Source/WebKit/ChangeLog (285708 => 285709)


--- trunk/Source/WebKit/ChangeLog	2021-11-12 08:59:44 UTC (rev 285708)
+++ trunk/Source/WebKit/ChangeLog	2021-11-12 10:17:21 UTC (rev 285709)
@@ -1,3 +1,14 @@
+2021-11-11  Sergio Villar Senin  <[email protected]>
+
+        [css-flexbox] Add flex-basis: content support
+        https://bugs.webkit.org/show_bug.cgi?id=221479
+
+        Reviewed by Javier Fernandez.
+
+        * Shared/WebCoreArgumentCoders.cpp:
+        (IPC::ArgumentCoder<Length>::encode): Handle content in switch.
+        (IPC::ArgumentCoder<Length>::decode): Ditto.
+
 2021-11-11  Per Arne Vollan <[email protected]>
 
         [macOS][GPUP] Remove access to mach services in sandbox

Modified: trunk/Source/WebKit/Shared/WebCoreArgumentCoders.cpp (285708 => 285709)


--- trunk/Source/WebKit/Shared/WebCoreArgumentCoders.cpp	2021-11-12 08:59:44 UTC (rev 285708)
+++ trunk/Source/WebKit/Shared/WebCoreArgumentCoders.cpp	2021-11-12 10:17:21 UTC (rev 285709)
@@ -717,6 +717,7 @@
 
     switch (length.type()) {
     case LengthType::Auto:
+    case LengthType::Content:
     case LengthType::Undefined:
         break;
     case LengthType::Fixed:
@@ -752,6 +753,7 @@
 
     switch (type) {
     case LengthType::Auto:
+    case LengthType::Content:
     case LengthType::Undefined:
         length = Length(type);
         return true;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to