Wrong element is selected in inspector after deleting an element, if whitespace text node is present
Categories
(DevTools :: Inspector, defect, P2)
Tracking
(firefox52 wontfix, firefox53 wontfix, firefox54 fix-optional, firefox56 wontfix, firefox57 fix-optional)
| Tracking | Status | |
|---|---|---|
| firefox52 | --- | wontfix |
| firefox53 | --- | wontfix |
| firefox54 | --- | fix-optional |
| firefox56 | --- | wontfix |
| firefox57 | --- | fix-optional |
People
(Reporter: 684sigma, Unassigned)
References
(Blocks 1 open bug)
Details
(Keywords: regression)
Updated•9 years ago
|
Comment 2•9 years ago
|
||
Comment 4•9 years ago
|
||
Comment 5•9 years ago
|
||
Updated•8 years ago
|
Updated•8 years ago
|
Updated•3 years ago
|
Updated•1 year ago
|
Comment 6•1 year ago
•
|
||
The issue comes from the removeNode function in https://searchfox.org/mozilla-central/rev/c5ed4a89fd7a8c878df552e5d53fe50e0088c15b/devtools/client/fronts/walker.js#333-340
async removeNode(node) {
const previousSibling = await this.previousSibling(node);
const nextSibling = await super.removeNode(node);
return {
previousSibling,
nextSibling,
};
}
So here, we're retrieving the previous and next siblings of the node we're going to remove, to select one or the other.
The issue is that when those siblings are whitespace text nodes, removing the node will make the whitespace text node to be selected, but also, now the whitespace text node is going to be skipped, i.e. removed from the markup view, so we end up with no selected node at all.
The fix isn't straightforward as we'd need to know before removing the node if it will impact the visibility of the siblings, and we don't have an easy way to do that.
Another solution would be to better handle re-selecting a sibling node when the selected whitespace text node is removed
Description
•