Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[LFC][IFC] Preserved tab is not a word separator
https://bugs.webkit.org/show_bug.cgi?id=231687 Reviewed by Antti Koivisto. Source/WebCore: The 'tab' character is not considered a word separator in the word-spacing sense. When the preserved whitespace sequence has the mix of word separators (regular space) and non-separators, we use incorrect 'x' position to compute the width of the 'tab' character (tab width is position sensitive). This patch fixes it by splitting the whitespace sequence at word-separator boundary (e.g [space][space][tab] will produce 2 individual InlineTextItems [space][space] and [tab]). Test: fast/text/preserved-white-space-with-word-spacing.html * layout/formattingContexts/inline/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::candidateContentForLine): * layout/formattingContexts/inline/InlineTextItem.cpp: (WebCore::Layout::moveToNextNonWhitespacePosition): (WebCore::Layout::InlineTextItem::createAndAppendTextItems): LayoutTests: * fast/text/preserved-white-space-with-word-spacing-expected.html: Added. * fast/text/preserved-white-space-with-word-spacing.html: Added. Canonical link: https://commits.webkit.org/242947@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284127 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
1 parent
7138c6f
commit e17cf3e831a3c87379b8e875710cd59a7c62ba15
Showing
6 changed files
with
71 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<style> | ||
body { | ||
margin: 0px; | ||
} | ||
div { | ||
font-family: Ahem; | ||
font-size: 50px; | ||
} | ||
</style> | ||
<div>XX</div> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<style> | ||
body { | ||
margin: 0px; | ||
} | ||
div { | ||
white-space: pre; | ||
font-family: Ahem; | ||
font-size: 50px; | ||
margin-left: -400px; | ||
} | ||
span { | ||
word-spacing: 100px; | ||
} | ||
</style> | ||
<!-- The preserved tab is not a word separator and should not trigger word-spacing --> | ||
<div>X<span> X</span>X</div> |
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