Resource timing spec unclear about setResourceTimingBufferSize and onresourcebufferfull

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