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

Resource timing spec unclear about setResourceTimingBufferSize and onresourcebufferfull

From: Valentin Gosu <valentin.gosu@gmail.com>
Date: Sun, 4 May 2014 21:17:46 +0300
Message-ID: <CACQYfiJDNfY92YyE9610kfiDBy4uVk3aCMh14oc2O+WrO5B9LQ@mail.gmail.com>
To: public-web-perf@w3.org
Hi,

While implementing the Resource Timing spec I came upon a couple of issues
that are unclear concerning setResourceTimingBufferSize and
onresourcebufferfull.

First of all, setResourceTimingBufferSize [1] says that "If the maxSize
parameter is less than the number of elements currently stored in the
buffer, no elements in the buffer are to be removed. The maxSize parameter
will apply only after the
clearResourceTimings<http://www.w3.org/TR/resource-timing/#dom-performance-clearresourcetimings>method
is called."

This makes it seem as the new maxSize will only apply after
clearResourceTimings is called. Point 20 of the processing model [2] does
specify that setResourceTimingBufferSize may be called in the event handler
for onresourcebufferfull to extend the primary buffer, but I feel that the
first reference is vague/misleading.

My second question concerns when the event handler for onresourcebufferfull
should be called. Should calling setResourceTimingBufferSize with a
parameter smaller than the number of elements in the buffer trigger the
event? Because in that case we could encounter this unfortunate loop:

performance.setResourceTimingBufferSize(1);
performance.onresourcebufferfull = function() {
    performance.setResourceTimingBufferSize(1);
};

[1]
http://www.w3.org/TR/resource-timing/#dom-performance-setresourcetimingbuffersize
[2] http://www.w3.org/TR/resource-timing/#processing-model

Thanks
-- 
Valentin
Received on Monday, 5 May 2014 08:21:26 UTC

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