-
Notifications
You must be signed in to change notification settings - Fork 345
Description
Spun off from the 2023-01-04 discussion of #3483. There was interest in considering a permission policy targeted at power usage (rather than privacy). This is easy to write out a strawperson for:
- Call the policy
webgpu-high-performance - Default it to
self(disabled for iframes by default)- Alternatively, could default to
*(enabled for iframes by default)
- Alternatively, could default to
- Spec says if you don't have this permission, and you ask for
powerPreference: "high-performance", it will either:- option 1: have no effect (be equivalent to
powerPreference: undefined). This is not exactly normative, sincepowerPreferenceis just a hint, but it's one we expect to have a pretty consistent, clearly-defined meaning in all browsers. - option 2: reject the adapter request. This is normative and more future-proof, but also more disruptive since it breaks code that would just work with option 1.
- option 1: have no effect (be equivalent to
The question is whether "high-performance" is something we want to limit third-party iframes from using by default. There's a tradeoff of protecting the user's battery life vs getting them higher performance.
User agents also are already completely free to ignore the powerPreference in certain contexts, for example heuristically-detected ad iframes, so we may not need a new tool here.
Note, a point raised in #3483 (comment) still applies: iframe embeds that have already shipped (say, a Sketchfab embed added in 2020) will not have this new allow= policy. This will prevent the embedded page from using the high-performance adapter through WebGPU until the embedder updates their site. Bad for cases like Sketchfab VR.