Bug 1901233: Make CreateFlexLineAndFlexItemInfo account for subtrees with only anonymous boxes. r=dholbert

Differential Revision: https://phabricator.services.mozilla.com/D213086
This commit is contained in:
Brad Werth
2024-06-10 23:17:43 +00:00
parent fc9f36b6b4
commit f67e91d1f1

View File

@@ -5031,8 +5031,11 @@ void nsFlexContainerFrame::CreateFlexLineAndFlexItemInfo(
// anonymous flex item, e.g. wrapping one or more text nodes.
// DevTools wants the content node for the actual child in
// the DOM tree, so we descend through anonymous boxes.
nsIContent* content = nullptr;
nsIFrame* targetFrame = GetFirstNonAnonBoxInSubtree(frame);
nsIContent* content = targetFrame->GetContent();
if (targetFrame) {
content = targetFrame->GetContent();
}
// Skip over content that is only whitespace, which might
// have been broken off from a text node which is our real