Changeset 252883 in webkit
- Timestamp:
- Nov 26, 2019 4:09:04 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r252867 r252883 1 2019-11-26 Manuel Rego Casasnovas <rego@igalia.com> 2 3 [css-grid] Avoid serializing [] in grid-template* specified values 4 https://bugs.webkit.org/show_bug.cgi?id=204501 5 6 Reviewed by Javier Fernandez. 7 8 Update tests results, several tests are now passing. 9 Other are still failing due to different bugs like webkit.org/b/204508. 10 11 * web-platform-tests/css/css-grid/parsing/grid-shorthand-expected.txt: 12 * web-platform-tests/css/css-grid/parsing/grid-shorthand-valid-expected.txt: 13 * web-platform-tests/css/css-grid/parsing/grid-template-columns-valid-expected.txt: 14 * web-platform-tests/css/css-grid/parsing/grid-template-rows-valid-expected.txt: 15 * web-platform-tests/css/css-grid/parsing/grid-template-shorthand-expected.txt: 16 * web-platform-tests/css/css-grid/parsing/grid-template-shorthand-valid-expected.txt: 17 1 18 2019-11-25 Manuel Rego Casasnovas <rego@igalia.com> 2 19 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-shorthand-expected.txt
r252867 r252883 39 39 FAIL e.style['grid'] = " [] \"a a a\" [] [] \"b b b\" 1fr [] / [] auto 1fr [] auto []" should set grid-auto-rows assert_equals: grid-auto-rows should be canonical expected "auto" but got "initial" 40 40 PASS e.style['grid'] = " [] \"a a a\" [] [] \"b b b\" 1fr [] / [] auto 1fr [] auto []" should set grid-template-areas 41 FAIL e.style['grid'] = " [] \"a a a\" [] [] \"b b b\" 1fr [] / [] auto 1fr [] auto []" should set grid-template-columns assert_equals: grid-template-columns should be canonical expected "auto 1fr auto" but got "[] auto 1fr [] auto []" 42 FAIL e.style['grid'] = " [] \"a a a\" [] [] \"b b b\" 1fr [] / [] auto 1fr [] auto []" should set grid-template-rows assert_equals: grid-template-rows should be canonical expected "auto 1fr" but got "[] auto [] [] 1fr []" 41 PASS e.style['grid'] = " [] \"a a a\" [] [] \"b b b\" 1fr [] / [] auto 1fr [] auto []" should set grid-template-columns 42 PASS e.style['grid'] = " [] \"a a a\" [] [] \"b b b\" 1fr [] / [] auto 1fr [] auto []" should set grid-template-rows 43 43 PASS e.style['grid'] = " [] \"a a a\" [] [] \"b b b\" 1fr [] / [] auto 1fr [] auto []" should not set unrelated longhands 44 44 PASS e.style['grid'] = "10px / auto-flow dense 20px" should set grid-auto-columns -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-shorthand-valid-expected.txt
r252867 r252883 2 2 FAIL e.style['grid'] = "auto / auto" should set the property value assert_equals: serialization should be canonical expected "auto / auto" but got "auto auto none" 3 3 FAIL e.style['grid'] = "none / [a] 0px" should set the property value assert_equals: serialization should be canonical expected "none / [a] 0px" but got "none [a] 0px none" 4 FAIL e.style['grid'] = "none / [] 0px" should set the property value assert_equals: serialization should be canonical expected "none / 0px" but got "none []0px none"4 FAIL e.style['grid'] = "none / [] 0px" should set the property value assert_equals: serialization should be canonical expected "none / 0px" but got "none 0px none" 5 5 FAIL e.style['grid'] = "[a] 10px / auto" should set the property value assert_equals: serialization should be canonical expected "[a] 10px / auto" but got "[a] 10px auto none" 6 6 FAIL e.style['grid'] = "[a] 10px / none" should set the property value assert_equals: serialization should be canonical expected "[a] 10px / none" but got "[a] 10px none none" 7 FAIL e.style['grid'] = "[] 10px [] / [] auto []" should set the property value assert_equals: serialization should be canonical expected "10px / auto" but got " [] 10px [] [] auto []none"7 FAIL e.style['grid'] = "[] 10px [] / [] auto []" should set the property value assert_equals: serialization should be canonical expected "10px / auto" but got "10px auto none" 8 8 FAIL e.style['grid'] = "[a] \"a\" 10px" should set the property value assert_equals: serialization should be canonical expected "[a] \"a\" 10px" but got "[a] 10px none \"a\"" 9 FAIL e.style['grid'] = "[a] \"a\" 10px []" should set the property value assert_equals: serialization should be canonical expected "[a] \"a\" 10px" but got "[a] 10px []none \"a\""9 FAIL e.style['grid'] = "[a] \"a\" 10px []" should set the property value assert_equals: serialization should be canonical expected "[a] \"a\" 10px" but got "[a] 10px none \"a\"" 10 10 FAIL e.style['grid'] = "\"a\" 10px" should set the property value assert_equals: serialization should be canonical expected "\"a\" 10px" but got "10px none \"a\"" 11 FAIL e.style['grid'] = "[] \"a\" 10px" should set the property value assert_equals: serialization should be canonical expected "\"a\" 10px" but got " []10px none \"a\""11 FAIL e.style['grid'] = "[] \"a\" 10px" should set the property value assert_equals: serialization should be canonical expected "\"a\" 10px" but got "10px none \"a\"" 12 12 FAIL e.style['grid'] = "[a] \"a\" 10px [a]" should set the property value assert_equals: serialization should be canonical expected "[a] \"a\" 10px [a]" but got "[a] 10px [a] none \"a\"" 13 13 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-columns-valid-expected.txt
r252867 r252883 23 23 PASS e.style['grid-template-columns'] = "fit-content(calc(0.5em + 10px))" should set the property value 24 24 PASS e.style['grid-template-columns'] = "fit-content(calc(30% + 40vw))" should set the property value 25 FAIL e.style['grid-template-columns'] = "repeat(1, [] 10px [])" should set the property value assert_equals: serialization should be canonical expected "repeat(1, 10px)" but got "repeat(1, [] 10px [])" 25 PASS e.style['grid-template-columns'] = "repeat(1, [] 10px [])" should set the property value 26 26 PASS e.style['grid-template-columns'] = "repeat(1, [one two] 20%)" should set the property value 27 27 PASS e.style['grid-template-columns'] = "repeat(2, minmax(10px, auto))" should set the property value 28 28 PASS e.style['grid-template-columns'] = "repeat(2, fit-content(20%) [three four] 30px 40px [five six])" should set the property value 29 29 PASS e.style['grid-template-columns'] = "min-content repeat(5, minmax(10px, auto))" should set the property value 30 FAIL e.style['grid-template-columns'] = "[] 150px [] 1fr []" should set the property value assert_equals: serialization should be canonical expected "150px 1fr" but got "[] 150px [] 1fr []" 30 PASS e.style['grid-template-columns'] = "[] 150px [] 1fr []" should set the property value 31 31 PASS e.style['grid-template-columns'] = "repeat(auto-fill, 10px)" should set the property value 32 32 PASS e.style['grid-template-columns'] = "repeat(auto-fit, [one] 20%)" should set the property value -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-rows-valid-expected.txt
r252867 r252883 23 23 PASS e.style['grid-template-rows'] = "fit-content(calc(0.5em + 10px))" should set the property value 24 24 PASS e.style['grid-template-rows'] = "fit-content(calc(30% + 40vw))" should set the property value 25 FAIL e.style['grid-template-rows'] = "repeat(1, [] 10px [])" should set the property value assert_equals: serialization should be canonical expected "repeat(1, 10px)" but got "repeat(1, [] 10px [])" 25 PASS e.style['grid-template-rows'] = "repeat(1, [] 10px [])" should set the property value 26 26 PASS e.style['grid-template-rows'] = "repeat(1, [one two] 20%)" should set the property value 27 27 PASS e.style['grid-template-rows'] = "repeat(2, minmax(10px, auto))" should set the property value 28 28 PASS e.style['grid-template-rows'] = "repeat(2, fit-content(20%) [three four] 30px 40px [five six])" should set the property value 29 29 PASS e.style['grid-template-rows'] = "min-content repeat(5, minmax(10px, auto))" should set the property value 30 FAIL e.style['grid-template-rows'] = "[] 150px [] 1fr []" should set the property value assert_equals: serialization should be canonical expected "150px 1fr" but got "[] 150px [] 1fr []" 30 PASS e.style['grid-template-rows'] = "[] 150px [] 1fr []" should set the property value 31 31 PASS e.style['grid-template-rows'] = "repeat(auto-fill, 10px)" should set the property value 32 32 PASS e.style['grid-template-rows'] = "repeat(auto-fit, [one] 20%)" should set the property value -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-shorthand-expected.txt
r252867 r252883 21 21 PASS e.style['grid-template'] = " \"a a a\" \"b b b\" 1fr/ auto 1fr auto" should not set unrelated longhands 22 22 PASS e.style['grid-template'] = " [] \"a a a\" [] [] \"b b b\" 1fr [] / [] auto 1fr [] auto []" should set grid-template-areas 23 FAIL e.style['grid-template'] = " [] \"a a a\" [] [] \"b b b\" 1fr [] / [] auto 1fr [] auto []" should set grid-template-columns assert_equals: grid-template-columns should be canonical expected "auto 1fr auto" but got "[] auto 1fr [] auto []" 24 FAIL e.style['grid-template'] = " [] \"a a a\" [] [] \"b b b\" 1fr [] / [] auto 1fr [] auto []" should set grid-template-rows assert_equals: grid-template-rows should be canonical expected "auto 1fr" but got "[] auto [] [] 1fr []" 23 PASS e.style['grid-template'] = " [] \"a a a\" [] [] \"b b b\" 1fr [] / [] auto 1fr [] auto []" should set grid-template-columns 24 PASS e.style['grid-template'] = " [] \"a a a\" [] [] \"b b b\" 1fr [] / [] auto 1fr [] auto []" should set grid-template-rows 25 25 PASS e.style['grid-template'] = " [] \"a a a\" [] [] \"b b b\" 1fr [] / [] auto 1fr [] auto []" should not set unrelated longhands 26 26 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-shorthand-valid-expected.txt
r252867 r252883 2 2 FAIL e.style['grid-template'] = "auto / auto" should set the property value assert_equals: serialization should be canonical expected "auto / auto" but got "auto auto none" 3 3 FAIL e.style['grid-template'] = "none / [a] 0px" should set the property value assert_equals: serialization should be canonical expected "none / [a] 0px" but got "none [a] 0px none" 4 FAIL e.style['grid-template'] = "none / [] 0px" should set the property value assert_equals: serialization should be canonical expected "none / 0px" but got "none []0px none"4 FAIL e.style['grid-template'] = "none / [] 0px" should set the property value assert_equals: serialization should be canonical expected "none / 0px" but got "none 0px none" 5 5 FAIL e.style['grid-template'] = "[a] 10px / auto" should set the property value assert_equals: serialization should be canonical expected "[a] 10px / auto" but got "[a] 10px auto none" 6 6 FAIL e.style['grid-template'] = "[a] 10px / none" should set the property value assert_equals: serialization should be canonical expected "[a] 10px / none" but got "[a] 10px none none" 7 FAIL e.style['grid-template'] = "[] 10px [] / [] auto []" should set the property value assert_equals: serialization should be canonical expected "10px / auto" but got " [] 10px [] [] auto []none"7 FAIL e.style['grid-template'] = "[] 10px [] / [] auto []" should set the property value assert_equals: serialization should be canonical expected "10px / auto" but got "10px auto none" 8 8 FAIL e.style['grid-template'] = "[a] \"a\" 10px" should set the property value assert_equals: serialization should be canonical expected "[a] \"a\" 10px" but got "[a] 10px none \"a\"" 9 FAIL e.style['grid-template'] = "[a] \"a\" 10px []" should set the property value assert_equals: serialization should be canonical expected "[a] \"a\" 10px" but got "[a] 10px []none \"a\""9 FAIL e.style['grid-template'] = "[a] \"a\" 10px []" should set the property value assert_equals: serialization should be canonical expected "[a] \"a\" 10px" but got "[a] 10px none \"a\"" 10 10 FAIL e.style['grid-template'] = "\"a\" 10px" should set the property value assert_equals: serialization should be canonical expected "\"a\" 10px" but got "10px none \"a\"" 11 FAIL e.style['grid-template'] = "[] \"a\" 10px" should set the property value assert_equals: serialization should be canonical expected "\"a\" 10px" but got " []10px none \"a\""11 FAIL e.style['grid-template'] = "[] \"a\" 10px" should set the property value assert_equals: serialization should be canonical expected "\"a\" 10px" but got "10px none \"a\"" 12 12 FAIL e.style['grid-template'] = "[a] \"a\" 10px [a]" should set the property value assert_equals: serialization should be canonical expected "[a] \"a\" 10px [a]" but got "[a] 10px [a] none \"a\"" 13 13 -
trunk/Source/WebCore/ChangeLog
r252882 r252883 1 2019-11-26 Manuel Rego Casasnovas <rego@igalia.com> 2 3 [css-grid] Avoid serializing [] in grid-template-* specified values 4 https://bugs.webkit.org/show_bug.cgi?id=204501 5 6 Reviewed by Javier Fernandez. 7 8 Based on Blink r699101 by <ericwilligers@chromium.org>. 9 10 This patch discards empty list of line names when parsing grid-template-* properties. 11 That way we avoid these empty lists "[]" during serialization. 12 13 This was discussed at: https://github.com/w3c/csswg-drafts/issues/4173. 14 15 Several WPT tests are passing thanks to this change. 16 17 * css/parser/CSSPropertyParser.cpp: 18 (WebCore::consumeGridLineNames): 19 (WebCore::consumeGridTrackList): 20 1 21 2019-11-26 Carlos Garcia Campos <cgarcia@igalia.com> 2 22 -
trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp
r252467 r252883 3342 3342 } 3343 3343 3344 // Appends to the passed in CSSGridLineNamesValue if any, otherwise creates a new one. 3344 // Appends to the passed in CSSGridLineNamesValue if any, otherwise creates a new one. Returns nullptr if an empty list is consumed. 3345 3345 static RefPtr<CSSGridLineNamesValue> consumeGridLineNames(CSSParserTokenRange& range, CSSGridLineNamesValue* lineNames = nullptr) 3346 3346 { … … 3357 3357 return nullptr; 3358 3358 range = rangeCopy; 3359 return result ;3359 return result->length() ? result : nullptr; 3360 3360 } 3361 3361 … … 3420 3420 bool allowGridLineNames = trackListType != GridAuto; 3421 3421 RefPtr<CSSValueList> values = CSSValueList::createSpaceSeparated(); 3422 if (!allowGridLineNames && range.peek().type() == LeftBracketToken) 3423 return nullptr; 3422 3424 RefPtr<CSSGridLineNamesValue> lineNames = consumeGridLineNames(range); 3423 if (lineNames) { 3424 if (!allowGridLineNames) 3425 return nullptr; 3425 if (lineNames) 3426 3426 values->append(lineNames.releaseNonNull()); 3427 }3428 3427 3429 3428 bool allowRepeat = trackListType == GridTemplate; … … 3449 3448 if (seenAutoRepeat && !allTracksAreFixedSized) 3450 3449 return nullptr; 3450 if (!allowGridLineNames && range.peek().type() == LeftBracketToken) 3451 return nullptr; 3451 3452 lineNames = consumeGridLineNames(range); 3452 if (lineNames) { 3453 if (!allowGridLineNames) 3454 return nullptr; 3453 if (lineNames) 3455 3454 values->append(lineNames.releaseNonNull()); 3456 }3457 3455 } while (!range.atEnd() && range.peek().type() != DelimiterToken); 3458 3456 return values;
Note: See TracChangeset
for help on using the changeset viewer.