[whatwg] The choice of script global object to use when the script element is moved

Adam Barth w3c at adambarth.com
Sat Feb 26 13:09:19 PST 2011


On Wed, Feb 2, 2011 at 5:48 AM, Henri Sivonen <hsivonen at iki.fi> wrote:
> On Feb 2, 2011, at 03:07, Ian Hickson wrote:
>
>> I suppose we could make it so that scripts get neutered when the document
>> that they were first associated with gets unloaded. Would that work?
>
> We did something different.
>
>> Proposal #1:
>
> Proposal #4 (what Gecko now does):
>
>  * If at the time when the parser triggers the 'run' algorithm, the owner document of the script is not the same document whose active parser the parser is, set the 'already executed' flag and abort the steps.
>
>  * If at the time of a script becoming available for evaluation the owner document of the script is not the same document that was the owner document at the time of the 'run' algorithm, don't evaluate the script.
>
> See https://bugzilla.mozilla.org/show_bug.cgi?id=592366

Sorry for the delayed response.  I don't recall off-hand what the spec
currently says, but any of these options sound fine.  Of (1), (2), and
(4), I have a slight preference for (4) because then we don't need to
notify all the script elements when a document gets unloaded.

Adam



More information about the whatwg mailing list