Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PerformanceObserver.supportedEntryTypescan't be annotated with [SameObject] #212

Open
petervanderbeken opened this issue Apr 18, 2024 · 7 comments
Assignees

Comments

@petervanderbeken
Copy link

The supportedEntryTypes attribute has a FrozenArray type. [SameObject] is only valid if the attribute's type is an interface or object, see https://webidl.spec.whatwg.org/#SameObject:

The [SameObject] extended attribute must not be used on anything other than a read only attribute whose type is an interface type or object.

@clelland
Copy link
Contributor

clelland commented May 7, 2024

@yoavweiss who may have some historical context here.

@yoavweiss
Copy link
Contributor

I vaguely remember the current state being a result of discussions on #117

I don't personally have a strong opinion on this.

@clelland
Copy link
Contributor

clelland commented May 7, 2024

whatwg/webidl#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.

@clelland
Copy link
Contributor

clelland commented May 21, 2024

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 whatwg/webidl#1402 (comment), we can avoid being blocked on whatwg/webidl#1402 if we change the spec text to just do what we want in the getter.

@tunetheweb
Copy link
Member

tunetheweb commented May 21, 2024

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.

@yoavweiss
Copy link
Contributor

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..

@clelland
Copy link
Contributor

  1. We should remove [SameObject], and just enforce that in the processing model. Can send a PR for that.
  2. To handle origin trials, we might want to switch from a FrozenArray to a regular sequence. That's less clear though.

@clelland clelland assigned clelland and unassigned yoavweiss Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants