Closed Bug 1700548 Opened 4 years ago Closed 4 years ago

Media color scheme simulation is turned off when closing RDM

Categories

(DevTools :: Responsive Design Mode, defect)

Firefox 87
defect

Tracking

(firefox89 fixed)

RESOLVED FIXED
89 Branch
Tracking Status
firefox89 --- fixed

People

(Reporter: nchevobbe, Assigned: nchevobbe)

References

Details

Attachments

(1 file)

Steps to reproduce

  1. Go to https://firefox-devtools-color-scheme-sim.glitch.me/
  2. Open the inspector and click on the moon icon to simulate dark mode
  3. Enable RDM (color simulation is still on)
  4. Close RDM

Expected results

Color simulation is still applied

Actual results

Color simulation isn't applied (going back to default light mode), even if the icon is still toggled.


This is due to the fact that closing RDM will lead to its associated commands instance being destroyed, which destroy the descriptor, which will destroy the browsingContext target, where we reset the color scheme simulation (devtools/server/actors/targets/browsing-context.js#1022,1031 -> devtools/server/actors/targets/browsing-context.js#1302,1308 )

Since RDM spawn a new browsing context target, closing it
was restoring the taret configuration, which meant disabling
any color-scheme simulation that might have been enabled.
This patch introduces a flag that is set when the color scheme
simulation is set, and that will be checked before disabling
it when the target is destroyed.
This way, the simulation is only disabled when the actual target
that was used to set it is destroyed (i.e. the toolbox target).
A test is added to check that the original issue with RDM is resolved.

Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED
Pushed by nchevobbe@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/7b3bb707ec67 [devtools] Reset color-scheme simulation from the browsing context target that set it. r=jdescottes.
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 89 Branch
Regressions: 1701750
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: