mirror of
https://github.com/servo/servo.git
synced 2025-08-15 02:15:33 +01:00
Update web-platform-tests to revision 8119bc10583682676a3db9806c82ed4044e88e13
This commit is contained in:
parent
56f1e7cbc5
commit
3c256580fa
189 changed files with 4341 additions and 1030 deletions
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE html>
|
||||
<link rel="help" href="https://crbug.com/981602">
|
||||
<link rel="author" href="mailto:kojii@chromium.org">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<style>
|
||||
.class6 { writing-mode: vertical-rl; }
|
||||
</style>
|
||||
<svg>
|
||||
<radialGradient id="svgvar00004">
|
||||
<pattern>
|
||||
<foreignObject>
|
||||
<pre class="class6">
|
||||
<svg>
|
||||
<polyline fill="url(#svgvar00004) red">
|
||||
</svg>
|
||||
<script>test(() => {});</script>
|
|
@ -0,0 +1,29 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Backgrounds and Borders Module Level 3: getComputedStyle().boxShadow</title>
|
||||
<link rel="help" href="https://drafts.csswg.org/css-backgrounds/#box-shadow">
|
||||
<meta name="assert" content="box-shadow computes to none or a list.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/computed-testcommon.js"></script>
|
||||
<style>
|
||||
#target {
|
||||
color: blue;
|
||||
font-size: 20px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="target"></div>
|
||||
<script>
|
||||
'use strict';
|
||||
const currentColor = 'rgb(0, 0, 255)';
|
||||
test_computed_value('box-shadow', 'none');
|
||||
test_computed_value('box-shadow', '1px 2px', currentColor + ' 1px 2px 0px 0px');
|
||||
test_computed_value('box-shadow', 'currentcolor -1em -2em 3em -4em', currentColor + ' -20px -40px 60px -80px');
|
||||
test_computed_value('box-shadow', 'rgb(0, 255, 0) 1px 2px 3px 4px inset');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/">
|
||||
<link rel="help" href="https://www.w3.org/TR/css-contain-1/#containment-style">
|
||||
<link rel="match" href="reference/contain-style-counters-003-ref.html">
|
||||
<link rel="match" href="reference/contain-style-counters-004-ref.html">
|
||||
|
||||
<meta name="flags" content="">
|
||||
|
||||
|
@ -63,8 +63,10 @@
|
|||
|
||||
<p> <span></span> <span></span> <span></span> <span></span>
|
||||
|
||||
<!-- 4 span inside the <p> -->
|
||||
<!-- 4 span inside the <p>. However, since div isn't a sibling of spans,
|
||||
it creates a new counter.
|
||||
-->
|
||||
|
||||
<p>Test passes if there is the number 20.
|
||||
<p>Test passes if there is the number 0.
|
||||
|
||||
<div></div>
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
<!DOCTYPE html>
|
||||
|
||||
<meta charset="UTF-8">
|
||||
|
||||
<title>CSS Reference Test</title>
|
||||
|
||||
<link rel="author" title="Vladimir Levin" href="mailto:vmpstr@chromium.org">
|
||||
|
||||
<style>
|
||||
div
|
||||
{
|
||||
font-size: 3em;
|
||||
}
|
||||
</style>
|
||||
|
||||
<p>Test passes if there is the number 0.
|
||||
|
||||
<div>0</div>
|
48
tests/wpt/web-platform-tests/css/css-fonts/inheritance.html
Normal file
48
tests/wpt/web-platform-tests/css/css-fonts/inheritance.html
Normal file
|
@ -0,0 +1,48 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Inheritance of CSS Fonts Level 3 properties</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-fonts-3/#property-index">
|
||||
<link rel="help" href="https://www.w3.org/TR/css-fonts-4/#font-stretch-prop">
|
||||
<meta name="assert" content="Properties inherit according to the spec.">
|
||||
<meta name="assert" content="Properties have initial values according to the spec.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/inheritance-testcommon.js"></script>
|
||||
<style>
|
||||
#box {
|
||||
font: initial;
|
||||
font-size: medium;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="box"></div>
|
||||
<div id="container">
|
||||
<div id="target"></div>
|
||||
</div>
|
||||
<script>
|
||||
'use strict';
|
||||
const box = document.getElementById('box');
|
||||
const initialFontFamily = getComputedStyle(box).fontFamily;
|
||||
const mediumFontSize = getComputedStyle(box).fontSize;
|
||||
|
||||
assert_inherited('font-family', initialFontFamily, '"Not Initial!"');
|
||||
assert_inherited('font-feature-settings', 'normal', '"smcp", "swsh" 2');
|
||||
assert_inherited('font-kerning', 'auto', 'none');
|
||||
assert_inherited('font-size', mediumFontSize /* medium */, '123px');
|
||||
assert_inherited('font-size-adjust', 'none', '1.5');
|
||||
assert_inherited('font-stretch', '100%' /* normal */, '75%');
|
||||
assert_inherited('font-style', 'normal', 'italic');
|
||||
assert_inherited('font-synthesis', 'weight style', 'none');
|
||||
assert_inherited('font-variant', 'normal', 'none');
|
||||
assert_inherited('font-variant-caps', 'normal', 'small-caps');
|
||||
assert_inherited('font-variant-east-asian', 'normal', 'ruby');
|
||||
assert_inherited('font-variant-ligatures', 'normal', 'none');
|
||||
assert_inherited('font-variant-numeric', 'normal', 'ordinal');
|
||||
assert_inherited('font-variant-position', 'normal', 'super');
|
||||
assert_inherited('font-weight', '400' /* normal */, '900');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,29 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Fonts Module Level 3: getComputedValue().fontFamily</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-fonts-3/#font-family-prop">
|
||||
<meta name="assert" content="font-family computed value is as specified.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/computed-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="target"></div>
|
||||
<script>
|
||||
test_computed_value('font-family', 'serif');
|
||||
test_computed_value('font-family', 'sans-serif');
|
||||
test_computed_value('font-family', 'cursive');
|
||||
test_computed_value('font-family', 'fantasy');
|
||||
test_computed_value('font-family', 'monospace');
|
||||
test_computed_value('font-family', 'serif, sans-serif, cursive, fantasy, monospace');
|
||||
|
||||
test_computed_value('font-family', 'Helvetica, Verdana, sans-serif');
|
||||
test_computed_value('font-family', '"New Century Schoolbook", serif');
|
||||
test_computed_value('font-family', '"21st Century", fantasy');
|
||||
|
||||
test_computed_value('font-family', '"inherit", "serif"');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,24 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Fonts Module Level 3: parsing font-family with invalid values</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-fonts-3/#font-family-prop">
|
||||
<meta name="assert" content="font-family supports only the grammar '[ <family-name> | <generic-family> ] #'.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/parsing-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
test_invalid_value('font-family', 'cursive serif');
|
||||
|
||||
test_invalid_value('font-family', 'Red/Black, sans-serif');
|
||||
test_invalid_value('font-family', '"Lucida" Grande, sans-serif');
|
||||
test_invalid_value('font-family', 'Ahem!, sans-serif');
|
||||
test_invalid_value('font-family', 'test@foo, sans-serif');
|
||||
test_invalid_value('font-family', '#POUND, sans-serif');
|
||||
test_invalid_value('font-family', 'Hawaii 5-0, sans-serif');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,28 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Fonts Module Level 3: parsing font-family with valid values</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-fonts-3/#font-family-prop">
|
||||
<meta name="assert" content="font-family supports the full grammar '[ <family-name> | <generic-family> ] #'.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/parsing-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
test_valid_value('font-family', 'Serif', 'serif');
|
||||
test_valid_value('font-family', 'Sans-Serif', 'sans-serif');
|
||||
test_valid_value('font-family', 'Cursive', 'cursive');
|
||||
test_valid_value('font-family', 'Fantasy', 'fantasy');
|
||||
test_valid_value('font-family', 'Monospace', 'monospace');
|
||||
test_valid_value('font-family', 'serif, sans-serif, cursive, fantasy, monospace');
|
||||
|
||||
test_valid_value('font-family', 'Helvetica, Verdana, sans-serif');
|
||||
test_valid_value('font-family', '"New Century Schoolbook", serif');
|
||||
test_valid_value('font-family', "'21st Century', fantasy", '"21st Century", fantasy');
|
||||
|
||||
test_valid_value('font-family', '"inherit", "serif"');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,28 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Fonts Module Level 3: getComputedValue().fontFeatureSettings</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-fonts-3/#font-feature-settings-prop">
|
||||
<meta name="assert" content="font-feature-settings computed value is as specified.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/computed-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="target"></div>
|
||||
<script>
|
||||
test_computed_value('font-feature-settings', 'normal');
|
||||
|
||||
test_computed_value('font-feature-settings', '"dlig"');
|
||||
test_computed_value('font-feature-settings', '"smcp"');
|
||||
test_computed_value('font-feature-settings', '"c2sc"');
|
||||
test_computed_value('font-feature-settings', '"liga" 0');
|
||||
test_computed_value('font-feature-settings', '"tnum", "hist"');
|
||||
|
||||
test_computed_value('font-feature-settings', '"PKRN"');
|
||||
|
||||
test_computed_value('font-feature-settings', '"dlig", "smcp", "dlig" 0');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,23 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Fonts Module Level 3: parsing font-feature-settings with invalid values</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-fonts-3/#font-feature-settings-prop">
|
||||
<meta name="assert" content="font-feature-settings supports only the grammar 'normal | <feature-tag-value> #'.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/parsing-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
test_invalid_value('font-feature-settings', 'normal "dlig"');
|
||||
test_invalid_value('font-feature-settings', '"c2sc", normal');
|
||||
|
||||
test_invalid_value('font-feature-settings', '"tnum" "hist"');
|
||||
test_invalid_value('font-feature-settings', '"silly" off');
|
||||
|
||||
test_invalid_value('font-feature-settings', 'dlig');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,28 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Fonts Module Level 3: parsing font-feature-settings with valid values</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-fonts-3/#font-feature-settings-prop">
|
||||
<meta name="assert" content="font-feature-settings supports the full grammar 'normal | <feature-tag-value> #'.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/parsing-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
test_valid_value('font-feature-settings', 'normal');
|
||||
|
||||
// <feature-tag-value> = <string> [ <integer> | on | off ]?
|
||||
test_valid_value('font-feature-settings', '"dlig" 1', '"dlig"');
|
||||
test_valid_value('font-feature-settings', '"smcp" on', '"smcp"');
|
||||
test_valid_value('font-feature-settings', "'c2sc'", '"c2sc"');
|
||||
test_valid_value('font-feature-settings', '"liga" off', '"liga" 0');
|
||||
test_valid_value('font-feature-settings', '"tnum", \'hist\'', '"tnum", "hist"');
|
||||
|
||||
test_valid_value('font-feature-settings', '"PKRN"');
|
||||
|
||||
test_valid_value('font-feature-settings', '"dlig" 1, "smcp" on, "dlig" 0', '"dlig", "smcp", "dlig" 0');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,28 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Fonts Module Level 4: parsing font with invalid values</title>
|
||||
<link rel="help" href="https://drafts.csswg.org/css-fonts-4/#font-prop">
|
||||
<meta name="assert" content="font supports only the grammar '[ [ <'font-style'> || <font-variant-css2> || <'font-weight'> || <font-stretch-css3> ]? <'font-size'> [ / <'line-height'> ]? <'font-family'> ] | caption | icon | menu | message-box | small-caption | status-bar'.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/parsing-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
test_invalid_value('font', 'menu icon');
|
||||
|
||||
test_invalid_value('font', 'italic oblique xx-small serif');
|
||||
test_invalid_value('font', 'small-caps small-caps medium/normal sans-serif');
|
||||
test_invalid_value('font', 'bold bolder xx-large/1.2 cursive');
|
||||
test_invalid_value('font', 'ultra-condensed extra-condensed larger/calc(120% + 1.2em) fantasy');
|
||||
test_invalid_value('font', 'italic small-caps lighter condensed normal smaller monospace');
|
||||
test_invalid_value('font', 'normal 100 semi-condensed oblique small-caps 10px/normal Menu');
|
||||
test_invalid_value('font', 'normal normal normal normal normal 20%/1.2 \"FB Armada\"');
|
||||
|
||||
test_invalid_value('font', 'italic small-caps lighter condensed smaller');
|
||||
test_invalid_value('font', 'normal 100 semi-condensed oblique small-caps Menu');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,20 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Fonts Module Level 3: getComputedValue().fontKerning</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-fonts-3/#font-kerning-prop">
|
||||
<meta name="assert" content="font-kerning computed value is as specified.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/computed-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="target"></div>
|
||||
<script>
|
||||
test_computed_value('font-kerning', 'auto');
|
||||
test_computed_value('font-kerning', 'normal');
|
||||
test_computed_value('font-kerning', 'none');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,18 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Fonts Module Level 3: parsing font-kerning with invalid values</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-fonts-3/#font-kerning-prop">
|
||||
<meta name="assert" content="font-kerning supports only the grammar 'auto | normal | none'.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/parsing-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
test_invalid_value('font-kerning', 'normal auto');
|
||||
test_invalid_value('font-kerning', 'none, auto');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,19 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Fonts Module Level 3: parsing font-kerning with valid values</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-fonts-3/#font-kerning-prop">
|
||||
<meta name="assert" content="font-kerning supports the full grammar 'auto | normal | none'.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/parsing-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
test_valid_value('font-kerning', 'auto');
|
||||
test_valid_value('font-kerning', 'normal');
|
||||
test_valid_value('font-kerning', 'none');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,19 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Fonts Module Level 3: getComputedValue().fontSizeAdjust</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-fonts-3/#font-size-adjust-prop">
|
||||
<meta name="assert" content="font-size-adjust computed value is as specified.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/computed-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="target"></div>
|
||||
<script>
|
||||
test_computed_value('font-size-adjust', 'none');
|
||||
test_computed_value('font-size-adjust', '0.5');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,18 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Fonts Module Level 3: parsing font-size-adjust with invalid values</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-fonts-3/#font-size-adjust-prop">
|
||||
<meta name="assert" content="font-size-adjust supports only the grammar 'none | <number>'.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/parsing-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
test_invalid_value('font-size-adjust', 'auto');
|
||||
test_invalid_value('font-size-adjust', '-10');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,18 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Fonts Module Level 3: parsing font-size-adjust with valid values</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-fonts-3/#font-size-adjust-prop">
|
||||
<meta name="assert" content="font-size-adjust supports the full grammar 'none | <number>'.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/parsing-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
test_valid_value('font-size-adjust', 'none');
|
||||
test_valid_value('font-size-adjust', '0.5');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,73 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Fonts Module Level 4: getComputedValue().fontSize</title>
|
||||
<link rel="help" href="https://drafts.csswg.org/css-fonts-4/#font-size-prop">
|
||||
<meta name="assert" content="font-size computed value is an absolute length.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/computed-testcommon.js"></script>
|
||||
<style>
|
||||
#container {
|
||||
font-size: 40px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="container">
|
||||
<div id="target"></div>
|
||||
</div>
|
||||
<font id="reference"></font>
|
||||
<script>
|
||||
function test_relative_size(first, second) {
|
||||
test(() => {
|
||||
const target = document.getElementById('target');
|
||||
target.style.fontSize = first;
|
||||
const firstResult = Number(getComputedStyle(target).fontSize.replace('px', ''));
|
||||
target.style.fontSize = second;
|
||||
const secondResult = Number(getComputedStyle(target).fontSize.replace('px', ''));
|
||||
assert_less_than_equal(firstResult, secondResult);
|
||||
}, first + ' <= ' + second);
|
||||
}
|
||||
|
||||
test_relative_size('xx-small', 'x-small');
|
||||
test_relative_size('x-small', 'small');
|
||||
test_relative_size('small', 'medium');
|
||||
test_relative_size('medium', 'large');
|
||||
test_relative_size('large', 'x-large');
|
||||
test_relative_size('x-large', 'xx-large');
|
||||
// Added in Fonts level 4: https://github.com/w3c/csswg-drafts/issues/3907
|
||||
test_relative_size('xx-large', 'xxx-large');
|
||||
|
||||
// <relative-size>
|
||||
test_relative_size('inherit', 'larger');
|
||||
test_relative_size('smaller', 'inherit');
|
||||
|
||||
// <length-percentage>
|
||||
test_computed_value('font-size', '10px');
|
||||
test_computed_value('font-size', '20%', '8px');
|
||||
test_computed_value('font-size', 'calc(30% - 40px)', '0px');
|
||||
test_computed_value('font-size', 'calc(30% + 40px)', '52px');
|
||||
test_computed_value('font-size', 'calc(10px - 0.5em)', '0px');
|
||||
test_computed_value('font-size', 'calc(10px + 0.5em)', '30px');
|
||||
|
||||
function test_font_size(attribute, keyword) {
|
||||
test(() => {
|
||||
const reference = document.getElementById('reference');
|
||||
reference.setAttribute('size', attribute);
|
||||
const target = document.getElementById('target');
|
||||
target.style.fontSize = keyword;
|
||||
assert_equals(getComputedStyle(target).fontSize, getComputedStyle(reference).fontSize);
|
||||
}, '<font size="' + attribute + '"> is font-size: ' + keyword);
|
||||
}
|
||||
|
||||
test_font_size('2', 'small');
|
||||
test_font_size('3', 'medium');
|
||||
test_font_size('4', 'large');
|
||||
test_font_size('5', 'x-large');
|
||||
test_font_size('6', 'xx-large');
|
||||
test_font_size('7', 'xxx-large');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,21 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Fonts Module Level 3: parsing font-size with invalid values</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-fonts-3/#font-size-prop">
|
||||
<meta name="assert" content="font-size supports only the grammar '<absolute-size> | <relative-size> | <length-percentage>'.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/parsing-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
test_invalid_value('font-size', 'auto');
|
||||
test_invalid_value('font-size', 'medium small');
|
||||
|
||||
test_invalid_value('font-size', '-10px');
|
||||
test_invalid_value('font-size', '-20%');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,35 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Fonts Module Level 4: parsing font-size with valid values</title>
|
||||
<link rel="help" href="https://drafts.csswg.org/css-fonts-4/#font-size-prop">
|
||||
<meta name="assert" content="font-size supports the full grammar '<absolute-size> | <relative-size> | <length-percentage>'.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/parsing-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
// <absolute-size>
|
||||
test_valid_value('font-size', 'xx-small');
|
||||
test_valid_value('font-size', 'x-small');
|
||||
test_valid_value('font-size', 'small');
|
||||
test_valid_value('font-size', 'medium');
|
||||
test_valid_value('font-size', 'large');
|
||||
test_valid_value('font-size', 'x-large');
|
||||
test_valid_value('font-size', 'xx-large');
|
||||
// Added in Fonts level 4: https://github.com/w3c/csswg-drafts/issues/3907
|
||||
test_valid_value('font-size', 'xxx-large');
|
||||
|
||||
// <relative-size>
|
||||
test_valid_value('font-size', 'larger');
|
||||
test_valid_value('font-size', 'smaller');
|
||||
|
||||
// <length-percentage>
|
||||
test_valid_value('font-size', '10px');
|
||||
test_valid_value('font-size', '20%');
|
||||
test_valid_value('font-size', 'calc(30% - 40px)');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,28 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Fonts Module Level 4: getComputedValue().fontStretch</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-fonts-4/#font-stretch-prop">
|
||||
<meta name="assert" content="font-stretch computed value is a percentage.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/computed-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="target"></div>
|
||||
<script>
|
||||
test_computed_value('font-stretch', 'ultra-condensed', '50%');
|
||||
test_computed_value('font-stretch', 'extra-condensed', '62.5%');
|
||||
test_computed_value('font-stretch', 'condensed', '75%');
|
||||
test_computed_value('font-stretch', 'semi-condensed', '87.5%');
|
||||
test_computed_value('font-stretch', 'normal', '100%');
|
||||
test_computed_value('font-stretch', 'semi-expanded', '112.5%');
|
||||
test_computed_value('font-stretch', 'expanded', '125%');
|
||||
test_computed_value('font-stretch', 'extra-expanded', '150%');
|
||||
test_computed_value('font-stretch', 'ultra-expanded', '200%');
|
||||
|
||||
test_computed_value('font-stretch', '234.5%');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,21 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Fonts Module Level 4: parsing font-stretch with invalid values</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-fonts-4/#font-stretch-prop">
|
||||
<meta name="assert" content="font-stretch supports only the grammar 'normal | <percentage> | ultra-condensed | extra-condensed | condensed | semi-condensed | semi-expanded | expanded | extra-expanded | ultra-expanded'.">
|
||||
<meta name="assert" content="Values less than 0% are invalid.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/parsing-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
test_invalid_value('font-stretch', 'auto');
|
||||
test_invalid_value('font-stretch', 'normal, ultra-condensed');
|
||||
test_invalid_value('font-stretch', 'condensed expanded');
|
||||
test_invalid_value('font-stretch', '-50%');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,27 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Fonts Module Level 4: parsing font-stretch with valid values</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-fonts-4/#font-stretch-prop">
|
||||
<meta name="assert" content="font-stretch supports the full grammar 'normal | <percentage> | ultra-condensed | extra-condensed | condensed | semi-condensed | semi-expanded | expanded | extra-expanded | ultra-expanded'.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/parsing-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
test_valid_value('font-stretch', 'normal');
|
||||
test_valid_value('font-stretch', 'ultra-condensed');
|
||||
test_valid_value('font-stretch', 'extra-condensed');
|
||||
test_valid_value('font-stretch', 'condensed');
|
||||
test_valid_value('font-stretch', 'semi-condensed');
|
||||
test_valid_value('font-stretch', 'semi-expanded');
|
||||
test_valid_value('font-stretch', 'expanded');
|
||||
test_valid_value('font-stretch', 'extra-expanded');
|
||||
test_valid_value('font-stretch', 'ultra-expanded');
|
||||
|
||||
test_valid_value('font-stretch', '234.5%');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,25 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Fonts Module Level 3: getComputedValue().fontStyle</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-fonts-3/#font-style-prop">
|
||||
<meta name="assert" content="font-style computed value is as specified.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/computed-testcommon.js"></script>
|
||||
<style>
|
||||
#target {
|
||||
font-family: Ahem;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="target"></div>
|
||||
<script>
|
||||
test_computed_value('font-style', 'normal');
|
||||
test_computed_value('font-style', 'italic');
|
||||
test_computed_value('font-style', 'oblique');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,18 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Fonts Module Level 3: parsing font-style with invalid values</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-fonts-3/#font-style-prop">
|
||||
<meta name="assert" content="font-style supports only the grammar 'normal | italic | oblique'.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/parsing-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
test_invalid_value('font-style', 'auto');
|
||||
test_invalid_value('font-style', 'italic oblique');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,19 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Fonts Module Level 3: parsing font-style with valid values</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-fonts-3/#font-style-prop">
|
||||
<meta name="assert" content="font-style supports the full grammar 'normal | italic | oblique'.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/parsing-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
test_valid_value('font-style', 'normal');
|
||||
test_valid_value('font-style', 'italic');
|
||||
test_valid_value('font-style', 'oblique');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,21 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Fonts Module Level 3: getComputedValue().fontSynthesis</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-fonts-3/#font-synthesis-prop">
|
||||
<meta name="assert" content="font-synthesis computed value is as specified.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/computed-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="target"></div>
|
||||
<script>
|
||||
test_computed_value('font-synthesis', 'none');
|
||||
test_computed_value('font-synthesis', 'weight');
|
||||
test_computed_value('font-synthesis', 'style');
|
||||
test_computed_value('font-synthesis', 'weight style');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,18 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Fonts Module Level 3: parsing font-synthesis with invalid values</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-fonts-3/#font-synthesis-prop">
|
||||
<meta name="assert" content="font-synthesis supports only the grammar 'none | [ weight || style ]'.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/parsing-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
test_invalid_value('font-synthesis', 'auto');
|
||||
test_invalid_value('font-synthesis', 'none weight');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,20 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Fonts Module Level 3: parsing font-synthesis with valid values</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-fonts-3/#font-synthesis-prop">
|
||||
<meta name="assert" content="font-synthesis supports the full grammar 'none | [ weight || style ]'.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/parsing-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
test_valid_value('font-synthesis', 'none');
|
||||
test_valid_value('font-synthesis', 'weight');
|
||||
test_valid_value('font-synthesis', 'style');
|
||||
test_valid_value('font-synthesis', 'style weight', 'weight style');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,205 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Fonts Module Level 4: parsing font with valid values</title>
|
||||
<link rel="help" href="https://drafts.csswg.org/css-fonts-4/#font-prop">
|
||||
<meta name="assert" content="font supports the full grammar '[ [ <'font-style'> || <font-variant-css2> || <'font-weight'> || <font-stretch-css3> ]? <'font-size'> [ / <'line-height'> ]? <'font-family'> ] | caption | icon | menu | message-box | small-caption | status-bar'.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/parsing-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="target"></div>
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
// Firefox and Edge 18 serialize these as supplied.
|
||||
// Blink and Safari have implementation-dependent or platform-dependent serializations.
|
||||
function test_system_font(keyword) {
|
||||
test(() => {
|
||||
const target = document.getElementById('target');
|
||||
const previousValue = 'italic xx-large/0px fantasy';
|
||||
target.style.font = previousValue;
|
||||
target.style.font = keyword;
|
||||
const readValue = target.style.getPropertyValue('font');
|
||||
assert_not_equals(readValue, '', 'font should be set');
|
||||
assert_not_equals(readValue, previousValue, 'font should be updated');
|
||||
target.style.font = previousValue;
|
||||
target.style.font = readValue;
|
||||
assert_equals(target.style.getPropertyValue('font'), readValue, "serialization should round-trip");
|
||||
}, keyword + ' should be a supported system font.');
|
||||
}
|
||||
|
||||
test_system_font('caption');
|
||||
test_system_font('icon');
|
||||
test_system_font('menu');
|
||||
test_system_font('message-box');
|
||||
test_system_font('small-caption');
|
||||
test_system_font('status-bar');
|
||||
|
||||
// values other than normal
|
||||
const generate_style = (() => {
|
||||
const alternatives = [
|
||||
'italic',
|
||||
'oblique'
|
||||
];
|
||||
let counter = 0;
|
||||
return () => alternatives[counter++ % alternatives.length];
|
||||
})();
|
||||
|
||||
// value other than normal
|
||||
const generate_variant = () => 'small-caps';
|
||||
|
||||
// values other than normal
|
||||
const generate_weight = (() => {
|
||||
const alternatives = [
|
||||
'bold',
|
||||
'bolder',
|
||||
'lighter',
|
||||
'100',
|
||||
'900'
|
||||
];
|
||||
let counter = 0;
|
||||
return () => alternatives[counter++ % alternatives.length];
|
||||
})();
|
||||
|
||||
// values other than normal
|
||||
const generate_stretch = (() => {
|
||||
const alternatives = [
|
||||
'ultra-condensed',
|
||||
'extra-condensed',
|
||||
'condensed',
|
||||
'semi-condensed',
|
||||
'semi-expanded',
|
||||
'expanded',
|
||||
'extra-expanded',
|
||||
'ultra-expanded'
|
||||
];
|
||||
let counter = 0;
|
||||
return () => alternatives[counter++ % alternatives.length];
|
||||
})();
|
||||
|
||||
const generate_size = (() => {
|
||||
const alternatives = [
|
||||
// <absolute-size>
|
||||
'xx-small',
|
||||
'medium',
|
||||
'xx-large',
|
||||
|
||||
// <relative-size>
|
||||
'larger',
|
||||
'smaller',
|
||||
|
||||
// <length-percentage>
|
||||
'10px',
|
||||
'20%',
|
||||
'calc(30% - 40px)',
|
||||
];
|
||||
let counter = 0;
|
||||
return () => alternatives[counter++ % alternatives.length];
|
||||
})();
|
||||
|
||||
const generate_line_height = (() => {
|
||||
const alternatives = [
|
||||
null,
|
||||
'normal',
|
||||
'1.2',
|
||||
'calc(120% + 1.2em)'
|
||||
];
|
||||
let counter = 0;
|
||||
return () => alternatives[counter++ % alternatives.length];
|
||||
})();
|
||||
|
||||
const generate_family = (() => {
|
||||
const alternatives = [
|
||||
'serif',
|
||||
'sans-serif',
|
||||
'cursive',
|
||||
'fantasy',
|
||||
'monospace',
|
||||
'Menu',
|
||||
'"FB Armada"'
|
||||
];
|
||||
let counter = 0;
|
||||
return () => alternatives[counter++ % alternatives.length];
|
||||
})();
|
||||
|
||||
function test_specific(prefix) {
|
||||
let parts = [];
|
||||
let canonical = [];
|
||||
let style = null;
|
||||
let variant = null;
|
||||
let weight = null;
|
||||
let stretch = null;
|
||||
for (let entry of prefix) {
|
||||
if (entry === 'style') {
|
||||
style = generate_style();
|
||||
parts.push(style);
|
||||
} else if (entry === 'variant') {
|
||||
variant = generate_variant();
|
||||
parts.push(variant);
|
||||
} else if (entry === 'weight') {
|
||||
weight = generate_weight();
|
||||
parts.push(weight);
|
||||
} else if (entry === 'stretch') {
|
||||
stretch = generate_stretch();
|
||||
parts.push(stretch);
|
||||
} else {
|
||||
// normal
|
||||
parts.push('normal');
|
||||
}
|
||||
}
|
||||
|
||||
if (style)
|
||||
canonical.push(style);
|
||||
if (variant)
|
||||
canonical.push(variant);
|
||||
if (weight)
|
||||
canonical.push(weight);
|
||||
if (stretch)
|
||||
canonical.push(stretch);
|
||||
|
||||
const size = generate_size();
|
||||
const lineHeight = generate_line_height();
|
||||
if (lineHeight) {
|
||||
parts.push(size + '/' + lineHeight);
|
||||
if (lineHeight === 'normal')
|
||||
canonical.push(size);
|
||||
else
|
||||
canonical.push(size + '/' + lineHeight);
|
||||
} else {
|
||||
parts.push(size);
|
||||
canonical.push(size);
|
||||
}
|
||||
|
||||
const family = generate_family();
|
||||
parts.push(family);
|
||||
canonical.push(family);
|
||||
|
||||
test_valid_value('font', parts.join(' '), canonical.join(' '));
|
||||
}
|
||||
|
||||
function test_various(prefix) {
|
||||
test_specific(prefix);
|
||||
if (prefix.length === 4)
|
||||
return;
|
||||
|
||||
const alternatives = [
|
||||
'normal',
|
||||
'style',
|
||||
'variant',
|
||||
'weight',
|
||||
'stretch'
|
||||
];
|
||||
for (let alternative of alternatives) {
|
||||
if (alternative === 'normal' || !prefix.includes(alternative))
|
||||
test_various(prefix.concat(alternative));
|
||||
// else we would have two styles or two variants, etc.
|
||||
}
|
||||
}
|
||||
|
||||
test_various([]);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,24 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Fonts Module Level 3: getComputedValue().fontVariantCaps</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-fonts-3/#font-variant-caps-prop">
|
||||
<meta name="assert" content="font-variant-caps computed value is as specified.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/computed-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="target"></div>
|
||||
<script>
|
||||
test_computed_value('font-variant-caps', 'normal');
|
||||
test_computed_value('font-variant-caps', 'small-caps');
|
||||
test_computed_value('font-variant-caps', 'all-small-caps');
|
||||
test_computed_value('font-variant-caps', 'petite-caps');
|
||||
test_computed_value('font-variant-caps', 'all-petite-caps');
|
||||
test_computed_value('font-variant-caps', 'unicase');
|
||||
test_computed_value('font-variant-caps', 'titling-caps');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,18 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Fonts Module Level 3: parsing font-variant-caps with invalid values</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-fonts-3/#font-variant-caps-prop">
|
||||
<meta name="assert" content="font-variant-caps supports only the grammar 'normal | small-caps | all-small-caps | petite-caps | all-petite-caps | unicase | titling-caps'.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/parsing-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
test_invalid_value('font-variant-caps', 'auto');
|
||||
test_invalid_value('font-variant-caps', 'normal unicase');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,23 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Fonts Module Level 3: parsing font-variant-caps with valid values</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-fonts-3/#font-variant-caps-prop">
|
||||
<meta name="assert" content="font-variant-caps supports the full grammar 'normal | small-caps | all-small-caps | petite-caps | all-petite-caps | unicase | titling-caps'.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/parsing-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
test_valid_value('font-variant-caps', 'normal');
|
||||
test_valid_value('font-variant-caps', 'small-caps');
|
||||
test_valid_value('font-variant-caps', 'all-small-caps');
|
||||
test_valid_value('font-variant-caps', 'petite-caps');
|
||||
test_valid_value('font-variant-caps', 'all-petite-caps');
|
||||
test_valid_value('font-variant-caps', 'unicase');
|
||||
test_valid_value('font-variant-caps', 'titling-caps');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,35 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Fonts Module Level 3: getComputedValue().fontVariantEastAsian</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-fonts-3/#font-variant-east-asian-prop">
|
||||
<meta name="assert" content="font-variant-east-asian computed value is as specified.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/computed-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="target"></div>
|
||||
<script>
|
||||
test_computed_value('font-variant-east-asian', 'normal');
|
||||
|
||||
// <east-asian-variant-values> = [ jis78 | jis83 | jis90 | jis04 | simplified | traditional ]
|
||||
test_computed_value('font-variant-east-asian', 'jis78');
|
||||
test_computed_value('font-variant-east-asian', 'jis83');
|
||||
test_computed_value('font-variant-east-asian', 'jis90');
|
||||
test_computed_value('font-variant-east-asian', 'jis04');
|
||||
test_computed_value('font-variant-east-asian', 'simplified');
|
||||
test_computed_value('font-variant-east-asian', 'traditional');
|
||||
|
||||
// <east-asian-width-values> = [ full-width | proportional-width ]
|
||||
test_computed_value('font-variant-east-asian', 'full-width');
|
||||
test_computed_value('font-variant-east-asian', 'proportional-width');
|
||||
|
||||
test_computed_value('font-variant-east-asian', 'ruby');
|
||||
|
||||
test_computed_value('font-variant-east-asian', 'jis78 proportional-width');
|
||||
test_computed_value('font-variant-east-asian', 'simplified full-width ruby');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,21 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Fonts Module Level 3: parsing font-variant-east-asian with invalid values</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-fonts-3/#font-variant-east-asian-prop">
|
||||
<meta name="assert" content="font-variant-east-asian supports only the grammar 'normal | [ <east-asian-variant-values> || <east-asian-width-values> || ruby ]'.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/parsing-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
test_invalid_value('font-variant-east-asian', 'normal ruby');
|
||||
|
||||
test_invalid_value('font-variant-east-asian', 'jis78 jis83');
|
||||
|
||||
test_invalid_value('font-variant-east-asian', 'full-width proportional-width');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,34 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Fonts Module Level 3: parsing font-variant-east-asian with valid values</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-fonts-3/#font-variant-east-asian-prop">
|
||||
<meta name="assert" content="font-variant-east-asian supports the full grammar 'normal | [ <east-asian-variant-values> || <east-asian-width-values> || ruby ]'.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/parsing-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
test_valid_value('font-variant-east-asian', 'normal');
|
||||
|
||||
// <east-asian-variant-values> = [ jis78 | jis83 | jis90 | jis04 | simplified | traditional ]
|
||||
test_valid_value('font-variant-east-asian', 'jis78');
|
||||
test_valid_value('font-variant-east-asian', 'jis83');
|
||||
test_valid_value('font-variant-east-asian', 'jis90');
|
||||
test_valid_value('font-variant-east-asian', 'jis04');
|
||||
test_valid_value('font-variant-east-asian', 'simplified');
|
||||
test_valid_value('font-variant-east-asian', 'traditional');
|
||||
|
||||
// <east-asian-width-values> = [ full-width | proportional-width ]
|
||||
test_valid_value('font-variant-east-asian', 'full-width');
|
||||
test_valid_value('font-variant-east-asian', 'proportional-width');
|
||||
|
||||
test_valid_value('font-variant-east-asian', 'ruby');
|
||||
|
||||
test_valid_value('font-variant-east-asian', 'jis78 proportional-width');
|
||||
test_valid_value('font-variant-east-asian', 'ruby full-width simplified', 'simplified full-width ruby');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,35 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Fonts Module Level 3: getComputedValue().fontVariantLigatures</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-fonts-3/#font-variant-ligatures-prop">
|
||||
<meta name="assert" content="font-variant-ligatures computed value is as specified.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/computed-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="target"></div>
|
||||
<script>
|
||||
test_computed_value('font-variant-ligatures', 'normal');
|
||||
test_computed_value('font-variant-ligatures', 'none');
|
||||
|
||||
// <common-lig-values> = [ common-ligatures | no-common-ligatures ]
|
||||
test_computed_value('font-variant-ligatures', 'common-ligatures');
|
||||
test_computed_value('font-variant-ligatures', 'no-common-ligatures');
|
||||
|
||||
// <discretionary-lig-values> = [ discretionary-ligatures | no-discretionary-ligatures ]
|
||||
test_computed_value('font-variant-ligatures', 'discretionary-ligatures');
|
||||
test_computed_value('font-variant-ligatures', 'no-discretionary-ligatures');
|
||||
|
||||
// <historical-lig-values> = [ historical-ligatures | no-historical-ligatures ]
|
||||
test_computed_value('font-variant-ligatures', 'historical-ligatures');
|
||||
test_computed_value('font-variant-ligatures', 'no-historical-ligatures');
|
||||
|
||||
// <contextual-alt-values> = [ contextual | no-contextual ]
|
||||
test_computed_value('font-variant-ligatures', 'contextual');
|
||||
test_computed_value('font-variant-ligatures', 'no-contextual');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,27 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Fonts Module Level 3: parsing font-variant-ligatures with invalid values</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-fonts-3/#font-variant-ligatures-prop">
|
||||
<meta name="assert" content="font-variant-ligatures supports only the grammar 'normal | none | [ <common-lig-values> || <discretionary-lig-values> || <historical-lig-values> || <contextual-alt-values> ]'.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/parsing-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
test_invalid_value('font-variant-ligatures', 'none normal');
|
||||
|
||||
test_invalid_value('font-variant-ligatures', 'normal common-ligatures');
|
||||
|
||||
test_invalid_value('font-variant-ligatures', 'common-ligatures no-common-ligatures');
|
||||
|
||||
test_invalid_value('font-variant-ligatures', 'discretionary-ligatures no-discretionary-ligatures');
|
||||
|
||||
test_invalid_value('font-variant-ligatures', 'historical-ligatures no-historical-ligatures');
|
||||
|
||||
test_invalid_value('font-variant-ligatures', 'contextual no-contextual');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,34 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Fonts Module Level 3: parsing font-variant-ligatures with valid values</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-fonts-3/#font-variant-ligatures-prop">
|
||||
<meta name="assert" content="font-variant-ligatures supports the full grammar 'normal | none | [ <common-lig-values> || <discretionary-lig-values> || <historical-lig-values> || <contextual-alt-values> ]'.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/parsing-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
test_valid_value('font-variant-ligatures', 'normal');
|
||||
test_valid_value('font-variant-ligatures', 'none');
|
||||
|
||||
// <common-lig-values> = [ common-ligatures | no-common-ligatures ]
|
||||
test_valid_value('font-variant-ligatures', 'common-ligatures');
|
||||
test_valid_value('font-variant-ligatures', 'no-common-ligatures');
|
||||
|
||||
// <discretionary-lig-values> = [ discretionary-ligatures | no-discretionary-ligatures ]
|
||||
test_valid_value('font-variant-ligatures', 'discretionary-ligatures');
|
||||
test_valid_value('font-variant-ligatures', 'no-discretionary-ligatures');
|
||||
|
||||
// <historical-lig-values> = [ historical-ligatures | no-historical-ligatures ]
|
||||
test_valid_value('font-variant-ligatures', 'historical-ligatures');
|
||||
test_valid_value('font-variant-ligatures', 'no-historical-ligatures');
|
||||
|
||||
// <contextual-alt-values> = [ contextual | no-contextual ]
|
||||
test_valid_value('font-variant-ligatures', 'contextual');
|
||||
test_valid_value('font-variant-ligatures', 'no-contextual');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,38 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Fonts Module Level 3: getComputedValue().fontVariantNumeric</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-fonts-3/#font-variant-numeric-prop">
|
||||
<meta name="assert" content="font-variant-numeric computed value is as specified.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/computed-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="target"></div>
|
||||
<script>
|
||||
test_computed_value('font-variant-numeric', 'normal');
|
||||
|
||||
// <numeric-figure-values> = [ lining-nums | oldstyle-nums ]
|
||||
test_computed_value('font-variant-numeric', 'lining-nums');
|
||||
test_computed_value('font-variant-numeric', 'oldstyle-nums');
|
||||
|
||||
// <numeric-spacing-values> = [ proportional-nums | tabular-nums ]
|
||||
test_computed_value('font-variant-numeric', 'proportional-nums');
|
||||
test_computed_value('font-variant-numeric', 'tabular-nums');
|
||||
|
||||
// <numeric-fraction-values> = [ diagonal-fractions | stacked-fractions ]
|
||||
test_computed_value('font-variant-numeric', 'diagonal-fractions');
|
||||
test_computed_value('font-variant-numeric', 'stacked-fractions');
|
||||
|
||||
test_computed_value('font-variant-numeric', 'ordinal');
|
||||
|
||||
test_computed_value('font-variant-numeric', 'slashed-zero');
|
||||
|
||||
test_computed_value('font-variant-numeric', 'oldstyle-nums tabular-nums diagonal-fractions');
|
||||
|
||||
test_computed_value('font-variant-numeric', 'lining-nums proportional-nums stacked-fractions ordinal slashed-zero');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,30 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Fonts Module Level 3: parsing font-variant-numeric with invalid values</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-fonts-3/#font-variant-numeric-prop">
|
||||
<meta name="assert" content="font-variant-numeric supports only the grammar 'normal | [ <numeric-figure-values> || <numeric-spacing-values> || <numeric-fraction-values> || ordinal || slashed-zero ]'.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/parsing-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
test_invalid_value('font-variant-numeric', 'auto');
|
||||
|
||||
test_invalid_value('font-variant-numeric', 'normal lining-nums');
|
||||
test_invalid_value('font-variant-numeric', 'lining-nums oldstyle-nums');
|
||||
|
||||
test_invalid_value('font-variant-numeric', 'proportional-nums normal');
|
||||
test_invalid_value('font-variant-numeric', 'tabular-nums proportional-nums');
|
||||
|
||||
test_invalid_value('font-variant-numeric', 'normal diagonal-fractions');
|
||||
test_invalid_value('font-variant-numeric', 'diagonal-fractions stacked-fractions');
|
||||
|
||||
test_invalid_value('font-variant-numeric', 'ordinal normal');
|
||||
|
||||
test_invalid_value('font-variant-numeric', 'normal slashed-zero');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,38 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Fonts Module Level 3: parsing font-variant-numeric with valid values</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-fonts-3/#font-variant-numeric-prop">
|
||||
<meta name="assert" content="font-variant-numeric supports the full grammar 'normal | [ <numeric-figure-values> || <numeric-spacing-values> || <numeric-fraction-values> || ordinal || slashed-zero ]'.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/parsing-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
test_valid_value('font-variant-numeric', 'normal');
|
||||
|
||||
// <numeric-figure-values> = [ lining-nums | oldstyle-nums ]
|
||||
test_valid_value('font-variant-numeric', 'lining-nums');
|
||||
test_valid_value('font-variant-numeric', 'oldstyle-nums');
|
||||
|
||||
// <numeric-spacing-values> = [ proportional-nums | tabular-nums ]
|
||||
test_valid_value('font-variant-numeric', 'proportional-nums');
|
||||
test_valid_value('font-variant-numeric', 'tabular-nums');
|
||||
|
||||
// <numeric-fraction-values> = [ diagonal-fractions | stacked-fractions ]
|
||||
test_valid_value('font-variant-numeric', 'diagonal-fractions');
|
||||
test_valid_value('font-variant-numeric', 'stacked-fractions');
|
||||
|
||||
test_valid_value('font-variant-numeric', 'ordinal');
|
||||
|
||||
test_valid_value('font-variant-numeric', 'slashed-zero');
|
||||
|
||||
test_valid_value('font-variant-numeric', 'oldstyle-nums tabular-nums diagonal-fractions');
|
||||
|
||||
// Blink gives "slashed-zero ordinal stacked-fractions proportional-nums lining-nums".
|
||||
test_valid_value('font-variant-numeric', 'slashed-zero ordinal stacked-fractions proportional-nums lining-nums', 'lining-nums proportional-nums stacked-fractions ordinal slashed-zero');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,20 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Fonts Module Level 3: getComputedValue().fontVariantPosition</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-fonts-3/#font-variant-position-prop">
|
||||
<meta name="assert" content="font-variant-position computed value is as specified.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/computed-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="target"></div>
|
||||
<script>
|
||||
test_computed_value('font-variant-position', 'normal');
|
||||
test_computed_value('font-variant-position', 'sub');
|
||||
test_computed_value('font-variant-position', 'super');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,18 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Fonts Module Level 3: parsing font-variant-position with invalid values</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-fonts-3/#font-variant-position-prop">
|
||||
<meta name="assert" content="font-variant-position supports only the grammar 'normal | sub | super'.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/parsing-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
test_invalid_value('font-variant-position', 'auto');
|
||||
test_invalid_value('font-variant-position', 'super sub');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,19 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Fonts Module Level 3: parsing font-variant-position with valid values</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-fonts-3/#font-variant-position-prop">
|
||||
<meta name="assert" content="font-variant-position supports the full grammar 'normal | sub | super'.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/parsing-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
test_valid_value('font-variant-position', 'normal');
|
||||
test_valid_value('font-variant-position', 'sub');
|
||||
test_valid_value('font-variant-position', 'super');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,61 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Fonts Module Level 3: getComputedValue().fontWeight</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-fonts-3/#font-weight-prop">
|
||||
<meta name="assert" content="font-weight computed value is a number.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/computed-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="container">
|
||||
<div id="target"></div>
|
||||
</div>
|
||||
<script>
|
||||
'use strict';
|
||||
test_computed_value('font-weight', 'normal', '400');
|
||||
test_computed_value('font-weight', 'bold', '700');
|
||||
test_computed_value('font-weight', '100');
|
||||
test_computed_value('font-weight', '200');
|
||||
test_computed_value('font-weight', '300');
|
||||
test_computed_value('font-weight', '400');
|
||||
test_computed_value('font-weight', '500');
|
||||
test_computed_value('font-weight', '600');
|
||||
test_computed_value('font-weight', '700');
|
||||
test_computed_value('font-weight', '800');
|
||||
test_computed_value('font-weight', '900');
|
||||
|
||||
function test_relative(specified, inherited, computed) {
|
||||
test(() => {
|
||||
const container = document.getElementById('container');
|
||||
const target = document.getElementById('target');
|
||||
container.style.fontWeight = inherited;
|
||||
target.style.fontWeight = specified;
|
||||
assert_equals(getComputedStyle(target).fontWeight, computed);
|
||||
}, inherited + ' made ' + specified + ' computes to ' + computed);
|
||||
}
|
||||
|
||||
test_relative('bolder', '100', '400');
|
||||
test_relative('bolder', '200', '400');
|
||||
test_relative('bolder', '300', '400');
|
||||
test_relative('bolder', '400', '700');
|
||||
test_relative('bolder', '500', '700');
|
||||
test_relative('bolder', '600', '900');
|
||||
test_relative('bolder', '700', '900');
|
||||
test_relative('bolder', '800', '900');
|
||||
test_relative('bolder', '900', '900');
|
||||
|
||||
test_relative('lighter', '100', '100');
|
||||
test_relative('lighter', '200', '100');
|
||||
test_relative('lighter', '300', '100');
|
||||
test_relative('lighter', '400', '100');
|
||||
test_relative('lighter', '500', '100');
|
||||
test_relative('lighter', '600', '400');
|
||||
test_relative('lighter', '700', '400');
|
||||
test_relative('lighter', '800', '700');
|
||||
test_relative('lighter', '900', '700');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,18 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Fonts Module Level 3: parsing font-weight with invalid values</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-fonts-3/#font-weight-prop">
|
||||
<meta name="assert" content="font-weight supports only the grammar 'normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900'.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/parsing-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
test_invalid_value('font-weight', 'auto');
|
||||
test_invalid_value('font-weight', 'bold 900');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,29 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Fonts Module Level 3: parsing font-weight with valid values</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-fonts-3/#font-weight-prop">
|
||||
<meta name="assert" content="font-weight supports the full grammar 'normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900'.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/parsing-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
test_valid_value('font-weight', 'normal');
|
||||
test_valid_value('font-weight', 'bold');
|
||||
test_valid_value('font-weight', 'bolder');
|
||||
test_valid_value('font-weight', 'lighter');
|
||||
test_valid_value('font-weight', '100');
|
||||
test_valid_value('font-weight', '200');
|
||||
test_valid_value('font-weight', '300');
|
||||
test_valid_value('font-weight', '400');
|
||||
test_valid_value('font-weight', '500');
|
||||
test_valid_value('font-weight', '600');
|
||||
test_valid_value('font-weight', '700');
|
||||
test_valid_value('font-weight', '800');
|
||||
test_valid_value('font-weight', '900');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -4,6 +4,7 @@
|
|||
<meta charset="utf-8"/>
|
||||
<title>text-transform math-auto</title>
|
||||
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/3745"/>
|
||||
<link rel="help" href="https://mathml-refresh.github.io/mathml-core/#new-text-transform-values">
|
||||
<link rel="match" href="text-transform-math-auto-002.tentative-ref.html"/>
|
||||
<meta name="assert" content="Test 'text-transform: math-auto' for text nodes of different lengths">
|
||||
<style>
|
||||
|
|
|
@ -56,6 +56,37 @@ promise_test(async t => {
|
|||
assert_equals(getComputedStyle(div).left, '100px');
|
||||
}, 'After setting a transition\'s effect to null, style is updated');
|
||||
|
||||
// This is a regression test for https://crbug.com/964113, where Chromium would
|
||||
// crash if the running transition's effect was set to null and a new transition
|
||||
// was started before the running one could finish.
|
||||
promise_test(async t => {
|
||||
const div = addDiv(t);
|
||||
div.style.left = '0px';
|
||||
|
||||
div.style.transition = 'left 100s';
|
||||
getComputedStyle(div).left;
|
||||
div.style.left = '100px';
|
||||
|
||||
assert_equals(div.getAnimations().length, 1);
|
||||
|
||||
const transition = div.getAnimations()[0];
|
||||
await transition.ready;
|
||||
|
||||
// Without yielding to the rendering loop, set the current transition's
|
||||
// effect to null and start a new transition. This should work correctly.
|
||||
transition.effect = null;
|
||||
|
||||
div.style.left = '150px';
|
||||
|
||||
// This will run style update.
|
||||
assert_equals(div.getAnimations().length, 1);
|
||||
|
||||
const new_transition = div.getAnimations()[0];
|
||||
await new_transition.ready;
|
||||
|
||||
assert_equals(getComputedStyle(div).left, '0px');
|
||||
}, 'After setting a transition\'s effect to null, a new transition can be started');
|
||||
|
||||
promise_test(async t => {
|
||||
const div = addDiv(t);
|
||||
div.style.left = '0px';
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS UI Level 3: getComputedStyle().caretColor</title>
|
||||
<link rel="help" href="https://drafts.csswg.org/css-ui-3/#caret-color">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/computed-testcommon.js"></script>
|
||||
<style>
|
||||
#target {
|
||||
color: blue;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="target"></div>
|
||||
<script>
|
||||
'use strict';
|
||||
const currentColor = "rgb(0, 0, 255)";
|
||||
test_computed_value("caret-color", "auto", currentColor);
|
||||
test_computed_value("caret-color", "currentColor", currentColor);
|
||||
test_computed_value("caret-color", "red", "rgb(255, 0, 0)");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,32 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS UI Level 3: getComputedStyle().outlineColor</title>
|
||||
<link rel="help" href="https://drafts.csswg.org/css-ui-3/#outline-color">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/computed-testcommon.js"></script>
|
||||
<style>
|
||||
#target {
|
||||
color: blue;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="target"></div>
|
||||
<script>
|
||||
'use strict';
|
||||
const currentColor = "rgb(0, 0, 255)";
|
||||
test_computed_value("outline-color", "currentColor", currentColor);
|
||||
test_computed_value("outline-color", "red", "rgb(255, 0, 0)");
|
||||
|
||||
test(() => {
|
||||
const target = document.getElementById('target');
|
||||
target.style.outlineColor = 'invert';
|
||||
if (target.style.outlineColor === 'invert')
|
||||
assert_equals(getComputedStyle(target).outlineColor, 'invert');
|
||||
}, 'invert, if supported, computes to invert');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue