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

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

Issue 1955723004: Implement font-variant-numeric (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove whitespace and clarified TODOs 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-numeric
34 // valid values
35 { prop: "font-variant-numeric", value: "normal", features: {"lnum": 0, "tnum": 0, "pnum": 0, "onum": 0} },
36 { prop: "font-variant-numeric", value: "lining-nums", features: {"lnum": 1, "o num": 0, "pnum": 0} },
37 { prop: "font-variant-numeric", value: "oldstyle-nums", features: {"lnum": 0, "onum": 1, "pnum": 0} },
38 { prop: "font-variant-numeric", value: "proportional-nums", features: {"lnum": 0, "onum": 0, "pnum": 1, "tnum": 0} },
39 { prop: "font-variant-numeric", value: "proportional-nums oldstyle-nums", feat ures: {"lnum": 0, "onum": 1, "pnum": 1, "tnum": 0} },
40 { prop: "font-variant-numeric", value: "tabular-nums", features: {"tnum": 1, " onum": 0, "pnum": 0} },
41 { prop: "font-variant-numeric", value: "diagonal-fractions", features: {"frac" : 1, "afrc": 0, "pnum": 0} },
42 { prop: "font-variant-numeric", value: "stacked-fractions", features: {"frac": 0, "afrc": 1, "pnum": 0} },
43 { prop: "font-variant-numeric", value: "slashed-zero", features: {"zero": 1, " pnum": 0} },
44 { prop: "font-variant-numeric", value: "ordinal", features: {"ordn": 1, "pnum" : 0} },
45 { prop: "font-variant-numeric", value: "lining-nums diagonal-fractions", featu res: {"frac": 1, "afrc": 0, "lnum": 1} },
46 { prop: "font-variant-numeric", value: "tabular-nums stacked-fractions", featu res: {"frac": 0, "afrc": 1, "tnum": 1} },
47 { prop: "font-variant-numeric", value: "tabular-nums slashed-zero stacked-frac tions", features: {"frac": 0, "afrc": 1, "tnum": 1, "zero": 1} },
48 { prop: "font-variant-numeric", value: "proportional-nums slashed-zero diagona l-fractions oldstyle-nums ordinal", features: {"frac": 1, "afrc": 0, "tnum": 0, "pnum": 1, "onum": 1, "ordn": 1, "zero": 1} },
49
50 // invalid values
51 { prop: "font-variant-numeric", value: "lining-nums normal", features: {"lnum" : 0, "onum": 0}, invalid: true },
52 { prop: "font-variant-numeric", value: "lining-nums oldstyle-nums", features: {"lnum": 0, "onum": 0}, invalid: true },
53 { prop: "font-variant-numeric", value: "lining-nums normal slashed-zero ordina l", features: {"lnum": 0, "onum": 0, "zero": 0}, invalid: true },
54 { prop: "font-variant-numeric", value: "proportional-nums tabular-nums", featu res: {"pnum": 0, "tnum": 0}, invalid: true },
55 { prop: "font-variant-numeric", value: "diagonal-fractions stacked-fractions", features: {"frac": 0, "afrc": 0}, invalid: true },
56 { prop: "font-variant-numeric", value: "slashed-zero diagonal-fractions slashe d-zero", features: {"frac": 0, "afrc": 0, "zero": 0}, invalid: true },
57 { prop: "font-variant-numeric", value: "lining-nums slashed-zero diagonal-frac tions oldstyle-nums", features: {"frac": 0, "afrc": 0, "zero": 0, "onum": 0}, in valid: true },
33 ]; 58 ];
34 59
35 // note: the code below requires an array "gFeatures" from : 60 // note: the code below requires an array "gFeatures" from :
36 // layout/reftests/fonts/gsubtest/gsubtest-features.js 61 // layout/reftests/fonts/gsubtest/gsubtest-features.js
37 62
38 // The font defines feature lookups for all OpenType features for a 63 // The font defines feature lookups for all OpenType features for a
39 // specific set of PUA codepoints, as listed in the gFeatures array. 64 // specific set of PUA codepoints, as listed in the gFeatures array.
40 // Using these codepoints and feature combinations, tests can be 65 // Using these codepoints and feature combinations, tests can be
41 // constructed to detect when certain features are enabled or not. 66 // constructed to detect when certain features are enabled or not.
42 67
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 span.innerHTML = "&#x" + cpOut.toString(16) + ";"; 159 span.innerHTML = "&#x" + cpOut.toString(16) + ";";
135 span.title = f + "=" + feature; 160 span.title = f + "=" + feature;
136 cell.appendChild(span); 161 cell.appendChild(span);
137 } 162 }
138 row.appendChild(cell); 163 row.appendChild(cell);
139 table.appendChild(row); 164 table.appendChild(row);
140 } 165 }
141 166
142 return table; 167 return table;
143 } 168 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698