Closed Bug 40566 Opened 22 years ago Closed 18 years ago

[FEATURE]"Out-of-band" XML loading should allow for synchronous loading.


(Core :: XML, enhancement, P3)






(Reporter: taras.tielkes, Assigned: nisheeth_mozilla)


The existing load mechanism using "load()" and an eventListener is very clean 
and useful.

In a lot of cases you just want to wait until the loading of data is complete, 
before processing or rendering (through HTML DOM).

A "load()" variant (or optional boolean argument) that blocks for the duration 
of the loading (or until time-out occurs) would be great.
Marking as a feature and scheduling for M18 for now...
Ever confirmed: true
Summary: "Out-of-band" XML loading should allow for synchronous loading. → [FEATURE]"Out-of-band" XML loading should allow for synchronous loading.
Target Milestone: --- → M18
Synchronous loading from script isn't possible for both practical and 
historical reasons. In Gecko, JS execution on the same thread as the UI pump - 
blocking the thread would freeze UI. Also, run-to-completion semantics have 
always been part of scripting (at least in Navigator) e.g. window.setTimeout() 
rather than a sleep() primitive.
Vidur, I see the threading problem involved here.
I also see your point w.r.t. scripting semantics.

Still, it's nice to have XML data from fixed sources load in one go.

Currently I use data islands in IE5 to load XML data in a fire-and-forget 
fashion. The islands will always load as part of "document" element, and I can 
rely on the data being there when my global "document.onload" fires. For data-
on-demand, I use the XmlHttpRequest in synchronous mode, but OTOH it's not much 
effort to use async.

I guess synchronous loading will have to wait until Mozilla gets some kind of 
apartment support in xpCOM.

Changing target milestone to Future...
Target Milestone: M18 → Future
Could this perhaps be implemented using the workaround Vidur is using for
synchronous HTTP from the "XMLHttpRequest" component?
QA Contact: chrisd → petersen
QA Contact: petersen → rakeshmishra
QA Contact: rakeshmishra → ashishbhatt

*** This bug has been marked as a duplicate of 139276 ***
Closed: 18 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.