W3C home > Mailing lists > Public > www-dom-ts@w3.org > February 2002

RE: Concerns regarding the W3 Document Object Model (DOM) Conform ance Test Suites

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Mon, 25 Feb 2002 16:52:30 -0500
Message-Id: <200202252152.QAA25908@m2-032-6.mit.edu>
To: www-dom-ts@w3.org
>> Addressing this issue would require either Netscape 6/Mozilla to 
>> provide a
>> method to synchronously load an XML document or a testing framework that
>> supports asychronous tests.  Obviously either of these would be 
>> welcomed.
>[dd] As noted by myself, Mary and Curt, we've raised the issue a few 
>times, obviously without solving it. Any help here is highly
> appreciated.

I was experimenting with tests using Document.load() (as the test suite
does) in Mozilla and found that simply triggering the test code off the
onload handler of the document being loaded worked quite nicely as a
possible solution.  Something like:

      myDoc.onload = myfunc;
      function myfunc (event) {
        // Run the test in here

This should avoid the synch/asynch issues, since onload is fired when
the document is fully loaded.

This approach introduces two new issues:

1)  Dependence on correct implementation of onload
2)  Dependence on .load() not clearing the onload handler

Issue #2 should be investigated in other ECMAScript DOM implementations
that would follow this codepath in the test suite.  Perhaps the handler
should be set both before and after calling .load().  Issue #1 we have
to live with, and it seems a smaller evil than depending on the tester
to wait long enough on the alert for the document to finish loading.

There is no distinctly American criminal class except
                      -- Mark Twain
Received on Monday, 25 February 2002 16:58:21 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:34:04 UTC