Closed Ms2ger closed 2 years ago
Hey! After talking to @domenic, I suspect that actually exposing Resource Timing to ShadowRealms would require a bit more than just an IDL change.
Please correct me if I'm wrong, but IIUC, it could be useful for folks to be able to use Shadow Realms in order to isolate their work from the rest of the document (or other realms). Hence, it could be useful to be able to know which resources your specific ShadowRealm loaded. That would require creating a separate performance timeline per ShadowRealm, and expose those entries there and only there.
Is Fetch aware of ShadowRealms? Would it be possible to pipe the ShadowRealm information from there? Have you looked into what work we'd need to do for PerformanceTimeline?
FWIW, once we figure things out for Resource Timing, Server Timing is likely to follow.
fetch and other kinds of I/O (e.g., loading CSS and images) aren't exposed to ShadowRealms. So I'm not sure if resource timing will be very useful. And I can see the argument that, if ShadowRealms do expose resource timing some day, then they should be separated somehow. All together, I'd suggest that we don't merge this PR or the Server Timing one, unless there's something I'm misunderstanding here.
Thanks @littledan! That makes perfect sense.
Closing for now, but feel free to reopen if you think it's the wrong call.
Thanks for looking into this, Dan!
Ref: https://github.com/tc39/proposal-shadowrealm/issues/331
Preview | Diff
Preview | Diff