WPT: Import /css/css-fonts/font-variant-*.html tests

This commit is contained in:
Johan Dahlin 2024-11-09 19:02:04 +01:00
parent ce3ce607ae
commit 2b316d16ce
16 changed files with 593 additions and 0 deletions

View file

@ -8,5 +8,6 @@ Libraries/LibJS/Tests/modules/top-level-dispose.mjs
Libraries/LibJS/Tests/using-declaration.js
Libraries/LibJS/Tests/using-for-loops.js
Tests/LibWeb/Ref/data
Tests/LibWeb/Ref/input/wpt-import
Tests/LibWeb/Text/input/wpt-import

View file

@ -0,0 +1,63 @@
body { margin: 10px; }
@font-face {
font-family: gsub-test;
src: url(gsubtest-lookup3.otf);
}
td.prop {
font-family: Menlo, monospace;
font-weight: normal;
text-align: left;
font-size: 80%;
}
td.features {
font-family: gsub-test;
}
.invalid {
color: red;
}
@font-feature-values gsub-test {
@styleset { ok-alt-a: 1 3 5; ok-alt-b: 19; }
@character-variant { ok-1: 78 2; }
@character-variant { ok-3: 23; }
@character-variant { not-good: 0 2; }
@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; }
}
@font-feature-values bogus-family {
@styleset { bogus: 3 4 7; }
}
@font-feature-values GSUB-tEsT {
@styleset { mixed-case: 3 4 7; }
}
@font-feature-values gSuB-tEsT {
@styleset { 3blah: 1 3; }
}
@font-feature-values gSuB-tEsT {
@styleset { moxie: 14; }
@styleset { 3blah: 1; }
}
@font-feature-values gSUB-TeST {
@styleset { moxie2: 14; }
@bongo { blah: 1; }
}
@font-feature-values gSUB-TEst {
@bongo { blah2: 1; }
@styleset { moxie3: 14; }
}

View file

@ -0,0 +1,218 @@
// data associated with gsubtest test font for testing font features
// prefix
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-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} },
{ prop: "font-variant-caps", value: "unicase", features: {"unic": 1, "titl": 0} },
// invalid values
{ prop: "font-variant-caps", value: "normal small-caps", features: {"smcp": 0}, invalid: true },
{ prop: "font-variant-caps", value: "small-caps potato", features: {"smcp": 0}, invalid: true },
{ prop: "font-variant-caps", value: "small-caps petite-caps", features: {"smcp": 0, "pcap": 0}, invalid: true },
{ prop: "font-variant-caps", value: "small-caps all-small-caps", features: {"smcp": 0, "c2sc": 0}, invalid: true },
{ prop: "font-variant-caps", value: "small-cap", features: {"smcp": 0}, invalid: true },
// font-variant-east-asian
// valid values
{ prop: "font-variant-east-asian", value: "jis78", features: {"jp78": 1, "jp04": 0} },
{ prop: "font-variant-east-asian", value: "jis83", features: {"jp83": 1, "jp04": 0} },
{ prop: "font-variant-east-asian", value: "jis90", features: {"jp90": 1, "jp04": 0} },
{ prop: "font-variant-east-asian", value: "jis04", features: {"jp04": 1, "jp78": 0} },
{ prop: "font-variant-east-asian", value: "simplified", features: {"smpl": 1, "jp04": 0} },
{ prop: "font-variant-east-asian", value: "traditional", features: {"trad": 1, "jp04": 0} },
{ prop: "font-variant-east-asian", value: "full-width", features: {"fwid": 1, "jp04": 0} },
{ prop: "font-variant-east-asian", value: "proportional-width", features: {"pwid": 1, "jp04": 0} },
{ prop: "font-variant-east-asian", value: "ruby", features: {"ruby": 1, "jp04": 0} },
{ prop: "font-variant-east-asian", value: "jis78 full-width", features: {"jp78": 1, "fwid": 1, "jp83": 0} },
{ prop: "font-variant-east-asian", value: "jis78 full-width ruby", features: {"jp78": 1, "fwid": 1, "jp83": 0, "ruby": 1} },
{ prop: "font-variant-east-asian", value: "simplified proportional-width", features: {"smpl": 1, "pwid": 1, "jp83": 0} },
{ prop: "font-variant-east-asian", value: "ruby simplified", features: {"ruby": 1, "smpl": 1, "trad": 0} },
// invalid values
{ prop: "font-variant-east-asian", value: "ruby normal", features: {"ruby": 0}, invalid: true },
{ prop: "font-variant-east-asian", value: "jis90 jis04", features: {"jp90": 0, "jp04": 0}, invalid: true },
{ prop: "font-variant-east-asian", value: "simplified traditional", features: {"smpl": 0, "trad": 0}, invalid: true },
{ prop: "font-variant-east-asian", value: "full-width proportional-width", features: {"fwid": 0, "pwid": 0}, invalid: true },
{ prop: "font-variant-east-asian", value: "ruby simplified ruby", features: {"ruby": 0, "smpl": 0, "jp04": 0}, invalid: true },
{ prop: "font-variant-east-asian", value: "jis78 ruby simplified", features: {"ruby": 0, "smpl": 0, "jp78": 0}, invalid: true },
// font-variant-ligatures
// valid values
{ prop: "font-variant-ligatures", value: "normal", features: {"liga": 1, "dlig": 0} },
{ prop: "font-variant-ligatures", value: "common-ligatures", features: {"liga": 1, "clig": 1, "dlig": 0, "hlig": 0, "calt": 1} },
{ prop: "font-variant-ligatures", value: "no-common-ligatures", features: {"liga": 0, "clig": 0, "dlig": 0, "hlig": 0, "calt": 1} },
{ prop: "font-variant-ligatures", value: "discretionary-ligatures", features: {"liga": 1, "clig": 1, "dlig": 1, "hlig": 0, "calt": 1} },
{ prop: "font-variant-ligatures", value: "no-discretionary-ligatures", features: {"liga": 1, "clig": 1, "dlig": 0, "hlig": 0, "calt": 1} },
{ prop: "font-variant-ligatures", value: "historical-ligatures", features: {"liga": 1, "clig": 1, "dlig": 0, "hlig": 1, "calt": 1} },
{ prop: "font-variant-ligatures", value: "no-historical-ligatures", features: {"liga": 1, "clig": 1, "dlig": 0, "hlig": 0, "calt": 1} },
{ prop: "font-variant-ligatures", value: "contextual", features: {"liga": 1, "clig": 1, "dlig": 0, "hlig": 0, "calt": 1} },
{ prop: "font-variant-ligatures", value: "no-contextual", features: {"liga": 1, "clig": 1, "dlig": 0, "hlig": 0, "calt": 0} },
{ prop: "font-variant-ligatures", value: "common-ligatures no-discretionary-ligatures", features: {"liga": 1, "clig": 1, "dlig": 0, "hlig": 0, "calt": 1} },
{ prop: "font-variant-ligatures", value: "historical-ligatures no-common-ligatures", features: {"clig": 0, "liga": 0, "dlig": 0, "hlig": 1, "calt": 1} },
{ prop: "font-variant-ligatures", value: "no-historical-ligatures discretionary-ligatures", features: {"liga": 1, "clig": 1, "dlig": 1, "hlig": 0, "calt": 1} },
{ prop: "font-variant-ligatures", value: "common-ligatures no-discretionary-ligatures historical-ligatures no-contextual", features: {"clig": 1, "dlig": 0, "hlig": 1, "liga": 1, "calt": 0} },
// invalid values
{ prop: "font-variant-ligatures", value: "common-ligatures normal", features: {"liga": 1, "clig": 1, "dlig": 0}, invalid: true },
{ prop: "font-variant-ligatures", value: "common-ligatures no-common-ligatures", features: {"liga": 1, "clig": 1, "dlig": 0}, invalid: true },
{ prop: "font-variant-ligatures", value: "common-ligatures common-ligatures", features: {"liga": 1, "clig": 1, "dlig": 0}, invalid: true },
{ prop: "font-variant-ligatures", value: "no-historical-ligatures historical-ligatures", features: {"liga": 1, "clig": 1, "dlig": 0, "hlig": 0}, invalid: true },
{ prop: "font-variant-ligatures", value: "no-contextual contextual", features: {"liga": 1, "clig": 1, "dlig": 0, "hlig": 0}, invalid: true },
{ prop: "font-variant-ligatures", value: "no-discretionary-ligatures discretionary-ligatures", features: {"liga": 1, "clig": 1, "dlig": 0}, invalid: true },
{ prop: "font-variant-ligatures", value: "common-ligatures no-discretionary-ligatures no-common-ligatures", features: {"liga": 1, "clig": 1, "dlig": 0}, invalid: true },
// font-variant-numeric
// valid values
{ prop: "font-variant-numeric", value: "normal", features: {"lnum": 0, "tnum": 0, "pnum": 0, "onum": 0} },
{ prop: "font-variant-numeric", value: "lining-nums", features: {"lnum": 1, "onum": 0, "pnum": 0} },
{ prop: "font-variant-numeric", value: "oldstyle-nums", features: {"lnum": 0, "onum": 1, "pnum": 0} },
{ prop: "font-variant-numeric", value: "proportional-nums", features: {"lnum": 0, "onum": 0, "pnum": 1, "tnum": 0} },
{ prop: "font-variant-numeric", value: "proportional-nums oldstyle-nums", features: {"lnum": 0, "onum": 1, "pnum": 1, "tnum": 0} },
{ prop: "font-variant-numeric", value: "tabular-nums", features: {"tnum": 1, "onum": 0, "pnum": 0} },
{ prop: "font-variant-numeric", value: "diagonal-fractions", features: {"frac": 1, "afrc": 0, "pnum": 0} },
{ prop: "font-variant-numeric", value: "stacked-fractions", features: {"frac": 0, "afrc": 1, "pnum": 0} },
{ prop: "font-variant-numeric", value: "slashed-zero", features: {"zero": 1, "pnum": 0} },
{ prop: "font-variant-numeric", value: "ordinal", features: {"ordn": 1, "pnum": 0} },
{ prop: "font-variant-numeric", value: "lining-nums diagonal-fractions", features: {"frac": 1, "afrc": 0, "lnum": 1} },
{ prop: "font-variant-numeric", value: "tabular-nums stacked-fractions", features: {"frac": 0, "afrc": 1, "tnum": 1} },
{ prop: "font-variant-numeric", value: "tabular-nums slashed-zero stacked-fractions", features: {"frac": 0, "afrc": 1, "tnum": 1, "zero": 1} },
{ prop: "font-variant-numeric", value: "proportional-nums slashed-zero diagonal-fractions oldstyle-nums ordinal", features: {"frac": 1, "afrc": 0, "tnum": 0, "pnum": 1, "onum": 1, "ordn": 1, "zero": 1} },
// invalid values
{ prop: "font-variant-numeric", value: "lining-nums normal", features: {"lnum": 0, "onum": 0}, invalid: true },
{ prop: "font-variant-numeric", value: "lining-nums oldstyle-nums", features: {"lnum": 0, "onum": 0}, invalid: true },
{ prop: "font-variant-numeric", value: "lining-nums normal slashed-zero ordinal", features: {"lnum": 0, "onum": 0, "zero": 0}, invalid: true },
{ 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} },
// 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 :
// support/fonts/gsubtest-features.js
// The font defines feature lookups for all OpenType features for a
// specific set of PUA codepoints, as listed in the gFeatures array.
// Using these codepoints and feature combinations, tests can be
// constructed to detect when certain features are enabled or not.
// return a created table containing tests for a given property
//
// Ex: { prop: "font-variant-ligatures", value: "common-ligatures", features: {"liga": 1, "clig": 1, "dlig": 0, "hlig": 0} }
//
// This means that for the property 'font-variant-ligatures' with the value 'common-ligatures', the features listed should
// either be explicitly enabled or disabled.
// propData is the prop/value list with corresponding feature assertions
// whichProp is either "all" or a specific subproperty (i.e. "font-variant-position")
// isRef is true when this is the reference
// debug outputs the prop/value pair along with the tests
function createFeatureTestTable(propData, whichProp, isRef, debug)
{
var table = document.createElement("table");
if (typeof(isRef) == "undefined") {
isRef = false;
}
if (typeof(debug) == "undefined") {
debug = false;
}
var doAll = (whichProp == "all");
for (var i in propData) {
var data = propData[i];
if (!doAll && data.prop != whichProp) continue;
var row = document.createElement("tr");
var invalid = false;
if ("invalid" in data) {
invalid = true;
row.className = "invalid";
}
var cell = document.createElement("td");
cell.className = "prop";
var styledecl = gPrefix + data.prop + ": " + data.value + ";";
cell.innerHTML = styledecl;
row.appendChild(cell);
if (debug) {
table.appendChild(row);
}
row = document.createElement("tr");
if (invalid) {
row.className = "invalid";
}
cell = document.createElement("td");
cell.className = "features";
if (!isRef) {
cell.style.cssText = styledecl;
}
for (var f in data.features) {
var feature = data.features[f];
var cp, unsupported = "F".charCodeAt(0);
var basecp = gFeatures[f];
if (typeof(basecp) == "undefined") {
cp = unsupported;
} else {
switch(feature) {
case 0:
cp = basecp;
break;
case 1:
cp = basecp + 1;
break;
case 2:
cp = basecp + 2;
break;
case 3:
cp = basecp + 3;
break;
default:
cp = basecp + 1;
break;
}
}
var span = document.createElement("span");
span.innerHTML = (isRef ? "P " : "&#x" + cp.toString(16) + "; ");
span.title = f + "=" + feature;
cell.appendChild(span);
}
row.appendChild(cell);
table.appendChild(row);
}
return table;
}

