WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
268438
Remove `includePartialGlyphs` argument from SVGInlineTextBox::offsetForPositionInFragment since always true
https://bugs.webkit.org/show_bug.cgi?id=268438
Summary
Remove `includePartialGlyphs` argument from SVGInlineTextBox::offsetForPositi...
Ahmad Saleem
Reported
2024-01-30 21:40:43 PST
Hi Team, It is always true, so rather than argument, we can pass it as directly in function.
https://searchfox.org/wubkat/rev/3b0ecebf15c658e0e5ecd1e3e217ff02d491733f/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp#91
__ Current: int SVGInlineTextBox::offsetForPositionInFragment(const SVGTextFragment& fragment, float position, bool includePartialGlyphs) const { float scalingFactor = renderer().scalingFactor(); ASSERT(scalingFactor); TextRun textRun = constructTextRun(renderer().style(), fragment); // Eventually handle lengthAdjust="spacingAndGlyphs". // FIXME: Handle vertical text. AffineTransform fragmentTransform; fragment.buildFragmentTransform(fragmentTransform); if (!fragmentTransform.isIdentity()) textRun.setHorizontalGlyphStretch(narrowPrecisionToFloat(fragmentTransform.xScale())); return fragment.characterOffset - start() + renderer().scaledFont().offsetForPosition(textRun, position * scalingFactor, includePartialGlyphs); } To: int SVGInlineTextBox::offsetForPositionInFragment(const SVGTextFragment& fragment, float position, ) const { float scalingFactor = renderer().scalingFactor(); ASSERT(scalingFactor); const bool includePartialGlyphs = true; TextRun textRun = constructTextRun(renderer().style(), fragment); // Eventually handle lengthAdjust="spacingAndGlyphs". // FIXME: Handle vertical text. AffineTransform fragmentTransform; fragment.buildFragmentTransform(fragmentTransform); if (!fragmentTransform.isIdentity()) textRun.setHorizontalGlyphStretch(narrowPrecisionToFloat(fragmentTransform.xScale())); return fragment.characterOffset - start() + renderer().scaledFont().offsetForPosition(textRun, position * scalingFactor, includePartialGlyphs); } ___ and also update the definition and also this call-site:
https://searchfox.org/wubkat/rev/3b0ecebf15c658e0e5ecd1e3e217ff02d491733f/Source/WebCore/rendering/svg/RenderSVGInlineText.cpp#203
from: int offset = closestDistanceBox->offsetForPositionInFragment(*closestDistanceFragment, absolutePoint.x() - closestDistancePosition, true); To: int offset = closestDistanceBox->offsetForPositionInFragment(*closestDistanceFragment, absolutePoint.x() - closestDistancePosition); ____ So just wanted to raise so we can fix it. Thanks!
Attachments
Add attachment
proposed patch, testcase, etc.
EWS
Comment 1
2024-01-31 09:46:33 PST
Committed
273833@main
(c7afd1bc35e2): <
https://commits.webkit.org/273833@main
> Reviewed commits have been landed. Closing PR #23562 and removing active labels.
Radar WebKit Bug Importer
Comment 2
2024-01-31 09:47:16 PST
<
rdar://problem/122022992
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug