From 09cbcd3413283169ee7569d34e66c8b704736a27 Mon Sep 17 00:00:00 2001 From: Job Bautista Date: Fri, 23 Dec 2022 19:21:40 +0800 Subject: [PATCH] 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 --- layout/generic/nsFrame.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index 291270db99..69d9376e5b 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -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 ||