DummyParserRequest and XML

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

DummyParserRequest and XML

Henri Sivonen
I got incremental XML loading (bug 18333) going. However, the comments
in the HTML content sink said that a DummyParserRequest is needed in
order to keep end events firing on interrupting the parser, so I hoisted
DummyParserRequest to nsContentSink.cpp and used it on the XML side as
well. This broke the incremental loading. I thought I had neglected to
prepare the wall clock timing stuff properly before letting expat parse
a buffer. I fixed that but incrementality remained broken.

I took the DummyParserRequest out. Incrementality worked again.

It turns out that DummyParserRequest is on its way out anyway:
https://bugzilla.mozilla.org/show_bug.cgi?id=294115

Is the fix for
https://bugzilla.mozilla.org/show_bug.cgi?id=293818
already taking care of everything on the XML side that
DummyParserRequest takes care of on the HTML side?

Which events are at stake? OnLoad? Others? How should I proceed
investigating whether I break something?

--
Henri Sivonen
[hidden email]
http://hsivonen.iki.fi/
_______________________________________________
dev-tech-xml mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xml
Reply | Threaded
Open this post in threaded view
|

Re: DummyParserRequest and XML

Boris Zbarsky
Henri Sivonen wrote:
> Is the fix for
> https://bugzilla.mozilla.org/show_bug.cgi?id=293818
> already taking care of everything on the XML side that
> DummyParserRequest takes care of on the HTML side?

That fix provides the ability to take care of it.  It doesn't actually do
anything in the parser so far.  We could replace adding/removing the dummy
parser request with BlockOnload()/UnblockOnload() if we handle the Cancel()
issue I mention in bug 294115.

I do find it odd that just using DummyParserRequest didn't work, though...  That
makes me suspect that the other solution would have the same issues, frankly.
If you want to check, you could ignore the Cancel() thing for now and just see
whether you can BlockOnload()/UnblockOnload() and whether that works.

> Which events are at stake? OnLoad? Others?

Just onload.

> How should I proceed investigating whether I break something?

Create an HTML page such that the parser would get interrupted after all the
data has been received from the network but before it's been parsed (simplest
way is to interrupt very often, probably).  Then see whether onload fires too
early (e.g. by having an inline <script> at the end of the document and an
onload handler and seeing which one runs first).

-Boris
_______________________________________________
dev-tech-xml mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xml
Reply | Threaded
Open this post in threaded view
|

Re: DummyParserRequest and XML

Henri Sivonen
In article <[hidden email]>,
 Boris Zbarsky <[hidden email]> wrote:

> I do find it odd that just using DummyParserRequest didn't work, though...  
> That
> makes me suspect that the other solution would have the same issues, frankly.
> If you want to check, you could ignore the Cancel() thing for now and just
> see
> whether you can BlockOnload()/UnblockOnload() and whether that works.

It turns out that it works the right way without either. I guess I
shouldn't try to fix it just in case when it isn't broken.

> Create an HTML page such that the parser would get interrupted after all the
> data has been received from the network but before it's been parsed (simplest
> way is to interrupt very often, probably).  Then see whether onload fires too
> early (e.g. by having an inline <script> at the end of the document and an
> onload handler and seeing which one runs first).

OK.

Thanks.

--
Henri Sivonen
[hidden email]
http://hsivonen.iki.fi/
_______________________________________________
dev-tech-xml mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xml
Reply | Threaded
Open this post in threaded view
|

Re: DummyParserRequest and XML

Boris Zbarsky
Henri Sivonen wrote:
> It turns out that it works the right way without either. I guess I
> shouldn't try to fix it just in case when it isn't broken.

Um...  That it isn't broken without the DummyParserRequest seems kinda unlikely.
  Are you sure you're interrupting the parser and spinning out to the event loop
after Necko has completely finished with all the parts of the document?

-Boris
_______________________________________________
dev-tech-xml mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xml
Reply | Threaded
Open this post in threaded view
|

Re: DummyParserRequest and XML

Boris Zbarsky
In reply to this post by Henri Sivonen
Henri Sivonen wrote:
>> whether you can BlockOnload()/UnblockOnload() and whether that works.
>
> It turns out that it works the right way without either. I guess I
> shouldn't try to fix it just in case when it isn't broken.

I suspect that this "works" because of the BlockOnload() call in
nsDocument::BeginLoad().

But you probably still need the Cancel() impl of the parser request, unless
you've replaced it with some code that does the equivalent...

-Boris
_______________________________________________
dev-tech-xml mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xml