View file

@ -0,0 +1,85 @@
/* This file is autogenerated by makegsubfonts.py */
/*
Features defined in gsubtest fonts with associated base
codepoints for each feature:
cp = codepoint for feature featX
cp default PASS
cp featX=1 FAIL
cp featX=2 FAIL
cp+1 default FAIL
cp+1 featX=1 PASS
cp+1 featX=2 FAIL
cp+2 default FAIL
cp+2 featX=1 FAIL
cp+2 featX=2 PASS
*/
var gFeatures = {
"MWL1": 0xe000, "NUM2": 0xe004, "PRIV": 0xe008, "T3ST": 0xe00c,
"TPSP": 0xe010, "abvf": 0xe014, "abvm": 0xe018, "abvs": 0xe01c,
"afrc": 0xe020, "akhn": 0xe024, "blwf": 0xe028, "blwm": 0xe02c,
"blws": 0xe030, "c2pc": 0xe034, "c2sc": 0xe038, "calt": 0xe03c,
"case": 0xe040, "ccmp": 0xe044, "cfar": 0xe048, "cjct": 0xe04c,
"clig": 0xe050, "cpct": 0xe054, "cpsp": 0xe058, "cswh": 0xe05c,
"curs": 0xe060, "cv00": 0xe064, "cv01": 0xe068, "cv02": 0xe06c,
"cv03": 0xe070, "cv04": 0xe074, "cv05": 0xe078, "cv06": 0xe07c,
"cv07": 0xe080, "cv08": 0xe084, "cv09": 0xe088, "cv10": 0xe08c,
"cv11": 0xe090, "cv12": 0xe094, "cv13": 0xe098, "cv14": 0xe09c,
"cv15": 0xe0a0, "cv16": 0xe0a4, "cv17": 0xe0a8, "cv18": 0xe0ac,
"cv19": 0xe0b0, "cv20": 0xe0b4, "cv21": 0xe0b8, "cv22": 0xe0bc,
"cv23": 0xe0c0, "cv24": 0xe0c4, "cv25": 0xe0c8, "cv26": 0xe0cc,
"cv27": 0xe0d0, "cv28": 0xe0d4, "cv29": 0xe0d8, "cv30": 0xe0dc,
"cv31": 0xe0e0, "cv32": 0xe0e4, "cv33": 0xe0e8, "cv34": 0xe0ec,
"cv35": 0xe0f0, "cv36": 0xe0f4, "cv37": 0xe0f8, "cv38": 0xe0fc,
"cv39": 0xe100, "cv40": 0xe104, "cv41": 0xe108, "cv42": 0xe10c,
"cv43": 0xe110, "cv44": 0xe114, "cv45": 0xe118, "cv46": 0xe11c,
"cv47": 0xe120, "cv48": 0xe124, "cv49": 0xe128, "cv50": 0xe12c,
"cv51": 0xe130, "cv52": 0xe134, "cv53": 0xe138, "cv54": 0xe13c,
"cv55": 0xe140, "cv56": 0xe144, "cv57": 0xe148, "cv58": 0xe14c,
"cv59": 0xe150, "cv60": 0xe154, "cv61": 0xe158, "cv62": 0xe15c,
"cv63": 0xe160, "cv64": 0xe164, "cv65": 0xe168, "cv66": 0xe16c,
"cv67": 0xe170, "cv68": 0xe174, "cv69": 0xe178, "cv70": 0xe17c,
"cv71": 0xe180, "cv72": 0xe184, "cv73": 0xe188, "cv74": 0xe18c,
"cv75": 0xe190, "cv76": 0xe194, "cv77": 0xe198, "cv78": 0xe19c,
"cv79": 0xe1a0, "cv80": 0xe1a4, "cv81": 0xe1a8, "cv82": 0xe1ac,
"cv83": 0xe1b0, "cv84": 0xe1b4, "cv85": 0xe1b8, "cv86": 0xe1bc,
"cv87": 0xe1c0, "cv88": 0xe1c4, "cv89": 0xe1c8, "cv90": 0xe1cc,
"cv91": 0xe1d0, "cv92": 0xe1d4, "cv93": 0xe1d8, "cv94": 0xe1dc,
"cv95": 0xe1e0, "cv96": 0xe1e4, "cv97": 0xe1e8, "cv98": 0xe1ec,
"cv99": 0xe1f0, "dist": 0xe1f4, "dlig": 0xe1f8, "dnom": 0xe1fc,
"expt": 0xe200, "falt": 0xe204, "fin2": 0xe208, "fin3": 0xe20c,
"fina": 0xe210, "frac": 0xe214, "fwid": 0xe218, "half": 0xe21c,
"haln": 0xe220, "halt": 0xe224, "hist": 0xe228, "hkna": 0xe22c,
"hlig": 0xe230, "hngl": 0xe234, "hojo": 0xe238, "hwid": 0xe23c,
"init": 0xe240, "isol": 0xe244, "ital": 0xe248, "jalt": 0xe24c,
"jp04": 0xe250, "jp78": 0xe254, "jp83": 0xe258, "jp90": 0xe25c,
"kern": 0xe260, "lfbd": 0xe264, "liga": 0xe268, "ljmo": 0xe26c,
"lnum": 0xe270, "locl": 0xe274, "ltra": 0xe278, "ltrm": 0xe27c,
"mark": 0xe280, "med2": 0xe284, "medi": 0xe288, "mgrk": 0xe28c,
"mkmk": 0xe290, "mset": 0xe294, "nalt": 0xe298, "nlck": 0xe29c,
"nukt": 0xe2a0, "numr": 0xe2a4, "onum": 0xe2a8, "opbd": 0xe2ac,
"ordn": 0xe2b0, "ornm": 0xe2b4, "palt": 0xe2b8, "pcap": 0xe2bc,
"pkna": 0xe2c0, "pnum": 0xe2c4, "pref": 0xe2c8, "pres": 0xe2cc,
"pstf": 0xe2d0, "psts": 0xe2d4, "pwid": 0xe2d8, "qwid": 0xe2dc,
"rand": 0xe2e0, "rkrf": 0xe2e4, "rlig": 0xe2e8, "rphf": 0xe2ec,
"rtbd": 0xe2f0, "rtla": 0xe2f4, "rtlm": 0xe2f8, "ruby": 0xe2fc,
"salt": 0xe300, "sinf": 0xe304, "size": 0xe308, "smcp": 0xe30c,
"smpl": 0xe310, "ss00": 0xe314, "ss01": 0xe318, "ss02": 0xe31c,
"ss03": 0xe320, "ss04": 0xe324, "ss05": 0xe328, "ss06": 0xe32c,
"ss07": 0xe330, "ss08": 0xe334, "ss09": 0xe338, "ss10": 0xe33c,
"ss11": 0xe340, "ss12": 0xe344, "ss13": 0xe348, "ss14": 0xe34c,
"ss15": 0xe350, "ss16": 0xe354, "ss17": 0xe358, "ss18": 0xe35c,
"ss19": 0xe360, "ss20": 0xe364, "ss21": 0xe368, "subs": 0xe36c,
"sups": 0xe370, "swsh": 0xe374, "titl": 0xe378, "tjmo": 0xe37c,
"tnam": 0xe380, "tnum": 0xe384, "trad": 0xe388, "twid": 0xe38c,
"unic": 0xe390, "valt": 0xe394, "vatu": 0xe398, "vert": 0xe39c,
"vhal": 0xe3a0, "vjmo": 0xe3a4, "vkna": 0xe3a8, "vkrn": 0xe3ac,
"vpal": 0xe3b0, "vrt2": 0xe3b4, "zero": 0xe3b8
};

Binary file not shown.

View file

@ -0,0 +1,21 @@
<!DOCTYPE HTML>
<html lang="en">
<head>
<title>CSS Test: feature value matching for font-variant-caps</title>
<link rel="author" title="John Daggett" href="mailto:jdaggett@mozilla.com"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="../../../../data/gsubtest-features.js"></script>
<script type="text/javascript" src="../../../../data/font-variant-features.js"></script>
<link rel="stylesheet" href="../../../../data/font-variant-features.css" type="text/css"/>
</head>
<body>
<div id="content"></div>
<script type="text/javascript">
document.fonts.ready.then(() => {
internals.finishLoading();
})
internals.disableAutomaticPageFinish();
document.getElementById("content").appendChild(createFeatureTestTable(gPropertyData, "font-variant-caps", true, false));
</script>
</body>
</html>

View file

@ -0,0 +1,21 @@
<!DOCTYPE HTML>
<html lang="en">
<head>
<title>CSS Test: feature value matching for font-variant-east-asian</title>
<link rel="author" title="John Daggett" href="mailto:jdaggett@mozilla.com"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="../../../../data/gsubtest-features.js"></script>
<script type="text/javascript" src="../../../../data/font-variant-features.js"></script>
<link rel="stylesheet" href="../../../../data/font-variant-features.css" type="text/css"/>
</head>
<body>
<div id="content"></div>
<script type="text/javascript">
document.fonts.ready.then(() => {
internals.finishLoading();
})
internals.disableAutomaticPageFinish();
document.getElementById("content").appendChild(createFeatureTestTable(gPropertyData, "font-variant-east-asian", true, false));
</script>
</body>
</html>

View file

@ -0,0 +1,21 @@
<!DOCTYPE HTML>
<html lang="en">
<head>
<title>CSS Test: feature value matching for font-variant-ligatures</title>
<link rel="author" title="John Daggett" href="mailto:jdaggett@mozilla.com"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="../../../../data/gsubtest-features.js"></script>
<script type="text/javascript" src="../../../../data/font-variant-features.js"></script>
<link rel="stylesheet" href="../../../../data/font-variant-features.css" type="text/css"/>
</head>
<body>
<div id="content"></div>
<script type="text/javascript">
document.fonts.ready.then(() => {
internals.finishLoading();
})
internals.disableAutomaticPageFinish();
document.getElementById("content").appendChild(createFeatureTestTable(gPropertyData, "font-variant-ligatures", true, false));
</script>
</body>
</html>

View file

@ -0,0 +1,21 @@
<!DOCTYPE HTML>
<html lang="en">
<head>
<title>CSS Test: feature value matching for font-variant-numeric</title>
<link rel="author" title="John Daggett" href="mailto:jdaggett@mozilla.com"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="../../../../data/gsubtest-features.js"></script>
<script type="text/javascript" src="../../../../data/font-variant-features.js"></script>
<link rel="stylesheet" href="../../../../data/font-variant-features.css" type="text/css"/>
</head>
<body>
<div id="content"></div>
<script type="text/javascript">
document.fonts.ready.then(() => {
internals.finishLoading();
})
internals.disableAutomaticPageFinish();
document.getElementById("content").appendChild(createFeatureTestTable(gPropertyData, "font-variant-numeric", true, false));
</script>
</body>
</html>

