Bug 1307941 - Add DOM nodes highlighter in new console frontend; r=bgrins

Add in serviceContainer highlight and unhighlight utils function so they can
be accessible in components.
Fix EvaluationResult component to pass the serviceContainer to the MessageBody.
Modify ElementNodeRep and TextNodeRep to allow passing them function properties
`onDOMNodeMouseOver` and `onDOMNodeMouseOut` that will be called respectively
on mouseOver and mouseOut.
Add a mochitest in the webconsole to make sure we indeed highlight and unhighlight
node as expected, and add tests in Reps to make sure the passed functions get called
as expected.

MozReview-Commit-ID: 8o8WM7vBfMM
This commit is contained in:
Nicolas Chevobbe
2016-11-04 23:53:35 +01:00
parent 06f016702f
commit c0445d7013
10 changed files with 220 additions and 9 deletions

View File

@@ -58,7 +58,17 @@ NewConsoleOutputWrapper.prototype = {
openLink: url => this.jsterm.hud.owner.openLink.call(this.jsterm.hud.owner, url),
createElement: nodename => {
return this.document.createElementNS("http://www.w3.org/1999/xhtml", nodename);
}
},
highlightDomElement: (grip, options = {}) => {
return this.toolbox && this.toolbox.highlighterUtils
? this.toolbox.highlighterUtils.highlightDomValueGrip(grip, options)
: null;
},
unHighlightDomElement: (forceHide = false) => {
return this.toolbox && this.toolbox.highlighterUtils
? this.toolbox.highlighterUtils.unhighlight(forceHide)
: null;
},
}
});
let filterBar = FilterBar({