Hi all,
I made some investigation about the source-loading problem which appeared in Firefox 2.0.0.1, and I found that Firefox now behaves in way similar to Internet Explorer; that is, when adding script nodes using DOM createElement() and appendChild(), script loading and parsing seems asynchronous, leading to out-of-order class initialization.

The main reason for adding <script> nodes in order to load qx sources in XHTML documents was to allow more meaningful error messages and effective use of tool like Firebug, but now this technique doesn't seem to work reliably anymore neither in Firefox.

Changing the default loader to document.write() (as the HotFix did) is ok for HTML documents, but doesn't work at all with XHTML documents: given this, to allow (at least) loading source builds of qx applications in XHTML documents, I made the following changes to the compiler (SVN revision 5473):
  • Switched the automatic source loader selection from client engine-based to document type-based
  • When the document type is HTML, the source loader uses document.write()
  • When the document type is XHTML, I replaced the "domappend" source loader with the new "xhrequest" loader which uses synchronous XMLHttpRequests to load the sources: this technique is perfectly reliable and completely cross-browser (tested with IE, Firefox, Opera and Konqueror); the only drawback is exactly the absence of <script> nodes, which limits the usefulness of error messages and _javascript_ debuggers, but at least the source build is usable.
  • Reverted the default loader type to "auto"
IMHO, if we want to fully support development of applications inside XHTML documents, it is mandatory (for the reasons stated above) to have source builds with a separate <script> tag for every source file.

I know I'm repeating here, but based on last months' experience, the only way I see to reliably accomplish this is by some preprocessing of the index file: the least disruptive way to do this, I think, would be to have the compiler also read the index.html (or .php or whatever) file and create a new one (say sindex.html) where the <script src=""> tag gets statically replaced by a sequence of <script src=""> tags, each referencing a source file (a sort of offline document.write()).

Then, the source loader could simply redirect the browser from index.html to sindex.html: the only (minimal) inconvenience I see is that you also have to execute "make" when the index file changes, but this should seldom happen.

Regards,
Alessandro





begin:vcard
fn:Alessandro Sala
n:Sala;Alessandro
email;internet:alessandro {dot} sala {at} mclink {dot} net
version:2.1
end:vcard

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to