Closed Bug 1850251 Opened 1 year ago Closed 1 year ago

[wpt-sync] Sync PR 41653 - Rationalize the behavior of SupportsFocus, Is{keybd|mouse}Focusable

Categories

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

task

Tracking

()

RESOLVED FIXED
119 Branch
Tracking Status
firefox119 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

(Blocks 1 open bug, )

Details

(Whiteboard: [wptsync downstream])

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

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

Mason Freed <masonf@chromium.org> wrote:

Rationalize the behavior of SupportsFocus, Is{keybd|mouse}Focusable

This CL cleans up three functions in Element:

  • SupportsFocus: true if the element is capable of being focused. An
    element supports focus if, e.g. it has a tabindex attribute, or it is
    editable, or other conditions. Note that the element might support
    focus while not being focusable, for example if the element is
    disconnected from the document.

  • IsMouseFocusable: true if the element SupportsFocus() and is
    currently focusable using the mouse.

  • IsKeyboardFocusable: true if the element IsMouseFocusable(), and
    is currently focusable using the keyboard.

Note that each method is a subset of the one above it, by
construction.

This also adds IsScrollableContainerThatShouldBeKeyboardFocusable(),
which returns true for scrollers that should be made keyboard focusable if the feature flag for that behavior is enabled.

This also adds a DocumentLifecycle::DisallowTransitionScope to
make sure SupportsFocus() does not update the rendering lifecycle.

Note crbug.com/1474971 and the new baselines for the
video-playback-speed-menu.html test. That focus ring was there due
to a confluence of weirdness in the media controls code, and that
will need to be tackled separately, if desired. The new behavior
might also be ok.

Note that accessibility code is using SupportsFocus() to mean
IsFocusable(), but prior to this CL, there were cases in which
SupportsFocus() returned false and yet IsFocusable() returned
true. That has been fixed in this CL everywhere except a11y code,
which still uses SupportsFocus(). In addition, to avoid breaking
a11y code, SupportsFocus() is still not calling the new
IsScrollableContainerThatShouldBeKeyboardFocusable() method, which
means for focusable scrollers, SupportsFocus will be false while
IsFocusable() will be true. This will be fixed in a followup
CL [2].

This patch borrows heavily from [1].

[1] https://chromium-review.googlesource.com/c/chromium/src/+/4518938
[2] https://chromium-review.googlesource.com/c/chromium/src/+/4813829

Bug: 1444450, 1474971
Change-Id: Ieeb5f0bde2cf2130c19cd15df1bf4f9c0aa21e19
Reviewed-on: https://chromium-review.googlesource.com/4795287
WPT-Export-Revision: 48622fb5edccc435f64a5c9a3cd805cd5d5c4a1d

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

CI Results

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

Total 1 tests and 6 subtests

Status Summary

Firefox

OK : 1
PASS : 1[Gecko-android-em-7.0-x86_64-lite-qr-opt-geckoview, Gecko-android-em-7.0-x86_64-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-qr-opt-geckoview] 3[Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-qr-opt, Gecko-windows11-32-2009-qr-debug, Gecko-windows11-32-2009-qr-opt, Gecko-windows11-64-2009-qr-debug, Gecko-windows11-64-2009-qr-opt]
FAIL : 3[Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-qr-opt, Gecko-windows11-32-2009-qr-debug, Gecko-windows11-32-2009-qr-opt, Gecko-windows11-64-2009-qr-debug, Gecko-windows11-64-2009-qr-opt] 5[Gecko-android-em-7.0-x86_64-lite-qr-opt-geckoview, Gecko-android-em-7.0-x86_64-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-qr-opt-geckoview]
TIMEOUT: 2
NOTRUN : 5

Chrome

ERROR : 1

Safari

PASS : 1
TIMEOUT: 2
NOTRUN : 4

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

  • /dom/events/scrolling/scrollend-event-fires-to-iframe-window.html [wpt.fyi]: OK [Gecko-android-em-7.0-x86_64-lite-qr-opt-geckoview, Gecko-android-em-7.0-x86_64-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-qr-opt-geckoview, Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-qr-opt, Gecko-windows11-32-2009-qr-debug, Gecko-windows11-32-2009-qr-opt, Gecko-windows11-64-2009-qr-debug, Gecko-windows11-64-2009-qr-opt], TIMEOUT [GitHub] (Chrome: ERROR, Safari: TIMEOUT)
    • Tests that the target_div within iframe gets scrollend event when touch dragging.: FAIL [Gecko-android-em-7.0-x86_64-lite-qr-opt-geckoview, Gecko-android-em-7.0-x86_64-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-qr-opt-geckoview, Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-qr-opt, Gecko-windows11-32-2009-qr-debug, Gecko-windows11-32-2009-qr-opt, Gecko-windows11-64-2009-qr-debug, Gecko-windows11-64-2009-qr-opt], TIMEOUT [GitHub] (Safari: PASS)
    • Tests that the target_div within iframe gets scrollend event when clicking scrollbar.: FAIL [Gecko-android-em-7.0-x86_64-lite-qr-opt-geckoview, Gecko-android-em-7.0-x86_64-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-qr-opt-geckoview], NOTRUN [GitHub], PASS [Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-qr-opt, Gecko-windows11-32-2009-qr-debug, Gecko-windows11-32-2009-qr-opt, Gecko-windows11-64-2009-qr-debug, Gecko-windows11-64-2009-qr-opt] (Safari: TIMEOUT)
    • Tests that the target_div within iframe gets scrollend event when dragging the scrollbar thumb.: FAIL [Gecko-android-em-7.0-x86_64-lite-qr-opt-geckoview, Gecko-android-em-7.0-x86_64-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-qr-opt-geckoview], NOTRUN [GitHub], PASS [Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-qr-opt, Gecko-windows11-32-2009-qr-debug, Gecko-windows11-32-2009-qr-opt, Gecko-windows11-64-2009-qr-debug, Gecko-windows11-64-2009-qr-opt] (Safari: NOTRUN)
    • Tests that the target_div within iframe gets scrollend event when mouse wheel scrolling.: FAIL [Gecko-android-em-7.0-x86_64-lite-qr-opt-geckoview, Gecko-android-em-7.0-x86_64-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-qr-opt-geckoview, Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-qr-opt, Gecko-windows11-32-2009-qr-debug, Gecko-windows11-32-2009-qr-opt, Gecko-windows11-64-2009-qr-debug, Gecko-windows11-64-2009-qr-opt], NOTRUN [GitHub] (Safari: NOTRUN)
    • Tests that the target_div within iframe gets scrollend event when sending DOWN key to the target.: NOTRUN [GitHub], PASS [Gecko-android-em-7.0-x86_64-lite-qr-opt-geckoview, Gecko-android-em-7.0-x86_64-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-qr-opt-geckoview, Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-qr-opt, Gecko-windows11-32-2009-qr-debug, Gecko-windows11-32-2009-qr-opt, Gecko-windows11-64-2009-qr-debug, Gecko-windows11-64-2009-qr-opt] (Safari: NOTRUN)
    • scrollend fires to iframe window on mousewheelscroll: FAIL [Gecko-android-em-7.0-x86_64-lite-qr-opt-geckoview, Gecko-android-em-7.0-x86_64-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-qr-opt-geckoview, Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-qr-opt, Gecko-windows11-32-2009-qr-debug, Gecko-windows11-32-2009-qr-opt, Gecko-windows11-64-2009-qr-debug, Gecko-windows11-64-2009-qr-opt], NOTRUN [GitHub] (Safari: NOTRUN)
Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/f81d27761edc [wpt PR 41653] - Rationalize the behavior of SupportsFocus, Is{keybd|mouse}Focusable, a=testonly
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 119 Branch
You need to log in before you can comment on or make changes to this bug.