Bug 1583654 - Use the subgridToParentMap to check that the node was previously a subgrid. r=pbro

The previous condition didn't fully check that the grid node was previously a subgrid.
So, we run into a scenario where we refresh the page and a "display-change" event is hit
after a new root is loaded, and the grid highlighter is restored and hidden because
the check will pass as long as the node is a grid container.

Differential Revision: https://phabricator.services.mozilla.com/D49659

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Gabriel Luong 2019-10-18 17:57:09 +00:00
parent e16526e5db
commit 7a5b8a6a4f

View File

@ -1275,7 +1275,7 @@ class HighlightersOverlay {
}
// Hide the grid highlighter if the node is no longer a subgrid.
if (display !== "subgrid" && this.gridHighlighters.has(node)) {
if (display !== "subgrid" && this.subgridToParentMap.has(node)) {
await this.hideGridHighlighter(node);
return;
}