blob: ac6b70f854c38114c0d4770561d7a29c45df8ef6 [file] [log] [blame]
<pre id="console"></pre>
<script>
if (window.testRunner)
testRunner.dumpAsText();
function log(message)
{
document.getElementById("console").appendChild(document.createTextNode(message + "\n"));
}
function test(value, expectedCSSText, expectedComputedCSSText)
{
var element = document.createElement("div");
element.style.setProperty("-webkit-font-variant-ligatures", value);
var cssText = element.style.webkitFontVariantLigatures;
document.body.appendChild(element);
var computedCSSText = getComputedStyle(element).webkitFontVariantLigatures;
document.body.removeChild(element);
if (cssText === expectedCSSText && computedCSSText == expectedComputedCSSText)
log("PASS: '" + value + "' parsed as '" + expectedCSSText + "' and computed to '" + computedCSSText + "'");
else {
if (cssText !== expectedCSSText)
log("FAIL: '" + value + "' parsed as '" + cssText + "' rather than '" + expectedCSSText + "'");
if (computedCSSText !== expectedComputedCSSText)
log("FAIL: '" + value + "' computed to '" + computedCSSText + "' rather than '" + expectedComputedCSSText + "'");
}
}
test('initial', 'initial', 'normal');
test('inherit', 'inherit', 'normal');
test('normal', 'normal', 'normal');
test('large', '', 'normal');
test('25px', '', 'normal');
test('normal normal', '', 'normal');
test('normal no-common-ligatures', '', 'normal');
log("");
test('no-common-ligatures', 'no-common-ligatures', 'no-common-ligatures');
test('common-ligatures', 'common-ligatures', 'common-ligatures');
test('no-discretionary-ligatures', 'no-discretionary-ligatures', 'no-discretionary-ligatures');
test('discretionary-ligatures', 'discretionary-ligatures', 'discretionary-ligatures');
test('no-historical-ligatures', 'no-historical-ligatures', 'no-historical-ligatures');
test('historical-ligatures', 'historical-ligatures', 'historical-ligatures');
log("");
test('no-common-ligatures no-common-ligatures', '', 'normal');
test('common-ligatures no-discretionary-ligatures', 'common-ligatures no-discretionary-ligatures', 'common-ligatures no-discretionary-ligatures');
test('common-ligatures no-discretionary-ligatures historical-ligatures', 'common-ligatures no-discretionary-ligatures historical-ligatures', 'common-ligatures no-discretionary-ligatures historical-ligatures');
test('common-ligatures no-discretionary-ligatures normal', '', 'normal');
</script>