Open petervanderbeken opened 4 months ago
@yoavweiss who may have some historical context here.
I vaguely remember the current state being a result of discussions on https://github.com/w3c/performance-timeline/issues/117
I don't personally have a strong opinion on this.
https://github.com/whatwg/webidl/issues/1402 has some recent movement on this issue.
I don't expect that we actually need this to be [SameObject]; I don't think people are modifying it and expecting it to retain those modifications. This was likely to avoid recalculating or allocating more memory every time the accessor is called.
We also don't technically need FrozenArray here either. I think that what we want is to return an array, and not recalculate that array every time it's requested. Perhaps as Domenic alludes to in https://github.com/whatwg/webidl/issues/1402#issuecomment-2085208885, we can avoid being blocked on https://github.com/whatwg/webidl/issues/1402 if we change the spec text to just do what we want in the getter.
It would be lovely if it was an array that could be updated but didn't need to be recalculated each time. So enabling things via origin trials for example could update these even if it's already been read. Ran into this with LoAF when it was enabled after first being read for another reason.
Changing the values of the array over time would be a web-exposed change, although I doubt that it'd be something anyone would notice..
The
supportedEntryTypes
attribute has aFrozenArray
type.[SameObject]
is only valid if the attribute's type is an interface orobject
, see https://webidl.spec.whatwg.org/#SameObject: