W3C home > Mailing lists > Public > public-web-perf@w3.org > May 2012

[NavigationTiming] Issues in the document.open test (or perhaps in the spec, if the test is correct)

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Wed, 23 May 2012 00:56:06 -0400
Message-ID: <4FBC6DE6.5010302@mit.edu>
To: public-web-perf@w3.org
I was just looking into the Gecko failures on 
http://w3c-test.org/webperf/tests/approved/navigation-timing/html/test_document_open.html 
and as far as I can tell the test is wrong.  I don't understand how 
other UAs are passing it, so I assume must be missing something...

The basic structure of the test is as follows:

1)  Load a document in a subframe.
2)  Record all the performance.timing attributes for the subframe's
     window.
3)  Use document.open/write/close to write a different document into
     the subframe.
4)  Assert that the performance.timing attributes did not change from
     the ones recorded in step 2.

If you look at the processing model in 
https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/NavigationTiming/Overview.html#processing-model 
(the March 30 draft), step 2 says:

   Immediately after the user agent prompts to unload the previous
   document, record the current time as navigationStart.

and if you look at 
http://www.whatwg.org/specs/web-apps/current-work/multipage/elements.html#dom-document-open 
step 7, it says:

   Prompt to unload the Document object.

Similarly, step 17 of the navigation timing processing model is:

   Record the time as domLoading immediately before the user agent
   sets the current document readiness to "loading".

and step 19 of the document.open processing model is:

   Set the current document readiness of the document to "loading".

and so forth.  So as far as I can tell, calling document.open() should 
in fact affect at least navigationStart and domLoading.

Similarly, if you trace through the processing model carefully, calling 
document.close() should enable the firing of onload (once all 
subresources are done loading), and in fact it does just that in at 
least Gecko, Presto, WebKit, and Trident.

So as far as I can tell, calling document.open and then document.close 
should affect various navigation timing values (navigationStart, 
domLoading, domComplete, loadEventStart, loadEventEnd, etc).  This is 
what Gecko does.

What _am_ I missing?

-Boris
Received on Wednesday, 23 May 2012 04:56:56 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:04:32 UTC