| Summary: | [LFC][IFC] Using Fontcascade::spaceWidth to subtract the trailing space width may result in incorrect layout | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | zalan <zalan> | ||||||||||||
| Component: | Layout and Rendering | Assignee: | zalan <zalan> | ||||||||||||
| Status: | RESOLVED FIXED | ||||||||||||||
| Severity: | Normal | CC: | bfulgham, commit-queue, koivisto, mjs, mmaxfield, simon.fraser, webkit-bug-importer, zalan | ||||||||||||
| Priority: | P2 | Keywords: | InRadar | ||||||||||||
| Version: | WebKit Nightly Build | ||||||||||||||
| Hardware: | Unspecified | ||||||||||||||
| OS: | Unspecified | ||||||||||||||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=235995 | ||||||||||||||
| Bug Depends on: | 235998 | ||||||||||||||
| Bug Blocks: | |||||||||||||||
| Attachments: |
|
||||||||||||||
|
Description
zalan
2022-01-31 20:23:58 PST
Created attachment 450492 [details]
Patch
Created attachment 450529 [details]
Patch
Created attachment 450538 [details]
Patch
Created attachment 450559 [details]
Patch
Committed r288914 (246654@main): <https://commits.webkit.org/246654@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 450559 [details]. Re-opened since this is blocked by bug 235998 Created attachment 450605 [details]
Patch
null terminator? where we're going we don't need null terminator. Committed r288944 (246674@main): <https://commits.webkit.org/246674@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 450605 [details]. Comment on attachment 450605 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=450605&action=review > Source/WebCore/layout/formattingContexts/inline/text/TextUtil.cpp:94 > + return fontCascade.width(TextRun { String { &space, 1 } }); There are no performance problems with this? (In reply to Myles C. Maxfield from comment #12) > Comment on attachment 450605 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=450605&action=review > > > Source/WebCore/layout/formattingContexts/inline/text/TextUtil.cpp:94 > > + return fontCascade.width(TextRun { String { &space, 1 } }); > > There are no performance problems with this? I had run our classic PerformanceTests/Layout/line-layout-simple.html microbenchmark locally before landing this and it showed about 0.5% regression. I also tested it with a slightly different version of the patch: const auto& spaceGlyphData = fontCascade.glyphDataForCharacter(space, false); return (!spaceGlyphData.font ? fontCascade.spaceWidth() : spaceGlyphData.font>widthForGlyph(spaceGlyphData.glyph)) + fontCascade.letterSpacing(); and it came back with the same numbers. |