@bzbarsky is the one I trust here.
"JavaScript global environment" is used in only a couple of places:
The DrawingStyle() constructor, when invoked, must return a newly created DrawingStyle object. If the constructor was passed an argument, then the DrawingStyle object's styles scope object is that element. Otherwise, if the JavaScript global environment is a document environment, the object's styles scope object is the Document object of the active document of the browsing context of the Window object on which the interface object of the invoked constructor is found. Otherwise, the JavaScript global environment is a worker environment, and the styles scope object is the worker.
For CanvasRenderingContext2D objects whose context bitmap mode is fixed, this is their canvas element; for other CanvasRenderingContext2D objects, if the JavaScript global environment is a document environment, the object's font style source object is the Document object of the active document of the browsing context of the Window object on which the interface object of the CanvasRenderingContext2D object is found; otherwise the JavaScript global environment is a worker environment and the font style source object is the worker.
The use here doesn't seem to correspond very well to ES's definition of "global environment". I think it's just saying, which global do these constructors (DrawingStyle or CanvasRenderingContext2D) belong to. Or maybe it's saying, what is the current global environment in which they are being called?
Can we come up with some better phrasing? My first try, assuming the first interpretation:
... Otherwise, if the DrawingStyle() constructor's global object is a Window, the object's styles .... Otherwise, the DrawingStyle() constructor's global object is a worker global scope, and the styles scope object is the corresponding worker.
@bzbarsky is the one I trust here.
"JavaScript global environment" is used in only a couple of places:
The use here doesn't seem to correspond very well to ES's definition of "global environment". I think it's just saying, which global do these constructors (DrawingStyle or CanvasRenderingContext2D) belong to. Or maybe it's saying, what is the current global environment in which they are being called?
Can we come up with some better phrasing? My first try, assuming the first interpretation: