STR: - visit https://www.mozilla.org/en-US/privacy/firefox/ and select "Firefox" from the top menu - have a look at the flex items in the sidebar ER: - show only items as interactive that are actually interactive AR: - text node shows with hover color and "navigation arrow", even though it's not clickable/selectable as flex item
Really it should be possible to click and select the text node within this flex container. The problem you have discovered here is that short text nodes that are only-child of a parent element are "inlined" in the markup-view instead of shown as a different node that can be independently selected. This was done on purpose years ago to make the markup-view look more compact. But now it's unfortunately making it impossible for us to select them and see the flex item sizing information for them. I don't think the solution is to undo the inlining of text nodes. Maybe we should show the anonymous block element that is created to wrap text nodes inside flex layouts? Or maybe we should make it possible to select an inlined text node.
I'm looking at the code for this, and what seems doable is not inlining text nodes when they are flex items. We do this already for Shadow DOM slots, so it might be good to this here too.
This change cleans up a lot of the getCurrentDisplay's logic which was unnecessarily complex, it seems. It also extracts the logic to walk up the DOM to find flex/grid containers to a reusable functions. Finally, this new extracted function is now used in the walker to determine if a text node can be inlined in its parent element or not.
Pushed by email@example.com: https://hg.mozilla.org/integration/autoland/rev/55d27d4a5f79 Don't inline only-child short text nodes that are also flex items; r=gl
You need to log in before you can comment on or make changes to this bug.