Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(528)

Side by Side Diff: third_party/WebKit/LayoutTests/fast/text/font-features/resources/font-variant-features.js

Issue 1958333004: Move font-variant-ligatures test to Mozilla style test (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add reftest expectations Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Test case adapted from Mozilla tests for font-variant-subproperties available under 1 // Test case adapted from Mozilla tests for font-variant-subproperties available under
2 // http://creativecommons.org/publicdomain/zero/1.0/ 2 // http://creativecommons.org/publicdomain/zero/1.0/
3 // See discussion on https://bugzilla.mozilla.org/show_bug.cgi?id=1261445 3 // See discussion on https://bugzilla.mozilla.org/show_bug.cgi?id=1261445
4 4
5 // data associated with gsubtest test font for testing font features 5 // data associated with gsubtest test font for testing font features
6 6
7 // prefix 7 // prefix
8 gPrefix = ""; 8 gPrefix = "";
9 9
10 // equivalent properties 10 // equivalent properties
(...skipping 12 matching lines...) Expand all
23 { prop: "font-variant-caps", value: "titling-caps", features: {"titl": 1, "smc p": 0} }, 23 { prop: "font-variant-caps", value: "titling-caps", features: {"titl": 1, "smc p": 0} },
24 { prop: "font-variant-caps", value: "unicase", features: {"unic": 1, "titl": 0 } }, 24 { prop: "font-variant-caps", value: "unicase", features: {"unic": 1, "titl": 0 } },
25 25
26 // invalid values 26 // invalid values
27 { prop: "font-variant-caps", value: "normal small-caps", features: {"smcp": 0} , invalid: true }, 27 { prop: "font-variant-caps", value: "normal small-caps", features: {"smcp": 0} , invalid: true },
28 { prop: "font-variant-caps", value: "small-caps potato", features: {"smcp": 0} , invalid: true }, 28 { prop: "font-variant-caps", value: "small-caps potato", features: {"smcp": 0} , invalid: true },
29 { prop: "font-variant-caps", value: "small-caps petite-caps", features: {"smcp ": 0, "pcap": 0}, invalid: true }, 29 { prop: "font-variant-caps", value: "small-caps petite-caps", features: {"smcp ": 0, "pcap": 0}, invalid: true },
30 { prop: "font-variant-caps", value: "small-caps all-small-caps", features: {"s mcp": 0, "c2sc": 0}, invalid: true }, 30 { prop: "font-variant-caps", value: "small-caps all-small-caps", features: {"s mcp": 0, "c2sc": 0}, invalid: true },
31 { prop: "font-variant-caps", value: "small-cap", features: {"smcp": 0}, invali d: true }, 31 { prop: "font-variant-caps", value: "small-cap", features: {"smcp": 0}, invali d: true },
32 32
33 // font-variant-ligatures
34 // valid values
35 { prop: "font-variant-ligatures", value: "none", features: {"liga": 0, "dlig": 0, "clig": 0, "calt": 0, "hlig": 0} },
36 { prop: "font-variant-ligatures", value: "normal", features: {"liga": 1, "dlig ": 0} },
37 { prop: "font-variant-ligatures", value: "common-ligatures", features: {"liga" : 1, "clig": 1, "dlig": 0, "hlig": 0, "calt": 1} },
38 { prop: "font-variant-ligatures", value: "no-common-ligatures", features: {"li ga": 0, "clig": 0, "dlig": 0, "hlig": 0, "calt": 1} },
39 { prop: "font-variant-ligatures", value: "discretionary-ligatures", features: {"liga": 1, "clig": 1, "dlig": 1, "hlig": 0, "calt": 1} },
40 { prop: "font-variant-ligatures", value: "no-discretionary-ligatures", feature s: {"liga": 1, "clig": 1, "dlig": 0, "hlig": 0, "calt": 1} },
41 { prop: "font-variant-ligatures", value: "historical-ligatures", features: {"l iga": 1, "clig": 1, "dlig": 0, "hlig": 1, "calt": 1} },
42 { prop: "font-variant-ligatures", value: "no-historical-ligatures", features: {"liga": 1, "clig": 1, "dlig": 0, "hlig": 0, "calt": 1} },
43 { prop: "font-variant-ligatures", value: "contextual", features: {"liga": 1, " clig": 1, "dlig": 0, "hlig": 0, "calt": 1} },
44 { prop: "font-variant-ligatures", value: "no-contextual", features: {"liga": 1 , "clig": 1, "dlig": 0, "hlig": 0, "calt": 0} },
45 { prop: "font-variant-ligatures", value: "common-ligatures no-discretionary-li gatures", features: {"liga": 1, "clig": 1, "dlig": 0, "hlig": 0, "calt": 1} },
46 { prop: "font-variant-ligatures", value: "historical-ligatures no-common-ligat ures", features: {"clig": 0, "liga": 0, "dlig": 0, "hlig": 1, "calt": 1} },
47 { prop: "font-variant-ligatures", value: "no-historical-ligatures discretionar y-ligatures", features: {"liga": 1, "clig": 1, "dlig": 1, "hlig": 0, "calt": 1} },
48 { prop: "font-variant-ligatures", value: "common-ligatures no-discretionary-li gatures historical-ligatures no-contextual", features: {"clig": 1, "dlig": 0, "h lig": 1, "liga": 1, "calt": 0} },
49
50 // invalid values
51 { prop: "font-variant-ligatures", value: "common-ligatures none", features: {" liga": 1, "clig": 1, "dlig": 0}, invalid: true },
52 { prop: "font-variant-ligatures", value: "none common-ligatures", features: {" liga": 1, "clig": 1, "dlig": 0}, invalid: true },
53 { prop: "font-variant-ligatures", value: "common-ligatures normal", features: {"liga": 1, "clig": 1, "dlig": 0}, invalid: true },
54 { prop: "font-variant-ligatures", value: "common-ligatures no-common-ligatures ", features: {"liga": 1, "clig": 1, "dlig": 0}, invalid: true },
55 { prop: "font-variant-ligatures", value: "common-ligatures common-ligatures", features: {"liga": 1, "clig": 1, "dlig": 0}, invalid: true },
56 { prop: "font-variant-ligatures", value: "no-historical-ligatures historical-l igatures", features: {"liga": 1, "clig": 1, "dlig": 0, "hlig": 0}, invalid: true },
57 { prop: "font-variant-ligatures", value: "no-contextual contextual", features: {"liga": 1, "clig": 1, "dlig": 0, "hlig": 0}, invalid: true },
58 { prop: "font-variant-ligatures", value: "no-discretionary-ligatures discretio nary-ligatures", features: {"liga": 1, "clig": 1, "dlig": 0}, invalid: true },
59 { prop: "font-variant-ligatures", value: "common-ligatures no-discretionary-li gatures no-common-ligatures", features: {"liga": 1, "clig": 1, "dlig": 0}, inval id: true },
33 ]; 60 ];
34 61
35 // note: the code below requires an array "gFeatures" from : 62 // note: the code below requires an array "gFeatures" from :
36 // layout/reftests/fonts/gsubtest/gsubtest-features.js 63 // layout/reftests/fonts/gsubtest/gsubtest-features.js
37 64
38 // The font defines feature lookups for all OpenType features for a 65 // The font defines feature lookups for all OpenType features for a
39 // specific set of PUA codepoints, as listed in the gFeatures array. 66 // specific set of PUA codepoints, as listed in the gFeatures array.
40 // Using these codepoints and feature combinations, tests can be 67 // Using these codepoints and feature combinations, tests can be
41 // constructed to detect when certain features are enabled or not. 68 // constructed to detect when certain features are enabled or not.
42 69
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 span.innerHTML = "&#x" + cpOut.toString(16) + ";"; 161 span.innerHTML = "&#x" + cpOut.toString(16) + ";";
135 span.title = f + "=" + feature; 162 span.title = f + "=" + feature;
136 cell.appendChild(span); 163 cell.appendChild(span);
137 } 164 }
138 row.appendChild(cell); 165 row.appendChild(cell);
139 table.appendChild(row); 166 table.appendChild(row);
140 } 167 }
141 168
142 return table; 169 return table;
143 } 170 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698