Update web-platform-tests to revision b'2d7c53f5bc604132d2c83955537e454ee9c788c0'

This commit is contained in:
WPT Sync Bot 2023-01-18 01:45:07 +00:00
parent 619a46113f
commit 1c6b303ef2
396 changed files with 29611 additions and 1967 deletions

View file

@ -1,80 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta name="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org">
<link rel="help" href="https://html.spec.whatwg.org/multipage/dom.html#the-directionality">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
test(() => {
const bdi = document.createElement('bdi');
assert_true(bdi.matches(':dir(ltr)'));
assert_false(bdi.matches(':dir(rtl)'));
bdi.textContent = '\u05EA';
assert_false(bdi.matches(':dir(ltr)'));
assert_true(bdi.matches(':dir(rtl)'));
}, 'bdi element without dir content attribute');
test(() => {
const bdi = document.createElement('bdi');
bdi.setAttribute('dir', 'foo');
assert_true(bdi.matches(':dir(ltr)'));
assert_false(bdi.matches(':dir(rtl)'));
bdi.textContent = '\u05EA';
assert_false(bdi.matches(':dir(ltr)'));
assert_true(bdi.matches(':dir(rtl)'));
}, 'bdi element with invalid dir content attribute');
test(() => {
const bdi = document.createElement('bdi');
bdi.setAttribute('dir', 'auto');
assert_true(bdi.matches(':dir(ltr)'));
assert_false(bdi.matches(':dir(rtl)'));
bdi.textContent = '\u05EA';
assert_false(bdi.matches(':dir(ltr)'));
assert_true(bdi.matches(':dir(rtl)'));
bdi.setAttribute('dir', 'AUTO');
assert_false(bdi.matches(':dir(ltr)'));
assert_true(bdi.matches(':dir(rtl)'));
}, 'bdi element with dir=auto content attribute');
test(() => {
const bdi = document.createElement('bdi');
bdi.setAttribute('dir', 'ltr');
assert_true(bdi.matches(':dir(ltr)'));
assert_false(bdi.matches(':dir(rtl)'));
bdi.setAttribute('dir', 'LTR');
assert_true(bdi.matches(':dir(ltr)'));
assert_false(bdi.matches(':dir(rtl)'));
bdi.textContent = '\u05EA';
assert_true(bdi.matches(':dir(ltr)'));
assert_false(bdi.matches(':dir(rtl)'));
}, 'bdi element with dir=ltr content attribute');
test(() => {
const bdi = document.createElement('bdi');
bdi.setAttribute('dir', 'rtl');
assert_false(bdi.matches(':dir(ltr)'));
assert_true(bdi.matches(':dir(rtl)'));
bdi.setAttribute('dir', 'RTL');
assert_false(bdi.matches(':dir(ltr)'));
assert_true(bdi.matches(':dir(rtl)'));
bdi.textContent = '\u05EA';
assert_false(bdi.matches(':dir(ltr)'));
assert_true(bdi.matches(':dir(rtl)'));
}, 'bdi element with dir=rtl content attribute');
</script>
</body>
</html>

View file

