Closed Bug 1499630 Opened 6 years ago Closed 6 years ago

Text nodes that are flex items aren't highlighted correctly in the flexbox highlighter when they wrap

Categories

(DevTools :: Inspector, defect, P2)

defect

Tracking

(firefox65 verified)

VERIFIED FIXED
Firefox 65
Tracking Status
firefox65 --- verified

People

(Reporter: pbro, Assigned: miker)

References

Details

Attachments

(2 files)

Steps to reproduce:

- Open the following URL in nightly
data:text/html,<div style="display:flex;width:400px;">this is just a text node that will be wrapped in an anonymous flex item element</div>
- Open the inspector
- Click on the [Flex] badge in the inspector

Expected result: the text node is a flex item (well, really it's wrapped in an anonymous block container), so it should be highlighted as such.

Actual result: only the first line of text is being highlighted, and depending on where the text wraps, there might be some justify-content area being highlighted where it should not.

Indeed, the anonymous container wrapping the text node takes all of the 400px that is available, so there really is no gap around the item. It only appears to be one because of the way we currently highlight flex items.

I'm guessing we use getBoxQuads and default to highlighting the first quad returned.
That will always work fine for actual ELEMENT_NODE items, but for TEXT_NODE items, we will probably need to use getBoundingClientRect or similar. 
The thing is, this doesn't work on text nodes.
This shows that only the first line is highlighted, and that there is some unwanted gap being highlighted at the end of the container.
Priority: -- → P2
Assignee: nobody → mratcliffe
Status: NEW → ASSIGNED
Pushed by mratcliffe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d71137840bd8
Text nodes that are flex items aren't highlighted correctly in the flexbox highlighter when they wrap r=gl
https://hg.mozilla.org/mozilla-central/rev/d71137840bd8
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 65
Flags: qe-verify+

I reproduced this issue using 64.0a1(2018-10-17), on Windows 10 x64.
I can confirm this issue is fixed, I verified using Fx 65.0b10 on Windows 10 x64, macOS 10.13 and Ubuntu 16.04 LTS.
Cheers!

Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: