Skip to content

Conversation

Ms2ger
Copy link
Member

@Ms2ger Ms2ger commented Oct 30, 2023

To replace #5339.

(See WHATWG Working Mode: Changes for more details.)

TODO:

  • Prepare PRs for dependent specs to adjust to terminology changes

/browsing-the-web.html ( diff )
/dom.html ( diff )
/embedded-content.html ( diff )
/form-elements.html ( diff )
/index.html ( diff )
/infrastructure.html ( diff )
/media.html ( diff )
/nav-history-apis.html ( diff )
/references.html ( diff )
/scripting.html ( diff )
/structured-data.html ( diff )
/timers-and-user-prompts.html ( diff )
/webappapis.html ( diff )
/workers.html ( diff )

Copy link
Contributor

@nicolo-ribaudo nicolo-ribaudo left a comment

Choose a reason for hiding this comment

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

The changes to the module loading algorithms look ok.

For the record, we (people working on modules in TC39) have some ideas for splitting the stateless and stateful parts of Module Records in ECMA-262. If/once that will happen, it would be great to share a module map for the stateless parts across principal realms and shadow realms, so that basically in this case:

import "/foo";
new ShadowRealm().importValue("/foo", "bar");

we only call into fetch once (to get the stateless part) and then we create the stateful part twice in both realms.

@Ms2ger Ms2ger marked this pull request as ready for review February 2, 2024 15:10
@Ms2ger
Copy link
Member Author

Ms2ger commented Feb 2, 2024

I think this could benefit from review at this point

@littledan
Copy link
Contributor

littledan commented Feb 7, 2024

ShadowRealms reached 2.7 in TC39. Acceptance of this PR by WHATWG editors is a blocking requirement for Stage 3, though it probably shouldn't be landed until the Web API set is finalized.

@domenic @annevk @zcorpan Any thoughts/concerns?

@Ms2ger
Copy link
Member Author

Ms2ger commented Oct 8, 2024

@domenic or @annevk - it seems to me that the we're making progress on the questions about exposure; is there anything else I can do to help move this PR forward?

data-x="synthetic-realm-settings-object-principal-realm">principal realm</span> to <var>O</var>'s
<span>associated realm</span>.</p></li>
<span>associated realm</span>'s
<span data-x="concept-principal-realm-of-realm">principal realm</span>.</p></li>
Copy link
Member

Choose a reason for hiding this comment

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

Could we still run into an issue here if there is a third layer of shadow realm nesting?

My thinking is that this should effectively be a while loop which will go up until it sees that the host defined is not a synthetic settings object. Then, principal-realm-of-realm does not need to worry about how many layers of nesting of shadow realms there are.

Copy link
Member Author

Choose a reason for hiding this comment

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

Suppose a principal realm X → ShadowRealm A → ShadowRealm B → ShadowRealm C.

  • Creating A: O's associated realm is X, so we set A.[[HostDefined]]'s synthetic-realm-settings-object-principal-realm to X's concept-principal-realm-of-realm which is also X
  • Creating B: O's associated realm is A, and A's concept-principal-realm-of-realm is A.[[HostDefined]]'s synthetic-realm-settings-object-principal-realm, which is X, and we set B.[[HostDefined]]'s synthetic-realm-settings-object-principal-realm to X.
  • Creating C: O's associated realm is B, and B's concept-principal-realm-of-realm is B.[[HostDefined]]'s synthetic-realm-settings-object-principal-realm, which is X, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs implementer interest Moving the issue forward requires implementers to express interest
Development

Successfully merging this pull request may close these issues.