Closed Bug 1523899 Opened 5 years ago Closed 5 years ago

Dynamic import in HTML event handlers should be relative to the document

Categories

(Core :: DOM: Core & HTML, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
mozilla67
Tracking Status
firefox67 --- fixed

People

(Reporter: jonco, Assigned: jonco)

References

()

Details

Attachments

(2 files)

The spec is changing the original behaviour of using the current script when the handler was compiled as the referencing script to using the null script. As noted, the original behaviour was path dependent and confusing.

To implement this we need to remove the association between newly compiled event handlers and the current active script.

Attachment #9041474 - Flags: review?(bugs)

Test code changes related to the above patch.

I'm planning to get these reviewed via the WPT github repo.

Comment on attachment 9041474 [details] [diff] [review]
bug1523899-event-handler-script

Yes, the old behavior was bizarre.
Do we need the same with setTimeout? Maybe not.
Attachment #9041474 - Flags: review?(bugs) → review+

(In reply to Olli Pettay [:smaug] (massive needinfo queue, ping on IRC on anything urgent) from comment #3)

Do we need the same with setTimeout? Maybe not.

I think the setTimeout behaviour makes sense as it is: the import is relative to the script that sets the timeout.

I'm going to land this with updated test expectations for the tests that will now fail.

I've created a PR for the test updates here: https://github.com/web-platform-tests/wpt/pull/15251

Pushed by jcoppeard@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/4f266277d3b8
Dynamic import in event handlers should be relative to the document r=smaug

There were also wpt failures on IndexedDB/idb-explicit-commit.any.worker.html
Log link: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=226478891&repo=mozilla-inbound&lineNumber=1405

Looks like I messed up updating those test expectations.

Flags: needinfo?(jcoppeard)
Pushed by jcoppeard@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/d49c8904e838
Dynamic import in event handlers should be relative to the document r=smaug
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: