Re: XSLT processing model in Mozilla

Jonas Sicking <[email protected]> Thu, 05 Jul 2007 13:27:16 -0700
Newsgroups gmane.comp.mozilla.devel.layout.xslt
Message-ID <[email protected]>
John J. Barton wrote:
> Jonas Sicking wrote:
>> John J. Barton wrote:
>>> Jonas Sicking wrote:
>>>> The way we do it for transformations done using
>>>> <?xml-stylesheet type="text/xslt" ...?> is as follows:
>>>>
>>>> We parse the source document normally into a DOM, however during 
>>>> this parsing script execution is turned off for the source document.
>>>>
>>>> Simultaneously we load the stylesheet and parse it into an internal 
>>>> compiled format (not a DOM).
>>>>
>>>> Once both the source document and stylesheet is done loading we 
>>>> execute the stylesheet.
>>>>
>>>> Executing the stylesheet builds DOM nodes which once the execution 
>>>> is done is displayed instead of the source document.
>>>
>>> Jonas,
>>>   - are any events raised after execution?
>>
>> You should get a normal 'load' event.
> 
> How about pageshow? DOMContentLoaded?

I think these are not currently fired. This is a bug which would be 
great to get fixed. I believe that if you search bugzilla you can find it.

Please refrain from "i'd like this bug fixed" comments though. We 
already know.

>>>   - at what point is script execution turned on?
>>
>> script execution is never turned on for the source document. It is 
>> always on for the result document though.
> 
> So the first script tag is executed before the next element is added? Or 
> the script engine is activated after the stylesheet has been exhausted 
> but before the 'load' event is raised? Or?

The script engine is always active, so the <script> element is executed 
as soon as it is inserted. The one difference though is that <script> 
elements that refer to external scripts will not halt execution of the 
stylesheet to wait for the external script to load. This means that such 
element will likely not execute until the stylesheet is finished executing.

/ Jonas