https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 3fed6eade6b0e342edd1f074adabd1b2ff76f1e1 authored by Hwanseung Lee on 14 March 2018, 01:43:17 UTC
[css-typed-om] support break-after, break-before, break-inside
Tip revision: 3fed6ea
first-when-later-but-before.html
<!DOCTYPE html>
<meta charset="utf-8">
<title>The temporally first autofocus in the document wins, even if an element is inserted later that is previous in the document tree</title>
<link rel="help" href="https://html.spec.whatwg.org/multipage/#autofocusing-a-form-control:-the-autofocus-attribute">
<link rel="author" title="Domenic Denicola" href="d@domenic.me">

<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>

<input autofocus>

<script>
"use strict";

const input1 = document.querySelector("input");

const input2 = document.createElement("input");
input2.autofocus = true;
document.body.prepend(input2);

step_timeout(() => {
    assert_equals(document.activeElement, input1);
    assert_not_equals(document.activeElement, input2);

    done();
}, 100);
</script>
back to top