[go: nahoru, domu]

blob: 474d5c087a66ae5ae46e377898a3759652af32e7 [file] [log] [blame]
Vladimir Levin7c5d9fe2020-03-06 18:12:501<!doctype HTML>
2<html>
3<meta charset="utf8">
Vladimir Levin265a2582020-05-04 21:14:334<title>Content Visibility: focus on new element</title>
5<link rel="author" title="Rakina Zata Amni" href="mailto:rakina@chromium.org">
Vladimir Levin458dc852020-06-09 18:29:336<link rel="help" href="https://drafts.csswg.org/css-contain/#content-visibility">
Vladimir Levin265a2582020-05-04 21:14:337<meta name="assert" content="focus can target content-visibility: auto subtrees created while hidden">
Vladimir Levin7c5d9fe2020-03-06 18:12:508
Vladimir Levin122b1102020-01-16 17:49:279<script src="/resources/testharness.js"></script>
10<script src="/resources/testharnessreport.js"></script>
Vladimir Levin265a2582020-05-04 21:14:3311
12<style>
13.auto {
14 content-visibility: auto;
15}
16.spacer {
17 height: 3000px;
18}
19</style>
20
21<div class=spacer></div>
22<div id=container class=auto></div>
Vladimir Levin122b1102020-01-16 17:49:2723
24<script>
Vladimir Levin265a2582020-05-04 21:14:3325async_test((t) => {
26 function runTest() {
27 const focusable = document.createElement("div");
28 focusable.tabIndex = 0;
29 container.appendChild(focusable);
30 focusable.focus();
Chromium WPT Synccb7665f22023-08-06 16:32:3231 step_timeout(finish, 0);
32 }
33 function finish() {
34 t.step(() => assert_greater_than(document.scrollingElement.scrollTop, 500));
35 t.done();
Vladimir Levin265a2582020-05-04 21:14:3336 }
37 onload = requestAnimationFrame(() => requestAnimationFrame(runTest));
38}, "Using tabindex to focus an newly constructed element in an auto subtree focuses element");
Vladimir Levin122b1102020-01-16 17:49:2739</script>
Vladimir Levin265a2582020-05-04 21:14:3340</html>