Html spec defines several ways to define Realms in js code via these conceptions: Entry, Incumbent, Current, Relevant.
The last one is specified by html spec in a special form:
Every platform object has a relevant Realm, which is roughly the JavaScript realm in which it was created. When writing algorithms, the most prominent platform object whose relevant Realm might be important is the this value of the currently-running function object. In some cases, there can be other important relevant Realms, such as those of any arguments.
If we follow to the link that relates to the definition on the platform object we will see the next:
Platform objects are objects that implement an interface.
What does mean interface in that case? Sure, I am not silly I looked into interface definition:
An interface is a definition (matching interface InterfaceRest) that declares some state and behavior that an object implementing that interface will expose.
From here we see that this is generic definition of the interface.
Also I found the following example of the platform objects:
In a browser, for example, the browser-implemented DOM objects (implementing interfaces such as Node and Document) that provide access to a web page’s contents to ECMAScript running in the page would be platform objects. These objects might be exotic objects, implemented in a language like C++, or they might be native ECMAScript objects.
As specified above instances of interfaces Node or Document are platform objects. Are their constructor objects - platform objects?
Now I've gotten a bunch of questions:
- What does platform object mean in whatwg spec? (ecmascript doesn't define this term)
- Which examples of objects are examples of platform objects and which are not?
- I didn't see interfaces of ECMAScript parts in whatwg, does it mean that initially ecmascript constructors and their instances are not platform objects?
P.S Please don't mark as "Needs more focus", I know that I asked several question in one issue, but these are parts of one general question.