Auto merge of #28099 - servo-wpt-sync:wpt_update_25-01-2021, r=jdm

Sync WPT with upstream (25-01-2021)

Automated downstream sync of changes from upstream as of 25-01-2021.
[no-wpt-sync]
r? @servo-wpt-sync
This commit is contained in:
bors-servo 2021-01-25 22:12:48 -05:00 committed by GitHub
commit 1ba6f598cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
55 changed files with 318 additions and 203 deletions

View file

@ -0,0 +1,4 @@
[hit-test-floats-003.html]
[Miss float below something else]
expected: FAIL

View file

@ -0,0 +1,4 @@
[hit-test-floats-004.html]
[Miss float below something else]
expected: FAIL

View file

@ -1,2 +0,0 @@
[trailing-other-space-separators-break-spaces-008.html]
expected: FAIL

View file

@ -2,6 +2,3 @@
[Hit test intersecting scaled box]
expected: FAIL
[Hit test within unscaled box]
expected: FAIL

View file

@ -11,9 +11,3 @@
[looks up handleEvent method on every event dispatch]
expected: FAIL
[calls handleEvent method of event listener]
expected: FAIL
[doesn't look up handleEvent method on callable event listeners]
expected: FAIL

View file

@ -17,6 +17,3 @@
[test the top of layer]
expected: FAIL
[test some point of the element: top left corner]
expected: FAIL

View file

@ -1,4 +0,0 @@
[elementsFromPoint-invalid-cases.html]
[The root element is the last element returned for otherwise empty queries within the viewport]
expected: FAIL

View file

@ -0,0 +1,7 @@
[focus-visible-017.html]
[By default initial programatic focus matches ':focus-visible', so the element shows a focus ring with 'outline-style: auto']
expected: FAIL
[":focus-visible" should be a valid selector]
expected: FAIL

View file

@ -315,9 +315,6 @@
[<iframe>: separate response Content-Type: text/html;x=" text/plain]
expected: FAIL
[<iframe>: combined response Content-Type: text/html;" text/plain]
expected: FAIL
[<iframe>: combined response Content-Type: text/html;charset=gbk text/plain text/html]
expected: FAIL
@ -330,6 +327,12 @@
[<iframe>: combined response Content-Type: text/html */*;charset=gbk]
expected: FAIL
[<iframe>: separate response Content-Type: text/html;" \\" text/plain]
[<iframe>: separate response Content-Type: text/html;" text/plain]
expected: FAIL
[<iframe>: separate response Content-Type: text/plain */*]
expected: FAIL
[<iframe>: combined response Content-Type: text/html;" \\" text/plain]
expected: FAIL

View file

@ -53,6 +53,9 @@
[combined text/javascript ]
expected: FAIL
[separate text/javascript x/x]
[separate text/javascript;charset=windows-1252 error text/javascript]
expected: FAIL
[separate text/javascript;charset=windows-1252 text/javascript]
expected: FAIL

View file

@ -1,4 +0,0 @@
[traverse_the_history_1.html]
[Multiple history traversals from the same task]
expected: FAIL

View file

@ -0,0 +1,4 @@
[traverse_the_history_4.html]
[Multiple history traversals, last would be aborted]
expected: FAIL

View file

@ -1,2 +0,0 @@
[cross-origin-objects-on-new-window.html]
expected: TIMEOUT

View file

@ -1,5 +1,4 @@
[embedded-opener-remove-frame.html]
expected: CRASH
[opener of discarded nested browsing context]
expected: FAIL

View file

@ -1,5 +1,4 @@
[iframe_sandbox_popups_escaping-3.html]
expected: TIMEOUT
[Check that popups from a sandboxed iframe escape the sandbox if\n allow-popups-to-escape-sandbox is used]
expected: TIMEOUT
expected: FAIL

View file

@ -1,5 +1,5 @@
[iframe_sandbox_popups_nonescaping-2.html]
expected: TIMEOUT
expected: CRASH
[Check that popups from a sandboxed iframe do not escape the sandbox]
expected: NOTRUN

View file

@ -1,5 +1,5 @@
[iframe_sandbox_popups_nonescaping-3.html]
expected: CRASH
expected: TIMEOUT
[Check that popups from a sandboxed iframe do not escape the sandbox]
expected: NOTRUN

View file

@ -1,4 +0,0 @@
[form-double-submit-2.html]
[preventDefault should allow onclick submit() to succeed]
expected: FAIL

View file

@ -8,69 +8,48 @@
[input type url: selectionStart out of range a second time (must not fire select)]
expected: FAIL
[input type tel: setRangeText() a second time (must not fire select)]
expected: FAIL
[input type search: setSelectionRange out of range a second time (must not fire select)]
expected: FAIL
[input type password: selectionEnd a second time (must not fire select)]
expected: FAIL
[input type url: setSelectionRange out of range a second time (must not fire select)]
expected: FAIL
[textarea: selectionDirection a second time (must not fire select)]
expected: FAIL
[input type url: selectionEnd a second time (must not fire select)]
expected: FAIL
[input type text: setSelectionRange out of range a second time (must not fire select)]
expected: FAIL
[input type text: selectionEnd out of range a second time (must not fire select)]
expected: FAIL
[input type search: selectionEnd a second time (must not fire select)]
expected: FAIL
[input type tel: setSelectionRange out of range a second time (must not fire select)]
expected: FAIL
[input type password: selectionStart out of range a second time (must not fire select)]
expected: FAIL
[input type search: selectionStart a second time (must not fire select)]
expected: FAIL
[input type password: selectionStart a second time (must not fire select)]
expected: FAIL
[input type url: selectionEnd out of range a second time (must not fire select)]
expected: FAIL
[input type search: setSelectionRange() a second time (must not fire select)]
expected: FAIL
[textarea: selectionStart a second time (must not fire select)]
expected: FAIL
[input type tel: selectionDirection a second time (must not fire select)]
expected: FAIL
[input type tel: setSelectionRange() a second time (must not fire select)]
expected: FAIL
[input type password: setRangeText() a second time (must not fire select)]
expected: FAIL
[input type search: selectionEnd out of range a second time (must not fire select)]
[input type password: select() a second time (must not fire select)]
expected: FAIL
[input type url: selectionStart a second time (must not fire select)]
[input type tel: selectionEnd out of range a second time (must not fire select)]
expected: FAIL
[input type tel: selectionStart a second time (must not fire select)]
[input type password: setSelectionRange() a second time (must not fire select)]
expected: FAIL
[input type password: selectionDirection a second time (must not fire select)]
expected: FAIL
[input type search: setRangeText() a second time (must not fire select)]
expected: FAIL

View file

@ -1,4 +0,0 @@
[module-static-import-delayed.html]
[document.write in an imported module]
expected: FAIL

View file

@ -3,6 +3,3 @@
[The incumbent settings object while executing the compiled callback via Web IDL's invoke must be that of the node document]
expected: TIMEOUT
[The entry settings object while executing the compiled callback via Web IDL's invoke must be that of the node document]
expected: TIMEOUT

View file

@ -0,0 +1,2 @@
[sharedworker-module.http.html]
expected: CRASH

View file

@ -569,3 +569,9 @@
[X Stitched sine-wave buffers at sample rate 43800 does not equal [0,0.06264832615852356,0.12505052983760834,0.18696144223213196,0.24813786149024963,0.308339387178421,0.36732959747314453,0.4248766601085663,0.480754554271698,0.5347436666488647,0.5866320133209229,0.6362156271934509,0.6832997798919678,0.7276994585990906,0.7692402601242065,0.8077589869499207...\] with an element-wise tolerance of {"absoluteThreshold":0.0038986,"relativeThreshold":0}.\n\tIndex\tActual\t\t\tExpected\t\tAbsError\t\tRelError\t\tTest threshold\n\t[25222\]\t8.3282489238748033e-20\t-8.0183947086334229e-1\t8.0183947086334229e-1\t1.0000000000000000e+0\t3.8985999999999999e-3\n\t[25223\]\t-3.5574635863304138e-1\t-8.3769923448562622e-1\t4.8195287585258484e-1\t5.7532925423826975e-1\t3.8985999999999999e-3\n\tMax AbsError of 8.0183947086334229e-1 at index of 25222.\n\tMax RelError of 1.0000000000000000e+0 at index of 25222.\n]
expected: FAIL
[X Stitched sine-wave buffers at sample rate 43800 does not equal [0,0.06264832615852356,0.12505052983760834,0.18696144223213196,0.24813786149024963,0.308339387178421,0.36732959747314453,0.4248766601085663,0.480754554271698,0.5347436666488647,0.5866320133209229,0.6362156271934509,0.6832997798919678,0.7276994585990906,0.7692402601242065,0.8077589869499207...\] with an element-wise tolerance of {"absoluteThreshold":0.0038986,"relativeThreshold":0}.\n\tIndex\tActual\t\t\tExpected\t\tAbsError\t\tRelError\t\tTest threshold\n\t[25222\]\t-3.0277793773115589e+31\t-8.0183947086334229e-1\t3.0277793773115589e+31\t3.7760418229992375e+31\t3.8985999999999999e-3\n\t[25223\]\t-3.5574635863304138e-1\t-8.3769923448562622e-1\t4.8195287585258484e-1\t5.7532925423826975e-1\t3.8985999999999999e-3\n\tMax AbsError of 3.0277793773115589e+31 at index of 25222.\n\tMax RelError of 3.7760418229992375e+31 at index of 25222.\n]
expected: FAIL
[X SNR (-586.1883985880588 dB) is not greater than or equal to 65.737. Got -586.1883985880588.]
expected: FAIL

View file

@ -1,4 +1,5 @@
[003.html]
expected: ERROR
[shared]
expected: FAIL

View file

@ -429559,7 +429559,7 @@
]
],
"focus-visible-007.html": [
"9a88a6bb9f0b05825d6735f180f2e7a22063a658",
"3b7abf7646222134e80c5ecf3f518d0a5cf80abf",
[
null,
{
@ -429608,6 +429608,15 @@
}
]
],
"focus-visible-013.html": [
"11cf4d7216a61bc833e4788975252c5829dfc884",
[
null,
{
"testdriver": true
}
]
],
"focus-visible-014.html": [
"6a4aef6e2bdf3c277b52ddb50679bc240b4cf744",
[
@ -429633,6 +429642,22 @@
}
]
],
"focus-visible-017.html": [
"21b7528f4e060a945ec74d5bf5cf40ea7059246a",
[
null,
{}
]
],
"focus-visible-018.html": [
"3f3ea8832c0bf798374e692d26478e05d0888f77",
[
null,
{
"testdriver": true
}
]
],
"focus-within-009.html": [
"c8d47d2df0aa350aaedbc77f9d70db5a5aa893e8",
[
@ -553173,7 +553198,7 @@
]
],
"audio-encoder.any.js": [
"16729935771c810eb8de71ffef5c5c13b51bbfab",
"8b918dc0ba0a686cda04b3bdf05f77fba1a931b0",
[
"webcodecs/audio-encoder.any.html",
{

View file

@ -0,0 +1,4 @@
[hit-test-floats-003.html]
[Miss float below something else]
expected: FAIL

View file

@ -0,0 +1,4 @@
[hit-test-floats-004.html]
[Miss float below something else]
expected: FAIL

View file

@ -1,2 +0,0 @@
[trailing-other-space-separators-break-spaces-008.html]
expected: FAIL

View file

@ -2,6 +2,3 @@
[Hit test intersecting scaled box]
expected: FAIL
[Hit test within unscaled box]
expected: FAIL

View file

@ -8,3 +8,6 @@
[throws if handleEvent is thruthy and not callable]
expected: FAIL
[looks up handleEvent method on every event dispatch]
expected: FAIL

View file

@ -21,6 +21,3 @@
[test the top of layer]
expected: FAIL
[test some point of the element: top left corner]
expected: FAIL

View file

@ -1,4 +0,0 @@
[elementsFromPoint-invalid-cases.html]
[The root element is the last element returned for otherwise empty queries within the viewport]
expected: FAIL

View file

@ -0,0 +1,7 @@
[focus-visible-017.html]
[By default initial programatic focus matches ':focus-visible', so the element shows a focus ring with 'outline-style: auto']
expected: FAIL
[":focus-visible" should be a valid selector]
expected: FAIL

View file

@ -315,9 +315,6 @@
[<iframe>: separate response Content-Type: text/html;x=" text/plain]
expected: FAIL
[<iframe>: combined response Content-Type: text/html;" text/plain]
expected: FAIL
[<iframe>: combined response Content-Type: text/html;charset=gbk text/plain text/html]
expected: FAIL
@ -330,6 +327,12 @@
[<iframe>: combined response Content-Type: text/html */*;charset=gbk]
expected: FAIL
[<iframe>: separate response Content-Type: text/html;" \\" text/plain]
[<iframe>: separate response Content-Type: text/html;" text/plain]
expected: FAIL
[<iframe>: separate response Content-Type: text/plain */*]
expected: FAIL
[<iframe>: combined response Content-Type: text/html;" \\" text/plain]
expected: FAIL

View file

@ -53,6 +53,9 @@
[combined text/javascript ]
expected: FAIL
[separate text/javascript x/x]
[separate text/javascript;charset=windows-1252 error text/javascript]
expected: FAIL
[separate text/javascript;charset=windows-1252 text/javascript]
expected: FAIL

View file

@ -1,4 +0,0 @@
[traverse_the_history_1.html]
[Multiple history traversals from the same task]
expected: FAIL

View file

@ -0,0 +1,4 @@
[traverse_the_history_4.html]
[Multiple history traversals, last would be aborted]
expected: FAIL

View file

@ -1,2 +0,0 @@
[cross-origin-objects-on-new-window.html]
expected: TIMEOUT

View file

@ -1,5 +1,4 @@
[embedded-opener-remove-frame.html]
expected: CRASH
[opener and "removed" embedded documents]
expected: FAIL

View file

@ -1,6 +1,5 @@
[iframe_sandbox_popups_escaping-3.html]
type: testharness
expected: TIMEOUT
[Check that popups from a sandboxed iframe escape the sandbox if\n allow-popups-to-escape-sandbox is used]
expected: TIMEOUT
expected: FAIL

View file

@ -1,6 +1,6 @@
[iframe_sandbox_popups_nonescaping-2.html]
type: testharness
expected: TIMEOUT
expected: CRASH
[Check that popups from a sandboxed iframe do not escape the sandbox]
expected: NOTRUN

View file

@ -1,5 +1,5 @@
[iframe_sandbox_popups_nonescaping-3.html]
expected: CRASH
expected: TIMEOUT
[Check that popups from a sandboxed iframe do not escape the sandbox]
expected: NOTRUN

View file

@ -1,4 +0,0 @@
[form-double-submit-2.html]
[preventDefault should allow onclick submit() to succeed]
expected: FAIL

View file

@ -8,69 +8,48 @@
[input type url: selectionStart out of range a second time (must not fire select)]
expected: FAIL
[input type tel: setRangeText() a second time (must not fire select)]
expected: FAIL
[input type search: setSelectionRange out of range a second time (must not fire select)]
expected: FAIL
[input type password: selectionEnd a second time (must not fire select)]
expected: FAIL
[input type url: setSelectionRange out of range a second time (must not fire select)]
expected: FAIL
[textarea: selectionDirection a second time (must not fire select)]
expected: FAIL
[input type url: selectionEnd a second time (must not fire select)]
expected: FAIL
[input type text: setSelectionRange out of range a second time (must not fire select)]
expected: FAIL
[input type text: selectionEnd out of range a second time (must not fire select)]
expected: FAIL
[input type search: selectionEnd a second time (must not fire select)]
expected: FAIL
[input type tel: setSelectionRange out of range a second time (must not fire select)]
expected: FAIL
[input type password: selectionStart out of range a second time (must not fire select)]
expected: FAIL
[input type search: selectionStart a second time (must not fire select)]
expected: FAIL
[input type password: selectionStart a second time (must not fire select)]
expected: FAIL
[input type url: selectionEnd out of range a second time (must not fire select)]
expected: FAIL
[input type search: setSelectionRange() a second time (must not fire select)]
expected: FAIL
[textarea: selectionStart a second time (must not fire select)]
expected: FAIL
[input type tel: selectionDirection a second time (must not fire select)]
expected: FAIL
[input type tel: setSelectionRange() a second time (must not fire select)]
expected: FAIL
[input type password: setRangeText() a second time (must not fire select)]
expected: FAIL
[input type search: selectionEnd out of range a second time (must not fire select)]
[input type password: select() a second time (must not fire select)]
expected: FAIL
[input type url: selectionStart a second time (must not fire select)]
[input type tel: selectionEnd out of range a second time (must not fire select)]
expected: FAIL
[input type tel: selectionStart a second time (must not fire select)]
[input type password: setSelectionRange() a second time (must not fire select)]
expected: FAIL
[input type password: selectionDirection a second time (must not fire select)]
expected: FAIL
[input type search: setRangeText() a second time (must not fire select)]
expected: FAIL

View file

@ -1,4 +0,0 @@
[module-static-import-delayed.html]
[document.write in an imported module]
expected: FAIL

View file

@ -4,6 +4,3 @@
[The incumbent settings object while executing the compiled callback via Web IDL's invoke must be that of the node document]
expected: TIMEOUT
[The entry settings object while executing the compiled callback via Web IDL's invoke must be that of the node document]
expected: TIMEOUT

View file

@ -797,3 +797,9 @@
[X Stitched sine-wave buffers at sample rate 43800 does not equal [0,0.06264832615852356,0.12505052983760834,0.18696144223213196,0.24813786149024963,0.308339387178421,0.36732959747314453,0.4248766601085663,0.480754554271698,0.5347436666488647,0.5866320133209229,0.6362156271934509,0.6832997798919678,0.7276994585990906,0.7692402601242065,0.8077589869499207...\] with an element-wise tolerance of {"absoluteThreshold":0.0038986,"relativeThreshold":0}.\n\tIndex\tActual\t\t\tExpected\t\tAbsError\t\tRelError\t\tTest threshold\n\t[25222\]\t8.3282489238748033e-20\t-8.0183947086334229e-1\t8.0183947086334229e-1\t1.0000000000000000e+0\t3.8985999999999999e-3\n\t[25223\]\t-3.5574635863304138e-1\t-8.3769923448562622e-1\t4.8195287585258484e-1\t5.7532925423826975e-1\t3.8985999999999999e-3\n\tMax AbsError of 8.0183947086334229e-1 at index of 25222.\n\tMax RelError of 1.0000000000000000e+0 at index of 25222.\n]
expected: FAIL
[X Stitched sine-wave buffers at sample rate 43800 does not equal [0,0.06264832615852356,0.12505052983760834,0.18696144223213196,0.24813786149024963,0.308339387178421,0.36732959747314453,0.4248766601085663,0.480754554271698,0.5347436666488647,0.5866320133209229,0.6362156271934509,0.6832997798919678,0.7276994585990906,0.7692402601242065,0.8077589869499207...\] with an element-wise tolerance of {"absoluteThreshold":0.0038986,"relativeThreshold":0}.\n\tIndex\tActual\t\t\tExpected\t\tAbsError\t\tRelError\t\tTest threshold\n\t[25222\]\t-3.0277793773115589e+31\t-8.0183947086334229e-1\t3.0277793773115589e+31\t3.7760418229992375e+31\t3.8985999999999999e-3\n\t[25223\]\t-3.5574635863304138e-1\t-8.3769923448562622e-1\t4.8195287585258484e-1\t5.7532925423826975e-1\t3.8985999999999999e-3\n\tMax AbsError of 3.0277793773115589e+31 at index of 25222.\n\tMax RelError of 3.7760418229992375e+31 at index of 25222.\n]
expected: FAIL
[X SNR (-586.1883985880588 dB) is not greater than or equal to 65.737. Got -586.1883985880588.]
expected: FAIL

View file

@ -1,5 +1,6 @@
[003.html]
type: testharness
expected: ERROR
[shared]
expected: FAIL

View file

@ -11,7 +11,7 @@
<script src="/resources/testdriver-vendor.js"></script>
<style>
[data-hadkeydown] :focus-visible {
outline: darkgreen solid 5px;
outline: green solid 5px;
}
[data-hadmousedown] :focus-visible {
@ -20,12 +20,12 @@
[data-hadkeydown] :focus:not(:focus-visible) {
outline: 0;
background-color: tomato;
background-color: red;
}
[data-hadmousedown] :focus:not(:focus-visible) {
outline: 0;
background-color: darkseagreen;
background-color: lime;
}
</style>
@ -34,16 +34,13 @@
This test checks that using the keyboard in a way that does not move focus still causes <code>:focus-visible</code> matching to trigger.
<ol id="instructions">
<li>If the user-agent does not claim to support the <code>:focus-visible</code> pseudo-class then SKIP this test.</li>
<li>Use the mouse to focus the element below that says "Click me first."</li>
<li>Use the mouse to focus the element below that says "Click me."</li>
<li>If the element has a red outline, then the test result is FAILURE.</li>
<li>Press the SHIFT key.</li>
<li>If the element now has a red background, then the test result is FAILURE.</li>
<li>Use the mouse to click the element below that says "Click me second."</li>
<li>If the element has a green background, the test result is SUCCESS.</li>
<li>If the element now has a green outline and not red background, then the test result is SUCCESS.</li>
</ol>
<div id="one" tabindex="0">Click me first.</div>
<div id="two" tabindex="0">Click me second.</div>
<div id="one" tabindex="0">Click me.</div>
<script>
document.body.addEventListener("keydown", (e) => {
delete document.body.dataset.hadmousedown;
@ -56,51 +53,29 @@
}, true);
async_test(function(t) {
let tested_modality_change = false;
let tested_modality_unchanged_by_mouse_click = false;
let tested_mouse_focus_after_modality_change = false;
let tested_initial_focus = false;
// TODO(crbug.com/828858): Remove this check once bug is resolved.
test_driver.send_keys(document.body, "\uE050").then(t.step_func(() => {
const handle_initial_focus = t.step_func(() => {
one.addEventListener("keyup", t.step_func(test_modality_change));
one.removeEventListener("focus", handle_initial_focus);
const handle_initial_focus = t.step_func(() => {
tested_initial_focus = true;
assert_equals(getComputedStyle(one).backgroundColor, "rgb(0, 255, 0)");
assert_not_equals(getComputedStyle(one).outlineColor, "rgb(255, 0, 0)");
test_driver.send_keys(one, "\uE050");
});
one.addEventListener("keyup", t.step_func(test_modality_change));
one.removeEventListener("focus", handle_initial_focus);
const test_modality_change = t.step_func(() => {
assert_equals(getComputedStyle(one).outlineColor, "rgb(59, 153, 252)");
tested_modality_change = true;
one.removeEventListener("keyup", test_modality_change);
one.addEventListener("click", test_modality_unchanged_by_mouse_click);
test_driver.click(one);
});
test_driver.send_keys(one, "\uE050");
});
const test_modality_unchanged_by_mouse_click = t.step_func(() => {
assert_true(tested_modality_change);
assert_equals(getComputedStyle(one).outlineColor, "rgb(59, 153, 252)");
tested_modality_unchanged_by_mouse_click = true;
one.removeEventListener("click", test_modality_unchanged_by_mouse_click);
two.addEventListener("focus", test_mouse_focus_after_modality_change);
test_driver.click(two);
});
const test_mouse_focus_after_modality_change = t.step_func(() => {
assert_true(tested_modality_unchanged_by_mouse_click);
assert_false("hadkeydown" in document.body.dataset);
assert_equals(getComputedStyle(two).outlineColor, "rgb(59, 153, 252)");
tested_mouse_focus_after_modality_change = true;
t.done();
});
one.addEventListener("focus", handle_initial_focus);
test_driver.click(one);
})).catch(t.step_func((e) => {
// TODO(crbug.com/828858): Remove this check once bug is resolved.
assert_true(false, "send_keys not implemented yet");
const test_modality_change = t.step_func(() => {
assert_true(tested_initial_focus);
one.removeEventListener("keyup", test_modality_change);
assert_equals(getComputedStyle(one).outlineColor, "rgb(0, 128, 0)");
assert_not_equals(getComputedStyle(one).backgroundColor, "rgb(255, 0, 0)");
t.done();
}));
});
one.addEventListener("focus", handle_initial_focus);
test_driver.click(one);
}, "Using keyboard while element is focused should trigger :focus-visible; using mouse without moving focus should not cancel it; moving focus using mouse should cancel it.");
</script>
</body>

View file

@ -0,0 +1,60 @@
<!DOCTYPE html>
<meta charset="utf-8" />
<title>CSS Selectors Test: :focus-visible does not match after mouse focus even if previous focused element was matching :focus-visible</title>
<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com">
<link rel="help" href="https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo" />
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<style>
@supports not (selector(:focus-visible)) {
:focus {
outline: red solid 5px;
}
}
#initial:focus-visible {
outline: green solid 5px;
}
#initial:focus:not(:focus-visible) {
outline: red solid 5px;
}
#target:focus-visible {
outline: red solid 5px;
}
#target:focus:not(:focus-visible) {
outline: green solid 5px;
}
</style>
<p>This test checks that if the active element matches ':focus-visible' and a mouse click causes focus to move elsewhere, the newly focused element should not match <code>:focus-visible</code>.</p>
<ol id="instructions">
<li>If the user-agent does not claim to support the <code>:focus-visible</code> pseudo-class then SKIP this test.</li>
<li>Press the TAB key.</li>
<li>If the element that says "Initial" has a red outline, then the test rsult is a FAILURE.</li>
<li>Use the mouse to focus the element below that says "Target".</li>
<li>If the element that says "Target" has a green outline, then the test result is a SUCCESS.</li>
</ol>
<div id="initial" tabindex="0">Initial</div>
<div id="target" tabindex="0">Target</div>
<script>
async_test(function(t) {
initial.addEventListener("focus", t.step_func(function() {
assert_equals(getComputedStyle(initial).outlineColor, "rgb(0, 128, 0)", `outlineColor for ${initial.tagName}#${initial.id} should be green`);
test_driver.click(target);
}));
target.addEventListener("focus", t.step_func_done(function() {
assert_equals(getComputedStyle(target).outlineColor, "rgb(0, 128, 0)", `outlineColor for ${target.tagName}#${target.id} should be green`);
}));
const tab_key = '\ue004';
test_driver.send_keys(document.body, tab_key);
}, ":focus-visible does not match after mouse click even if previous focused element was matching :focus-visible");
</script>

View file

@ -0,0 +1,44 @@
<!DOCTYPE html>
<meta charset="utf-8" />
<title>CSS Test (Selectors): By default initial programatic focus matches :focus-visible and it shows an auto focus ring</title>
<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com">
<link rel="help" href="https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo" />
<link rel="help" href="https://html.spec.whatwg.org/#phrasing-content-3" />
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/parsing-testcommon.js"></script>
<style>
#warning {
display: none;
background: red;
}
@supports not (selector(:focus-visible)) {
#instructions {
display: none;
}
#warning {
display: block;
}
}
</style>
<p>This test checks that by default, if using JavaScript to focus an element triggers <code>:focus-visible</code> matching, then the element should show a focus ring with <code>outline-style: auto</code>.</p>
<ol id="instructions">
<li>If the element below that says "Target" show a focus ring with <code>outline-style: auto</code>, then the test result is SUCCESS.</li>
</ol>
<p id="warning">Your user-agent does not support <code>:focus-visible</code> pseudo-class, please SKIP this test.</p>
<div id="target" tabindex="0">Target</div>
<script>
// Check that :focus-visible is supported.
test_valid_selector(':focus-visible');
async_test(function(t) {
target.addEventListener("focus", t.step_func(function() {
assert_equals(getComputedStyle(target).outlineStyle, "auto", `outline-style for ${target.tagName}#${target.id} should be auto`);
t.done();
}));
target.focus();
}, "By default initial programatic focus matches ':focus-visible', so the element shows a focus ring with 'outline-style: auto'");
</script>

View file

@ -0,0 +1,49 @@
<!DOCTYPE html>
<meta charset="utf-8" />
<title>CSS Test (Selectors): Mouse focus does not show a focus ring by default</title>
<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com">
<link rel="help" href="https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo" />
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-actions.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script src="/css/support/parsing-testcommon.js"></script>
<style>
#warning {
display: none;
background: red;
}
@supports not (selector(:focus-visible)) {
#instructions {
display: none;
}
#warning {
display: block;
}
}
</style>
<p>This test checks that by default, using the mouse to focus a generic element does not show a focus ring (because it does not trigger <code>:focus-visible</code> matching).</p>
<ol id="instructions">
<li>Click on the element below that says "Click me."</li>
<li>If the element does not have a focus ring, then the test result is SUCCESS.</li>
</ol>
<p id="warning">Your user-agent does not support <code>:focus-visible</code> pseudo-class, please SKIP this test.</p>
<div id="target" tabindex="0">Click me.</div>
<script>
setup({ explicit_done: true });
// Check that :focus-visible is supported.
test_valid_selector(':focus-visible');
async_test(function(t) {
target.addEventListener("focus", t.step_func(function() {
assert_equals(getComputedStyle(target).outlineStyle, "none", `outline-style for ${target.tagName}#${target.id} should be none`);
t.done();
}));
test_driver.click(target).then(() => done());
}, "Mouse focus does not show a focus ring by default");
</script>

View file

@ -25,7 +25,9 @@ function make_audio_frame(timestamp, channels, sampleRate, length) {
}
promise_test(async t => {
let frame_count = 100;
let sample_rate = 48000;
let total_duration_s = 2;
let frame_count = 20;
let outputs = [];
let init = {
error: e => {
@ -41,27 +43,28 @@ promise_test(async t => {
assert_equals(encoder.state, "unconfigured");
let config = {
codec: 'opus',
sampleRate: 48000,
sampleRate: sample_rate,
numberOfChannels: 2,
bitrate: 256000 //256kbit
};
encoder.configure(config);
let timestamp = 0;
let timestamp_us = 0;
for (let i = 0; i < frame_count; i++) {
// one tenth of a seconds per frame
let length = config.sampleRate / 10;
timestamp += 100_000;
let frame = make_audio_frame(timestamp, config.numberOfChannels,
let frame_duration_s = total_duration_s / frame_count;
let length = frame_duration_s * config.sampleRate;
let frame = make_audio_frame(timestamp_us, config.numberOfChannels,
config.sampleRate, length);
encoder.encode(frame);
timestamp_us += frame_duration_s * 1_000_000;
}
await encoder.flush();
encoder.close();
assert_greater_than_equal(outputs.length, frame_count);
assert_equals(outputs[0].timestamp, 0, "first chunk timestamp");
for (chunk of outputs) {
assert_greater_than(chunk.data.byteLength, 0);
assert_greater_than(timestamp, chunk.timestamp);
assert_greater_than(timestamp_us, chunk.timestamp);
}
}, 'Simple audio encoding');