Changeset 282396 in webkit
- Timestamp:
- Sep 14, 2021 10:08:05 AM (10 months ago)
- Location:
- trunk
- Files:
-
- 22 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/css/cursor-parsing-image-set-expected.txt (modified) (1 diff)
-
LayoutTests/fast/css/cursor-parsing-image-set.html (modified) (1 diff)
-
LayoutTests/fast/css/image-set-parsing-expected.txt (modified) (13 diffs)
-
LayoutTests/fast/css/image-set-parsing-generated-expected.txt (modified) (6 diffs)
-
LayoutTests/fast/css/image-set-parsing-generated.html (modified) (1 diff)
-
LayoutTests/fast/css/image-set-parsing.html (modified) (2 diffs)
-
LayoutTests/fast/css/image-set-setting-expected.txt (modified) (1 diff)
-
LayoutTests/fast/css/image-set-setting.html (modified) (1 diff)
-
LayoutTests/fast/css/image-set-unprefixed.html (modified) (1 diff)
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/test_media_queries-expected.txt (modified) (4 diffs)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/css/CSSPrimitiveValue.cpp (modified) (7 diffs)
-
Source/WebCore/css/CSSPrimitiveValue.h (modified) (1 diff)
-
Source/WebCore/css/CSSUnits.cpp (modified) (2 diffs)
-
Source/WebCore/css/CSSUnits.h (modified) (1 diff)
-
Source/WebCore/css/DeprecatedCSSOMPrimitiveValue.cpp (modified) (2 diffs)
-
Source/WebCore/css/calc/CSSCalcCategoryMapping.cpp (modified) (1 diff)
-
Source/WebCore/css/parser/CSSParserToken.cpp (modified) (1 diff)
-
Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp (modified) (4 diffs)
-
Source/WebCore/css/parser/CSSPropertyParserHelpers.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r282394 r282396 1 2021-09-14 Sam Sneddon <gsnedders@apple.com> 2 3 Support the `x` resolution unit 4 https://bugs.webkit.org/show_bug.cgi?id=229777 5 6 Reviewed by Simon Fraser. 7 8 Update tests so that they expect the x unit to serialize as the x unit 9 (and not magically change to the dppx unit). 10 11 * fast/css/cursor-parsing-image-set-expected.txt: 12 * fast/css/cursor-parsing-image-set.html: 13 * fast/css/image-set-parsing-expected.txt: 14 * fast/css/image-set-parsing-generated-expected.txt: 15 * fast/css/image-set-parsing-generated.html: 16 * fast/css/image-set-parsing.html: 17 * fast/css/image-set-setting-expected.txt: 18 * fast/css/image-set-setting.html: 19 * fast/css/image-set-unprefixed.html: 20 1 21 2021-09-14 Ayumi Kojima <ayumi_kojima@apple.com> 2 22 -
trunk/LayoutTests/fast/css/cursor-parsing-image-set-expected.txt
r255228 r282396 7 7 8 8 Test a bunch of cursor rules which should round-trip exactly. 9 PASS style.cssText is "cursor: image-set(url(\"file:///foo.png\") 1 dppx), auto;"10 PASS style.cssText is "cursor: image-set(url(\"file:///foo.png\") 1 dppx, url(\"file:///foo2x.png\") 2dppx), auto;"11 PASS style.cssText is "cursor: image-set(url(\"file:///foo.png\") 1 dppx, url(\"file:///foo2x.png\") 2dppx) 2 3, auto;"12 PASS style.cssText is "cursor: image-set(url(\"file:///foo03.png\") 0.3 dppx, url(\"file:///foo5x.png\") 5dppx) 6 5, url(\"file:///foo.png\") 12 3, pointer;"9 PASS style.cssText is "cursor: image-set(url(\"file:///foo.png\") 1x), auto;" 10 PASS style.cssText is "cursor: image-set(url(\"file:///foo.png\") 1x, url(\"file:///foo2x.png\") 2x), auto;" 11 PASS style.cssText is "cursor: image-set(url(\"file:///foo.png\") 1x, url(\"file:///foo2x.png\") 2x) 2 3, auto;" 12 PASS style.cssText is "cursor: image-set(url(\"file:///foo03.png\") 0.3x, url(\"file:///foo5x.png\") 5x) 6 5, url(\"file:///foo.png\") 12 3, pointer;" 13 13 PASS successfullyParsed is true 14 14 -
trunk/LayoutTests/fast/css/cursor-parsing-image-set.html
r255228 r282396 22 22 var cssText = makeCursorRule(rule); 23 23 style = roundtripCssRule(cssText); 24 shouldBeEqualToString('style.cssText', cssText .replace(/x(?=[,)])/g, 'dppx'));24 shouldBeEqualToString('style.cssText', cssText); 25 25 } 26 26 -
trunk/LayoutTests/fast/css/image-set-parsing-expected.txt
r260992 r282396 11 11 PASS imageSetRule.length is 2 12 12 PASS subRule is 'a' 13 PASS subRule.cssText is '1 dppx'13 PASS subRule.cssText is '1x' 14 14 15 15 Multiple values for background-image : url('#a') 1x, url('#b') 2x … … 19 19 PASS imageSetRule.length is 4 20 20 PASS subRule is 'a' 21 PASS subRule.cssText is '1 dppx'21 PASS subRule.cssText is '1x' 22 22 PASS subRule is 'b' 23 PASS subRule.cssText is '2 dppx'23 PASS subRule.cssText is '2x' 24 24 25 25 Single value for background-image without url() function : '#a' 1x … … 29 29 PASS imageSetRule.length is 2 30 30 PASS subRule is 'a' 31 PASS subRule.cssText is '1 dppx'31 PASS subRule.cssText is '1x' 32 32 33 33 Multiple values for background-image without url() function : '#a' 1x, '#b' 2x … … 37 37 PASS imageSetRule.length is 4 38 38 PASS subRule is 'a' 39 PASS subRule.cssText is '1 dppx'39 PASS subRule.cssText is '1x' 40 40 PASS subRule is 'b' 41 PASS subRule.cssText is '2 dppx'41 PASS subRule.cssText is '2x' 42 42 43 43 Mix values with and without url() function : '#a' 1x, url('#b') 2x … … 47 47 PASS imageSetRule.length is 4 48 48 PASS subRule is 'a' 49 PASS subRule.cssText is '1 dppx'49 PASS subRule.cssText is '1x' 50 50 PASS subRule is 'b' 51 PASS subRule.cssText is '2 dppx'51 PASS subRule.cssText is '2x' 52 52 53 53 Multiple values for background-image, out of order : url('#c') 3x, url('#b') 2x, url('#a') 1x … … 57 57 PASS imageSetRule.length is 6 58 58 PASS subRule is 'c' 59 PASS subRule.cssText is '3 dppx'59 PASS subRule.cssText is '3x' 60 60 PASS subRule is 'b' 61 PASS subRule.cssText is '2 dppx'61 PASS subRule.cssText is '2x' 62 62 PASS subRule is 'a' 63 PASS subRule.cssText is '1 dppx'63 PASS subRule.cssText is '1x' 64 64 65 65 Single value for content : url('#a') 1x … … 69 69 PASS imageSetRule.length is 2 70 70 PASS subRule is 'a' 71 PASS subRule.cssText is '1 dppx'71 PASS subRule.cssText is '1x' 72 72 73 73 Multiple values for content : url('#a') 1x, url('#b') 2x … … 77 77 PASS imageSetRule.length is 4 78 78 PASS subRule is 'a' 79 PASS subRule.cssText is '1 dppx'79 PASS subRule.cssText is '1x' 80 80 PASS subRule is 'b' 81 PASS subRule.cssText is '2 dppx'81 PASS subRule.cssText is '2x' 82 82 83 83 Single value for border-image : url('#a') 1x … … 87 87 PASS imageSetRule.length is 2 88 88 PASS subRule is 'a' 89 PASS subRule.cssText is '1 dppx'89 PASS subRule.cssText is '1x' 90 90 91 91 Multiple values for border-image : url('#a') 1x, url('#b') 2x … … 95 95 PASS imageSetRule.length is 4 96 96 PASS subRule is 'a' 97 PASS subRule.cssText is '1 dppx'97 PASS subRule.cssText is '1x' 98 98 PASS subRule is 'b' 99 PASS subRule.cssText is '2 dppx'99 PASS subRule.cssText is '2x' 100 100 101 101 Single value for -webkit-mask-box-image : url('#a') 1x … … 105 105 PASS imageSetRule.length is 2 106 106 PASS subRule is 'a' 107 PASS subRule.cssText is '1 dppx'107 PASS subRule.cssText is '1x' 108 108 109 109 Multiple values for -webkit-mask-box-image : url('#a') 1x, url('#b') 2x … … 113 113 PASS imageSetRule.length is 4 114 114 PASS subRule is 'a' 115 PASS subRule.cssText is '1 dppx'115 PASS subRule.cssText is '1x' 116 116 PASS subRule is 'b' 117 PASS subRule.cssText is '2 dppx'117 PASS subRule.cssText is '2x' 118 118 119 119 Single value with dppx : url('#a') 1dppx … … 147 147 PASS imageSetRule.length is 6 148 148 PASS subRule is 'a' 149 PASS subRule.cssText is '1 dppx'149 PASS subRule.cssText is '1x' 150 150 PASS subRule is 'b' 151 151 PASS subRule.cssText is '2dppx' -
trunk/LayoutTests/fast/css/image-set-parsing-generated-expected.txt
r260992 r282396 11 11 PASS imageSetRule.length is 2 12 12 PASS subRule.cssText is 'linear-gradient(green, white)' 13 PASS subRule.cssText is '1 dppx'13 PASS subRule.cssText is '1x' 14 14 15 15 Single value for content with gradient : linear-gradient(green, white) 1x … … 19 19 PASS imageSetRule.length is 2 20 20 PASS subRule.cssText is 'linear-gradient(green, white)' 21 PASS subRule.cssText is '1 dppx'21 PASS subRule.cssText is '1x' 22 22 23 23 Single value for background-image with gradients : linear-gradient(green, white) 1x, radial-gradient(blue, white) 2x … … 27 27 PASS imageSetRule.length is 4 28 28 PASS subRule.cssText is 'linear-gradient(green, white)' 29 PASS subRule.cssText is '1 dppx'29 PASS subRule.cssText is '1x' 30 30 PASS subRule.cssText is 'radial-gradient(blue, white)' 31 PASS subRule.cssText is '2 dppx'31 PASS subRule.cssText is '2x' 32 32 33 33 Combined gradient and URL : url('#a') 1x, linear-gradient(green, white) 2x … … 37 37 PASS imageSetRule.length is 4 38 38 PASS subRule is 'a' 39 PASS subRule.cssText is '1 dppx'39 PASS subRule.cssText is '1x' 40 40 PASS subRule.cssText is 'linear-gradient(green, white)' 41 PASS subRule.cssText is '2 dppx'41 PASS subRule.cssText is '2x' 42 42 43 43 Combined gradient and URL in content : url('#a') 1x, linear-gradient(green, white) 2x … … 47 47 PASS imageSetRule.length is 4 48 48 PASS subRule is 'a' 49 PASS subRule.cssText is '1 dppx'49 PASS subRule.cssText is '1x' 50 50 PASS subRule.cssText is 'linear-gradient(green, white)' 51 PASS subRule.cssText is '2 dppx'51 PASS subRule.cssText is '2x' 52 52 53 53 Combined gradient and cross-fade : -webkit-cross-fade(url('#a'), url('#b'), 70%) 1x, linear-gradient(green, white) 2x … … 57 57 PASS imageSetRule.length is 4 58 58 PASS subRule is 'a' 59 PASS subRule.cssText is '1 dppx'59 PASS subRule.cssText is '1x' 60 60 PASS subRule.cssText is 'linear-gradient(green, white)' 61 PASS subRule.cssText is '2 dppx'61 PASS subRule.cssText is '2x' 62 62 63 63 Single value for background-image with gradient and dpi : linear-gradient(green, white) 192dpi -
trunk/LayoutTests/fast/css/image-set-parsing-generated.html
r260992 r282396 71 71 "background-image", 72 72 "linear-gradient(green, white) 1x", 2, 73 ["linear-gradient(green, white)", "1 dppx"]);73 ["linear-gradient(green, white)", "1x"]); 74 74 testImageSetRule("Single value for content with gradient", 75 75 "background-image", 76 76 "linear-gradient(green, white) 1x", 2, 77 ["linear-gradient(green, white)", "1 dppx"]);77 ["linear-gradient(green, white)", "1x"]); 78 78 79 79 testImageSetRule("Single value for background-image with gradients", 80 80 "background-image", 81 81 "linear-gradient(green, white) 1x, radial-gradient(blue, white) 2x", 4, 82 ["linear-gradient(green, white)", "1 dppx", "radial-gradient(blue, white)", "2dppx"]);82 ["linear-gradient(green, white)", "1x", "radial-gradient(blue, white)", "2x"]); 83 83 84 84 testImageSetRule("Combined gradient and URL", 85 85 "background-image", 86 86 "url('#a') 1x, linear-gradient(green, white) 2x", 4, 87 ["a", "1 dppx", "linear-gradient(green, white)", "2dppx"]);87 ["a", "1x", "linear-gradient(green, white)", "2x"]); 88 88 89 89 testImageSetRule("Combined gradient and URL in content", 90 90 "content", 91 91 "url('#a') 1x, linear-gradient(green, white) 2x", 4, 92 ["a", "1 dppx", "linear-gradient(green, white)", "2dppx"]);92 ["a", "1x", "linear-gradient(green, white)", "2x"]); 93 93 94 94 testImageSetRule("Combined gradient and cross-fade", 95 95 "background-image", 96 96 "-webkit-cross-fade(url('#a'), url('#b'), 70%) 1x, linear-gradient(green, white) 2x", 4, 97 ["a", "1 dppx", "linear-gradient(green, white)", "2dppx"]);97 ["a", "1x", "linear-gradient(green, white)", "2x"]); 98 98 99 99 testImageSetRule("Single value for background-image with gradient and dpi", -
trunk/LayoutTests/fast/css/image-set-parsing.html
r260992 r282396 71 71 "background-image", 72 72 "url('#a') 1x", 2, 73 ["a", "1 dppx"]);73 ["a", "1x"]); 74 74 75 75 testImageSetRule("Multiple values for background-image", 76 76 "background-image", 77 77 "url('#a') 1x, url('#b') 2x", 4, 78 ["a", "1 dppx", "b", "2dppx"]);78 ["a", "1x", "b", "2x"]); 79 79 80 80 testImageSetRule("Single value for background-image without url() function", 81 81 "background-image", 82 82 "'#a' 1x", 2, 83 ["a", "1 dppx"], "image-set");83 ["a", "1x"], "image-set"); 84 84 85 85 testImageSetRule("Multiple values for background-image without url() function", 86 86 "background-image", 87 87 "'#a' 1x, '#b' 2x", 4, 88 ["a", "1 dppx", "b", "2dppx"], "image-set");88 ["a", "1x", "b", "2x"], "image-set"); 89 89 90 90 testImageSetRule("Mix values with and without url() function", 91 91 "background-image", 92 92 "'#a' 1x, url('#b') 2x", 4, 93 ["a", "1 dppx", "b", "2dppx"], "image-set");93 ["a", "1x", "b", "2x"], "image-set"); 94 94 95 95 testImageSetRule("Multiple values for background-image, out of order", 96 96 "background-image", 97 97 "url('#c') 3x, url('#b') 2x, url('#a') 1x", 6, 98 ["c", "3 dppx", "b", "2dppx", "a", "1dppx"]);98 ["c", "3x", "b", "2x", "a", "1x"]); 99 99 100 100 testImageSetRule("Single value for content", 101 101 "content", 102 102 "url('#a') 1x", 2, 103 ["a", "1 dppx"]);103 ["a", "1x"]); 104 104 105 105 testImageSetRule("Multiple values for content", 106 106 "content", 107 107 "url('#a') 1x, url('#b') 2x", 4, 108 ["a", "1 dppx", "b", "2dppx"]);108 ["a", "1x", "b", "2x"]); 109 109 110 110 testImageSetRule("Single value for border-image", 111 111 "-webkit-border-image", 112 112 "url('#a') 1x", 2, 113 ["a", "1 dppx"]);113 ["a", "1x"]); 114 114 115 115 testImageSetRule("Multiple values for border-image", 116 116 "-webkit-border-image", 117 117 "url('#a') 1x, url('#b') 2x", 4, 118 ["a", "1 dppx", "b", "2dppx"]);118 ["a", "1x", "b", "2x"]); 119 119 120 120 testImageSetRule("Single value for -webkit-mask-box-image", 121 121 "-webkit-mask-box-image", 122 122 "url('#a') 1x", 2, 123 ["a", "1 dppx"]);123 ["a", "1x"]); 124 124 125 125 testImageSetRule("Multiple values for -webkit-mask-box-image", 126 126 "-webkit-mask-box-image", 127 127 "url('#a') 1x, url('#b') 2x", 4, 128 ["a", "1 dppx", "b", "2dppx"]);128 ["a", "1x", "b", "2x"]); 129 129 130 130 testImageSetRule("Single value with dppx", … … 146 146 "background-image", 147 147 "url('#a') 1x, url('#b') 2dppx, url('#c') 250dpi", 6, 148 ["a", "1 dppx", "b", "2dppx", "c", "250dpi"]);148 ["a", "1x", "b", "2dppx", "c", "250dpi"]); 149 149 150 150 successfullyParsed = true; -
trunk/LayoutTests/fast/css/image-set-setting-expected.txt
r255228 r282396 6 6 7 7 Single value for background-image : url("http://www.webkit.org/a") 1x 8 PASS style.backgroundImage is "image-set(url(\"http://www.webkit.org/a\") 1 dppx)"8 PASS style.backgroundImage is "image-set(url(\"http://www.webkit.org/a\") 1x)" 9 9 10 10 Multiple values for background-image : url("http://www.webkit.org/a") 1x, url("http://www.webkit.org/b") 2x 11 PASS style.backgroundImage is "image-set(url(\"http://www.webkit.org/a\") 1 dppx, url(\"http://www.webkit.org/b\") 2dppx)"11 PASS style.backgroundImage is "image-set(url(\"http://www.webkit.org/a\") 1x, url(\"http://www.webkit.org/b\") 2x)" 12 12 13 13 Multiple values for background-image, out of order : url("http://www.webkit.org/c") 3x, url("http://www.webkit.org/b") 2x, url("http://www.webkit.org/a") 1x 14 PASS style.backgroundImage is "image-set(url(\"http://www.webkit.org/c\") 3 dppx, url(\"http://www.webkit.org/b\") 2dppx, url(\"http://www.webkit.org/a\") 1dppx)"14 PASS style.backgroundImage is "image-set(url(\"http://www.webkit.org/c\") 3x, url(\"http://www.webkit.org/b\") 2x, url(\"http://www.webkit.org/a\") 1x)" 15 15 16 16 Duplicate values for background-image : url("http://www.webkit.org/c") 1x, url("http://www.webkit.org/b") 2x, url("http://www.webkit.org/a") 1x 17 PASS style.backgroundImage is "image-set(url(\"http://www.webkit.org/c\") 1 dppx, url(\"http://www.webkit.org/b\") 2dppx, url(\"http://www.webkit.org/a\") 1dppx)"17 PASS style.backgroundImage is "image-set(url(\"http://www.webkit.org/c\") 1x, url(\"http://www.webkit.org/b\") 2x, url(\"http://www.webkit.org/a\") 1x)" 18 18 19 19 Fractional values for background-image : url("http://www.webkit.org/c") 0.2x, url("http://www.webkit.org/b") 2.3x, url("http://www.webkit.org/a") 12.3456x 20 PASS style.backgroundImage is "image-set(url(\"http://www.webkit.org/c\") 0.2 dppx, url(\"http://www.webkit.org/b\") 2.3dppx, url(\"http://www.webkit.org/a\") 12.3456dppx)"20 PASS style.backgroundImage is "image-set(url(\"http://www.webkit.org/c\") 0.2x, url(\"http://www.webkit.org/b\") 2.3x, url(\"http://www.webkit.org/a\") 12.3456x)" 21 21 PASS successfullyParsed is true 22 22 -
trunk/LayoutTests/fast/css/image-set-setting.html
r255228 r282396 29 29 var fullRule = "image-set(" + rule + ")"; 30 30 style = testComputedStyle(property, fullRule); 31 shouldBeEqualToString('style.backgroundImage', fullRule .replace(/x(?=[,)])/g, 'dppx'));31 shouldBeEqualToString('style.backgroundImage', fullRule); 32 32 } 33 33 -
trunk/LayoutTests/fast/css/image-set-unprefixed.html
r255228 r282396 26 26 rule += ', default'; 27 27 28 if (testComputedStyle(property, rule) == rule .replace(/x(?=[,)])/g, 'dppx'))28 if (testComputedStyle(property, rule) == rule) 29 29 debug("Unprefixed: PASS"); 30 30 else 31 31 debug("Unprefixed: FAIL"); 32 32 33 if (testComputedStyle(property, "-webkit-" + rule) == rule .replace(/x(?=[,)])/g, 'dppx'))33 if (testComputedStyle(property, "-webkit-" + rule) == rule) 34 34 debug("Prefixed: PASS"); 35 35 else -
trunk/LayoutTests/imported/w3c/ChangeLog
r282381 r282396 1 2021-09-14 Sam Sneddon <gsnedders@apple.com> 2 3 Support the `x` resolution unit 4 https://bugs.webkit.org/show_bug.cgi?id=229777 5 6 Reviewed by Simon Fraser. 7 8 Rebaseline for more passing tests. 9 10 * web-platform-tests/css/mediaqueries/test_media_queries-expected.txt: 11 1 12 2021-09-14 Youenn Fablet <youenn@apple.com> 2 13 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/test_media_queries-expected.txt
r282357 r282396 791 791 PASS subtest_662 792 792 PASS subtest_663 793 FAIL subtest_664 assert_true: expected true got false 793 PASS subtest_664 794 794 PASS subtest_665 795 FAIL subtest_666 assert_true: expected true got false 795 PASS subtest_666 796 796 PASS subtest_667 797 797 PASS subtest_668 … … 805 805 PASS subtest_676 806 806 PASS subtest_677 807 FAIL subtest_678 assert_true: expected true got false 807 PASS subtest_678 808 808 PASS subtest_679 809 FAIL subtest_680 assert_true: expected true got false 809 PASS subtest_680 810 810 PASS subtest_681 811 811 PASS subtest_682 … … 819 819 PASS subtest_690 820 820 PASS subtest_691 821 FAIL subtest_692 assert_true: expected true got false 821 PASS subtest_692 822 822 PASS subtest_693 823 FAIL subtest_694 assert_true: expected true got false 823 PASS subtest_694 824 824 PASS subtest_695 825 825 PASS subtest_696 … … 830 830 PASS subtest_700 831 831 PASS subtest_701 832 FAIL subtest_702 assert_true: (resolution: 1x) should apply expected true got false 832 PASS subtest_702 833 833 PASS subtest_703 834 834 PASS subtest_704 -
trunk/Source/WebCore/ChangeLog
r282395 r282396 1 2021-09-14 Sam Sneddon <gsnedders@apple.com> 2 3 Support the `x` resolution unit 4 https://bugs.webkit.org/show_bug.cgi?id=229777 5 6 Reviewed by Simon Fraser. 7 8 Covered by existing (progressing) tests. 9 10 * css/CSSPrimitiveValue.cpp: 11 (WebCore::isValidCSSUnitTypeForDoubleConversion): 12 (WebCore::isStringType): 13 (WebCore::CSSPrimitiveValue::cleanup): 14 (WebCore::CSSPrimitiveValue::conversionToCanonicalUnitsScaleFactor): 15 (WebCore::CSSPrimitiveValue::unitTypeString): 16 (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText const): 17 (WebCore::CSSPrimitiveValue::equals const): 18 * css/CSSPrimitiveValue.h: 19 * css/CSSUnits.cpp: 20 (WebCore::unitCategory): 21 (WebCore::operator<<): 22 * css/CSSUnits.h: 23 * css/DeprecatedCSSOMPrimitiveValue.cpp: 24 (WebCore::DeprecatedCSSOMPrimitiveValue::primitiveType const): 25 (WebCore::DeprecatedCSSOMPrimitiveValue::getFloatValue const): 26 * css/calc/CSSCalcCategoryMapping.cpp: 27 (WebCore::hasDoubleValue): 28 * css/parser/CSSParserToken.cpp: 29 (WebCore::cssPrimitiveValueUnitFromTrie): 30 * css/parser/CSSPropertyParserHelpers.cpp: 31 (WebCore::CSSPropertyParserHelpers::consumeResolutionCSSPrimitiveValueWithKnownTokenTypeDimension): 32 (WebCore::CSSPropertyParserHelpers::consumeResolution): 33 (WebCore::CSSPropertyParserHelpers::consumeImageSet): 34 * css/parser/CSSPropertyParserHelpers.h: 35 (WebCore::CSSPropertyParserHelpers::consumeResolution): 36 Remove the optional allowX argument now it's part of the normal syntax. 37 1 38 2021-09-14 Youenn Fablet <youenn@apple.com> 2 39 -
trunk/Source/WebCore/css/CSSPrimitiveValue.cpp
r282144 r282396 89 89 case CSSUnitType::CSS_DPI: 90 90 case CSSUnitType::CSS_DPPX: 91 case CSSUnitType::CSS_X: 91 92 return true; 92 93 case CSSUnitType::CSS_ATTR: … … 137 138 case CSSUnitType::CSS_DPI: 138 139 case CSSUnitType::CSS_DPPX: 140 case CSSUnitType::CSS_X: 139 141 case CSSUnitType::CSS_EMS: 140 142 case CSSUnitType::CSS_EXS: … … 511 513 case CSSUnitType::CSS_VMAX: 512 514 case CSSUnitType::CSS_DPPX: 515 case CSSUnitType::CSS_X: 513 516 case CSSUnitType::CSS_DPI: 514 517 case CSSUnitType::CSS_DPCM: … … 769 772 case CSSUnitType::CSS_DPPX: 770 773 break; 774 case CSSUnitType::CSS_X: 775 // This is semantically identical to (canonical) dppx 776 break; 771 777 case CSSUnitType::CSS_CM: 772 778 factor = cssPixelsPerInch / cmPerInch; … … 967 973 case CSSUnitType::CSS_VMAX: return "vmax"; 968 974 case CSSUnitType::CSS_DPPX: return "dppx"; 975 case CSSUnitType::CSS_X: return "x"; 969 976 case CSSUnitType::CSS_DPI: return "dpi"; 970 977 case CSSUnitType::CSS_DPCM: return "dpcm"; … … 1030 1037 case CSSUnitType::CSS_DPPX: 1031 1038 return formatNumberValue("dppx"); 1039 case CSSUnitType::CSS_X: 1040 return formatNumberValue("x"); 1032 1041 case CSSUnitType::CSS_DPI: 1033 1042 return formatNumberValue("dpi"); … … 1169 1178 case CSSUnitType::CSS_CM: 1170 1179 case CSSUnitType::CSS_DPPX: 1180 case CSSUnitType::CSS_X: 1171 1181 case CSSUnitType::CSS_DPI: 1172 1182 case CSSUnitType::CSS_DPCM: -
trunk/Source/WebCore/css/CSSPrimitiveValue.h
r282144 r282396 109 109 bool isDotsPerPixel() const { return primitiveType() == CSSUnitType::CSS_DPPX; } 110 110 bool isDotsPerCentimeter() const { return primitiveType() == CSSUnitType::CSS_DPCM; } 111 bool isX() const { return primitiveType() == CSSUnitType::CSS_X; } 111 112 bool isResolution() const { return unitCategory(primitiveType()) == CSSUnitCategory::Resolution; } 112 113 bool isViewportPercentageLength() const { return isViewportPercentageLength(primitiveUnitType()); } -
trunk/Source/WebCore/css/CSSUnits.cpp
r282357 r282396 53 53 return CSSUnitCategory::Frequency; 54 54 case CSSUnitType::CSS_DPPX: 55 case CSSUnitType::CSS_X: 55 56 case CSSUnitType::CSS_DPI: 56 57 case CSSUnitType::CSS_DPCM: … … 138 139 case CSSUnitType::CSS_VMAX: ts << "vmax"; break; 139 140 case CSSUnitType::CSS_DPPX: ts << "dppx"; break; 141 case CSSUnitType::CSS_X: ts << "x"; break; 140 142 case CSSUnitType::CSS_DPI: ts << "dpi"; break; 141 143 case CSSUnitType::CSS_DPCM: ts << "dpcm"; break; -
trunk/Source/WebCore/css/CSSUnits.h
r281785 r282396 61 61 CSS_VMAX, 62 62 CSS_DPPX, 63 CSS_X, 63 64 CSS_DPI, 64 65 CSS_DPCM, -
trunk/Source/WebCore/css/DeprecatedCSSOMPrimitiveValue.cpp
r278540 r282396 92 92 case CSSUnitType::CSS_VMIN: return CSS_VMIN; 93 93 case CSSUnitType::CSS_VW: return CSS_VW; 94 case CSSUnitType::CSS_X: return 37; 94 95 } 95 96 … … 133 134 case 35: return m_value->getFloatValue(CSSUnitType::CSS_LHS); 134 135 case 36: return m_value->getFloatValue(CSSUnitType::CSS_RLHS); 136 case 37: return m_value->getFloatValue(CSSUnitType::CSS_X); 135 137 case 107: return m_value->getFloatValue(CSSUnitType::CSS_TURN); 136 138 case 108: return m_value->getFloatValue(CSSUnitType::CSS_REMS); -
trunk/Source/WebCore/css/calc/CSSCalcCategoryMapping.cpp
r278540 r282396 161 161 case CSSUnitType::CSS_VMAX: 162 162 case CSSUnitType::CSS_DPPX: 163 case CSSUnitType::CSS_X: 163 164 case CSSUnitType::CSS_DPI: 164 165 case CSSUnitType::CSS_DPCM: -
trunk/Source/WebCore/css/parser/CSSParserToken.cpp
r279498 r282396 53 53 case 's': 54 54 return CSSUnitType::CSS_S; 55 case 'x': 56 return CSSUnitType::CSS_X; 55 57 } 56 58 break; -
trunk/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp
r282234 r282396 630 630 // MARK: Resolution (CSSPrimitiveValue - no calc) 631 631 632 static RefPtr<CSSPrimitiveValue> consumeResolutionCSSPrimitiveValueWithKnownTokenTypeDimension(CSSParserTokenRange& range, AllowXResolutionUnit allowX,CSSValuePool& pool)632 static RefPtr<CSSPrimitiveValue> consumeResolutionCSSPrimitiveValueWithKnownTokenTypeDimension(CSSParserTokenRange& range, CSSValuePool& pool) 633 633 { 634 634 ASSERT(range.peek().type() == DimensionToken); 635 635 636 if (auto unit = range.peek().unitType(); unit == CSSUnitType::CSS_DPPX || unit == CSSUnitType::CSS_ DPI || unit == CSSUnitType::CSS_DPCM)636 if (auto unit = range.peek().unitType(); unit == CSSUnitType::CSS_DPPX || unit == CSSUnitType::CSS_X || unit == CSSUnitType::CSS_DPI || unit == CSSUnitType::CSS_DPCM) 637 637 return pool.createValue(range.consumeIncludingWhitespace().numericValue(), unit); 638 if (allowX == AllowXResolutionUnit::Allow && range.peek().unitString() == "x")639 return pool.createValue(range.consumeIncludingWhitespace().numericValue(), CSSUnitType::CSS_DPPX);640 638 641 639 return nullptr; … … 889 887 } 890 888 891 RefPtr<CSSPrimitiveValue> consumeResolution(CSSParserTokenRange& range , AllowXResolutionUnit allowX)889 RefPtr<CSSPrimitiveValue> consumeResolution(CSSParserTokenRange& range) 892 890 { 893 891 // NOTE: Unlike the other types, calc() does not work with <resolution>. … … 897 895 switch (token.type()) { 898 896 case DimensionToken: 899 return consumeResolutionCSSPrimitiveValueWithKnownTokenTypeDimension(range, allowX,CSSValuePool::singleton());897 return consumeResolutionCSSPrimitiveValueWithKnownTokenTypeDimension(range, CSSValuePool::singleton()); 900 898 901 899 default: … … 3331 3329 imageSet->append(image.releaseNonNull()); 3332 3330 3333 auto resolution = consumeResolution(args , AllowXResolutionUnit::Allow);3331 auto resolution = consumeResolution(args); 3334 3332 if (!resolution || resolution->floatValue() <= 0) 3335 3333 return nullptr; -
trunk/Source/WebCore/css/parser/CSSPropertyParserHelpers.h
r282234 r282396 63 63 enum class UnitlessQuirk { Allow, Forbid }; 64 64 enum class UnitlessZeroQuirk { Allow, Forbid }; 65 enum class AllowXResolutionUnit { Allow, Forbid };66 65 67 66 struct AngleRaw { … … 98 97 RefPtr<CSSPrimitiveValue> consumeAngleWorkerSafe(CSSParserTokenRange&, CSSParserMode, CSSValuePool&, UnitlessQuirk = UnitlessQuirk::Forbid, UnitlessZeroQuirk = UnitlessZeroQuirk::Forbid); 99 98 RefPtr<CSSPrimitiveValue> consumeTime(CSSParserTokenRange&, CSSParserMode, ValueRange, UnitlessQuirk = UnitlessQuirk::Forbid); 100 RefPtr<CSSPrimitiveValue> consumeResolution(CSSParserTokenRange& , AllowXResolutionUnit = AllowXResolutionUnit::Forbid);99 RefPtr<CSSPrimitiveValue> consumeResolution(CSSParserTokenRange&); 101 100 102 101 std::optional<CSSValueID> consumeIdentRaw(CSSParserTokenRange&);
Note: See TracChangeset
for help on using the changeset viewer.