-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fast text codepath] CharactersTreatedAsSpace is overly prescriptive
https://bugs.webkit.org/show_bug.cgi?id=260843 rdar://114607926 Reviewed by Cameron McCormack. When we lay out web content, we make multiple passes over the text, chopping it up multiple different ways. Because of this, we have an invariant that the width of a space can't change depending on the bounds of how we're chopping up the text. Kerning can affect the width of a space, so we enforce the invariant by having a postprocess that we perform after shaping to retroactively go back and adjust the width of any glyphs associated with space characters, to reset their widths. This is called "CharactersTreatedAsSpace." However, CharactersTreatedAsSpace actually does something else, too: it also adjusts the width of the character directly before the space to be whatever it was before shaping. However, this is kind of bogus - it's totally valid for shaping to adjust the width of whichever character happens to be before the space. Now that we're trying to make the fast text codepath handle complex character clusters, we're hitting the case more often where shaping is adjusting the non-space glyphs to be correct, but then our postprocess is coming along and messing them up. This patch removes that logic, just for the glyphs before the space characters. The logic about trying to reset the space characters' width is still there. * Source/WebCore/platform/graphics/WidthIterator.cpp: (WebCore::OriginalAdvancesForCharacterTreatedAsSpace::OriginalAdvancesForCharacterTreatedAsSpace): (WebCore::WidthIterator::applyFontTransforms): (WebCore::WidthIterator::advanceInternal): Canonical link: https://commits.webkit.org/267541@main
- Loading branch information
Showing
5 changed files
with
21 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters