зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1620280 - [devtools] Prevent showing/hiding highlighters when the panels are already destroyed. r=jdescottes
browser_animation_animation-target_select.js was failing on debug builds because of exception during test ends. Differential Revision: https://phabricator.services.mozilla.com/D91892
This commit is contained in:
Родитель
2a6162be5b
Коммит
2c5b9717e7
|
@ -233,6 +233,11 @@ BoxModel.prototype = {
|
|||
* Hides the box-model highlighter on the currently selected element.
|
||||
*/
|
||||
onHideBoxModelHighlighter() {
|
||||
// As React components aren't destroyed when the panel closes,
|
||||
// this function may still be called and throw because of destroyed fronts.
|
||||
if (!this.inspector) {
|
||||
return;
|
||||
}
|
||||
this.inspector.highlighters.hideHighlighterType(
|
||||
this.inspector.highlighters.TYPES.BOXMODEL
|
||||
);
|
||||
|
|
|
@ -1927,6 +1927,11 @@ Inspector.prototype = {
|
|||
* Options passed to the highlighter actor.
|
||||
*/
|
||||
onShowBoxModelHighlighterForNode(nodeFront, options) {
|
||||
// As React components aren't destroyed when the panel closes,
|
||||
// this function may still be called and throw because of destroyed fronts.
|
||||
if (this._destroyed) {
|
||||
return;
|
||||
}
|
||||
this.highlighters.showHighlighterTypeForNode(
|
||||
this.highlighters.TYPES.BOXMODEL,
|
||||
nodeFront,
|
||||
|
|
Загрузка…
Ссылка в новой задаче