mirror of
https://github.com/servo/servo.git
synced 2025-08-12 17:05:33 +01:00
Update web-platform-tests to revision 9919d0f04266001686c09d47ff6e25c98b48d91f
This commit is contained in:
parent
026e550d35
commit
e7fcc8e274
453 changed files with 7751 additions and 2288 deletions
|
@ -2,7 +2,7 @@
|
|||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Text: getComputedValue().hyphens</title>
|
||||
<title>CSS Text: getComputedStyle().hyphens</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-hyphens">
|
||||
<meta name="assert" content="hyphens computed value is specified keyword.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Text: getComputedValue().letterSpacing</title>
|
||||
<title>CSS Text: getComputedStyle().letterSpacing</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-letter-spacing">
|
||||
<meta name="assert" content="letter-spacing computed value is an absolute length.">
|
||||
<meta name="assert" content="'normal' computes to zero.">
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Text: getComputedValue().lineBreak</title>
|
||||
<title>CSS Text: getComputedStyle().lineBreak</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-line-break">
|
||||
<meta name="assert" content="line-break computed value is specified keyword.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Text: getComputedValue().overflowWrap</title>
|
||||
<title>CSS Text: getComputedStyle().overflowWrap</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-overflow-wrap">
|
||||
<meta name="assert" content="overflow-wrap computed value is specified keyword.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Text: getComputedValue().tabSize</title>
|
||||
<title>CSS Text: getComputedStyle().tabSize</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-tab-size">
|
||||
<meta name="assert" content="tab-size computed value is the specified number or an absolute length.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Text: getComputedValue().textAlignLast</title>
|
||||
<title>CSS Text: getComputedStyle().textAlignLast</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-text-align-last">
|
||||
<meta name="assert" content="text-align-last computed value is specified keyword.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Text: getComputedValue().textIndent</title>
|
||||
<title>CSS Text: getComputedStyle().textIndent</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-text-indent">
|
||||
<meta name="assert" content="text-indent computed value is computed <length-percentage> value, plus any specified keywords.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Text: getComputedValue().textJustify</title>
|
||||
<title>CSS Text: getComputedStyle().textJustify</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-text-justify">
|
||||
<meta name="assert" content="text-justify computed value is specified keyword.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Text: getComputedValue().textTransform</title>
|
||||
<title>CSS Text: getComputedStyle().textTransform</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-text-transform">
|
||||
<meta name="assert" content="text-transform computed value is specified keywords.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Text: getComputedValue().whiteSpace</title>
|
||||
<title>CSS Text: getComputedStyle().whiteSpace</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-white-space">
|
||||
<meta name="assert" content="white-space computed value is specified keyword.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Text: getComputedValue().wordBreak</title>
|
||||
<title>CSS Text: getComputedStyle().wordBreak</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-word-break">
|
||||
<meta name="assert" content="word-break computed value is specified keyword.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Text: getComputedValue().wordSpacing</title>
|
||||
<title>CSS Text: getComputedStyle().wordSpacing</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-word-spacing">
|
||||
<meta name="assert" content="word-spacing computed value is an absolute length.">
|
||||
<meta name="assert" content="'normal' computes to zero.">
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Text: getComputedValue().wordWrap</title>
|
||||
<title>CSS Text: getComputedStyle().wordWrap</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-word-wrap">
|
||||
<meta name="assert" content="word-wrap computed value is specified keyword.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
|
|
|
@ -0,0 +1,97 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>Test: CSS value type of the CSS property 'tab-size'</title>
|
||||
<link rel="help" href="https://drafts.csswg.org/css-text-3/#tab-size-property">
|
||||
<style>
|
||||
body {
|
||||
font-family: Ahem;
|
||||
font-size: 13px;
|
||||
}
|
||||
.px-tab-size {
|
||||
tab-size: 60px;
|
||||
}
|
||||
.em-tab-size {
|
||||
tab-size: 7em;
|
||||
}
|
||||
.int-tab-size {
|
||||
tab-size: 9;
|
||||
}
|
||||
.fractional-tab-size {
|
||||
tab-size: 2.5;
|
||||
}
|
||||
</style>
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
<div style="background-repeat: repeat-x;">
|
||||
<div><pre id="leading-px" class="px-tab-size">	<span>leading text, tab-size in px.</span></pre></div>
|
||||
<div><pre id="leading-em" class="em-tab-size">	<span>leading text, tab-size in em.</span></pre></div>
|
||||
<div><pre id="leading-int" class="int-tab-size">	<span>leading text, tab-size in spaces.</span></pre></div>
|
||||
<div><pre id="leading-fraction" class="fractional-tab-size">	<span>leading text, tab-size in fraction.</span></pre></div>
|
||||
<div><pre id="trailing-px" class="px-tab-size"><span>leading text</span>	<span>trailing text, tab-size in px.</span></pre></div>
|
||||
<div><pre id="trailing-em" class="em-tab-size"><span>leading text</span>	<span>trailing text, tab-size in em.</span></pre></div>
|
||||
<div><pre id="trailing-int" class="int-tab-size"><span>leading text</span>	<span>trailing text, tab-size in spaces.</span></pre></div>
|
||||
<div><pre id="trailing-fraction" class="fractional-tab-size"><span>leading text</span>	<span>trailing text, tab-size in fraction.</span></pre></div>
|
||||
<div><pre>Some spaces... '<span id="space-size-reference"> </span>' ... for size reference.</pre></div>
|
||||
<div><pre>A space... '<span id="one-space-size-reference"> </span>' ... for size reference.</pre></div>
|
||||
<div><pre>'<span id="leading-text-size-reference">leading text</span>', for size reference.</pre></div>
|
||||
<script>
|
||||
test(function() {
|
||||
// Tests with a tab character at the beginning of the line.
|
||||
var pxPre = document.getElementById('leading-px');
|
||||
var emPre = document.getElementById('leading-em');
|
||||
var intPre = document.getElementById('leading-int');
|
||||
var fractionPre = document.getElementById("leading-fraction");
|
||||
|
||||
var pxLeadingSpan = pxPre.firstElementChild;
|
||||
var emLeadingSpan = emPre.firstElementChild;
|
||||
var intLeadingSpan = intPre.firstElementChild;
|
||||
var fractionLeadingspan = fractionPre.firstElementChild;
|
||||
|
||||
var pxExpected = 60; // tab size in px.
|
||||
var emExpected = 13 * 7; // (font size) * (tab size in em)
|
||||
var intExpected = document.getElementById('space-size-reference').getBoundingClientRect().width;
|
||||
var fractionExpected = 2.5 * document.getElementById('one-space-size-reference').getBoundingClientRect().width;
|
||||
|
||||
var pxTabLength = pxLeadingSpan.getBoundingClientRect().left - pxPre.getBoundingClientRect().left;
|
||||
var emTabLength = emLeadingSpan.getBoundingClientRect().left - emPre.getBoundingClientRect().left;
|
||||
var intTabLength = intLeadingSpan.getBoundingClientRect().left - intPre.getBoundingClientRect().left;
|
||||
var fractionTabLength = fractionLeadingspan.getBoundingClientRect().left - fractionPre.getBoundingClientRect().left;
|
||||
|
||||
assert_approx_equals(pxTabLength, pxExpected, 0.02);
|
||||
assert_approx_equals(emTabLength, emExpected, 0.02);
|
||||
assert_approx_equals(intTabLength, intExpected, 0.02);
|
||||
assert_approx_equals(fractionTabLength, fractionExpected, 0.02);
|
||||
|
||||
// Tests with a tab character after leading text.
|
||||
var leadingTextSize = document.getElementById('leading-text-size-reference').getBoundingClientRect().width;
|
||||
pxExpected = pxExpected - (leadingTextSize % pxExpected);
|
||||
emExpected = emExpected - (leadingTextSize % emExpected);
|
||||
intExpected = intExpected - (leadingTextSize % intExpected);
|
||||
fractionExpected = fractionExpected - (leadingTextSize % fractionExpected);
|
||||
|
||||
pxPre = document.getElementById('trailing-px');
|
||||
emPre = document.getElementById('trailing-em');
|
||||
intPre = document.getElementById('trailing-int');
|
||||
fractionPre = document.getElementById("trailing-fraction");
|
||||
|
||||
pxLeadingSpan = pxPre.firstElementChild;
|
||||
emLeadingSpan = emPre.firstElementChild;
|
||||
intLeadingSpan = intPre.firstElementChild;
|
||||
fractionLeadingspan = fractionPre.firstElementChild;
|
||||
|
||||
pxTrailingSpan = pxPre.lastElementChild;
|
||||
emTrailingSpan = emPre.lastElementChild;
|
||||
intTrailingSpan = intPre.lastElementChild;
|
||||
fractionTrailingSpan = fractionPre.lastElementChild;
|
||||
|
||||
pxTabLength = pxTrailingSpan.getBoundingClientRect().left - pxLeadingSpan.getBoundingClientRect().right;
|
||||
emTabLength = emTrailingSpan.getBoundingClientRect().left - emLeadingSpan.getBoundingClientRect().right;
|
||||
intTabLength = intTrailingSpan.getBoundingClientRect().left - intLeadingSpan.getBoundingClientRect().right;
|
||||
fractionTabLength = fractionTrailingSpan.getBoundingClientRect().left - fractionLeadingspan.getBoundingClientRect().right;
|
||||
|
||||
assert_approx_equals(pxTabLength, pxExpected, 0.02);
|
||||
assert_approx_equals(emTabLength, emExpected, 0.02);
|
||||
assert_approx_equals(intTabLength, intExpected, 0.02);
|
||||
assert_approx_equals(fractionTabLength, fractionExpected, 0.02);
|
||||
}, "Test tab-size measurements");
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue