Skip to content

Use origin of source document for MessageEvent resulting from postMessage #22888

@jdm

Description

@jdm

Right now Window::post_message passes None as the value that will initialize MessageEvent.origin. The spec says this should be the origin of the source document that posted the message instead. We will want to add a new origin argument to Window::post_message, and store the origin in ScriptMsg::PostMessage as well so the code path in DissimilarOriginWindow::post_message also works.

This should allow tests/wpt/web-platform-tests/dom/events/EventListener-incumbent-global-1.sub.html to make more progress.

Code: components/script/dom/window.rs, components/script/dom/dissimilaroriginwindow.rs, components/script/script_thread.rs, components/script_traits/lib.rs
Test: ./mach test-wpt tests/wpt/web-platform-tests/dom/events/EventListener-incumbent-global-1.sub.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-content/domInteracting with the DOM from web contentC-assignedThere is someone working on resolving the issueE-more-complexVariable effort required; may require a mentor. Recommended solution is clearly described in the iss

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions