- From: Philippe Le Hegaret <plh@w3.org>
- Date: Thu, 10 Jul 2014 15:40:15 -0400
- To: Boris Zbarsky <bzbarsky@MIT.EDU>
- Cc: Arvind Jain <arvind@google.com>, "public-web-perf@w3.org" <public-web-perf@w3.org>
On Thu, 2014-07-10 at 15:09 -0400, Boris Zbarsky wrote: > > So far, it's assumed to be there as soon as a script can > > be executed, ie by dom loading, like several objects available from > > window. > > Assumed by whom? Again, some specs define this explicitly for their > objects, and that's generally a good idea. Just like specs should > define which global their objects are associated with... I meant by Web developers, ie their document could start as follows: [[ <script>var perf = window.performance</script> <title>My Document</title> ]] But you're correct that the performance could be created on demand. > > It seems to me that we need to define this in performance timeline. In > > others words, each specification (like Navigation or Resource Timing) > > should define when the objects get created and added to the entries > > list > > Right now, note, there isn't even an "entries list" for things to get > added to (and hence nothing gets added to it, of course). Good point, performance entry needs to introduce the notion of "browsing context performance entries list". > > In that case, we would need to add the > > following to Performance Timeline: > > [[ > > A part of the steps defined in "unload a document" [See Unloading > > documents, HTML], if both the Document's salvageable state and recycle > > are false, the Document's browsing context must discard all instances of > > PerformanceEntry objects after discarding the Document and getEntries() > > must return an empty PerformanceEntryList. > > ]] > > That's the general idea, but instead of monkeypatching please use the > existing extensibility point the HTML spec has for this. See > http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html#unloading-document-cleanup-steps > which is invoked by step 11 of > http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html#unload-a-document Actually, when I wrote the lines, I was thinking to insert the step between step 15 and step 16 steps: [[ 15. If both the Document's salvageable state and recycle are false, then the Document's browsing context must discard the Document. 16. End: Decrease the Document's ignore-opens-during-unload counter by one. ]] thus, it only get discarded if the Document itself is discarded, but that would qualify it as monkeypatching unless HTML adds a hook for us. > -- that's the right place to hook into. That's assuming you want to > clear things on unload, of course. And you'll want to define "discard": > all it means is it's gone from whatever getEntries looks at, right? That's what I meant by adding to the description: "getEntries() must return an empty PerformanceEntryList." Philippe
Received on Thursday, 10 July 2014 19:40:21 UTC