Closed Bug 2076811 Opened 1 month ago Closed 1 month ago

[wpt-sync] Sync PR 63110 - HTML: fix event handlers and no browsing context

Categories

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

task

Tracking

()

RESOLVED FIXED
160 Branch
Tracking Status
firefox160 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

Anne van Kesteren <annevk@annevk.nl> wrote:

HTML: fix event handlers and no browsing context

The event handler IDL attribute setter is not affected by the lack of a browsing context. Determining the target of an event handler returns the event target itself unless it is a body or frameset element whose name is a WindowEventHandlers member or in the Window-reflecting body element event handler set, so for a div it never returns null.

That is what implementations do, and event-handler-attributes-windowless-body.html already asserts as much for handlers that are not shadowed, on a windowless body element in a DOMParser document — so these two files currently contradict each other.

Also:

  • The content attribute body assigned to a local variable of run_checks that it cannot see, so the handler running would have gone unnoticed.
  • new Document() is an XML document, so innerHTML used the XML fragment parsing algorithm and left the div in no namespace, where it has no onclick IDL attribute at all.

Follow-up to #56715, see https://github.com/whatwg/html/issues/12014.

/cc @zcorpan

PR 63110 applied with additional changes from upstream: e6ba3d7abea784a1f03347bccaad76e7a6347eae

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

CI Results

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

Total 51 tests and 1 subtests

Status Summary

Firefox

OK : 1[GitHub] 48[Gecko-windows11-32-25h2-debug, Gecko-windows11-64-25h2-debug] 49[Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-opt, Gecko-windows11-64-25h2-opt] 50[Gecko-linux2404-64-debug] 51[Gecko-android-em-14-x86_64-debug-geckoview]
PASS : 1194[Gecko-android-em-14-x86_64-lite-opt-geckoview] 1195[Gecko-android-em-14-x86_64-opt-geckoview, Gecko-windows11-32-25h2-debug, Gecko-windows11-64-25h2-debug] 1328[Gecko-linux2404-64-opt, Gecko-windows11-64-25h2-opt] 1463[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-linux2404-64-debug]
FAIL : 3[GitHub] 29[Gecko-windows11-32-25h2-debug, Gecko-windows11-64-25h2-debug] 30[Gecko-android-em-14-x86_64-opt-geckoview] 31[Gecko-android-em-14-x86_64-lite-opt-geckoview] 35[Gecko-linux2404-64-opt, Gecko-windows11-64-25h2-opt] 39[Gecko-linux2404-64-debug] 40[Gecko-android-em-14-x86_64-debug-geckoview]
ERROR: 1[Gecko-linux2404-64-opt, Gecko-windows11-64-25h2-opt] 2[Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-windows11-32-25h2-debug, Gecko-windows11-64-25h2-debug]

Chrome

OK : 1
FAIL : 3

Safari

OK : 1
FAIL : 3

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

Tests Disabled in Gecko Infrastructure

Status: NEW → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 160 Branch
You need to log in before you can comment on or make changes to this bug.