Issue #2063 - Ensure a floated ::first-letter inherits from ::first-line.

This fixes the 24 year old Mozilla bug 13610.

Co-authored-by: Ryo Onodera <ryoqun@gmail.com>
This commit is contained in:
Job Bautista 2022-12-23 19:21:40 +08:00 committed by roytam1
commit 09cbcd3413

View file

@ -9033,6 +9033,13 @@ nsFrame::CorrectStyleParentFrame(nsIFrame* aProspectiveParent,
parent = sibling;
}
}
// Ensure ::first-letter inherits from ::first-line even when floated, see
// Issue #2063 / Mozilla bug 13610.
if (parent->GetType() == nsGkAtoms::lineFrame &&
parent == parent->FirstInFlow()) {
return parent;
}
nsIAtom* parentPseudo = parent->StyleContext()->GetPseudo();
if (!parentPseudo ||