-
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.
[IFC][Partial layout] Unbalanced InlineBoxStart/End may cause unexpec…
…ted state in InlineItemsBuilder https://bugs.webkit.org/show_bug.cgi?id=271430 <rdar://125183454> Reviewed by Antti Koivisto. This change ensures graceful recovery when partial layout produces unbalanced InlineBoxStart/End pairs with more InlineBoxEnd items than InlineBoxStart ones. * LayoutTests/TestExpectations: * LayoutTests/fast/text/bidi-text-and-partial-layout-crash-expected.txt: Added. * LayoutTests/fast/text/bidi-text-and-partial-layout-crash.html: Added. * Source/WebCore/layout/formattingContexts/inline/InlineItemsBuilder.cpp: (WebCore::Layout::handleEnterExitBidiContext): (WebCore::Layout::rewindBidiContextStack): Canonical link: https://commits.webkit.org/276535@main
- Loading branch information
1 parent
b7d8be7
commit 9ca509f
Showing
4 changed files
with
56 additions
and
0 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
7 changes: 7 additions & 0 deletions
7
LayoutTests/fast/text/bidi-text-and-partial-layout-crash-expected.txt
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,7 @@ | ||
|
||
|
||
PASS if no crash. | ||
|
||
|
||
|
||
|
36 changes: 36 additions & 0 deletions
36
LayoutTests/fast/text/bidi-text-and-partial-layout-crash.html
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,36 @@ | ||
<style> | ||
#container { | ||
text-indent: 200px each-line; | ||
white-space: pre; | ||
widows: 1; | ||
} | ||
|
||
.writing-mode { | ||
height: 102px; | ||
writing-mode: tb-rl; | ||
} | ||
|
||
*:nth-last-child(1) { | ||
-webkit-column-span: all; | ||
} | ||
|
||
*:read-only { | ||
-webkit-user-modify: read-write; | ||
padding: 10px; | ||
column-width: 100px; | ||
} | ||
</style> | ||
<span id=container><b class=writing-mode dir="auto"> | ||
<span style="unicode-bidi: isolate"> | ||
PASS if no crash. | ||
</span> | ||
</b> | ||
<span></span> | ||
<script> | ||
if (window.testRunner) | ||
testRunner.dumpAsText(); | ||
|
||
document.dir = "rtl"; | ||
window.getSelection().selectAllChildren(container); | ||
document.execCommand("justifyLeft", false, null); | ||
</script> |
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