Re: [csswg-drafts] [cssom] Can we lift the restriction on constructed flag for adoptedStylesheets? (#10013)

If you're interested in exploring this feature more, we've lifted the restriction behind a flag in Firefox nightly, to allow developers to experiment with this.

![a screenshot of Firefox Nightly 136.0a1 (2025-01-31), with `about:config` open, showing the `dom.webcomponents.lift-adoptedstylesheets-restriction.enabled` entry. This flag is bold, indicating that it has changed from the stock default. The value is true, so the flag has been enabled in this profile.](https://github.com/user-attachments/assets/ab2152c0-13f4-449c-9fed-0ab466443060)

Firefox Nightly 136.0a1 (2025-01-31) onwards has the ability to lift this restriction. This means you can go to `about:config`, search for `adopted` and you'll find the `dom.webcomponents.lift-adoptedstylesheets-restriction.enabled` flag. Double click it to set it to true and try to adopt a `link.sheet` or `style.sheet` object and it should "just work".


**What to expect**
Expect crashes. Expect some styles to not work properly for weird reasons. Expect some rules to not apply for some reasons. Each of these are useful data so...

I anticipate subresources, `@import` rules, combinations such as `<base>`, or differing paths, or cross document sheets might break (or even crash). I expect things like `@keyframes` rules or `@layer` rules to behave weirdly when given to another shadowroot. 

**What I _want_ from you**
If you have complex applications that could leverage this feature _please try it_ and _if_ you discover crashes or weird behaviour, please let me know! It's _really important_ we kick the tyres on this so figure out what goes wrong, then we can generate reproductions, tests (WPTs) and help validate the ability to remove this feature.

This feature _cannot_ ship until we're confident that there are zero crashes, no footguns, and issues are minimal with well documented workarounds. For this to happen we need to build a _comprehensive_ test suite showing all the interesting ways a shadowdom can adopt an existing stylesheet. I'm not capable of thinking of all of these so we need to try this "in the wild" to see what could occur.

-- 
GitHub Notification of comment by keithamus
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10013#issuecomment-2627222385 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 31 January 2025 12:47:15 UTC