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
ASSERT hit in surrogatePairAwareIndex and surrogatePairAwareStart lam…
…bdas for text with unpaired surrogates https://bugs.webkit.org/show_bug.cgi?id=231606 Patch by Gabriel Nava Marino <gnavamarino@apple.com> on 2021-10-12 Reviewed by Myles C. Maxfield. Source/WebCore: Tests: fast/text/word-break-column-gap-display-flex-utf16-surrogates.html fast/text/word-break-letter-spacing-utf16-surrogates.html fast/text/word-break-max-width-utf16-surrogates.html * layout/formattingContexts/inline/text/TextUtil.cpp: (WebCore::Layout::TextUtil::midWordBreak): Account for unpaired surrogates in surrogatePairAwareIndex and surrogatePairAwareStart lambdas in TextUtil::MidWordBreak TextUtil::midWordBreak LayoutTests: * fast/text/word-break-column-gap-display-flex-utf16-surrogates-expected.txt: Added. * fast/text/word-break-column-gap-display-flex-utf16-surrogates.html: Added. * fast/text/word-break-letter-spacing-utf16-surrogates-expected.txt: Added. * fast/text/word-break-letter-spacing-utf16-surrogates.html: Added. * fast/text/word-break-max-width-utf16-surrogates-expected.txt: Added. * fast/text/word-break-max-width-utf16-surrogates.html: Added. Canonical link: https://commits.webkit.org/242879@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284050 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
1 parent
b831a5d
commit fd51b4f290365fe44e338167b1c94a9bec950776
Showing
9 changed files
with
287 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
@@ -0,0 +1,15 @@ | ||
� | ||
� | ||
�r | ||
�r | ||
r� | ||
� | ||
𐀀 | ||
r�r | ||
r�r | ||
�� | ||
�r� | ||
�r� | ||
�𐀀 | ||
𐀀� | ||
PASS |
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
@@ -0,0 +1,70 @@ | ||
<style> | ||
div { | ||
word-break: break-word; | ||
column-gap: 1000px; | ||
display: flex; | ||
} | ||
</style> | ||
<script> | ||
onload = () => { | ||
// only surrogate lead | ||
document.getElementById("div1").append("\ud800"); | ||
|
||
// only surrogate trail | ||
document.getElementById("div2").append("\udc00"); | ||
|
||
// surrogate lead + single | ||
document.getElementById("div3").append("\ud800r"); | ||
|
||
// surrogate trail + single | ||
document.getElementById("div4").append("\udc00r"); | ||
|
||
// single + surrogate lead | ||
document.getElementById("div5").append("r\ud800"); | ||
|
||
// single + surrogate trail | ||
document.getElementById("div6").append("\udc00"); | ||
|
||
// surrogate lead + surrogate trail | ||
document.getElementById("div7").append("\ud800\udc00"); | ||
|
||
// single + surrogate lead + single | ||
document.getElementById("div8").append("r\ud800r"); | ||
|
||
// single + surrogate trail + single | ||
document.getElementById("div9").append("r\udc00r"); | ||
|
||
// surrogate trail + surrogate lead | ||
document.getElementById("div10").append("\udc00\ud800"); | ||
|
||
// surrogate lead + single + surrogate trail | ||
document.getElementById("div11").append("\ud800r\udc00"); | ||
|
||
// surrogate trail + single + surrogate lead | ||
document.getElementById("div12").append("\udc00r\ud800"); | ||
|
||
// surrogate trail + surrogate lead + surrogate trail | ||
document.getElementById("div13").append("\udc00\ud800\udc00"); | ||
|
||
// surrogate lead + surrogate trail + surrogate lead | ||
document.getElementById("div14").append("\ud800\udc00\ud800"); | ||
|
||
if (window.testRunner) | ||
testRunner.dumpAsText(); | ||
}; | ||
</script> | ||
<div id="div1"></div> | ||
<div id="div2"></div> | ||
<div id="div3"></div> | ||
<div id="div4"></div> | ||
<div id="div5"></div> | ||
<div id="div6"></div> | ||
<div id="div7"></div> | ||
<div id="div8"></div> | ||
<div id="div9"></div> | ||
<div id="div10"></div> | ||
<div id="div11"></div> | ||
<div id="div12"></div> | ||
<div id="div13"></div> | ||
<div id="div14"></div> | ||
PASS |
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
@@ -0,0 +1,15 @@ | ||
� | ||
� | ||
�r | ||
�r | ||
r� | ||
� | ||
𐀀 | ||
r�r | ||
r�r | ||
�� | ||
�r� | ||
�r� | ||
�𐀀 | ||
𐀀� | ||
PASS |
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
@@ -0,0 +1,69 @@ | ||
<style> | ||
div { | ||
word-break: break-word; | ||
letter-spacing: 1000px; | ||
} | ||
</style> | ||
<script> | ||
onload = () => { | ||
// only surrogate lead | ||
document.getElementById("div1").append("\ud800"); | ||
|
||
// only surrogate trail | ||
document.getElementById("div2").append("\udc00"); | ||
|
||
// surrogate lead + single | ||
document.getElementById("div3").append("\ud800r"); | ||
|
||
// surrogate trail + single | ||
document.getElementById("div4").append("\udc00r"); | ||
|
||
// single + surrogate lead | ||
document.getElementById("div5").append("r\ud800"); | ||
|
||
// single + surrogate trail | ||
document.getElementById("div6").append("\udc00"); | ||
|
||
// surrogate lead + surrogate trail | ||
document.getElementById("div7").append("\ud800\udc00"); | ||
|
||
// single + surrogate lead + single | ||
document.getElementById("div8").append("r\ud800r"); | ||
|
||
// single + surrogate trail + single | ||
document.getElementById("div9").append("r\udc00r"); | ||
|
||
// surrogate trail + surrogate lead | ||
document.getElementById("div10").append("\udc00\ud800"); | ||
|
||
// surrogate lead + single + surrogate trail | ||
document.getElementById("div11").append("\ud800r\udc00"); | ||
|
||
// surrogate trail + single + surrogate lead | ||
document.getElementById("div12").append("\udc00r\ud800"); | ||
|
||
// surrogate trail + surrogate lead + surrogate trail | ||
document.getElementById("div13").append("\udc00\ud800\udc00"); | ||
|
||
// surrogate lead + surrogate trail + surrogate lead | ||
document.getElementById("div14").append("\ud800\udc00\ud800"); | ||
|
||
if (window.testRunner) | ||
testRunner.dumpAsText(); | ||
}; | ||
</script> | ||
<div id="div1"></div> | ||
<div id="div2"></div> | ||
<div id="div3"></div> | ||
<div id="div4"></div> | ||
<div id="div5"></div> | ||
<div id="div6"></div> | ||
<div id="div7"></div> | ||
<div id="div8"></div> | ||
<div id="div9"></div> | ||
<div id="div10"></div> | ||
<div id="div11"></div> | ||
<div id="div12"></div> | ||
<div id="div13"></div> | ||
<div id="div14"></div> | ||
PASS |
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
@@ -0,0 +1,15 @@ | ||
� | ||
� | ||
�r | ||
�r | ||
r� | ||
� | ||
𐀀 | ||
r�r | ||
r�r | ||
�� | ||
�r� | ||
�r� | ||
�𐀀 | ||
𐀀� | ||
PASS |
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
@@ -0,0 +1,69 @@ | ||
<style> | ||
div { | ||
word-break: break-word; | ||
max-width: 1px; | ||
} | ||
</style> | ||
<script> | ||
onload = () => { | ||
// only surrogate lead | ||
document.getElementById("div1").append("\ud800"); | ||
|
||
// only surrogate trail | ||
document.getElementById("div2").append("\udc00"); | ||
|
||
// surrogate lead + single | ||
document.getElementById("div3").append("\ud800r"); | ||
|
||
// surrogate trail + single | ||
document.getElementById("div4").append("\udc00r"); | ||
|
||
// single + surrogate lead | ||
document.getElementById("div5").append("r\ud800"); | ||
|
||
// single + surrogate trail | ||
document.getElementById("div6").append("\udc00"); | ||
|
||
// surrogate lead + surrogate trail | ||
document.getElementById("div7").append("\ud800\udc00"); | ||
|
||
// single + surrogate lead + single | ||
document.getElementById("div8").append("r\ud800r"); | ||
|
||
// single + surrogate trail + single | ||
document.getElementById("div9").append("r\udc00r"); | ||
|
||
// surrogate trail + surrogate lead | ||
document.getElementById("div10").append("\udc00\ud800"); | ||
|
||
// surrogate lead + single + surrogate trail | ||
document.getElementById("div11").append("\ud800r\udc00"); | ||
|
||
// surrogate trail + single + surrogate lead | ||
document.getElementById("div12").append("\udc00r\ud800"); | ||
|
||
// surrogate trail + surrogate lead + surrogate trail | ||
document.getElementById("div13").append("\udc00\ud800\udc00"); | ||
|
||
// surrogate lead + surrogate trail + surrogate lead | ||
document.getElementById("div14").append("\ud800\udc00\ud800"); | ||
|
||
if (window.testRunner) | ||
testRunner.dumpAsText(); | ||
}; | ||
</script> | ||
<div id="div1"></div> | ||
<div id="div2"></div> | ||
<div id="div3"></div> | ||
<div id="div4"></div> | ||
<div id="div5"></div> | ||
<div id="div6"></div> | ||
<div id="div7"></div> | ||
<div id="div8"></div> | ||
<div id="div9"></div> | ||
<div id="div10"></div> | ||
<div id="div11"></div> | ||
<div id="div12"></div> | ||
<div id="div13"></div> | ||
<div id="div14"></div> | ||
PASS |
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