Open Bug 1158171 Opened 9 years ago Updated 2 years ago

Get rid of the highlighter creation error in XUL documents

Categories

(DevTools :: Style Editor, defect, P3)

defect

Tracking

(Not tracked)

People

(Reporter: pbro, Unassigned)

References

Details

STR:
- open a XUL document: about:preferences
- open the style-editor

The tool opens up fine, but the following error is logged:

console.error: 
  Message: Error: Custom SelectorHighlighterhighlighter cannot be created in a XUL window
  Stack:
    exports.CustomHighlighterActor<.initialize@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/server/actors/highlighter.js:431:1
constructor@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/core/heritage.js:146:23
exports.InspectorActor<.getHighlighterByType<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/server/actors/inspector.js:3469:14
actorProto/</handler@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/server/protocol.js:1006:19
DSC_onPacket@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/server/main.js:1456:15
LocalDebuggerTransport.prototype.send/<@resource://gre/modules/devtools/dbg-client.jsm -> resource://gre/modules/devtools/transport/transport.js:561:11
makeInfallible/<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/DevToolsUtils.js:82:14
makeInfallible/<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/DevToolsUtils.js:82:14

exports.CustomHighlighterActor<.initialize@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/server/actors/highlighter.js:431:1
constructor@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/core/heritage.js:146:23
exports.InspectorActor<.getHighlighterByType<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/server/actors/inspector.js:3469:14
actorProto/</handler@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/server/protocol.js:1006:19
DSC_onPacket@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/server/main.js:1456:15
LocalDebuggerTransport.prototype.send/<@resource://gre/modules/devtools/dbg-client.jsm -> resource://gre/modules/devtools/transport/transport.js:561:11
makeInfallible/<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/DevToolsUtils.js:82:14
makeInfallible/<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/DevToolsUtils.js:82:14
console.error: 
  Protocol error (unknownError): Error: Custom SelectorHighlighterhighlighter cannot be created in a XUL window
console.warn: The selectorHighlighter couldn't be instantiated, elements matching hovered selectors will not be highlighted

It's even more frustrating because the same message is logged twice.

Our devtools highlighters only work in HTML documents right now. We know this, it's a limitation (see bug 1094959).
The style-editor needs a highlighter because it can highlight matching nodes when you hover selectors.
So, when it initializes, it tries to get the highlighter. That call fails, and logs an error via protocol.js.
The front-end is prepared for this and doesn't break, so it's fine, but we really shouldn't show this error at all.
Originally, the plan was to only log a single line console.warn warning. I'm wondering if that's even needed.
Inspector bug triage (filter on CLIMBING SHOES).
Priority: -- → P3
Product: Firefox → DevTools
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.