Changeset 288184 in webkit
- Timestamp:
- Jan 19, 2022 1:28:38 AM (6 months ago)
- Location:
- trunk
- Files:
-
- 4 edited
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/parsing/flex-shorthand-expected.txt (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/css/parser/CSSPropertyParser.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r288174 r288184 1 2022-01-18 Sergio Villar Senin <svillar@igalia.com> 2 3 [css-flexbox] Add support for intrinsic sizes to the flex shorthand 4 https://bugs.webkit.org/show_bug.cgi?id=235314 5 6 Reviewed by Darin Adler. 7 8 * web-platform-tests/css/css-flexbox/parsing/flex-shorthand-expected.txt: Replaced FAIL by PASS expectations. 9 1 10 2022-01-18 Chris Dumez <cdumez@apple.com> 2 11 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/parsing/flex-shorthand-expected.txt
r285709 r288184 28 28 PASS e.style['flex'] = "content" should set flex-shrink 29 29 PASS e.style['flex'] = "content" should not set unrelated longhands 30 FAIL e.style['flex'] = "0 fit-content" should set flex-basis assert_equals: flex-basis should be canonical expected "fit-content" but got "" 31 FAIL e.style['flex'] = "0 fit-content" should set flex-grow assert_equals: flex-grow should be canonical expected "0" but got "" 32 FAIL e.style['flex'] = "0 fit-content" should set flex-shrink assert_equals: flex-shrink should be canonical expected "1" but got "" 33 FAIL e.style['flex'] = "0 fit-content" should not set unrelated longhands assert_true: expected true got false 34 FAIL e.style['flex'] = "1 0 max-content" should set flex-basis assert_equals: flex-basis should be canonical expected "max-content" but got "" 35 FAIL e.style['flex'] = "1 0 max-content" should set flex-grow assert_equals: flex-grow should be canonical expected "1" but got "" 36 FAIL e.style['flex'] = "1 0 max-content" should set flex-shrink assert_equals: flex-shrink should be canonical expected "0" but got "" 37 FAIL e.style['flex'] = "1 0 max-content" should not set unrelated longhands assert_true: expected true got false 30 PASS e.style['flex'] = "0 fit-content" should set flex-basis 31 PASS e.style['flex'] = "0 fit-content" should set flex-grow 32 PASS e.style['flex'] = "0 fit-content" should set flex-shrink 33 PASS e.style['flex'] = "0 fit-content" should not set unrelated longhands 34 PASS e.style['flex'] = "1 0 max-content" should set flex-basis 35 PASS e.style['flex'] = "1 0 max-content" should set flex-grow 36 PASS e.style['flex'] = "1 0 max-content" should set flex-shrink 37 PASS e.style['flex'] = "1 0 max-content" should not set unrelated longhands 38 38 -
trunk/Source/WebCore/ChangeLog
r288183 r288184 1 2022-01-18 Sergio Villar Senin <svillar@igalia.com> 2 3 [css-flexbox] Add support for intrinsic sizes to the flex shorthand 4 https://bugs.webkit.org/show_bug.cgi?id=235314 5 6 Reviewed by Darin Adler. 7 8 In r288113 we added support for intrinsic sizes in the flex-basis property. However the flex-basis property 9 can be also set via the flex shorthand. The flex shorthand was still not accepting the intrinsic sizes as 10 valid values. That's why the code that was checking idents in flex-basis was refactored so we do perform 11 now the very same test when parsing flex-basis and flex. 12 13 This allows WebKit to pass 8 additional WPT subtests. 14 15 * css/parser/CSSPropertyParser.cpp: 16 (WebCore::isFlexBasisIdent): Refactored from consumeFlexBasis. Checks whether a given ident is a valid keyword 17 for the flex-basis property. 18 (WebCore::consumeFlexBasis): Use isFlexBasisIdent. 19 (WebCore::CSSPropertyParser::consumeFlex): Ditto. 20 1 21 2022-01-19 Said Abou-Hallawa <said@apple.com> 2 22 -
trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp
r288113 r288184 2285 2285 } 2286 2286 2287 static bool isFlexBasisIdent(const WebCore::CSSValueID id, const CSSParserContext& context) 2288 { 2289 return identMatches<CSSValueAuto, CSSValueContent>(id) || validWidthOrHeightKeyword(id, context); 2290 } 2291 2287 2292 static RefPtr<CSSValue> consumeFlexBasis(CSSParserTokenRange& range, const CSSParserContext& context) 2288 2293 { 2289 if (i dentMatches<CSSValueAuto, CSSValueContent>(range.peek().id()) || validWidthOrHeightKeyword(range.peek().id(), context))2294 if (isFlexBasisIdent(range.peek().id(), context)) 2290 2295 return consumeIdent(range); 2291 2296 return consumeLengthOrPercent(range, context.mode, ValueRange::NonNegative); … … 5353 5358 return false; 5354 5359 } else if (!flexBasis) { 5355 if ( m_range.peek().id() == CSSValueAuto || m_range.peek().id() == CSSValueContent)5360 if (isFlexBasisIdent(m_range.peek().id(), m_context)) 5356 5361 flexBasis = consumeIdent(m_range); 5357 5362 if (!flexBasis)
Note: See TracChangeset
for help on using the changeset viewer.