Commit 349a8363 authored by Dominik Röttsches's avatar Dominik Röttsches Committed by Commit Bot

Switch src: Local() font matching on by default

The feature has been tested at 50% in beta. Before marking it as rolled
out for 100% in the experimentation configuration, activate it to
100% on ToT.

Bug: 627143, 828317
Change-Id: I8824ef67c48846533d30f0b5416bcc184354dbcb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1752829
Commit-Queue: Dominik Röttsches <drott@chromium.org>
Auto-Submit: Dominik Röttsches <drott@chromium.org>
Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Reviewed-by: default avatarEmil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#687692}
parent 168926a9
...@@ -158,7 +158,7 @@ const base::Feature kFeaturePolicyForSandbox{"FeaturePolicyForSandbox", ...@@ -158,7 +158,7 @@ const base::Feature kFeaturePolicyForSandbox{"FeaturePolicyForSandbox",
// font name or postscript name. Rolling out behind a flag, as enabling this // font name or postscript name. Rolling out behind a flag, as enabling this
// enables a font indexer on Android which we need to test in the field first. // enables a font indexer on Android which we need to test in the field first.
const base::Feature kFontSrcLocalMatching{"FontSrcLocalMatching", const base::Feature kFontSrcLocalMatching{"FontSrcLocalMatching",
base::FEATURE_DISABLED_BY_DEFAULT}; base::FEATURE_ENABLED_BY_DEFAULT};
// Enables scrollers inside Blink to store scroll offsets in fractional // Enables scrollers inside Blink to store scroll offsets in fractional
// floating-point numbers rather than truncating to integers. // floating-point numbers rather than truncating to integers.
......
...@@ -5,13 +5,13 @@ ...@@ -5,13 +5,13 @@
font-family: 'test'; font-family: 'test';
font-weight: 400; font-weight: 400;
unicode-range: U+0020, U+0041-005A; /* space, A-Z */ unicode-range: U+0020, U+0041-005A; /* space, A-Z */
src: local('Helvetica'), local('Arial'); src: local('Helvetica'), local('Arial'), local(Arimo Regular);
} }
@font-face { @font-face {
font-family: 'test'; font-family: 'test';
font-weight: 700; font-weight: 700;
unicode-range: U+0061-007A; /* a-z */ unicode-range: U+0061-007A; /* a-z */
src: local('Times'), local('Times New Roman'); src: local('Times'), local('Times Roman'), local('Times New Roman'), local('Tinos Regular');
} }
span { span {
font-family: 'test', 'Courier', 'Courier New'; font-family: 'test', 'Courier', 'Courier New';
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<style> <style>
@font-face { @font-face {
font-family: 'myfont'; font-family: 'myfont';
src: local(Courier), local('Courier New'); /* Use monospace font */ src: local(Courier), local('Courier New'), local('Cousine Regular'); /* Use monospace font */
unicode-range: U+062-60; unicode-range: U+062-60;
} }
</style> </style>
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
/* Test 0: Download success */ /* Test 0: Download success */
@font-face { @font-face {
font-family:myfont_0; font-family:myfont_0;
src: local('Courier'), local('Courier New'); src: local('Courier'), local('Courier New'), local('Cousine Regular');
} }
@font-face { @font-face {
font-family:myfont_0; font-family:myfont_0;
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
/* Test 1: Download error */ /* Test 1: Download error */
@font-face { @font-face {
font-family:myfont_1; font-family:myfont_1;
src: local('Courier'), local('Courier New'); src: local('Courier'), local('Courier New'), local('Cousine Regular');
} }
@font-face { @font-face {
font-family:myfont_1; font-family:myfont_1;
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
/* Test 2: Download error followed by success */ /* Test 2: Download error followed by success */
@font-face { @font-face {
font-family:myfont_2; font-family:myfont_2;
src: local('Courier'), local('Courier New'); src: local('Courier'), local('Courier New'), local('Cousine Regular');
} }
@font-face { @font-face {
font-family:myfont_2; font-family:myfont_2;
...@@ -44,11 +44,11 @@ ...@@ -44,11 +44,11 @@
/* Test 3: Download error followed by existing local font */ /* Test 3: Download error followed by existing local font */
@font-face { @font-face {
font-family:myfont_3; font-family:myfont_3;
src: local('Courier'), local('Courier New'); src: local('Courier'), local('Courier New'), local('Cousine Regular');
} }
@font-face { @font-face {
font-family:myfont_3; font-family:myfont_3;
src: url('resources/DownLoadErrorAhem.otf'), local(Arial); src: url('resources/DownLoadErrorAhem.otf'), local(Arial), local(Arimo Regular);
unicode-range: u+69; /* 'i' */ unicode-range: u+69; /* 'i' */
} }
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
@media screen { @media screen {
@font-face { @font-face {
font-family: Times; font-family: Times;
src: local("Arial"); src: local("Arial"), local("Arimo Regular");
} }
} }
......
...@@ -10,77 +10,77 @@ ...@@ -10,77 +10,77 @@
/* Test 0: Comma-separated list, which is valid. */ /* Test 0: Comma-separated list, which is valid. */
@font-face { @font-face {
font-family:myfont_0; font-family:myfont_0;
src: local('Times New Roman'), local('Times'); src: local('Times New Roman'), local('Times'), local(Tinos Regular);
} }
@font-face { @font-face {
font-family:myfont_0; font-family:myfont_0;
src: local('Courier New'), local('Courier'); src: local('Courier New'), local('Courier'), local(Cousine Regular);
unicode-range: u+69, u+6a; /* 'i' and 'j' */ unicode-range: u+69, u+6a; /* 'i' and 'j' */
} }
/* Test 1: Comma-separated list with three elements, which is valid. */ /* Test 1: Comma-separated list with three elements, which is valid. */
@font-face { @font-face {
font-family:myfont_1; font-family:myfont_1;
src: local('Times New Roman'), local('Times'); src: local('Times New Roman'), local('Times'), local(Tinos Regular);
} }
@font-face { @font-face {
font-family:myfont_1; font-family:myfont_1;
src: local('Courier New'), local('Courier'); src: local('Courier New'), local('Courier'), local(Cousine Regular);
unicode-range: u+69 , u+6a ,u+6c; /* 'i', 'j', and 'l' */ unicode-range: u+69 , u+6a ,u+6c; /* 'i', 'j', and 'l' */
} }
/* Test 2: Comma-separated list with two consecutive commas, which is invalid. */ /* Test 2: Comma-separated list with two consecutive commas, which is invalid. */
@font-face { @font-face {
font-family:myfont_2; font-family:myfont_2;
src: local('Times New Roman'), local('Times'); src: local('Times New Roman'), local('Times'), local(Tinos Regular);
} }
@font-face { @font-face {
font-family:myfont_2; font-family:myfont_2;
src: local('Courier New'), local('Courier'); src: local('Courier New'), local('Courier'), local(Cousine Regular);
unicode-range: u+69, , u+6a; /* 'i' and 'j' */ unicode-range: u+69, , u+6a; /* 'i' and 'j' */
} }
/* Test 3: Comma-separated list with a trailing comma, which is invalid. */ /* Test 3: Comma-separated list with a trailing comma, which is invalid. */
@font-face { @font-face {
font-family:myfont_3; font-family:myfont_3;
src: local('Times New Roman'), local('Times'); src: local('Times New Roman'), local('Times'), local(Tinos Regular);
} }
@font-face { @font-face {
font-family:myfont_3; font-family:myfont_3;
src: local('Courier New'), local('Courier'); src: local('Courier New'), local('Courier'), local(Cousine Regular);
unicode-range: u+69, u+6a,; /* 'i' and 'j' */ unicode-range: u+69, u+6a,; /* 'i' and 'j' */
} }
/* Test 4: Comma-separated list with a leading comma, which is invalid. */ /* Test 4: Comma-separated list with a leading comma, which is invalid. */
@font-face { @font-face {
font-family:myfont_4; font-family:myfont_4;
src: local('Times New Roman'), local('Times'); src: local('Times New Roman'), local('Times'), local(Tinos Regular);
} }
@font-face { @font-face {
font-family:myfont_4; font-family:myfont_4;
src: local('Courier New'), local('Courier'); src: local('Courier New'), local('Courier'), local(Cousine Regular);
unicode-range: , u+69, u+6a; /* 'i' and 'j' */ unicode-range: , u+69, u+6a; /* 'i' and 'j' */
} }
/* Test 5: Space-separated list, which is invalid. */ /* Test 5: Space-separated list, which is invalid. */
@font-face { @font-face {
font-family:myfont_5; font-family:myfont_5;
src: local('Times New Roman'), local('Times'); src: local('Times New Roman'), local('Times'), local(Tinos Regular);
} }
@font-face { @font-face {
font-family:myfont_5; font-family:myfont_5;
src: local('Courier New'), local('Courier'); src: local('Courier New'), local('Courier'), local(Cousine Regular);
unicode-range: u+69 u+6a ; /* 'i' and 'j' */ unicode-range: u+69 u+6a ; /* 'i' and 'j' */
} }
/* Test 6: Slash-separated list, which is invalid. */ /* Test 6: Slash-separated list, which is invalid. */
@font-face { @font-face {
font-family:myfont_6; font-family:myfont_6;
src: local('Times New Roman'), local('Times'); src: local('Times New Roman'), local('Times'), local(Tinos Regular);
} }
@font-face { @font-face {
font-family:myfont_6; font-family:myfont_6;
src: local('Courier New'), local('Courier'); src: local('Courier New'), local('Courier'), local(Cousine Regular);
unicode-range: u+69/u+6a; /* 'i' and 'j' */ unicode-range: u+69/u+6a; /* 'i' and 'j' */
} }
......
...@@ -3,13 +3,13 @@ ...@@ -3,13 +3,13 @@
<style> <style>
@font-face { @font-face {
font-family: font1; font-family: font1;
src: local(Courier), local('Courier New'); /* Use monospace font */ src: local(Courier), local('Courier New'), local(Cousine Regular); /* Use monospace font */
unicode-range: U+0041; /* 'A' */ unicode-range: U+0041; /* 'A' */
} }
@font-face { @font-face {
font-family: font2; font-family: font2;
src: local(Arial); src: local(Arial), local(Arimo Regular);
unicode-range: U+006d; /* 'm' */ unicode-range: U+006d; /* 'm' */
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<style> <style>
@font-face { @font-face {
font-family: TestFont; font-family: TestFont;
src: local(Arial); src: local(Arial), local(Arimo Regular);
} }
@font-face { @font-face {
font-family: Ahem; font-family: Ahem;
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
/* Test 4: Download error followed by existing local font */ /* Test 4: Download error followed by existing local font */
@font-face { @font-face {
font-family: myfont4; font-family: myfont4;
src: url('resources/DownLoadErrorAhem.otf'), local('Courier New'); src: url('resources/DownLoadErrorAhem.otf'), local('Courier New'), local(Cousine Regular);
} }
/* Test 5: Multiple errors */ /* Test 5: Multiple errors */
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<style> <style>
@font-face { @font-face {
font-family: TestFont; font-family: TestFont;
src: local('Courier New'); src: local('Courier New'), local(Cousine Regular);
} }
@font-face { @font-face {
......
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
<option class="font2">font 2</option> <option class="font2">font 2</option>
</select> </select>
<script> <script>
var face1 = new FontFace("TestFont", "local(Arial)"); var face1 = new FontFace("TestFont", "local(Arial), local(Arimo Regular)");
var face2 = new FontFace("TestFont 2", "local(Arial)"); var face2 = new FontFace("TestFont 2", "local(Arial), local(Arimo Regular)");
document.fonts.add(face1); document.fonts.add(face1);
document.fonts.add(face2); document.fonts.add(face2);
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<style> <style>
@font-face { @font-face {
font-family:T; font-family:T;
src:local('Times New Roman'); src:local('Times New Roman'), local(Tinos Regular);
unicode-range:U+41; unicode-range:U+41;
} }
div { div {
......
B<style type="text/css"> B<style type="text/css">
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
@font-face { @font-face {
font-family: 'test5'; font-family: 'test5';
src: local('Times'), local('Tinos-Regular'), local('Times New Roman'); src: local('Times'), local('Times Roman'), local('Tinos-Regular'), local('Times New Roman');
} }
@font-face { @font-face {
font-family: 'test5'; font-family: 'test5';
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment