Changeset 245798 in webkit
- Timestamp:
- May 27, 2019, 2:27:15 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 19 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/css-grid-layout/grid-element-auto-repeat-get-set-expected.txt (modified) (3 diffs)
-
LayoutTests/fast/css-grid-layout/grid-element-auto-repeat-get-set.html (modified) (1 diff)
-
LayoutTests/fast/css-grid-layout/grid-repeat-calc-expected.txt (modified) (1 diff)
-
LayoutTests/fast/css-grid-layout/grid-repeat-calc.html (modified) (1 diff)
-
LayoutTests/fast/css-grid-layout/named-grid-line-get-set-expected.txt (modified) (1 diff)
-
LayoutTests/fast/css-grid-layout/named-grid-line-get-set.html (modified) (1 diff)
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-support-repeat-002-expected.txt (added)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-support-repeat-002.html (added)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-definition/w3c-import.log (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/Headers.cmake (modified) (1 diff)
-
Source/WebCore/Sources.txt (modified) (1 diff)
-
Source/WebCore/WebCore.xcodeproj/project.pbxproj (modified) (4 diffs)
-
Source/WebCore/css/CSSGridIntegerRepeatValue.cpp (added)
-
Source/WebCore/css/CSSGridIntegerRepeatValue.h (added)
-
Source/WebCore/css/CSSValue.cpp (modified) (4 diffs)
-
Source/WebCore/css/CSSValue.h (modified) (2 diffs)
-
Source/WebCore/css/StyleBuilderConverter.h (modified) (4 diffs)
-
Source/WebCore/css/parser/CSSPropertyParser.cpp (modified) (2 diffs)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/TestWebKitAPI/Tests/WebCore/CSSParser.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r245788 r245798 1 2019-05-27 Oriol Brufau <obrufau@igalia.com> 2 3 [css-grid] Preserve repeat() notation when serializing declared values 4 https://bugs.webkit.org/show_bug.cgi?id=197840 5 6 Reviewed by Manuel Rego Casasnovas. 7 8 Update test expectations. 9 10 * fast/css-grid-layout/grid-element-auto-repeat-get-set-expected.txt: 11 * fast/css-grid-layout/grid-element-auto-repeat-get-set.html: 12 * fast/css-grid-layout/grid-repeat-calc-expected.txt: 13 * fast/css-grid-layout/grid-repeat-calc.html: 14 * fast/css-grid-layout/named-grid-line-get-set-expected.txt: 15 * fast/css-grid-layout/named-grid-line-get-set.html: 16 1 17 2019-05-27 Carlos Garcia Campos <cgarcia@igalia.com> 2 18 -
trunk/LayoutTests/fast/css-grid-layout/grid-element-auto-repeat-get-set-expected.txt
r213831 r245798 14 14 PASS element.style.gridTemplateRows is "repeat(auto-fill, [foo] minmax(175px, max-content) [bar])" 15 15 PASS getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "100px 100px 100px 250px 250px" 16 PASS element.style.gridTemplateColumns is "repeat(auto-fill, minmax(50px, 100px)) 250px 250px"16 PASS element.style.gridTemplateColumns is "repeat(auto-fill, minmax(50px, 100px)) repeat(2, 250px)" 17 17 PASS getComputedStyle(element, '').getPropertyValue('grid-template-rows') is "450px 50px [bar] 50px [bar foo] 10px [foo] 10px" 18 PASS element.style.gridTemplateRows is " 450px repeat(auto-fill, minmax(max-content, 5em) [bar]) [foo] 1em [foo] 1em"18 PASS element.style.gridTemplateRows is "repeat(1, 450px) repeat(auto-fill, minmax(max-content, 5em) [bar]) repeat(2, [foo] 1em)" 19 19 PASS getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "[start] 80px [foo bar] 200px [foo bar] 200px [foo bar] 200px [end]" 20 20 PASS element.style.gridTemplateColumns is "[start] 10% repeat(auto-fill, [foo bar] 200px) [end]" … … 34 34 PASS element.style.gridTemplateRows is "repeat(auto-fit, [foo] minmax(20em, max-content) [bar])" 35 35 PASS getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "0px 0px 20px 20px" 36 PASS element.style.gridTemplateColumns is "repeat(auto-fit, minmax(300px, min-content)) 20px 20px"36 PASS element.style.gridTemplateColumns is "repeat(auto-fit, minmax(300px, min-content)) repeat(2, 20px)" 37 37 PASS getComputedStyle(element, '').getPropertyValue('grid-template-rows') is "60px 0px [bar foo] 10px [foo] 10px" 38 PASS element.style.gridTemplateRows is " 10% repeat(auto-fit, minmax(30em, max-content) [bar]) [foo] 1em [foo] 1em"38 PASS element.style.gridTemplateRows is "repeat(1, 10%) repeat(auto-fit, minmax(30em, max-content) [bar]) repeat(2, [foo] 1em)" 39 39 PASS getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "[a z] 0px [y z] 0px [y z] 0px [y z] 0px [y z] 0px [y z] 0px [y z] 0px [y b] 30px [c d] 20px [e]" 40 40 PASS element.style.gridTemplateColumns is "[a] repeat(auto-fit, [z] 100px [y]) [b] 30px [c d] 20px [e]" … … 42 42 PASS element.style.gridTemplateRows is "repeat(auto-fit, [z] 100px [y]) [a b] 30px [c d] 20px [e]" 43 43 PASS getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "[a z] 0px [y z] 0px [y z] 0px [y z] 0px [y z] 0px [y z] 0px [y z] 0px [y b] 30px [c] 20px [e]" 44 PASS element.style.gridTemplateColumns is "[a] repeat(auto-fit, [z] 100px [y]) [b] 30px [c]20px [e]"44 PASS element.style.gridTemplateColumns is "[a] repeat(auto-fit, [z] 100px [y]) repeat(1, [b] 30px [c]) 20px [e]" 45 45 PASS getComputedStyle(element, '').getPropertyValue('grid-template-rows') is "[a b] 30px [c d] 20px [e z] 0px [y z] 0px [y z] 0px [y z] 0px [y z] 0px [y]" 46 46 PASS element.style.gridTemplateRows is "[a b] 30px [c d] 20px [e] repeat(auto-fit, [z] 100px [y])" -
trunk/LayoutTests/fast/css-grid-layout/grid-element-auto-repeat-get-set.html
r213831 r245798 14 14 testGridTemplatesSetJSValues("repeat(auto-fill, [foo bar] 200px)", "repeat(auto-fill, 20em [foo bar])", "[foo bar] 200px [foo bar] 200px [foo bar] 200px [foo bar] 200px", "200px [foo bar] 200px [foo bar] 200px [foo bar]"); 15 15 testGridTemplatesSetJSValues("repeat(auto-fill, [foo bar] minmax(300px, 1fr))", "repeat(auto-fill, [foo] minmax(175px, max-content) [bar])", "[foo bar] 400px [foo bar] 400px", "[foo] 175px [bar foo] 175px [bar foo] 175px [bar]"); 16 testGridTemplatesSetJSValues("repeat(auto-fill, minmax(50px, 100px)) repeat(2, 250px)", "repeat(1, 450px) repeat(auto-fill, minmax(max-content, 5em) [bar]) repeat(2, [foo] 1em)", "100px 100px 100px 250px 250px", "450px 50px [bar] 50px [bar foo] 10px [foo] 10px", "repeat(auto-fill, minmax(50px, 100px)) 250px 250px", "450px repeat(auto-fill, minmax(max-content, 5em) [bar]) [foo] 1em [foo] 1em");16 testGridTemplatesSetJSValues("repeat(auto-fill, minmax(50px, 100px)) repeat(2, 250px)", "repeat(1, 450px) repeat(auto-fill, minmax(max-content, 5em) [bar]) repeat(2, [foo] 1em)", "100px 100px 100px 250px 250px", "450px 50px [bar] 50px [bar foo] 10px [foo] 10px", "repeat(auto-fill, minmax(50px, 100px)) repeat(2, 250px)", "repeat(1, 450px) repeat(auto-fill, minmax(max-content, 5em) [bar]) repeat(2, [foo] 1em)"); 17 17 testGridTemplatesSetJSValues("[start] 10% repeat(auto-fill, [foo bar] 200px) [end]", "75px [prev] repeat(auto-fill, 20em [foo bar]) [next] 15em [last end]", "[start] 80px [foo bar] 200px [foo bar] 200px [foo bar] 200px [end]", "75px [prev] 200px [foo bar next] 150px [last end]"); 18 18 testGridTemplatesSetJSValues("repeat(auto-fit, [foo bar] 150px)", "repeat(auto-fit, 24em [foo bar])", "[foo bar] 0px [foo bar] 0px [foo bar] 0px [foo bar] 0px [foo bar] 0px", "0px [foo bar] 0px [foo bar]"); 19 19 testGridTemplatesSetJSValues("repeat(auto-fill, [start] 200px 100px [end])", "100px [foo] repeat(auto-fill, [a] 2em [b] 10% [c]) [bar] 3em", "[start] 200px 100px [end start] 200px 100px [end]", "100px [foo a] 20px [b] 60px [c a] 20px [b] 60px [c a] 20px [b] 60px [c a] 20px [b] 60px [c a] 20px [b] 60px [c bar] 30px"); 20 20 testGridTemplatesSetJSValues("repeat(auto-fit, [foo bar] minmax(270px, 1fr))", "repeat(auto-fit, [foo] minmax(20em, max-content) [bar])", "[foo bar] 0px [foo bar] 0px", "[foo] 0px [bar foo] 0px [bar foo] 0px [bar]"); 21 testGridTemplatesSetJSValues("repeat(auto-fit, minmax(300px, min-content)) repeat(2, 20px)", "repeat(1, 10%) repeat(auto-fit, minmax(30em, max-content) [bar]) repeat(2, [foo] 1em)", "0px 0px 20px 20px", "60px 0px [bar foo] 10px [foo] 10px", "repeat(auto-fit, minmax(300px, min-content)) 20px 20px", "10% repeat(auto-fit, minmax(30em, max-content) [bar]) [foo] 1em [foo] 1em");21 testGridTemplatesSetJSValues("repeat(auto-fit, minmax(300px, min-content)) repeat(2, 20px)", "repeat(1, 10%) repeat(auto-fit, minmax(30em, max-content) [bar]) repeat(2, [foo] 1em)", "0px 0px 20px 20px", "60px 0px [bar foo] 10px [foo] 10px", "repeat(auto-fit, minmax(300px, min-content)) repeat(2, 20px)", "repeat(1, 10%) repeat(auto-fit, minmax(30em, max-content) [bar]) repeat(2, [foo] 1em)"); 22 22 testGridTemplatesSetJSValues("[a] repeat(auto-fit, [z] 100px [y]) [b] 30px [c d] 20px [e]", "repeat(auto-fit, [z] 100px [y]) [a b] 30px [c d] 20px [e]", "[a z] 0px [y z] 0px [y z] 0px [y z] 0px [y z] 0px [y z] 0px [y z] 0px [y b] 30px [c d] 20px [e]", "[z] 0px [y z] 0px [y z] 0px [y z] 0px [y z] 0px [y a b] 30px [c d] 20px [e]"); 23 testGridTemplatesSetJSValues("[a] repeat(auto-fit, [z] 100px [y]) repeat(1, [b] 30px [c]) 20px [e]", "[a b] 30px [c d] 20px [e] repeat(auto-fit, [z] 100px [y])", "[a z] 0px [y z] 0px [y z] 0px [y z] 0px [y z] 0px [y z] 0px [y z] 0px [y b] 30px [c] 20px [e]", "[a b] 30px [c d] 20px [e z] 0px [y z] 0px [y z] 0px [y z] 0px [y z] 0px [y]", "[a] repeat(auto-fit, [z] 100px [y]) [b] 30px [c]20px [e]");23 testGridTemplatesSetJSValues("[a] repeat(auto-fit, [z] 100px [y]) repeat(1, [b] 30px [c]) 20px [e]", "[a b] 30px [c d] 20px [e] repeat(auto-fit, [z] 100px [y])", "[a z] 0px [y z] 0px [y z] 0px [y z] 0px [y z] 0px [y z] 0px [y z] 0px [y b] 30px [c] 20px [e]", "[a b] 30px [c d] 20px [e z] 0px [y z] 0px [y z] 0px [y z] 0px [y z] 0px [y]", "[a] repeat(auto-fit, [z] 100px [y]) repeat(1, [b] 30px [c]) 20px [e]"); 24 24 testGridTemplatesSetJSValues("repeat(auto-fit, [start] 200px 100px [end])", "100px [foo] repeat(auto-fit, [a] 2em [b] 10% [c]) [bar] 3em", "[start] 0px 0px [end start] 0px 0px [end]", "100px [foo a] 0px [b] 0px [c a] 0px [b] 0px [c a] 0px [b] 0px [c a] 0px [b] 0px [c a] 0px [b] 0px [c bar] 30px"); 25 25 -
trunk/LayoutTests/fast/css-grid-layout/grid-repeat-calc-expected.txt
r200510 r245798 6 6 PASS testDiv.style['grid-template-rows'] is "" 7 7 testDiv.style['grid-template-rows'] = 'repeat(calc(1 + 1), 18px)' 8 PASS testDiv.style['grid-template-rows'] is " 18px 18px"8 PASS testDiv.style['grid-template-rows'] is "repeat(2, 18px)" 9 9 PASS window.getComputedStyle(testDiv).getPropertyValue('grid-template-rows') is "18px 18px" 10 10 PASS successfullyParsed is true -
trunk/LayoutTests/fast/css-grid-layout/grid-repeat-calc.html
r200510 r245798 11 11 shouldBeEmptyString("testDiv.style['grid-template-rows']"); 12 12 evalAndLog("testDiv.style['grid-template-rows'] = 'repeat(calc(1 + 1), 18px)'"); 13 shouldBeEqualToString("testDiv.style['grid-template-rows']", " 18px 18px");13 shouldBeEqualToString("testDiv.style['grid-template-rows']", "repeat(2, 18px)"); 14 14 shouldBeEqualToString("window.getComputedStyle(testDiv).getPropertyValue('grid-template-rows')", "18px 18px"); 15 15 -
trunk/LayoutTests/fast/css-grid-layout/named-grid-line-get-set-expected.txt
r234687 r245798 78 78 PASS element.style.gridTemplateRows is "[foo bar] auto [foo] auto [bar]" 79 79 PASS getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "[first] 0px [foo bar] 20px [foo bar] 20px" 80 PASS element.style.gridTemplateColumns is "[first] auto [foo bar] 20px [foo bar] 20px"80 PASS element.style.gridTemplateColumns is "[first] auto repeat(2, [foo bar] 20px)" 81 81 PASS getComputedStyle(element, '').getPropertyValue('grid-template-rows') is "220px [foo] 300px [baz]" 82 PASS element.style.gridTemplateRows is "220px [foo] 50% [baz]"82 PASS element.style.gridTemplateRows is "220px [foo] repeat(1, 50% [baz])" 83 83 84 84 Test getting invalid grid-template-columns and grid-template-rows set through CSS -
trunk/LayoutTests/fast/css-grid-layout/named-grid-line-get-set.html
r234687 r245798 125 125 testGridTemplatesSetJSValues("[first nav] minmax(min-content, max-content) [nav] auto [last]", "[first nav2] minmax(max-content, min-content) [nav2] minmax(10px, 15px) [last]", "[first nav] 0px [nav] 0px [last]", "[first nav2] 0px [nav2] 15px [last]", "[first nav] minmax(min-content, max-content) [nav] auto [last]", "[first nav2] minmax(max-content, min-content) [nav2] minmax(10px, 15px) [last]"); 126 126 testGridTemplatesSetJSValues("[foo bar] auto [foo] auto [bar]", "[foo bar] auto [foo] auto [bar]", "[foo bar] 0px [foo] 0px [bar]", "[foo bar] 0px [foo] 0px [bar]", "[foo bar] auto [foo] auto [bar]", "[foo bar] auto [foo] auto [bar]"); 127 testGridTemplatesSetJSValues("[first] auto repeat(2, [foo bar] 20px)", "220px [foo] repeat(1, 50% [baz] )", "[first] 0px [foo bar] 20px [foo bar] 20px", "220px [foo] 300px [baz]", "[first] auto [foo bar] 20px [foo bar] 20px", "220px [foo] 50% [baz]");127 testGridTemplatesSetJSValues("[first] auto repeat(2, [foo bar] 20px)", "220px [foo] repeat(1, 50% [baz]", "[first] 0px [foo bar] 20px [foo bar] 20px", "220px [foo] 300px [baz]", "[first] auto repeat(2, [foo bar] 20px)", "220px [foo] repeat(1, 50% [baz])"); 128 128 129 129 debug(""); -
trunk/LayoutTests/imported/w3c/ChangeLog
r245768 r245798 1 2019-05-27 Oriol Brufau <obrufau@igalia.com> 2 3 [css-grid] Preserve repeat() notation when serializing declared values 4 https://bugs.webkit.org/show_bug.cgi?id=197840 5 6 Reviewed by Manuel Rego Casasnovas. 7 8 Import WPT test. 9 10 * web-platform-tests/css/css-grid/grid-definition/grid-support-repeat-002-expected.txt: Added. 11 * web-platform-tests/css/css-grid/grid-definition/grid-support-repeat-002.html: Added. 12 * web-platform-tests/css/css-grid/grid-definition/w3c-import.log: 13 1 14 2019-05-24 Joonghun Park <jh718.park@samsung.com> 2 15 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-definition/w3c-import.log
r245295 r245798 47 47 /LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-support-named-grid-lines-001.html 48 48 /LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-support-repeat-001.html 49 /LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-support-repeat-002.html 49 50 /LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-template-columns-fit-content-001-expected.html 50 51 /LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-template-columns-fit-content-001.html -
trunk/Source/WebCore/ChangeLog
r245796 r245798 1 2019-05-27 Oriol Brufau <obrufau@igalia.com> 2 3 [css-grid] Preserve repeat() notation when serializing declared values 4 https://bugs.webkit.org/show_bug.cgi?id=197840 5 6 Reviewed by Manuel Rego Casasnovas. 7 8 Tests: fast/css-grid-layout/grid-element-auto-repeat-get-set.html 9 fast/css-grid-layout/grid-repeat-calc.html 10 fast/css-grid-layout/named-grid-line-get-set.html 11 imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-support-repeat-002.html 12 13 Before this change, a repeat() notation with an integral number of 14 repetitions was expanded at parse time. This was observable when reading 15 declared values using JS APIs. 16 17 This patch makes the parser preserve that notation, like it was already 18 happening when the number of repetitions was automatic and not integral. 19 20 The resolved value in getComputedStyle() will still be expanded, though, 21 as required by the spec. 22 23 * Sources.txt: 24 * WebCore.xcodeproj/project.pbxproj: 25 * css/CSSGridIntegerRepeatValue.cpp: Added. 26 (WebCore::CSSGridIntegerRepeatValue::customCSSText const): 27 (WebCore::CSSGridIntegerRepeatValue::equals const): 28 * css/CSSGridIntegerRepeatValue.h: Added. 29 * css/CSSValue.cpp: 30 (WebCore::CSSValue::equals const): 31 (WebCore::CSSValue::cssText const): 32 (WebCore::CSSValue::destroy): 33 * css/CSSValue.h: 34 (WebCore::CSSValue::isGridIntegerRepeatValue const): 35 * css/StyleBuilderConverter.h: 36 (WebCore::StyleBuilderConverter::createGridTrackList): 37 (WebCore::StyleBuilderConverter::convertGridTrackSizeList): 38 * css/parser/CSSPropertyParser.cpp: 39 (WebCore::consumeGridTrackRepeatFunction): 40 1 41 2019-05-27 Chris Dumez <cdumez@apple.com> 2 42 -
trunk/Source/WebCore/Headers.cmake
r245796 r245798 289 289 css/CSSFontFaceRule.h 290 290 css/CSSFontFamily.h 291 css/CSSGridIntegerRepeatValue.h 291 292 css/CSSGroupingRule.h 292 293 css/CSSImportRule.h -
trunk/Source/WebCore/Sources.txt
r245787 r245798 673 673 css/CSSGradientValue.cpp 674 674 css/CSSGridAutoRepeatValue.cpp 675 css/CSSGridIntegerRepeatValue.cpp 675 676 css/CSSGridLineNamesValue.cpp 676 677 css/CSSGridTemplateAreasValue.cpp -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r245796 r245798 984 984 33503CA410179AD7003B47E1 /* JSNotification.h in Headers */ = {isa = PBXBuildFile; fileRef = 33503CA010179AD7003B47E1 /* JSNotification.h */; settings = {ATTRIBUTES = (Private, ); }; }; 985 985 33D0212D131DB37B004091A8 /* CookieStorage.h in Headers */ = {isa = PBXBuildFile; fileRef = E13F01EA1270E10D00DFBA71 /* CookieStorage.h */; settings = {ATTRIBUTES = (Private, ); }; }; 986 35C74FDB228A1EF6000C21A0 /* CSSGridIntegerRepeatValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 35C74FD7228A19A6000C21A0 /* CSSGridIntegerRepeatValue.h */; settings = {ATTRIBUTES = (Private, ); }; }; 986 987 3717D7E817ECC591003C276D /* extract-localizable-strings.pl in Copy Scripts */ = {isa = PBXBuildFile; fileRef = 3717D7E517ECC3A6003C276D /* extract-localizable-strings.pl */; }; 987 988 371E65CC13661EDC00BEEDB0 /* PageSerializer.h in Headers */ = {isa = PBXBuildFile; fileRef = 371E65CB13661EDC00BEEDB0 /* PageSerializer.h */; }; … … 7101 7102 33503CA010179AD7003B47E1 /* JSNotification.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSNotification.h; sourceTree = "<group>"; }; 7102 7103 33503CC61017A1B1003B47E1 /* Notification.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Notification.cpp; sourceTree = "<group>"; }; 7104 35C74FD3228A1912000C21A0 /* CSSGridIntegerRepeatValue.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CSSGridIntegerRepeatValue.cpp; sourceTree = "<group>"; }; 7105 35C74FD7228A19A6000C21A0 /* CSSGridIntegerRepeatValue.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CSSGridIntegerRepeatValue.h; sourceTree = "<group>"; }; 7103 7106 3662F984047CEDBE5DDDAFAA /* RenderMathMLMenclose.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderMathMLMenclose.cpp; sourceTree = "<group>"; }; 7104 7107 37119A7920CCB610002C6DC9 /* WebKitTargetConditionals.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = WebKitTargetConditionals.xcconfig; sourceTree = "<group>"; }; … … 26592 26595 E110032E1C9AC3DE00412DD0 /* CSSGridAutoRepeatValue.cpp */, 26593 26596 E110032F1C9AC3DE00412DD0 /* CSSGridAutoRepeatValue.h */, 26597 35C74FD3228A1912000C21A0 /* CSSGridIntegerRepeatValue.cpp */, 26598 35C74FD7228A19A6000C21A0 /* CSSGridIntegerRepeatValue.h */, 26594 26599 CD7DBB2618CA11FF00C11066 /* CSSGridLineNamesValue.cpp */, 26595 26600 CD7DBB2718CA11FF00C11066 /* CSSGridLineNamesValue.h */, … … 28657 28662 BC53C6920DA591140021EB5D /* CSSGradientValue.h in Headers */, 28658 28663 E11003311C9AC3DE00412DD0 /* CSSGridAutoRepeatValue.h in Headers */, 28664 35C74FDB228A1EF6000C21A0 /* CSSGridIntegerRepeatValue.h in Headers */, 28659 28665 CD7DBB2918CA19C600C11066 /* CSSGridLineNamesValue.h in Headers */, 28660 28666 CD3E252418046BCD00E27F56 /* CSSGridTemplateAreasValue.h in Headers */, -
trunk/Source/WebCore/css/CSSValue.cpp
r237243 r245798 66 66 67 67 #include "CSSGridAutoRepeatValue.h" 68 #include "CSSGridIntegerRepeatValue.h" 68 69 #include "CSSGridLineNamesValue.h" 69 70 #include "CSSGridTemplateAreasValue.h" … … 189 190 case GridAutoRepeatClass: 190 191 return compareCSSValues<CSSGridAutoRepeatValue>(*this, other); 192 case GridIntegerRepeatClass: 193 return compareCSSValues<CSSGridIntegerRepeatValue>(*this, other); 191 194 case GridLineNamesClass: 192 195 return compareCSSValues<CSSGridLineNamesValue>(*this, other); … … 289 292 case GridAutoRepeatClass: 290 293 return downcast<CSSGridAutoRepeatValue>(*this).customCSSText(); 294 case GridIntegerRepeatClass: 295 return downcast<CSSGridIntegerRepeatValue>(*this).customCSSText(); 291 296 case GridLineNamesClass: 292 297 return downcast<CSSGridLineNamesValue>(*this).customCSSText(); … … 400 405 delete downcast<CSSGridAutoRepeatValue>(this); 401 406 return; 407 case GridIntegerRepeatClass: 408 delete downcast<CSSGridIntegerRepeatValue>(this); 409 return; 402 410 case GridLineNamesClass: 403 411 delete downcast<CSSGridLineNamesValue>(this); -
trunk/Source/WebCore/css/CSSValue.h
r238771 r245798 112 112 bool isContentDistributionValue() const { return m_classType == CSSContentDistributionClass; } 113 113 bool isGridAutoRepeatValue() const { return m_classType == GridAutoRepeatClass; } 114 bool isGridIntegerRepeatValue() const { return m_classType == GridIntegerRepeatClass; } 114 115 bool isGridTemplateAreasValue() const { return m_classType == GridTemplateAreasClass; } 115 116 bool isGridLineNamesValue() const { return m_classType == GridLineNamesClass; } … … 201 202 GridLineNamesClass, 202 203 GridAutoRepeatClass, 204 GridIntegerRepeatClass, 203 205 // Do not append non-list class types here. 204 206 }; -
trunk/Source/WebCore/css/StyleBuilderConverter.h
r245276 r245798 35 35 #include "CSSFunctionValue.h" 36 36 #include "CSSGridAutoRepeatValue.h" 37 #include "CSSGridIntegerRepeatValue.h" 37 38 #include "CSSGridLineNamesValue.h" 38 39 #include "CSSImageGeneratorValue.h" … … 990 991 991 992 unsigned currentNamedGridLine = 0; 993 auto handleLineNameOrTrackSize = [&](const CSSValue& currentValue) { 994 if (is<CSSGridLineNamesValue>(currentValue)) 995 createGridLineNamesList(currentValue, currentNamedGridLine, tracksData.m_namedGridLines, tracksData.m_orderedNamedGridLines); 996 else { 997 ++currentNamedGridLine; 998 tracksData.m_trackSizes.append(createGridTrackSize(currentValue, styleResolver)); 999 } 1000 }; 1001 992 1002 for (auto& currentValue : downcast<CSSValueList>(value)) { 993 if (is<CSSGridLineNamesValue>(currentValue)) {994 createGridLineNamesList(currentValue.get(), currentNamedGridLine, tracksData.m_namedGridLines, tracksData.m_orderedNamedGridLines);995 continue;996 }997 998 1003 if (is<CSSGridAutoRepeatValue>(currentValue)) { 999 1004 ASSERT(tracksData.m_autoRepeatTrackSizes.isEmpty()); … … 1014 1019 } 1015 1020 1016 ++currentNamedGridLine; 1017 tracksData.m_trackSizes.append(createGridTrackSize(currentValue, styleResolver)); 1021 if (is<CSSGridIntegerRepeatValue>(currentValue)) { 1022 size_t repetitions = downcast<CSSGridIntegerRepeatValue>(currentValue.get()).repetitions(); 1023 for (size_t i = 0; i < repetitions; ++i) { 1024 for (auto& integerRepeatValue : downcast<CSSValueList>(currentValue.get())) 1025 handleLineNameOrTrackSize(integerRepeatValue); 1026 } 1027 continue; 1028 } 1029 1030 handleLineNameOrTrackSize(currentValue); 1018 1031 } 1019 1032 … … 1100 1113 ASSERT(!currValue->isGridLineNamesValue()); 1101 1114 ASSERT(!currValue->isGridAutoRepeatValue()); 1115 ASSERT(!currValue->isGridIntegerRepeatValue()); 1102 1116 trackSizes.uncheckedAppend(convertGridTrackSize(styleResolver, currValue)); 1103 1117 } -
trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp
r245276 r245798 48 48 #include "CSSFunctionValue.h" 49 49 #include "CSSGridAutoRepeatValue.h" 50 #include "CSSGridIntegerRepeatValue.h" 50 51 #include "CSSGridLineNamesValue.h" 51 52 #include "CSSGridTemplateAreasValue.h" … … 3405 3406 // We clamp the repetitions to a multiple of the repeat() track list's size, while staying below the max grid size. 3406 3407 repetitions = std::min(repetitions, GridPosition::max() / numberOfTracks); 3407 for (size_t i = 0; i < repetitions; ++i) {3408 for (size_t j = 0; j < repeatedValues->length(); ++j)3409 list.append(*repeatedValues->itemWithoutBoundsCheck(j));3410 }3408 RefPtr<CSSValueList> integerRepeatedValues = CSSGridIntegerRepeatValue::create(repetitions); 3409 for (size_t i = 0; i < repeatedValues->length(); ++i) 3410 integerRepeatedValues->append(*repeatedValues->itemWithoutBoundsCheck(i)); 3411 list.append(integerRepeatedValues.releaseNonNull()); 3411 3412 } 3412 3413 return true; -
trunk/Tools/ChangeLog
r245778 r245798 1 2019-05-27 Oriol Brufau <obrufau@igalia.com> 2 3 [css-grid] Preserve repeat() notation when serializing declared values 4 https://bugs.webkit.org/show_bug.cgi?id=197840 5 6 Reviewed by Manuel Rego Casasnovas. 7 8 Adapt CSSPropertyParserTest to CSSGridIntegerRepeatValue. 9 10 * TestWebKitAPI/Tests/WebCore/CSSParser.cpp: 11 (TestWebKitAPI::computeNumberOfTracks): 12 1 13 2019-05-26 Wenson Hsieh <wenson_hsieh@apple.com> 2 14 -
trunk/Tools/TestWebKitAPI/Tests/WebCore/CSSParser.cpp
r212629 r245798 26 26 #include "config.h" 27 27 28 #include <WebCore/CSSGridIntegerRepeatValue.h> 28 29 #include <WebCore/CSSParser.h> 29 30 #include <WebCore/CSSValueList.h> … … 40 41 if (value->isGridLineNamesValue()) 41 42 continue; 43 if (is<CSSGridIntegerRepeatValue>(value)) { 44 auto& repeatValue = downcast<CSSGridIntegerRepeatValue>(value.get()); 45 numberOfTracks += repeatValue.repetitions() * computeNumberOfTracks(repeatValue); 46 continue; 47 } 42 48 ++numberOfTracks; 43 49 }
Note:
See TracChangeset
for help on using the changeset viewer.