Bug 1024804 p3 - reftests for subscript/superscript fallback. r=jfkthame
authorJohn Daggett <jdaggett@mozilla.com>
Tue, 22 Jul 2014 09:02:50 +0900
changeset 195421 17d016b2af19c8dbd098f642f56931f542882fd3
parent 195420 4cb44d54d48cdbb3096cc7ec28605ce6a2084261
child 195422 7bafd7701140fc72342d97d80f4d3e54cc36a003
push id27182
push useremorley@mozilla.com
push dateTue, 22 Jul 2014 16:21:27 +0000
treeherdermozilla-central@fe7c119a55e2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjfkthame
bugs1024804
milestone33.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 1024804 p3 - reftests for subscript/superscript fallback. r=jfkthame
layout/reftests/font-features/font-variant-features.js
layout/reftests/font-features/reftest.list
layout/reftests/font-features/subsuper-fallback-notref1.html
layout/reftests/font-features/subsuper-fallback-notref2.html
layout/reftests/font-features/subsuper-fallback-notref3.html
layout/reftests/font-features/subsuper-fallback-omega-notref.html
layout/reftests/font-features/subsuper-fallback-omega.html
layout/reftests/font-features/subsuper-fallback-ref.html
layout/reftests/font-features/subsuper-fallback.html
layout/reftests/font-features/subsuper-nofallback-notref.html
layout/reftests/font-features/subsuper-nofallback-ref1.html
layout/reftests/font-features/subsuper-nofallback-ref2.html
layout/reftests/font-features/subsuper-nofallback.html
--- a/layout/reftests/font-features/font-variant-features.js
+++ b/layout/reftests/font-features/font-variant-features.js
@@ -103,18 +103,20 @@ var gPropertyData = [
   { prop: "font-variant-numeric", value: "proportional-nums tabular-nums", features: {"pnum": 0, "tnum": 0}, invalid: true },
   { prop: "font-variant-numeric", value: "diagonal-fractions stacked-fractions", features: {"frac": 0, "afrc": 0}, invalid: true },
   { prop: "font-variant-numeric", value: "slashed-zero diagonal-fractions slashed-zero", features: {"frac": 0, "afrc": 0, "zero": 0}, invalid: true },
   { prop: "font-variant-numeric", value: "lining-nums slashed-zero diagonal-fractions oldstyle-nums", features: {"frac": 0, "afrc": 0, "zero": 0, "onum": 0}, invalid: true },
 
   // font-variant-position
   // valid values
   { prop: "font-variant-position", value: "normal", features: {"subs": 0, "sups": 0} },
-  { prop: "font-variant-position", value: "super", features: {"subs": 0, "sups": 1} },
-  { prop: "font-variant-position", value: "sub", features: {"subs": 1, "sups": 0} },
+
+  // note: because of fallback, can *only* test activated features here
+  { prop: "font-variant-position", value: "super", features: {"sups": 1} },
+  { prop: "font-variant-position", value: "sub", features: {"subs": 1} },
 
   // invalid values
   { prop: "font-variant-position", value: "super sub", features: {"subs": 0, "sups": 0}, invalid: true },
 ];
 
 // note: the code below requires an array "gFeatures" from :
 //   layout/reftests/fonts/gsubtest/gsubtest-features.js
 
@@ -204,17 +206,17 @@ function createFeatureTestTable(propData
           break;
         default:
           cp = basecp + 1;
           break;
         }
       }
 
       var span = document.createElement("span");
-      span.innerHTML = (isRef ? "P " : "&#x" + cp.toString(16) + "; ");
+      span.innerHTML = (isRef ? "P" : "&#x" + cp.toString(16) + ";");
       span.title = f + "=" + feature;
       cell.appendChild(span);
     }
     row.appendChild(cell);
     table.appendChild(row);
   }
 
   return table;
--- a/layout/reftests/font-features/reftest.list
+++ b/layout/reftests/font-features/reftest.list
@@ -109,8 +109,17 @@ pref(layout.css.font-features.enabled,tr
 pref(layout.css.font-features.enabled,true) HTTP(..) != caps-fallback-allpetitecaps.html caps-fallback-default.html
 # -- normal or fallback rendering
 pref(layout.css.font-features.enabled,true) HTTP(..) == caps-fallback-smallcaps1.html caps-fallback-smcp.html
 pref(layout.css.font-features.enabled,true) HTTP(..) == caps-fallback-smallcaps2.html caps-fallback-smcp.html
 pref(layout.css.font-features.enabled,true) HTTP(..) == caps-fallback-petitecaps.html caps-fallback-smcp.html
 pref(layout.css.font-features.enabled,true) HTTP(..) == caps-fallback-allsmallcaps.html caps-fallback-smcpc2sc.html
 pref(layout.css.font-features.enabled,true) HTTP(..) == caps-fallback-allpetitecaps.html caps-fallback-smcpc2sc.html
 
+# font-variant-position fallback
+pref(layout.css.font-features.enabled,true) HTTP(..) == subsuper-fallback.html subsuper-fallback-ref.html
+pref(layout.css.font-features.enabled,true) HTTP(..) != subsuper-fallback.html subsuper-fallback-notref1.html
+pref(layout.css.font-features.enabled,true) HTTP(..) != subsuper-fallback.html subsuper-fallback-notref2.html
+pref(layout.css.font-features.enabled,true) HTTP(..) != subsuper-fallback.html subsuper-fallback-notref3.html
+pref(layout.css.font-features.enabled,true) HTTP(..) != subsuper-fallback-omega.html subsuper-fallback-omega-notref.html
+pref(layout.css.font-features.enabled,true) HTTP(..) == subsuper-nofallback.html subsuper-nofallback-ref1.html
+pref(layout.css.font-features.enabled,true) HTTP(..) == subsuper-nofallback.html subsuper-nofallback-ref2.html
+pref(layout.css.font-features.enabled,true) HTTP(..) != subsuper-nofallback.html subsuper-nofallback-notref.html
new file mode 100644
--- /dev/null
+++ b/layout/reftests/font-features/subsuper-fallback-notref1.html
@@ -0,0 +1,32 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>font-variant-position fallback</title>
+<meta charset="UTF-8">
+<style>
+
+/* sups: 0-9 + - ( ) =  subs: 0-9 + - ( ) */
+@font-face {
+  font-family: subsuper;
+  src: url(../fonts/subsuper.woff); /* FiraSans with blank omega */
+}
+
+body {
+  margin: 20px;
+  font-family: subsuper, sans-serif;
+}
+
+p {
+  margin: 0;
+  font-size: 50px;
+}
+h4 { font-weight: normal }
+</style>
+</head>
+<body>
+<h4>All the subscripts and superscripts should display with synthesized glyphs:</h4>
+<p><span class=sub>3n</span>C<span class=super>2n</span> <span class=sub>n3</span>C<span class=super>n2</span></p>
+<p><span class=sub>3&pi;</span>C<span class=super>2&pi;</span> <span class=sub>&pi;3</span>C<span class=super>&pi;2</span></p>
+<p><span class=sub>3&#x1F4A9;</span>C<span class=super>2&#x1F4A9;</span> <span class=sub>&#x1F4A9;3</span>C<span class=super>&#x1F4A9;2</span></p>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/font-features/subsuper-fallback-notref2.html
@@ -0,0 +1,32 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>font-variant-position fallback</title>
+<meta charset="UTF-8">
+<style>
+
+/* sups: 0-9 + - ( ) =  subs: 0-9 + - ( ) */
+@font-face {
+  font-family: subsuper;
+  src: url(../fonts/subsuper.woff); /* FiraSans with blank omega */
+}
+
+body {
+  margin: 20px;
+  font-family: subsuper, sans-serif;
+}
+
+p {
+  margin: 0;
+  font-size: 50px;
+}
+h4 { font-weight: normal }
+</style>
+</head>
+<body>
+<h4>All the subscripts and superscripts should display with synthesized glyphs:</h4>
+<p><span class=sub>&#x2083;n</span>C<span class=super>&#x0b2;n</span> <span class=sub>n&#x2083;</span>C<span class=super>n&#x0b2;</span></p>
+<p><span class=sub>&#x2083;&pi;</span>C<span class=super>&#x0b2;&pi;</span> <span class=sub>&pi;&#x2083;</span>C<span class=super>&pi;&#x0b2;</span></p>
+<p><span class=sub>&#x2083;&#x1F4A9;</span>C<span class=super>&#x0b2;&#x1F4A9;</span> <span class=sub>&#x1F4A9;&#x2083;</span>C<span class=super>&#x1F4A9;&#x0b2;</span></p>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/font-features/subsuper-fallback-notref3.html
@@ -0,0 +1,41 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>font-variant-position fallback</title>
+<meta charset="UTF-8">
+<style>
+
+/* sups: 0-9 + - ( ) =  subs: 0-9 + - ( ) */
+@font-face {
+  font-family: subsuper;
+  src: url(../fonts/subsuper.woff); /* FiraSans with blank omega */
+}
+
+@font-face {
+  font-family: subsuper-nofeat;
+  src: url(../fonts/subsuper.woff); /* FiraSans with blank omega */
+}
+
+body {
+  margin: 20px;
+  font-family: subsuper, sans-serif;
+}
+
+p {
+  margin: 0;
+  font-size: 50px;
+}
+h4 { font-weight: normal }
+
+.nofeat { font-family: subsuper-nofeat }
+.nofeat span.sub { font-variant-position: sub }
+.nofeat span.super { font-variant-position: super }
+</style>
+</head>
+<body>
+<h4>All the subscripts and superscripts should display with synthesized glyphs:</h4>
+<p><span class=sub>&#x2083;n</span>C<span class=super>&#x0b2;n</span> <span class=sub>n&#x2083;</span>C<span class=super>n&#x0b2;</span></p>
+<p><span class=sub>&#x2083;&pi;</span>C<span class=super>&#x0b2;&pi;</span> <span class=sub>&pi;&#x2083;</span>C<span class=super>&pi;&#x0b2;</span></p>
+<p class=nofeat><span class=sub>3&#x1F4A9;</span>C<span class=super>2&#x1F4A9;</span> <span class=sub>&#x1F4A9;3</span>C<span class=super>&#x1F4A9;2</span></p>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/font-features/subsuper-fallback-omega-notref.html
@@ -0,0 +1,30 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>font-variant-position fallback</title>
+<meta charset="UTF-8">
+<style>
+
+/* sups: 0-9 + - ( ) =  subs: 0-9 + - ( ) */
+@font-face {
+  font-family: subsuper;
+  src: url(../fonts/subsuper-nofeat.woff); /* FiraSans with blank omega */
+}
+
+body {
+  margin: 20px;
+  font-family: subsuper, sans-serif;
+}
+
+p {
+  margin: 0;
+  font-size: 200px;
+}
+h4 { font-weight: normal }
+</style>
+</head>
+<body>
+<p>e&#x0b2;</p>
+<p>e&#x2082;</p>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/font-features/subsuper-fallback-omega.html
@@ -0,0 +1,32 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>font-variant-position fallback</title>
+<meta charset="UTF-8">
+<style>
+
+/* sups: 0-9 + - ( ) =  subs: 0-9 + - ( ) */
+@font-face {
+  font-family: subsuper;
+  src: url(../fonts/subsuper.woff); /* FiraSans with blank omega */
+}
+
+body {
+  margin: 20px;
+  font-family: subsuper, sans-serif;
+}
+
+p {
+  margin: 0;
+  font-size: 200px;
+}
+h4 { font-weight: normal }
+span.sub { font-variant-position: sub }
+span.super { font-variant-position: super }
+</style>
+</head>
+<body>
+<p>e<span class=super>2&omega;</span></p>
+<p>e<span class=sub>2&omega;</span></p>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/font-features/subsuper-fallback-ref.html
@@ -0,0 +1,34 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>font-variant-position fallback</title>
+<meta charset="UTF-8">
+<style>
+
+/* sups: 0-9 + - ( ) =  subs: 0-9 + - ( ) */
+@font-face {
+  font-family: subsuper;
+  src: url(../fonts/subsuper-nofeat.woff); /* FiraSans with blank omega */
+}
+
+body {
+  margin: 20px;
+  font-family: subsuper, sans-serif;
+}
+
+p {
+  margin: 0;
+  font-size: 50px;
+}
+h4 { font-weight: normal }
+span.sub { font-variant-position: sub }
+span.super { font-variant-position: super }
+</style>
+</head>
+<body>
+<h4>All the subscripts and superscripts should display with synthesized glyphs:</h4>
+<p><span class=sub>3n</span>C<span class=super>2n</span> <span class=sub>n3</span>C<span class=super>n2</span></p>
+<p><span class=sub>3&pi;</span>C<span class=super>2&pi;</span> <span class=sub>&pi;3</span>C<span class=super>&pi;2</span></p>
+<p><span class=sub>3&#x1F4A9;</span>C<span class=super>2&#x1F4A9;</span> <span class=sub>&#x1F4A9;3</span>C<span class=super>&#x1F4A9;2</span></p>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/font-features/subsuper-fallback.html
@@ -0,0 +1,34 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>font-variant-position fallback</title>
+<meta charset="UTF-8">
+<style>
+
+/* sups: 0-9 + - ( ) =  subs: 0-9 + - ( ) */
+@font-face {
+  font-family: subsuper;
+  src: url(../fonts/subsuper.woff); /* FiraSans with blank omega */
+}
+
+body {
+  margin: 20px;
+  font-family: subsuper, sans-serif;
+}
+
+p {
+  margin: 0;
+  font-size: 50px;
+}
+h4 { font-weight: normal }
+span.sub { font-variant-position: sub }
+span.super { font-variant-position: super }
+</style>
+</head>
+<body>
+<h4>All the subscripts and superscripts should display with synthesized glyphs:</h4>
+<p><span class=sub>3n</span>C<span class=super>2n</span> <span class=sub>n3</span>C<span class=super>n2</span></p>
+<p><span class=sub>3&pi;</span>C<span class=super>2&pi;</span> <span class=sub>&pi;3</span>C<span class=super>&pi;2</span></p>
+<p><span class=sub>3&#x1F4A9;</span>C<span class=super>2&#x1F4A9;</span> <span class=sub>&#x1F4A9;3</span>C<span class=super>&#x1F4A9;2</span></p>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/font-features/subsuper-nofallback-notref.html
@@ -0,0 +1,34 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>font-variant-position fallback</title>
+<meta charset="UTF-8">
+<style>
+
+/* sups: 0-9 + - ( ) =  subs: 0-9 + - ( ) */
+@font-face {
+  font-family: subsuper;
+  src: url(../fonts/subsuper.woff); /* FiraSans with blank omega */
+}
+
+body {
+  margin: 20px;
+  font-family: subsuper, sans-serif;
+}
+
+p {
+  margin: 0;
+  font-size: 75px;
+}
+h4 { font-weight: normal }
+</style>
+</head>
+<body>
+<h4>All the subscripts and superscripts should display with variant glyphs:</h4>
+<p>
+<span class=sub>3</span>C<span class=super>2</span>
+<span class=sub>(3)</span>C<span class=super>(2)</span>
+<span class=sub>21+3</span>C<span class=super>45</span>
+</p>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/font-features/subsuper-nofallback-ref1.html
@@ -0,0 +1,45 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>font-variant-position fallback</title>
+<meta charset="UTF-8">
+<style>
+
+/* sups: 0-9 + - ( ) =  subs: 0-9 + - ( ) */
+@font-face {
+  font-family: subsuper;
+  src: url(../fonts/subsuper.woff); /* FiraSans with blank omega */
+}
+
+body {
+  margin: 20px;
+  font-family: subsuper, sans-serif;
+}
+
+p {
+  margin: 0;
+  font-size: 75px;
+}
+h4 { font-weight: normal }
+span.super {
+  -moz-font-feature-settings: "sups" on;
+  -webkit-font-feature-settings: "sups" on;
+  font-feature-settings: "sups" on;
+}
+span.sub {
+  -moz-font-feature-settings: "subs" on;
+  -webkit-font-feature-settings: "subs" on;
+  font-feature-settings: "subs" on;
+}
+
+</style>
+</head>
+<body>
+<h4>All the subscripts and superscripts should display with variant glyphs:</h4>
+<p>
+<span class=sub>3</span>C<span class=super>2</span>
+<span class=sub>(3)</span>C<span class=super>(2)</span>
+<span class=sub>21+3</span>C<span class=super>45</span>
+</p>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/font-features/subsuper-nofallback-ref2.html
@@ -0,0 +1,35 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>font-variant-position fallback</title>
+<meta charset="UTF-8">
+<style>
+
+/* sups: 0-9 + - ( ) =  subs: 0-9 + - ( ) */
+@font-face {
+  font-family: subsuper;
+  src: url(../fonts/subsuper-nofeat.woff); /* FiraSans with blank omega */
+}
+
+body {
+  margin: 20px;
+  font-family: subsuper, sans-serif;
+}
+
+p {
+  margin: 0;
+  font-size: 75px;
+}
+h4 { font-weight: normal }
+
+</style>
+</head>
+<body>
+<h4>All the subscripts and superscripts should display with variant glyphs:</h4>
+<p>
+<span class=sub>&#x2083;</span>C<span class=super>&#x0b2;</span>
+<span class=sub>&#x208d;&#x2083;&#x208e;</span>C<span class=super>&#x207d;&#x0b2;&#x207e;</span>
+<span class=sub>&#x2082;&#x2081;&#x208a;&#x2083;</span>C<span class=super>&#x2074;&#x2075;</span>
+</p>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/font-features/subsuper-nofallback.html
@@ -0,0 +1,36 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>font-variant-position fallback</title>
+<meta charset="UTF-8">
+<style>
+
+/* sups: 0-9 + - ( ) =  subs: 0-9 + - ( ) */
+@font-face {
+  font-family: subsuper;
+  src: url(../fonts/subsuper.woff); /* FiraSans with blank omega */
+}
+
+body {
+  margin: 20px;
+  font-family: subsuper, sans-serif;
+}
+
+p {
+  margin: 0;
+  font-size: 75px;
+}
+h4 { font-weight: normal }
+span.sub { font-variant-position: sub }
+span.super { font-variant-position: super }
+</style>
+</head>
+<body>
+<h4>All the subscripts and superscripts should display with variant glyphs:</h4>
+<p>
+<span class=sub>3</span>C<span class=super>2</span>
+<span class=sub>(3)</span>C<span class=super>(2)</span>
+<span class=sub>21+3</span>C<span class=super>45</span>
+</p>
+</body>
+</html>