The "initialization" steps for Web browsers
Ian Hickson
ian at hixie.ch
Mon Jul 21 10:49:18 PDT 2014
On Tue, 10 Jun 2014, Ian Hickson wrote:
> On Tue, 10 Jun 2014, Allen Wirfs-Brock wrote:
> >
> > By an ECMAScript Environment (and this is what Ecma-262 defines,
> > although it doesn't actually use that name) I mean a heap of
> > ECMAScript objects (and related values) that may directly reference
> > (point to) each other and a single thread of execution of ECMAScript
> > code. The environment may include multiple "global objects".
>
> Ok. Sounds like that mays to an event loop, on the HTML side.
>
> That should be quite workable. I'll invoke 8.5 when I create an event
> loop (with zero scripts), and I'll invoke CreateRealm() and then 8.5.1
> when I create a Window.
So I started trying to figure out how this would work, but I'm still
having trouble (sorry).
When an event loop is created, we invoke the algorithm in 8.5
Initialization, with step 7 set to obtain zero scripts, right?. Now, the
user opens a tab or something, and so a Window object needs to be created.
What do I do, exactly? Do I need to create a new realm? New execution
context? Both? Do I basically do steps 1-5 of the Initialization steps
again? I guess I do nothing else until I see a <script>; then what do I
do? do I create a PendingTask record for the execution of the script, push
it to the front of the Task Queue, and let 9.5's NextTask call procede
with this new task?
--
Ian Hickson U+1047E )\._.,--....,'``. fL
http://ln.hixie.ch/ U+263A /, _.. \ _\ ;`._ ,.
Things that are impossible just take longer. `._.-(,_..'--(,_..'`-.;.'
More information about the es-discuss
mailing list