Creates a mechanism to enable/disable IDL attributes per instance with a pref

NEW
Unassigned

Status

()

Core
DOM
6 years ago
6 years ago

People

(Reporter: mounir, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

6 years ago
We want our users to be able to disable some features (ie. IDL attributes) with a pref. To make sure the web reacts correctly, we want those features to not be seen as part of the object. Currently, the only way to do that is per-interface in classinfo which requires to restart Firefox when the pref is toggled.

We should find a simple way to make this per-instance: to have the pref being considered when the object is created. Which means users will be able to toggle the pref and reload.

IRC log that might be more clear that my explanations:
[19:35] < mounir> bz: could you be more explicit about the classinfo vs prototype thing for the pref?
[19:35] <@bz> mounir: yes
[19:35] <@bz> mounir: right now the only way we have to pref stuff is on a per-interface level
[19:36] <@bz> mounir: and that happens by munging the set of interfaces exposed in classinfo
[19:36] <@bz> mounir: this set is computed once, afaik
[19:36] <@bz> mounir: so is static for process lifetime
[19:36] <@bz> mounir: there was some talk about adding a way to declare a pref on a per-member basis in the idl
[19:36] <@bz> mounir: and check that pref in the code that defines properties on the releavant DOM prototype
[19:37] <@bz> mounir: prototypes are set up per-page
[19:37] < mounir> bz: but there is currently no way to do that, right?
[19:37] <@bz> yes
So my thinking was that we could add a IDL annotation, only support it for quicktubbed methods, and have the quickstubs prototype setup do the right thing.  Sound feasible?
You need to log in before you can comment on or make changes to this bug.