Open Bug 1832263 Opened 2 years ago Updated 2 years ago

Regression on userChrome.css transitions

Categories

(DevTools :: Style Editor, defect, P3)

defect

Tracking

(Not tracked)

UNCONFIRMED

People

(Reporter: n, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/112.0

Steps to reproduce:

Tried to call the update method of the stylesheets actor on the userChrome.css stylesheet with transition = true.

Actual results:

Got the following error:

{"from":"server1.conn22.styleSheetsActor6","error":"TypeError","message":"document is null","fileName":"resource://devtools/server/actors/utils/stylesheets-manager.js","lineNumber":379,"columnNumber":20}

and the stylesheet wasn't applied.

Expected results:

The stylesheet should have been applied with a transition. It is applied correctly if I set transition = false.

The error message points at this line: https://searchfox.org/mozilla-central/rev/master/devtools/server/actors/utils/stylesheets-manager.js#379

This suggests that the userChrome.css stylesheet has no associatedDocument, hence the null error.

The line was last changed by https://hg.mozilla.org/integration/autoland/rev/6d2ce4736498 (https://bugzilla.mozilla.org/show_bug.cgi?id=1769771). Before that commit, styleSheet.ownerNode.ownerDocument was used.

Maybe the fix is to fall back to ownerNode.ownerDocument if associatedDocument does not exist?

For reference, I am using this script to interact with the Remote Debugger Protocol.

Flags: needinfo?(emilio)

Before that commit it shouldn't work either, because styleSheet.ownerNode is null for userChrome.css.

Flags: needinfo?(emilio)

I see. This used to work a few years ago (hell, even a year ago I'm pretty sure) but I have not tracked the VCS history far enough.

You can bisect using mozregression with a custom --profile-persistence so that it has a profile with userChrome.css, probably?

I can't figure out how to start the debugger server to test a given build.

/run/user/1000/tmpl_dx701l/firefox/firefox -profile /run/user/1000/tmpf4pikzoe.mozrunner --start-debugger-server 6080

This complains that "Firefox is already running, but not responding".

Component: Agent → General
Product: Remote Protocol → DevTools

The Bugbug bot thinks this bug should belong to the 'DevTools::Debugger' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: General → Debugger

Need to identify which stylesheets are impacted by this issue and if regular toolbox or browser toolbox users can experience the bug.

Flags: needinfo?(jdescottes)

Changes made to userChrome.css in the browser toolbox take effect immediately without transition, so I don't know if it's affected.

Note that in 109, the old way (getting the stylesheet actor with getStyleSheets) still works fine with transition = true. Then in 110 the old way breaks with InspectorUtils.parseStyleSheet: Argument 1 is not an object., while the new way gives the document is null error.

(In reply to n from comment #7)

Changes made to userChrome.css in the browser toolbox take effect immediately without transition, so I don't know if it's affected.

Thanks for checking!

Severity: -- → S3
Component: Debugger → Style Editor
Flags: needinfo?(jdescottes)
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.