Bug 1051668 - add testdata for font-variant-alternates. r=mkato
authorJohn Daggett <jdaggett@mozilla.com>
Mon, 11 Aug 2014 17:05:01 +0900
changeset 198839 8faf629efcadc158b3609eb00805b8137bc99755
parent 198838 fa47185dbc7cfffee0dee8375af7a33de6c9c5ae
child 198840 99e040a2e972ee87b5808a22ce16e6505eb4c6dc
push id47501
push userjdaggett@mozilla.com
push dateMon, 11 Aug 2014 08:05:49 +0000
treeherdermozilla-inbound@8faf629efcad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmkato
bugs1051668
milestone34.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1051668 - add testdata for font-variant-alternates. r=mkato
layout/reftests/font-features/font-variant-features.css
layout/reftests/font-features/font-variant-features.js
--- a/layout/reftests/font-features/font-variant-features.css
+++ b/layout/reftests/font-features/font-variant-features.css
@@ -28,16 +28,19 @@ td.features {
   @annotation { ok-4: 1; }
   @annotation { bogus-font-doesnt-support: 23; }
   @annotation { circled: 1; }
   @character-variant { multi-def: 4; }
   @annotation { multi-def: 3; }
   @styleset { multi-def2: 3 4 5; }
   @styleset { MULTI-def2: 2 6; }
   @styleset { out-of-bounds1: 0; out-of-bounds2: 100; }
+  @styleset { scope-test1: 23; scope-test2: 24 1 }
+  @character-variant { scope-test1: 24; scope-test2: 23 2 }
+  @character-variant { overlap1: 23 1; overlap2: 23 2 }
 }
 
 @font-feature-values bogus-family {
   @styleset { bogus: 3 4 7; }
 }
 
 @font-feature-values GSUB-tEsT {
   @styleset { mixed-case: 3 4 7; }
--- a/layout/reftests/font-features/font-variant-features.js
+++ b/layout/reftests/font-features/font-variant-features.js
@@ -5,16 +5,41 @@
 gPrefix = "";
 
 // equivalent properties
 // setting prop: value should match the specific feature settings listed
 //
 // each of these tests evaluate whether a given feature is enabled as required
 // and also whether features that shouldn't be enabled are or not.
 var gPropertyData = [
+  // font-variant-alternates
+  // valid values
+  { prop: "font-variant-alternates", value: "normal", features: {"salt": 0, "swsh": 0} },
+  { prop: "font-variant-alternates", value: "historical-forms", features: {"hist": 1, "hlig": 0} },
+  { prop: "font-variant-alternates", value: "styleset(ok-alt-a, ok-alt-b)", features: {"ss01": 1, "ss02": 0, "ss03": 1, "ss04": 0, "ss05": 1, "ss19": 1, "ss20": 0} },
+  { prop: "font-variant-alternates", value: "character-variant(ok-1)", features: {"cv78": 2, "cv79": 0, "cv77": 0} },
+  { prop: "font-variant-alternates", value: "character-variant(ok-1, ok-3)", features: {"cv78": 2, "cv79": 0, "cv77": 0, "cv23": 1, "cv22": 0, "cv24": 0} },
+  { prop: "font-variant-alternates", value: "annotation(circled)", features: {"nalt": 1} },
+  { prop: "font-variant-alternates", value: "styleset(out-of-bounds1, out-of-bounds2)", features: {"ss00": 0, "ss01": 0, "ss99": 0} }, // out-of-bounds values but not invalid syntax
+  { prop: "font-variant-alternates", value: "styleset(circled)", features: {"nalt": 0, "ss00": 0, "ss01": 0} }, // circled defined for annotation not styleset
+  { prop: "font-variant-alternates", value: "styleset(scope-test1)", features: {"ss23": 1, "ss24": 0} },
+  { prop: "font-variant-alternates", value: "character-variant(scope-test1)", features: {"cv23": 0, "cv24": 1} },
+  { prop: "font-variant-alternates", value: "styleset(scope-test2)", features: {"ss23": 0, "ss24": 1, "ss01": 1} },
+  { prop: "font-variant-alternates", value: "character-variant(scope-test2)", features: {"cv23": 2, "cv24": 0, "cv01": 0} },
+  { prop: "font-variant-alternates", value: "character-variant(overlap1, overlap2)", features: {"cv23": 2} },
+  { prop: "font-variant-alternates", value: "character-variant(overlap2, overlap1)", features: {"cv23": 1} },
+
+  // invalid values
+  { prop: "font-variant-alternates", value: "historical-forms normal", features: {"hist": 0}, invalid: true },
+  { prop: "font-variant-alternates", value: "historical-forms historical-forms", features: {"hist": 0}, invalid: true },
+  { prop: "font-variant-alternates", value: "swash", features: {"swsh": 0}, invalid: true },
+  { prop: "font-variant-alternates", value: "swash(3)", features: {"swsh": 0}, invalid: true },
+  { prop: "font-variant-alternates", value: "annotation(a, b)", features: {"nalt": 0}, invalid: true },
+  { prop: "font-variant-alternates", value: "ornaments(a,b)", features: {"ornm": 0, "nalt": 0}, invalid: true },
+
   // font-variant-caps
   // valid values
   { prop: "font-variant-caps", value: "normal", features: {"smcp": 0} },
   { prop: "font-variant-caps", value: "small-caps", features: {"smcp": 1, "c2sc": 0} },
   { prop: "font-variant-caps", value: "all-small-caps", features: {"smcp": 1, "c2sc": 1, "pcap": 0} },
   { prop: "font-variant-caps", value: "petite-caps", features: {"pcap": 1, "smcp": 0} },
   { prop: "font-variant-caps", value: "all-petite-caps", features: {"c2pc": 1, "pcap": 1, "smcp": 0} },
   { prop: "font-variant-caps", value: "titling-caps", features: {"titl": 1, "smcp": 0} },