Closed Bug 1778977 Opened 1 year ago Closed 1 year ago

Can't disable system stylesheet in Style Editor

Categories

(DevTools :: Style Editor, defect, P3)

defect

Tracking

(firefox106 verified)

VERIFIED FIXED
106 Branch
Tracking Status
firefox106 --- verified

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

Blocks: 1788236
Assignee: nobody → jdescottes
Status: NEW → ASSIGNED
Depends on: 1789580

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: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 106 Branch
QA Whiteboard: [qa-106b-p2]

Reproduced the issue with Firefox 104.0a1 (2022-07-11) using the steps from the description, on Windows 10x64 and macOS 12. The forms.css stylesheet isn't disabled and can't be disabled by clicking on the eye icon.
The issue is verified fixed with Firefox 106.0 (20221010110315) on Windows 10x64, macOS 12, and Ubuntu 20.04. The forms.css stylesheet has the correct status, the stylesheet is disabled (hidden).

Status: RESOLVED → VERIFIED
QA Whiteboard: [qa-106b-p2]
You need to log in before you can comment on or make changes to this bug.