From 3ed091cf7013d5b8b07302c251bb4dcd9bdc897c Mon Sep 17 00:00:00 2001 From: Michael Ratcliffe Date: Wed, 28 Nov 2018 16:40:20 +0000 Subject: [PATCH] Bug 1509004 - Flexbox highlighter remains in place when toggling display:flex in the styles r=gl Differential Revision: https://phabricator.services.mozilla.com/D12665 --HG-- extra : moz-landing-system : lando --- devtools/server/actors/highlighters/flexbox.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/devtools/server/actors/highlighters/flexbox.js b/devtools/server/actors/highlighters/flexbox.js index a47ac6507329..0c9a82a84ea4 100644 --- a/devtools/server/actors/highlighters/flexbox.js +++ b/devtools/server/actors/highlighters/flexbox.js @@ -747,6 +747,18 @@ class FlexboxHighlighter extends AutoRefreshHighlighter { } _update() { + // If this.currentNode is not a flex container we have nothing to highlight. + // We can't simply use getAsFlexContainer() here because this fails for + // text fields. This will be removed by https://bugzil.la/1509460. + if (!this.computedStyle) { + this.computedStyle = getComputedStyle(this.currentNode); + } + + if (this.computedStyle.display !== "flex" && + this.computedStyle.display !== "inline-flex") { + return false; + } + setIgnoreLayoutChanges(true); const root = this.getElement("root");