Closed Bug 1751434 Opened 4 years ago Closed 3 years ago

[wpt-sync] Sync PR 32494 - [inert] EnsureComputedStyle() for canvas fallback content focusability

Categories

(Core :: DOM: Core & HTML, task, P4)

task

Tracking

()

RESOLVED FIXED
99 Branch
Tracking Status
firefox99 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

(Depends on 1 open bug, )

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 32494 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/32494
Details from upstream follow.

Oriol Brufau <obrufau@igalia.com> wrote:

[inert] EnsureComputedStyle() for canvas fallback content focusability

Elements that are not rendered can still be focusable if they are inside
a canvas that is rendered. However, inertness should still prevent them
from being focusable.

But there is a problem: if they are in a display:none subtree, we won't
have a ComputedStyle to check IsInert(). In that case, the code was
assuming that it wouldn't be inert, but it was not great: forcing the
style computation with getComputedStyle() or other JS APIs could then
make the element be detected as inert, and thus stop being focusable.

This patch makes Element::IsFocusableStyle() use EnsureComputedStyle()
for elements inside a canvas, so that we can know whether they are
actually inert or not.

The problem is that this operation is not const, so a bunch of methods
related to focus need to stop being const.

TEST=external/wpt/inert/inert-canvas-fallback-content.tentative.html

Bug: 692360
Change-Id: Iae979322ac32df7e8ea68255be13be0419c9fc93
Cq-Do-Not-Cancel-Tryjobs: true
Reviewed-on: https://chromium-review.googlesource.com/3395837
WPT-Export-Revision: 68e8d5d6bd9ccc1e21a79391cae3002979fa42ac

Component: web-platform-tests → DOM: Core & HTML
Product: Testing → Core

CI Results

Ran 0 Firefox configurations based on mozilla-central, and Firefox, and Chrome on GitHub CI

Total 6 tests and 12 subtests

Status Summary

Firefox

OK : 6
PASS: 49
FAIL: 3

Chrome

OK : 6
PASS: 25
FAIL: 27

Links

GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

/inert/inert-canvas-fallback-content.tentative.html

  inert `div`
: FAIL (Chrome: PASS)

  inert `span`
: FAIL (Chrome: PASS)

  inert `a`
: FAIL (Chrome: FAIL)
Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/f166703b6010 [wpt PR 32494] - [inert] Fix focusability of canvas descendants, a=testonly
Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/cbd7d2e9ac8b [wpt PR 32494] - [inert] Fix focusability of canvas descendants, a=testonly
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 99 Branch
You need to log in before you can comment on or make changes to this bug.