restrict buffered option to type-based observation per spec

The buffered option is only valid with the type option, not entryTypes,
per the Performance Observer specification.
This commit is contained in:
egrs
2026-02-17 16:12:20 +01:00
parent afbd927fc0
commit df9779ec59

View File

@@ -115,7 +115,8 @@ pub fn observe(
self._interests = interests; self._interests = interests;
// Deliver existing entries if buffered option is set. // Deliver existing entries if buffered option is set.
if (options.buffered) { // Per spec, buffered is only valid with the type option, not entryTypes.
if (options.buffered and options.type != null) {
for (page.window._performance._entries.items) |entry| { for (page.window._performance._entries.items) |entry| {
if (self.interested(entry)) { if (self.interested(entry)) {
try self._entries.append(page.arena, entry); try self._entries.append(page.arena, entry);