tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit a6aaefa6fdd36988305374faa14f10b11f7630ff
parent 6bd0f2609a93f191facac703e722b7a43f8aa255
Author: longsonr <longsonr@gmail.com>
Date:   Fri, 10 Oct 2025 18:33:35 +0000

Bug 1992865 r=jfkthame,emilio

Differential Revision: https://phabricator.services.mozilla.com/D267948

Diffstat:
Mlayout/svg/SVGTextFrame.cpp | 26+++++++++++++++-----------
1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/layout/svg/SVGTextFrame.cpp b/layout/svg/SVGTextFrame.cpp @@ -3621,18 +3621,22 @@ void SVGTextFrame::SelectSubString(nsIContent* aContent, uint32_t charnum, UpdateGlyphPositioning(); - // Convert charnum/nchars from addressable characters relative to - // aContent to global character indices. - CharIterator chit(this, CharIterator::eAddressable, aContent); - if (!chit.AdvanceToSubtree() || !chit.Next(charnum) || - chit.IsAfterSubtree()) { - aRv.ThrowIndexSizeError("Character index out of range"); - return; + RefPtr<nsIContent> content; + + { + // Convert charnum/nchars from addressable characters relative to + // aContent to global character indices. + CharIterator chit(this, CharIterator::eAddressable, aContent); + if (!chit.AdvanceToSubtree() || !chit.Next(charnum) || + chit.IsAfterSubtree()) { + aRv.ThrowIndexSizeError("Character index out of range"); + return; + } + charnum = chit.TextElementCharIndex(); + content = chit.GetTextFrame()->GetContent(); + chit.NextWithinSubtree(nchars); + nchars = chit.TextElementCharIndex() - charnum; } - charnum = chit.TextElementCharIndex(); - const RefPtr<nsIContent> content = chit.GetTextFrame()->GetContent(); - chit.NextWithinSubtree(nchars); - nchars = chit.TextElementCharIndex() - charnum; RefPtr<nsFrameSelection> frameSelection = GetFrameSelection();