Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

WindowOrWorkerGlobalContext mixin documented

6 views
Skip to first unread message

Chris Mills

unread,
Jan 12, 2017, 10:53:53 AM1/12/17
to MDN (Public)
I thought I’d share this in case anyone case across these changes and wondered what was going on.

Today I took on the bug "Implement WorkerGlobalScope.isSecureContext" (https://bugzilla.mozilla.org/show_bug.cgi?id=1269052), but as is often the case, it ended up a lot more work than I was hoping.

It turns out that this property is on the new WindowOrWorkerGlobalScope mixin, along with a bunch of other stuff, so I’ve documented the whole thing.

This includes updating Window and WorkerGlobalScope to show the new places where these features are implemented from:

https://developer.mozilla.org/en-US/docs/Web/API/Window
https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope

And I've marked out-of-date interfaces as obsolete and moved across features that are now available on WindowOrWorkerGlobalScope:

https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers
https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64
https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmapFactories
https://developer.mozilla.org/en-US/docs/Web/API/GlobalFetch
https://developer.mozilla.org/en-US/docs/Web/API/IDBEnvironment

QUESTIONS:

1. Since this was quite a tricky one, can I get someone to review it soonish?
2. I wasn’t 100% sure how best to show these features in the Window/WorkerGlobalScope sidebars. Could I have some help on this from a macro-meister like Florian?

thanks!

Chris Mills
Senior tech writer || Mozilla
developer.mozilla.org || MDN
cmi...@mozilla.com || @chrisdavidmills

Florian Scholz

unread,
Jan 13, 2017, 7:13:12 AM1/13/17
to Chris Mills, MDN (Public)
Hey,

I think it is not visible to web developers in most of the cases on
which non-object interface these methods or properties are installed. I
would therefore recommend to just make the WindowTimers, WindowBase64,
ImageBitmapFactories, GlobalFetch and IDBEnvironment pages redirect to
the WindowOrWorkerGlobalScope mixin.

Likely more relevant here is what is available to which scope (window,
workers or both). So, for example the setTimeout method (quite a popular
one), was on WindowTimers and is now on WindowOrWorkerGlobalScope. It
doesn't change anything, because WindowTimers was also available to
workers. Sometimes this does change though.

Why are changing the interfaces/mixins anyway? Why isn't just
window.setTimeout? Well, it is more convenient if we follow closely with
the IDLs and we have started to visualize inheritance and we build the
side navigations based on this inheritance.

In the sidebars this is visible whenever use see "Inheritance" followed
by a list of parent interfaces or "Implements", e.g. on
https://developer.mozilla.org/en-US/docs/Web/API/Window where you can
see methods and properties of all the mixins that the window object uses.

As a visualization, some pages use an Inheritance diagram, but it is
still a bit experimental
https://developer.mozilla.org/en-US/docs/Web/API/WheelEvent

In order for this to work, inheritance data has to be maintained. You
can find this data in this macro:
https://github.com/mozilla/kumascript/blob/master/macros/InterfaceData.json

So, what you still need to do, is to update the entry for "Window"
there. Remove the WindowTimers, WindowBase64, ImageBitmapFactories,
GlobalFetch and IDBEnvironment from the "impl" list and add
WindowOrWorkerGlobalScope there. Do the same for "WorkerGlobalScope".

I hope this makes things more clear. Please don't hesitate to ask in
case you have any more questions.

-Florian

Florian Scholz
Technical Writer / Macro-Meister
Mozilla Developer Network
> _______________________________________________
> mdn mailing list
> m...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/mdn

Eric Shepherd

unread,
Mar 1, 2017, 10:12:16 AM3/1/17
to Florian Scholz, Chris Mills, MDN (Public)
It’s also easier because by documenting the mixins, we only have to edit one place when changes are made that apply to multiple contexts, such as Window and WorkerGlobalScope.

> On Jan 13, 2017, at 7:12 AM, Florian Scholz <fsc...@mozilla.com> wrote:
>
> Why are changing the interfaces/mixins anyway? Why isn't just window.setTimeout? Well, it is more convenient if we follow closely with the IDLs and we have started to visualize inheritance and we build the side navigations based on this inheritance.


Eric Shepherd
Senior Technical Writer
Mozilla Developer Network <https://developer.mozilla.org/>
Blog: https://www.bitstampede.com/
Twitter: https://twitter.com/sheppy

0 new messages