mirror of
https://github.com/servo/servo.git
synced 2025-08-14 01:45:33 +01:00
Update web-platform-tests to revision bf42dca1ce568ce559d5a4cad507239035b91dcb
This commit is contained in:
parent
91d2bd3d64
commit
20e57b5c74
81 changed files with 3616 additions and 289 deletions
|
@ -22,12 +22,6 @@
|
|||
<script>
|
||||
'use strict';
|
||||
|
||||
const initial_style = 'normal';
|
||||
const initial_variant = 'normal';
|
||||
const initial_weight = 'normal';
|
||||
const initial_stretch = 'normal';
|
||||
const initial_line_height = 'normal';
|
||||
|
||||
// Firefox and Edge 18 serialize these as supplied.
|
||||
// Blink and Safari have implementation-dependent or platform-dependent serializations.
|
||||
function test_system_font(keyword) {
|
||||
|
@ -178,27 +172,19 @@ function test_specific(prefix) {
|
|||
if (style) {
|
||||
canonical.push(style);
|
||||
reference.style.fontStyle = style;
|
||||
} else {
|
||||
canonical.push(initial_style);
|
||||
}
|
||||
|
||||
if (variant) {
|
||||
canonical.push(variant);
|
||||
reference.style.fontVariant = style;
|
||||
} else {
|
||||
canonical.push(initial_variant);
|
||||
}
|
||||
if (weight) {
|
||||
canonical.push(compute_weight(weight));
|
||||
reference.style.fontWeight = style;
|
||||
} else {
|
||||
canonical.push(compute_weight(initial_weight));
|
||||
}
|
||||
if (stretch) {
|
||||
canonical.push(stretch);
|
||||
reference.style.fontStretch = style;
|
||||
} else {
|
||||
canonical.push(initial_stretch);
|
||||
}
|
||||
|
||||
const size = generate_size();
|
||||
|
@ -215,15 +201,19 @@ function test_specific(prefix) {
|
|||
parts.push(family);
|
||||
reference.style.fontFamily = family;
|
||||
|
||||
canonical.push(getComputedStyle(reference).fontSize + '/' + getComputedStyle(reference).lineHeight);
|
||||
if (!line_height || line_height === 'normal') {
|
||||
canonical.push(getComputedStyle(reference).fontSize);
|
||||
} else {
|
||||
// Implementations differ on adjacent space when serializing '/'
|
||||
// https://github.com/w3c/csswg-drafts/issues/4282
|
||||
canonical.push(getComputedStyle(reference).fontSize + ' / ' + getComputedStyle(reference).lineHeight);
|
||||
}
|
||||
|
||||
canonical.push(family);
|
||||
|
||||
reference.remove();
|
||||
|
||||
// Implementations differ on adjacent space when serializing '/'
|
||||
// https://github.com/w3c/csswg-drafts/issues/4282
|
||||
const expected = canonical.join(' ');
|
||||
test_computed_value('font', parts.join(' '), [expected, expected.replace('/', ' / ')]);
|
||||
test_computed_value('font', parts.join(' '), canonical.join(' '));
|
||||
}
|
||||
|
||||
// Font style, variant, weight and stretch may appear in any order.
|
||||
|
|
|
@ -23,6 +23,7 @@ test_invalid_value('font', 'normal normal normal normal normal 20%/1.2 \"FB Arma
|
|||
|
||||
test_invalid_value('font', 'italic small-caps lighter condensed smaller');
|
||||
test_invalid_value('font', 'normal 100 semi-condensed oblique small-caps Menu');
|
||||
test_invalid_value('font', '100% larger / 2 fantasy');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -167,7 +167,7 @@ function test_specific(prefix) {
|
|||
if (lineHeight === 'normal')
|
||||
canonical.push(size);
|
||||
else
|
||||
canonical.push(size + '/' + lineHeight);
|
||||
canonical.push(size + ' / ' + lineHeight);
|
||||
} else {
|
||||
parts.push(size);
|
||||
canonical.push(size);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue