script: Distinguish between sequential (keyboard) and click focusability (#43019)

This changes makes it so that keyboard and click focusability are two
separate concepts in `script`. Some elements may be focusable only by
the keyboard and some only by the click events.

In addition, the `SEQUENTIALLY_FOCUSABLE` `Node` flag is removed in
favor of a
more specification-aligned approach of checking lazily if an element is
a focusable area. This allows moving the focus fixup steps to their
correct place, asynchronously during "update the rendering" and
synchronously during `unbind_from_tree`.

Testing: This causes some WPT tests to start passing and some to start
failing:
- Two subtests tests in
`tests/wpt/meta/css/css-conditional/container-queries/` because
we do not implement support for container queries. These are legitimate
failures
   and they are compensated by a good subtest pass in the same file.
- A few subtests in `/html/interaction/focus/tabindex-focus-flag.html`
because now
we do not allow focusing non-rendering elements. The failures are HTML
elements with
`<svg>` which we do not rendering and `<summary>` elements of
`<details>` which
   need special handling we do not implement yet.
- `html/semantics/forms/the-fieldset-element/disabled-003.html`: Some of
these tests
start to fail, but they are not spec compliant and browser properly
implementing
   the asynchronous focus fixup rule also fail them. 

Fixes: #31870.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
Martin Robinson
2026-03-05 09:58:59 +01:00
committed by GitHub
parent 6a98cdc37d
commit b47b39f974
34 changed files with 232 additions and 297 deletions

View File

@@ -620,7 +620,6 @@ impl VirtualMethods for HTMLTextAreaElement {
}
},
}
el.update_sequentially_focusable_status(CanGc::note());
},
local_name!("maxlength") => match *attr.value() {
AttrValue::Int(_, value) => {