Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: call setIsTrusted for generated events (MessageEvent) #19919

Merged
merged 3 commits into from
Jul 31, 2023

Conversation

corrideat
Copy link
Contributor

This addresses issue #19918.

Issue description

Event messages have the wrong isTrusted value when they are not triggered by user interaction, which differs from the browser. In particular, all MessageEvents created by Deno have isTrusted set to false, even though it should be true.

This is my first ever contribution to Deno, so I might be missing something.

@CLAassistant
Copy link

CLAassistant commented Jul 23, 2023

CLA assistant check
All committers have signed the CLA.

@corrideat
Copy link
Contributor Author

The automated tests fail here:

expected test failures that passed:

        "/webmessaging/MessageEvent-trusted.any.html - With a MessageChannel and its MessagePorts"
        "/webmessaging/MessageEvent-trusted.any.html - With a BroadcastChannel"
        "/webmessaging/MessageEvent-trusted.any.worker.html - With a MessageChannel and its MessagePorts"
        "/webmessaging/MessageEvent-trusted.any.worker.html - With a BroadcastChannel"

I believe that those tests are supposed to pass with this change. The corresponding lines in tools/wpt/expectation.json are:

    "MessageEvent-trusted.any.html": false,
    "MessageEvent-trusted.any.worker.html": false,

Should I update these as well in the PR, or is there a reason for them to be supposed to fail?

@bartlomieju
Copy link
Member

No other reason besides it wasn't implemented :) you should update these entries to true to make WPT test suite happy.

@bartlomieju bartlomieju added this to the 1.36 milestone Jul 31, 2023
Copy link
Member

@crowlKats crowlKats left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks

@crowlKats crowlKats merged commit 9840369 into denoland:main Jul 31, 2023
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants