Closed Bug 926974 Opened 6 years ago Closed 6 years ago

[markup view] Theme does not immediately apply after switching


(DevTools :: Inspector, defect)

Not set


(Not tracked)

Firefox 27


(Reporter: bgrins, Assigned: bgrins)



(2 files)

Steps to reproduce:

Open devtools
Open the inspector panel and note the theme applied to the markup view
Open the devtools settings
Switch the theme
Go back to inspector panel

Expected behavior:
The markup view's theme will have been updated

Actual behavior:
The markup view's theme is still the same as the old one.

This appears to have been triggered by Bug 918996, somehow related to this line:


If this is replaced with either true or false, the theme switches as expected.
Attached patch 926974.patchSplinter Review
theme-switching.js is throwing an exception the first time this is run on markup-view.xhtml in line 38 of theme-switching.js:

     "TypeError: window.matchMedia(...) is null"

This is causing the markup view to not bind to the "pref-changed" event and causes the error.  We could work around this issue using the hiddenDOMWindow instead of window.  It seems like maybe this is this a bug in the implementation that we need to get fixed?  According to, this function should be returning a MediaQueryList, it doesn't specify any times that it should be returning null.  The main difference with this one place where it fails is that it seems to be that it is running inside of an HTML window.

Here is a patch that works around the problem by using the hiddenDOMWindow.  Should we go with this or deal with it some other way?
Attachment #817233 - Flags: review?(paul)
Attachment #817233 - Flags: review?(paul) → review+
Keywords: checkin-needed
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 27
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.