Skip to content

Commit 1e5f068

Browse files
Add clarification about context propagation into worklets (#136)
1 parent d1e282d commit 1e5f068

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

WEB-INTEGRATION.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,13 @@ calling those methods), in practice that context will always match the root cont
568568
worklet scope (because `register*()` is always called at the top-level). Hence, to simplify
569569
implementations we propose that Worklet methods always run in the root context.
570570

571+
According to the HTML spec, creating a worklet global scope always creates a new agent, and
572+
therefore there can't be any propagation from other context into the worklet and vice versa, even
573+
if its event loop runs in the same thread as other agents. This isn't always implemented this way –
574+
in Chromium, for example, the equivalent of an agent is shared among worklets and other agents
575+
running in the same thread; but since this agent sharing is unobservable, we should not add a
576+
dependency on it.
577+
571578
### Custom elements
572579

573580
Custom elements are also registered by passing a class to a web API, and this class

0 commit comments

Comments
 (0)