WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED DUPLICATE of
bug 277893
289948
Web Inspector: CSS is read-only when applied via adoptedStyleSheets
https://bugs.webkit.org/show_bug.cgi?id=289948
Summary
Web Inspector: CSS is read-only when applied via adoptedStyleSheets
Vadim Makeev
Reported
2025-03-18 04:19:40 PDT
Created
attachment 474601
[details]
Two shadowroots with different style attachment approaches When CSS is attached to a shadow root via `adoptedStyleSheets` (constructable stylesheets), the internal elements could not be debugged (styles modified). ``` const sheet = new CSSStyleSheet(); sheet.replaceSync(` div { width: 256px; height: 256px; background-color: tomato; } `); root.adoptedStyleSheets = [sheet]; ``` Styles are locked and marked as User Agent Stylesheet. But when styles are attached using DOM, everything is fine: ``` const style = document.createElement('style'); style.textContent = ` div { width: 256px; height: 256px; background-color: lightgreen; } `; root.appendChild(style); ``` See the attached demo comparing to approaches.
Attachments
Two shadowroots with different style attachment approaches
(1.05 KB, text/html)
2025-03-18 04:19 PDT
,
Vadim Makeev
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Vadim Makeev
Comment 1
2025-03-18 06:48:02 PDT
I turned out you don’t even need the shadow root. Any styles applied via `adoptedStyleSheets` are read-only in Web Inspector.
Radar WebKit Bug Importer
Comment 2
2025-03-18 09:30:37 PDT
<
rdar://problem/147322950
>
Vadim Makeev
Comment 3
2025-05-16 23:08:41 PDT
Most likely a duplicate of
https://bugs.webkit.org/show_bug.cgi?id=277893
Anthony Ricaud
Comment 4
2025-05-17 01:02:10 PDT
*** This bug has been marked as a duplicate of
bug 277893
***
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug