8000 Change the default oblique angle from 20deg to 14deg · WebKit/WebKit@28de25b · GitHub
[go: up one dir, main page]

Skip to content

Commit 28de25b

Browse files
Ahmad-S792nt1m
authored andcommitted
Change the default oblique angle from 20deg to 14deg
Change the default oblique angle from 20deg to 14deg https://bugs.webkit.org/show_bug.cgi?id=248258 Reviewed by Myles C. Maxfield. This patch is to align Webkit with Blink / Chromium, Gecko / Firefox and Web-Specification. This is also part of Interop 2023 proposal [1]. [1] web-platform-tests/interop#64 Merge - https://chromium.googlesource.com/chromium/src/+/8bfd7d5770ec70f47e84b5cf33961b437a87c5a7 Web-Specification - http://w3c.github.io/csswg-drafts/css-fonts-4/#valdef-font-style-oblique-angle-90deg-90deg The specs refer to have default angle as 14deg - "The lack of an <angle> represents 14deg.". The imported test cases are leveraging font from Stephen Nixon using the Open Font License [2]. [2] https://github.com/arrowtype/vf-slnt-test/blob/main/fonts/license-recursive-OFL.txt#L3 * Source/WebCore/platform/graphics/FontSelectionAlgorithm.h: Update "italicThreshold" and "normalItalicValue" from 20deg to 14deg * LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/variations/slnt-variable.html: Added Test Case * LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/variations/slnt-variable-ref.html: Added Test Case Reference * LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/variations/slnt-variable-expected.html: Added Test Case Expectations * LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/variations/slnt-backslant-variable.html: Added Test Case * LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/variations/slnt-backslant-variable-ref.html: Added Test Case Reference * LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/variations/slnt-backslant-variable-expected.html: Added Test Case Expectations * LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/variations/at-font-face-matching-expected.txt: Updated Test Expectations * LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/variations/resources/FontStyleTest-slnt_backslant-VF.woff2 Added Test Font * LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/variations/resources/FontStyleTest-slnt-VF.woff2: Added Test Font * LayoutTests/fast/text/font-style-parse.html: Rebaselined * LayoutTests/fast/text/font-style-parse-expected.txt: Rebaselined * LayoutTests/platform/glib/TestExpectations: Add "Failure" Expectation with reference bug * LayoutTests/platform/ios/TestExpectations: Add "Failure" Expectation with reference bug * LayoutTests/platform/mac/TestExpectations: Add "Failure" Expectation with reference bug Canonical link: https://commits.webkit.org/258722@main
1 parent 20b003d commit 28de25b

16 files changed

+183
-14
lines changed

LayoutTests/fast/text/font-style-parse-expected.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ PASS getComputedStyle(document.getElementById('test17')).fontStyle is "normal"
1818
PASS getComputedStyle(document.getElementById('test18')).fontStyle is "italic"
1919
PASS getComputedStyle(document.getElementById('test19')).fontStyle is "italic"
2020
PASS getComputedStyle(document.getElementById('test20')).fontStyle is "normal"
21-
PASS getComputedStyle(document.getElementById('test21')).fontStyle is "oblique 14deg"
22-
PASS getComputedStyle(document.getElementById('test22')).fontStyle is "oblique"
21+
PASS getComputedStyle(document.getElementById('test21')).fontStyle is "oblique"
22+
PASS getComputedStyle(document.getElementById('test22')).fontStyle is "oblique 20deg"
2323
PASS getComputedStyle(document.getElementById('test1')).font is "16px / 18px Times"
2424
PASS getComputedStyle(document.getElementById('test2')).font is ""
2525
PASS getComputedStyle(document.getElementById('test3')).font is ""
@@ -40,8 +40,8 @@ PASS getComputedStyle(document.getElementById('test17')).font is "100 48px / 49p
4040
PASS getComputedStyle(document.getElementById('test18')).font is "italic 48px / 49px \"Helvetica Neue\""
4141
PASS getComputedStyle(document.getElementById('test19')).font is "italic small-caps 100 extra-expanded 48px / 49px \"Helvetica Neue\""
4242
PASS getComputedStyle(document.getElementById('test20')).font is "16px / 1 6D40 8px Times"
43-
PASS getComputedStyle(document.getElementById('test21')).font is ""
44-
PASS getComputedStyle(document.getElementById('test22')).font is "oblique 16px / 18px Times"
43+
PASS getComputedStyle(document.getElementById('test21')).font is "oblique small-caps 123 extra-expanded 48px / 49px \"Helvetica Neue\""
44+
PASS getComputedStyle(document.getElementById('test22')).font is ""
4545
PASS document.getElementById('test1').style.font is ""
4646
PASS document.getElementById('test15').style.font is "italic 100 48px / 49px \"Helvetica Neue\""
4747
PASS document.getElementById('test16').style.font is "italic 100 48px / 49px \"Helvetica Neue\""

LayoutTests/fast/text/font-style-parse.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@
4949
shouldBeEqualToString("getComputedStyle(document.getElementById('test18')).fontStyle", "italic");
5050
shouldBeEqualToString("getComputedStyle(document.getElementById('test19')).fontStyle", "italic");
5151
shouldBeEqualToString("getComputedStyle(document.getElementById('test20')).fontStyle", "normal");
52-
shouldBeEqualToString("getComputedStyle(document.getElementById('test21')).fontStyle", "oblique 14deg");
53-
shouldBeEqualToString("getComputedStyle(document.getElementById('test22')).fontStyle", "oblique");
52+
shouldBeEqualToString("getComputedStyle(document.getElementById('test21')).fontStyle", "oblique");
53+
shouldBeEqualToString("getComputedStyle(document.getElementById('test22')).fontStyle", "oblique 20deg");
5454

5555
shouldBeEqualToString("getComputedStyle(document.getElementById('test1')).font", "16px / 18px Times");
5656
shouldBeEqualToString("getComputedStyle(document.getElementById('test2')).font", "");
@@ -72,8 +72,8 @@
7272
shouldBeEqualToString("getComputedStyle(document.getElementById('test18')).font", `italic 48px / 49px "Helvetica Neue"`);
7373
shouldBeEqualToString("getComputedStyle(document.getElementById('test19')).font", `italic small-caps 100 extra-expanded 48px / 49px "Helvetica Neue"`);
7474
shouldBeEqualToString("getComputedStyle(document.getElementById('test20')).font", "16px / 18px Times");
75-
shouldBeEqualToString("getComputedStyle(document.getElementById('test21')).font", "");
76-
shouldBeEqualToString("getComputedStyle(document.getElementById('test22')).font", "oblique 16px / 18px Times");
75+
shouldBeEqualToString("getComputedStyle(document.getElementById('test21')).font", `oblique small-caps 123 extra-expanded 48px / 49px "Helvetica Neue"`);
76+
shouldBeEqualToString("getComputedStyle(document.getElementById('test22')).font", "");
7777

7878
shouldBeEqualToString("document.getElementById('test1').style.font", "");
7979
shouldBeEqualToString("document.getElementById('test15').style.font", `italic 100 48px / 49px "Helvetica Neue"`);

LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/variations/at-font-face-font-matching-expected.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ FAIL Matching font-style: 'normal' should prefer 'oblique 0deg' over 'oblique 10
5050
PASS Matching font-style: 'normal' should prefer 'oblique 10deg 40deg' over 'oblique 20deg 30deg'
5151
FAIL Matching font-style: 'normal' should prefer 'oblique 20deg 30deg' over 'oblique -50deg -20deg' assert_equals: Unexpected font on test element expected 488 but got 533
5252
PASS Matching font-style: 'normal' should prefer 'oblique -50deg -20deg' over 'oblique -40deg -30deg'
53-
FAIL Matching font-style: 'italic' should prefer 'italic' over 'oblique 20deg' assert_equals: Unexpected font on test element expected 488 but got 5 6D38 33
53+
PASS Matching font-style: 'italic' should prefer 'italic' over 'oblique 20deg'
5454
PASS Matching font-style: 'italic' should prefer 'oblique 20deg' over 'oblique 30deg 60deg'
5555
FAIL Matching font-style: 'italic' should prefer 'oblique 30deg 60deg' over 'oblique 40deg 50deg' assert_equals: Unexpected font on test element expected 488 but got 533
5656
PASS Matching font-style: 'italic' should prefer 'oblique 40deg 50deg' over 'oblique 5deg 10deg'

LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/variations/font-style-parsing-expected.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ PASS Font-style (supports): 'oblique' followed by calc is valid even if it mixes
2929
PASS Font-style (computed): 'italic' is valid
3030
PASS Font-style (computed): 'oblique' is valid
3131
FAIL Font-style (computed): 'oblique' followed by zero degrees is valid assert_equals: Font-style computed style: 'oblique' followed by zero degrees is valid expected "oblique 0deg" but got "normal"
32-
FAIL Font-style (computed): 'oblique' followed by positive angle in degrees is valid assert_equals: Font-style computed style: 'oblique' followed by positive angle in degrees is valid expected "oblique 20deg" but got "oblique"
32+
PASS Font-style (computed): 'oblique' followed by positive angle in degrees is valid
3333
FAIL Font-style (computed): 'oblique' followed by positive angle in radians is valid assert_equals: Font-style computed style: 'oblique' followed by positive angle in radians is valid expected "oblique 28.6479deg" but got "oblique 28.5deg"
3434
PASS Font-style (computed): 'oblique' followed by positive angle in gradians is valid
3535
PASS Font-style (computed): 'oblique' followed by positive angle in turns is valid
@@ -41,5 +41,5 @@ PASS Font-style (computed): 'oblique' followed by positive angle is valid
4141
PASS Font-style (computed): 'oblique' followed by calc is valid
4242
PASS Font-style (computed): 'oblique' followed by calc is valid even if it must be clamped (no computation)
4343
PASS Font-style (computed): 'oblique' followed by calc is valid even if it must be clamped (with computation)
44-
PASS Font-style (computed): 'oblique' followed by calc is valid even if it mixes units (with computation)
44+
FAIL Font-style (computed): 'oblique' followed by calc is valid even if it mixes units (with computation) assert_equals: Font-style computed style: 'oblique' followed by calc is valid even if it mixes units (with computation) expected "oblique 14deg" but got "oblique"
4545

19.9 KB
Binary file not shown.
25 KB
Binary file not shown.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<meta charset="utf-8" />
4+
<title>CSS Test: Variable fonts with slant axis</title>
5+
<style>
6+
@font-face {
7+
font-family: "slnt test font";
8+
src: url('resources/FontStyleTest-slnt_backslant-VF.woff2');
9+
font-style: oblique -15deg 15deg;
10+
}
11+
.test {
12+
font-family: "slnt test font";
13+
font-size: 3em;
14+
}
15+
.slnt14 {
16+
font-variation-settings: 'slnt' -14;
17+
}
18+
.backslant14 {
19+
font-variation-settings: 'slnt' 14;
20+
}
21+
</style>
22+
<p class="test backslant14">varfont</p>
23+
<p class="test slnt14">varfont</p>
24+
<p class="test slnt14">varfont</p>
25+
<p class="test">varfont</p>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<meta charset="utf-8" />
4+
<title>CSS Test: Variable fonts with slant axis</title>
5+
<style>
6+
@font-face {
7+
font-family: "slnt test font";
8+
src: url('resources/FontStyleTest-slnt_backslant-VF.woff2');
9+
font-style: oblique -15deg 15deg;
10+
}
11+
.test {
12+
font-family: "slnt test font";
13+
font-size: 3em;
14+
}
15+
.slnt14 {
16+
font-variation-settings: 'slnt' -14;
17+
}
18+
.backslant14 {
19+
font-variation-settings: 'slnt' 14;
20+
}
21+
</style>
22+
<p class="test backslant14">varfont</p>
23+
<p class="test slnt14">varfont</p>
24+
<p class="test slnt14">varfont</p>
25+
<p class="test">varfont</p>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<meta charset="utf-8" />
4+
<title>CSS Test: Variable fonts with slant axis</title>
5+
<link rel="help" href="https://www.w3.org/TR/css-fonts-4/#descdef-font-face-font-variation-settings" />
6+
<link rel="help" href="http://w3c.github.io/csswg-drafts/css-fonts-4/#valdef-font-style-oblique-angle-90deg-90deg" />
7+
<link rel="match" href="slnt-backslant-variable-ref.html">
8+
<meta name="assert"
9+
content="For variable fonts, setting font-style to oblique or italic should apply forward and backward slant to variable axis.">
10+
<!-- Fonts used in this test are authored by Stephen Nixon, more information in the link:
11+
https://arrowtype.github.io/vf-slnt-test/index.html -->
12+
<style>
13+
@font-face {
14+
font-family: "slnt test font";
15+
src: url('resources/FontStyleTest-slnt_backslant-VF.woff2');
16+
font-style: oblique -15deg 15deg;
17+
}
18+
.test {
19+
font-family: "slnt test font";
20+
font-size: 3em;
21+
}
22+
.backslant {
23+
font-style: oblique -14deg;
24+
}
25+
.oblique {
26+
font-style: oblique;
27+
}
28+
.italic {
29+
font-style: italic;
30+
}
31+
</style>
32+
<p class="test backslant">varfont</p>
33+
<p class="test oblique">varfont</p>
34+
<p class="test italic">varfont</p>
35+
<p class="test">varfont</p>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<meta charset="utf-8" />
4+
<title>CSS Test: Variable fonts with slant axis</title>
5+
<style>
6+
@font-face {
7+
font-family: "slnt test font";
8+
src: url('resources/FontStyleTest-slnt-VF.woff2');
9+
font-style: oblique 0deg 15deg;
10+
}
11+
.test {
12+
font-family: "slnt test font";
13+
font-size: 3em;
14+
}
15+
.slnt14 {
16+
font-variation-settings: 'slnt' -14;
17+
}
18+
</style>
19+
<p class="test slnt14">varfont</p>
20+
<p class="test slnt14">varfont</p>
21+
<p class="test">varfont</p>

0 commit comments

Comments
 (0)
0