From 53149e33f88bec26d76e00a08748a99485e053e2 Mon Sep 17 00:00:00 2001 From: roytam1 Date: Fri, 8 May 2026 07:07:40 +0800 Subject: [PATCH] import from UXP: [layout] Check offset against start of skip range. (80b4d0fb) --- layout/generic/nsTextFrame.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layout/generic/nsTextFrame.cpp b/layout/generic/nsTextFrame.cpp index 5adf41fbd..ed45bd636 100644 --- a/layout/generic/nsTextFrame.cpp +++ b/layout/generic/nsTextFrame.cpp @@ -7375,7 +7375,7 @@ nsTextFrame::GetCharacterOffsetAtFramePointInternal(nsPoint aPoint, gfxFontUtils::IsRegionalIndicator (SURROGATE_TO_UCS4(frag->CharAt(offs), frag->CharAt(offs + 1)))) { allowSplitLigature = false; - if (extraCluster.GetSkippedOffset() > 1 && + if (extraCluster.GetSkippedOffset() >= skippedRange.start + 2 && !mTextRun->IsLigatureGroupStart(extraCluster.GetSkippedOffset())) { // CountCharsFit() left us in the middle of the flag; back up over the // first character of the ligature, and adjust fitWidth accordingly.