Closed Bug 1637834 Opened 5 years ago Closed 5 years ago

[wpt-sync] Sync PR 23587 - Fix flaky test focus-without-user-activation-tentative.sub.html

Categories

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

task

Tracking

()

RESOLVED INVALID

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

Charlie Hu <chenleihu@google.com> wrote:

Fix flaky test focus-without-user-activation-tentative.sub.html

Previously the test relies on focus event bubble-up from subframe to
main frame to determine whether there is a focus event in subframe.
However, the bubble-up of focus event can be quite unreliable to
observe.

The solution is to directly observe the onfocus event in iframe and
send the result back to main frame using |postMessage|.

Besides, use same origin url for subframe instead of cross origin url,
because otherwise autofocus will be blocked no matter the state of
focus-without-user-activation feature policy (https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/core/dom/element.cc;drc=a2c2b4b601f50fc782d2c5e7e4e089beac30d327;l=530).

Bug: 1067482
Change-Id: Ifaa5120350ac828a0ed04271f795360f71803191

Reviewed-on: https://chromium-review.googlesource.com/2199708
WPT-Export-Revision: 832169d318853a6298b65aea077e8cbb1003ae22

PR 23587 applied with additional changes from upstream: 622c9625dddfdef0c6dfafa8fa00d5119db50201, 5681e96ff1cc7f2516c73f377639011aee94bc26, 540f25e22401fe99e72bf6da2cb1ca1748a8ca4f, 094353fedf808caf83e82b4959b5edf02e1be92e
Component: web-platform-tests → DOM: Core & HTML
Product: Testing → Core
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.