Bug 1434692: Add a WPT test for calc font-variation-settings. r=dholbert
authorEmilio Cobos Álvarez <emilio@crisal.io>
Thu, 08 Mar 2018 23:54:24 +0100
changeset 462375 d1a36af94ccd8800d7538a9f9510c39dbcc090f5
parent 462374 1f522b139917c38f2b4eb88c8ea00247219579d4
child 462376 457704c7f810c7506af50ab82bfd76bbabf4c95a
push id1683
push usersfraser@mozilla.com
push dateThu, 26 Apr 2018 16:43:40 +0000
treeherdermozilla-release@5af6cb21869d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs1434692
milestone60.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 1434692: Add a WPT test for calc font-variation-settings. r=dholbert Summary: Along with other internal tests. Tests for font-feature-settings exist, they're not synced yet. Reviewers: dholbert Reviewed By: dholbert Bug #: 1434692 Differential Revision: https://phabricator.services.mozilla.com/D544 MozReview-Commit-ID: BfGSZMh9Hss
layout/style/test/property_database.js
testing/web-platform/meta/MANIFEST.json
testing/web-platform/meta/css/css-fonts/__dir__.ini
testing/web-platform/tests/css/css-fonts/calc-in-font-variation-settings.html
--- a/layout/style/test/property_database.js
+++ b/layout/style/test/property_database.js
@@ -6368,16 +6368,24 @@ if (IsCSSPropertyPrefEnabled("layout.css
     applies_to_first_letter: true,
     applies_to_first_line: true,
     applies_to_placeholder: true,
     initial_values: [ "auto" ],
     other_values: [ "none" ],
     invalid_values: [ "on" ]
   };
   gCSSProperties["font"].subproperties.push("font-optical-sizing");
+  if (SpecialPowers.DOMWindowUtils.isStyledByServo) {
+    gCSSProperties["font-variation-settings"].other_values
+      .push("'vert' calc(2.5)");
+  }
+}
+
+if (SpecialPowers.DOMWindowUtils.isStyledByServo) {
+  gCSSProperties["font-feature-settings"].other_values.push("'vert' calc(2)");
 }
 
 if (IsCSSPropertyPrefEnabled("layout.css.frames-timing.enabled")) {
   gCSSProperties["animation-timing-function"].other_values.push(
     "frames(2)", "frames(1000)", "frames( 2 )");
   gCSSProperties["animation-timing-function"].invalid_values.push(
     "frames(1)", "frames(-2)", "frames", "frames()", "frames(,)",
     "frames(a)", "frames(2.0)", "frames(2.5)", "frames(2 3)");
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -308805,16 +308805,22 @@
     ]
    ],
    "css/css-font-loading/fontfacesetloadevent-constructor.html": [
     [
      "/css/css-font-loading/fontfacesetloadevent-constructor.html",
      {}
     ]
    ],
+   "css/css-fonts/calc-in-font-variation-settings.html": [
+    [
+     "/css/css-fonts/calc-in-font-variation-settings.html",
+     {}
+    ]
+   ],
    "css/css-fonts/font-display/font-display-failure-fallback.html": [
     [
      "/css/css-fonts/font-display/font-display-failure-fallback.html",
      {}
     ]
    ],
    "css/css-fonts/font-feature-settings-serialization-001.html": [
     [
@@ -485752,16 +485758,20 @@
   "css/css-fonts/alternates-order-ref.html": [
    "5ca219e9f3b14418a44e771d6b00d487debe15af",
    "support"
   ],
   "css/css-fonts/alternates-order.html": [
    "9232ad7768f5bea41d87469113b210b3c663750e",
    "reftest"
   ],
+  "css/css-fonts/calc-in-font-variation-settings.html": [
+   "ebd68854330dd96a6cfa31c273d9b6810442497d",
+   "testharness"
+  ],
   "css/css-fonts/first-available-font-001-ref.html": [
    "b908d93443cee9e64628e85a29d288d567f19e5a",
    "support"
   ],
   "css/css-fonts/first-available-font-001.html": [
    "b766a6b03eda1f84317330e4144efda1fe11877e",
    "reftest"
   ],
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/meta/css/css-fonts/__dir__.ini
@@ -0,0 +1,1 @@
+prefs: [layout.css.font-variations.enabled:true]
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/css-fonts/calc-in-font-variation-settings.html
@@ -0,0 +1,19 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>CSS Test: calc() function in font-variation-settings</title>
+<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
+<link rel="help" href="https://drafts.csswg.org/css-values/#funcdef-calc">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<style>
+#test {
+  font-variation-settings: "XHGT" calc(0.7);
+}
+</style>
+<div id="test"></div>
+<script>
+const div = document.querySelector("#test");
+test(function() {
+  assert_equals(getComputedStyle(div).fontVariationSettings, "\"XHGT\" 0.7");
+}, "calc() in font-variation-settings");
+</script>