@ -1,180 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta name="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org">
<link rel="help" href="https://html.spec.whatwg.org/multipage/dom.html#the-directionality">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
test(() => {
const input = document.createElement('input');
input.type = 'tel';
assert_true(input.matches(':dir(ltr)'));
assert_false(input.matches(':dir(rtl)'));
input.setAttribute('dir', 'foo');
assert_true(input.matches(':dir(ltr)'));
assert_false(input.matches(':dir(rtl)'));
input.setAttribute('dir', 'rtl');
assert_false(input.matches(':dir(ltr)'));
assert_true(input.matches(':dir(rtl)'));
input.setAttribute('dir', 'RTL');
assert_false(input.matches(':dir(ltr)'));
assert_true(input.matches(':dir(rtl)'));
input.setAttribute('dir', 'ltr');
assert_true(input.matches(':dir(ltr)'));
assert_false(input.matches(':dir(rtl)'));
input.setAttribute('dir', 'LTR');
assert_true(input.matches(':dir(ltr)'));
assert_false(input.matches(':dir(rtl)'));
input.setAttribute('dir', 'auto');
assert_true(input.matches(':dir(ltr)'));
assert_false(input.matches(':dir(rtl)'));
input.value = '\u05EA';
assert_false(input.matches(':dir(ltr)'));
assert_true(input.matches(':dir(rtl)'));
input.setAttribute('dir', 'AUTO');
assert_false(input.matches(':dir(ltr)'));
assert_true(input.matches(':dir(rtl)'));
input.removeAttribute('dir');
assert_true(input.matches(':dir(ltr)'));
assert_false(input.matches(':dir(rtl)'));
}, 'input element whose type attribute is in the telephone state');
test(() => {
const input = document.createElement('input');
input.type = 'tel';
const container = document.createElement('div');
container.setAttribute('dir', 'rtl');
container.appendChild(input);
// Insert the element into the document so that we can also check for
// 'direction' in computed style.
document.body.appendChild(container);
assert_true(input.matches(':dir(ltr)'));
assert_false(input.matches(':dir(rtl)'));
// Per https://html.spec.whatwg.org/multipage/rendering.html#bidi-rendering:
assert_equals(getComputedStyle(input).direction, 'ltr');
// Changing to a different type causes the special type=tel rule to no longer apply.
input.type = 'text';
assert_false(input.matches(':dir(ltr)'));
assert_true(input.matches(':dir(rtl)'));
assert_equals(getComputedStyle(input).direction, 'rtl');
// And restoring type=tel brings back that behavior.
input.type = 'tel';
assert_true(input.matches(':dir(ltr)'));
assert_false(input.matches(':dir(rtl)'));
assert_equals(getComputedStyle(input).direction, 'ltr');
document.body.removeChild(container);
}, 'input element whose type attribute is in the telephone state in a RTL block');
for (let type of ['text', 'search', 'url', 'email']) {
test(() => {
const input = document.createElement('input');
input.type = type;
assert_true(input.matches(':dir(ltr)'));
assert_false(input.matches(':dir(rtl)'));
input.setAttribute('dir', 'foo');
assert_true(input.matches(':dir(ltr)'));
assert_false(input.matches(':dir(rtl)'));
input.setAttribute('dir', 'rtl');
assert_false(input.matches(':dir(ltr)'));
assert_true(input.matches(':dir(rtl)'));
input.setAttribute('dir', 'RTL');
assert_false(input.matches(':dir(ltr)'));
assert_true(input.matches(':dir(rtl)'));
input.setAttribute('dir', 'ltr');
assert_true(input.matches(':dir(ltr)'));
assert_false(input.matches(':dir(rtl)'));
input.setAttribute('dir', 'LTR');
assert_true(input.matches(':dir(ltr)'));
assert_false(input.matches(':dir(rtl)'));
input.setAttribute('dir', 'auto');
assert_true(input.matches(':dir(ltr)'));
assert_false(input.matches(':dir(rtl)'));
input.value = '\u05EA';
assert_false(input.matches(':dir(ltr)'));
assert_true(input.matches(':dir(rtl)'));
input.setAttribute('dir', 'AUTO');
assert_false(input.matches(':dir(ltr)'));
assert_true(input.matches(':dir(rtl)'))
input.removeAttribute('dir');
assert_true(input.matches(':dir(ltr)'));
assert_false(input.matches(':dir(rtl)'));
}, `input element whose type attribute is in the ${type} state`);
}
for (let type of ['password', 'date', 'time', 'number', 'range', 'color',
'checkbox', 'radio', 'submit', 'image', 'reset', 'button']) {
test(() => {
const input = document.createElement('input');
input.type = type;
assert_true(input.matches(':dir(ltr)'));
assert_false(input.matches(':dir(rtl)'));
input.setAttribute('dir', 'foo');
assert_true(input.matches(':dir(ltr)'));
assert_false(input.matches(':dir(rtl)'));
input.setAttribute('dir', 'rtl');
assert_false(input.matches(':dir(ltr)'));
assert_true(input.matches(':dir(rtl)'));
input.setAttribute('dir', 'RTL');
assert_false(input.matches(':dir(ltr)'));
assert_true(input.matches(':dir(rtl)'));
input.setAttribute('dir', 'ltr');
assert_true(input.matches(':dir(ltr)'));
assert_false(input.matches(':dir(rtl)'));
input.setAttribute('dir', 'LTR');
assert_true(input.matches(':dir(ltr)'));
assert_false(input.matches(':dir(rtl)'));
input.setAttribute('dir', 'auto');
assert_true(input.matches(':dir(ltr)'));
assert_false(input.matches(':dir(rtl)'));
input.value = '\u05EA';
assert_true(input.matches(':dir(ltr)'));
assert_false(input.matches(':dir(rtl)'));
input.setAttribute('dir', 'AUTO');
assert_true(input.matches(':dir(ltr)'));
assert_false(input.matches(':dir(rtl)'))
input.removeAttribute('dir');
assert_true(input.matches(':dir(ltr)'));
assert_false(input.matches(':dir(rtl)'));
}, `input element whose type attribute is in the ${type} state`);
}
</script>
</body>
</html>

View file

@ -1,7 +0,0 @@
<!DOCTYPE html>
<html>
<body>
<p>Test passes if you see a single 100px by 100px green box below.</p>
<div style="width: 100px; height: 100px; background: green;"></div>
</body>
</html>

View file

@ -1,28 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<link rel="help" href="https://drafts.csswg.org/selectors/#lang-pseudo">
<link rel="match" href="lang-pseudo-class-across-shadow-boundaries-ref.html">
</head>
<body>
<p>Test passes if you see a single 100px by 100px green box below.</p>
<style>
#testCases div { width: 100px; height: 25px; }
#host1:lang(zh) { background: green; }
#host3 > :lang(ja) { background: green; }
#host4 > div { background: red; }
</style>
<div id="testCases">
<div id="host1" lang="zh"><div></div></div>
<div id="host2" lang="de"><div></div></div>
<div id="host3" lang="ja"><div></div></div>
<div id="host4"><div></div></div>
</div>
<script>
host1.attachShadow({mode: 'closed'}).innerHTML = '<slot></slot>';
host2.attachShadow({mode: 'closed'}).innerHTML = '<style> div { width: 100px; height: 25px; background: red; } div:lang(de) { background: green; } </style><div></div>';
host3.attachShadow({mode: 'closed'}).innerHTML = '<slot lang="en"></slot>';
host4.attachShadow({mode: 'closed'}).innerHTML = '<style> :lang(ja)::slotted(*) { background: green !important; } </style><slot lang="ja"></slot>';
</script>
</body>
</html>