Re: [NavigationTiming] few comments

On 03/19/2011 10:53 PM, Olli Pettay wrote:
> Some more comments
>
>
> "Some user agents maintain the DOM structure of the document in memory
> during navigation operations such as forward and backward. In those
> cases, the window.performance.timing and window.performance.navigation
> objects must not be altered during the navigation."
> What does this actually mean?
>
> If bfcache (which keeps DOM in memory for session history) is enabled
> and page A is first loaded normally and the window has
> window.performance.<a> values. Then page B is loaded and window gets
> window.performance.<b>. Then page C is loaded and window gets
> values window.performance.<c>.
> Then 'back' button is pressed so that B is again the active document.
> Does "the window.performance.timing and window.performance.navigation
> objects must not be altered during the navigation" mean that
> window.performance.* point to <c> or <b>?
> I assume <b>. And <b>'s unload event timing refers to the
> unload event of page A.
> (window.performance.navigation.type would never be TYPE_BACK_FORWARD in
> this scenario.)
> But it would be better to clarify this all.
>
> If bfcache is disabled and 'back' button is pressed,
> window.performance.* will get values <b'>, the navigation.type
> is TYPE_BACK_FORWARD and <b'>'s unload event timing refers to the
> unload event of page C. So the window.performance.* will be different
> depending on whether DOM was cached. And at least in case
> of Gecko web page cannot know whether some page will
> be bfcached, since it depends not only beforeunload/unload event
> handlers, but also possibly open network connections and also
> timing (cached DOM will be evicted after X minutes)
>
>
> So this all needs clarifications. Otherwise writing any cross-browser
> code for window.performance.* is difficult.
> And even writing reliable tests for this all isn't possible.
>
>

How do current implementations handle cached DOM + back-forward?
http://dvcs.w3.org/hg/webperf/file/fb6cbccbb0cc/tests/approved/test_navigation_type_backforward.htm
seems to assume a behavior where iframe's DOM isn't cached.
Or it just doesn't care about
"Some user agents maintain the DOM structure of the document in memory
  during navigation operations such as forward and backward. In those
  cases, the window.performance.timing and window.performance.navigation
  objects must not be altered during the navigation."




-Olli

Received on Tuesday, 22 March 2011 21:46:30 UTC