Bug 1571653: Reshow as parent grid if the grid which we hid is a parent of a subgrid highlighting. r=gl

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Daisuke Akatsuka 2019-08-15 05:01:26 +00:00
parent 7658b3e68d
commit 401719fc2b

View File

@ -672,9 +672,13 @@ class HighlightersOverlay {
// Since the subgrid and its parent grid container were previously both highlighted
// and the parent grid container (the given node) has just been hidden, show a
// translucent highlight of the parent grid container.
for (const parentGridNode of this.subgridToParentMap.values()) {
if (parentGridNode === node) {
await this.showParentGridHighlighter(parentGridNode);
for (const highlightedNode of this.gridHighlighters.keys()) {
const parentGridNode = await this.walker.getParentGridNode(
highlightedNode
);
if (node === parentGridNode) {
this.subgridToParentMap.set(highlightedNode, node);
await this.showParentGridHighlighter(node);
break;
}
}
@ -713,8 +717,10 @@ class HighlightersOverlay {
}
const highlighter = this.parentGridHighlighters.get(node);
await highlighter.hide();
this.extraGridHighlighterPool.push(highlighter);
if (highlighter) {
await highlighter.hide();
this.extraGridHighlighterPool.push(highlighter);
}
this.state.grids.delete(node);
this.parentGridHighlighters.delete(node);
}