Closed Bug 1778977 Opened 3 months ago Closed 27 days ago

Can't disable system stylesheet in Style Editor

Categories

(DevTools :: Style Editor, defect, P3)

defect

Tracking

(firefox106 fixed)

RESOLVED FIXED
106 Branch
Tracking Status
firefox106 --- fixed

People

(Reporter: Honza, Assigned: jdescottes)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

STR:

  1. Load about:support page
  2. Open DevTools Toolbox and select the Style Editor
  3. Lookup forms.css stylesheet and try to disable it (click on the eye icon)

ER: the stylesheet is disabled (hidden)
AR: the stylesheet can't be disabled

Honza

The severity field is not set for this bug.
:jdescottes, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(jdescottes)

I think we are hitting read-only stylesheets:

bool StyleSheet::IsReadOnly() const {
  return IsComplete() && GetOrigin() == StyleOrigin::UserAgent;
}

https://searchfox.org/mozilla-central/rev/1d861901b6682ef2e191b9f7683eb267bdd131e2/layout/style/StyleSheet.cpp#1515-1517

Will verify this after a full build is completed. At the moment I can't see anything in the IDL which would help us detect that a stylesheet is read only or not however. It might be worth exposing this to chrome code. Or if the readonly flag is only here so that users cannot disable it, maybe we could lift the restriction for the browser toolbox.

Severity: -- → S3
Flags: needinfo?(jdescottes)
Priority: -- → P3

Those stylesheets can actually not be edited at all, even after lifting the restriction in IsReadOnly. But we can read the system property to flag them accordingly.

system stylesheets cannot be disabled, apply a dedicated classname on the summary and disable the visibility toggle

Assignee: nobody → jdescottes
Status: NEW → ASSIGNED

Now that the toggle itself can be disabled, the classname felt too confusing

Pushed by jdescottes@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/3b4cf7908a1d
[devtools] Disable the visibility toggle button on system stylesheets in Style Editor r=nchevobbe,fluent-reviewers,flod
https://hg.mozilla.org/integration/autoland/rev/50b43191a445
[devtools] Rename stylesheet-enabled to stylesheet-toggle r=nchevobbe
Status: ASSIGNED → RESOLVED
Closed: 27 days ago
Resolution: --- → FIXED
Target Milestone: --- → 106 Branch
QA Whiteboard: [qa-106b-p2]
You need to log in before you can comment on or make changes to this bug.