View file

@ -0,0 +1,21 @@
<!DOCTYPE HTML>
<html lang="en">
<head>
<title>CSS Test: feature value matching for font-variant-position</title>
<link rel="author" title="John Daggett" href="mailto:jdaggett@mozilla.com"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="../../../../data/gsubtest-features.js"></script>
<script type="text/javascript" src="../../../../data/font-variant-features.js"></script>
<link rel="stylesheet" href="../../../../data/font-variant-features.css" type="text/css"/>
</head>
<body>
<div id="content"></div>
<script type="text/javascript">
document.fonts.ready.then(() => {
internals.finishLoading();
})
internals.disableAutomaticPageFinish();
document.getElementById("content").appendChild(createFeatureTestTable(gPropertyData, "font-variant-position", true, false));
</script>
</body>
</html>

View file

@ -0,0 +1,24 @@
<!DOCTYPE HTML>
<html lang="en">
<head>
<title>CSS Test: feature value matching for font-variant-caps</title>
<link rel="author" title="John Daggett" href="mailto:jdaggett@mozilla.com"/>
<link rel="help" href="http://www.w3.org/TR/css-fonts-3/#font-variant-caps-prop"/>
<link rel="match" href="../../../../expected/wpt-import/css/css-fonts/font-variant-caps-ref.html"/>
<meta name="assert" content="Values of font-variant-caps should enable specific features without enabling others"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="../../../../data/gsubtest-features.js"></script>
<script type="text/javascript" src="../../../../data/font-variant-features.js"></script>
<link rel="stylesheet" href="../../../../data/font-variant-features.css" type="text/css"/>
</head>
<body>
<div id="content"></div>
<script type="text/javascript">
document.fonts.ready.then(() => {
internals.finishLoading();
})
internals.disableAutomaticPageFinish();
document.getElementById("content").appendChild(createFeatureTestTable(gPropertyData, "font-variant-caps", false, false));
</script>
</body>
</html>

View file

@ -0,0 +1,24 @@
<!DOCTYPE HTML>
<html lang="en">
<head>
<title>CSS Test: feature value matching for font-variant-east-asian</title>
<link rel="author" title="John Daggett" href="mailto:jdaggett@mozilla.com"/>
<link rel="help" href="http://www.w3.org/TR/css-fonts-3/#font-variant-east-asian-prop"/>
<link rel="match" href="../../../../expected/wpt-import/css/css-fonts/font-variant-east-asian-ref.html"/>
<meta name="assert" content="Values of font-variant-east-asian should enable specific features without enabling others"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="../../../../data/gsubtest-features.js"></script>
<script type="text/javascript" src="../../../../data/font-variant-features.js"></script>
<link rel="stylesheet" href="../../../../data/font-variant-features.css" type="text/css"/>
</head>
<body>
<div id="content"></div>
<script type="text/javascript">
document.fonts.ready.then(() => {
internals.finishLoading();
})
internals.disableAutomaticPageFinish();
document.getElementById("content").appendChild(createFeatureTestTable(gPropertyData, "font-variant-east-asian", false, false));
</script>
</body>
</html>

View file

@ -0,0 +1,24 @@
<!DOCTYPE HTML>
<html lang="en">
<head>
<title>CSS Test: feature value matching for font-variant-ligatures</title>
<link rel="author" title="John Daggett" href="mailto:jdaggett@mozilla.com"/>
<link rel="help" href="http://www.w3.org/TR/css-fonts-3/#font-variant-ligatures-prop"/>
<link rel="match" href="../../../../expected/wpt-import/css/css-fonts/font-variant-ligatures-ref.html"/>
<meta name="assert" content="Values of font-variant-ligatures should enable specific features without enabling others"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="../../../../data/gsubtest-features.js"></script>
<script type="text/javascript" src="../../../../data/font-variant-features.js"></script>
<link rel="stylesheet" href="../../../../data/font-variant-features.css" type="text/css"/>
</head>
<body>
<div id="content"></div>
<script type="text/javascript">
document.fonts.ready.then(() => {
internals.finishLoading();
})
internals.disableAutomaticPageFinish();
document.getElementById("content").appendChild(createFeatureTestTable(gPropertyData, "font-variant-ligatures", false, false));
</script>
</body>
</html>

View file

@ -0,0 +1,24 @@
<!DOCTYPE HTML>
<html lang="en">
<head>
<title>CSS Test: feature value matching for font-variant-numeric</title>
<link rel="author" title="John Daggett" href="mailto:jdaggett@mozilla.com"/>
<link rel="help" href="http://www.w3.org/TR/css-fonts-3/#font-variant-numeric-prop"/>
<link rel="match" href="../../../../expected/wpt-import/css/css-fonts/font-variant-numeric-ref.html"/>
<meta name="assert" content="Values of font-variant-numeric should enable specific features without enabling others"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="../../../../data/gsubtest-features.js"></script>
<script type="text/javascript" src="../../../../data/font-variant-features.js"></script>
<link rel="stylesheet" href="../../../../data/font-variant-features.css" type="text/css"/>
</head>
<body>
<div id="content"></div>
<script type="text/javascript">
document.fonts.ready.then(() => {
internals.finishLoading();
})
internals.disableAutomaticPageFinish();
document.getElementById("content").appendChild(createFeatureTestTable(gPropertyData, "font-variant-numeric", false, false));
</script>
</body>
</html>

View file

@ -0,0 +1,24 @@
<!DOCTYPE HTML>
<html lang="en">
<head>
<title>CSS Test: feature value matching for font-variant-position</title>
<link rel="author" title="John Daggett" href="mailto:jdaggett@mozilla.com"/>
<link rel="help" href="http://www.w3.org/TR/css-fonts-3/#font-variant-position-prop"/>
<link rel="match" href="../../../../expected/wpt-import/css/css-fonts/font-variant-position-ref.html"/>
<meta name="assert" content="Values of font-variant-position should enable specific features without enabling others"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="../../../../data/gsubtest-features.js"></script>
<script type="text/javascript" src="../../../../data/font-variant-features.js"></script>
<link rel="stylesheet" href="../../../../data/font-variant-features.css" type="text/css"/>
</head>
<body>
<div id="content"></div>
<script type="text/javascript">
document.fonts.ready.then(() => {
internals.finishLoading();
})
internals.disableAutomaticPageFinish();
document.getElementById("content").appendChild(createFeatureTestTable(gPropertyData, "font-variant-position", false, false));
</script>
</body>
</html>

View file

@ -23,6 +23,7 @@
#include <LibGfx/ImageFormats/PNGWriter.h>
#include <LibURL/URL.h>
#include <LibWeb/HTML/SelectedFile.h>
#include <LibWeb/HTML/Window.h>
#include <UI/Headless/Application.h>
#include <UI/Headless/HeadlessWebView.h>
#include <UI/Headless/Test.h>