Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[IFC][Partial layout] Incorrect damage line index may cause double in…
…line items https://bugs.webkit.org/show_bug.cgi?id=256020 <rdar://108558653> Reviewed by Antti Koivisto. When the damaged content is at the beginning of the line, we mark the previous line as the entry point for the subsequent partial layout. It is not only a correctness requirement but also it provides a more convenient starting point for line layout/InlineItemBuilder to process the inline content. Layout::damagedLineIndex failed to recognize a leading display box due to collapsed whitespace content. Through some further content mutation, it lead to duplicated inline items (hard line breaks). * LayoutTests/fast/inline/contenteditable-with-leading-whitespace-crash-expected.txt: Added. * LayoutTests/fast/inline/contenteditable-with-leading-whitespace-crash.html: Added. * Source/WebCore/layout/formattingContexts/inline/InlineItemsBuilder.cpp: (WebCore::Layout::InlineItemsBuilder::build): * Source/WebCore/layout/formattingContexts/inline/invalidation/InlineInvalidation.cpp: (WebCore::Layout::damagedLineIndex): Canonical link: https://commits.webkit.org/263455@main
- Loading branch information
1 parent
9ac904f
commit 44b5f74
Showing
4 changed files
with
31 additions
and
2 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
LayoutTests/fast/inline/contenteditable-with-leading-whitespace-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,3 @@ | ||
PASS if no crash. | ||
|
||
|
20 changes: 20 additions & 0 deletions
20
LayoutTests/fast/inline/contenteditable-with-leading-whitespace-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,20 @@ | ||
<style> | ||
div { | ||
display: contents; | ||
} | ||
|
||
.flex_box { | ||
display: flex; | ||
} | ||
</style>PASS if no crash.<div class=flex_box onfocusin="justify()" contenteditable="true" draggable="true"> <details id=details></details></div> | ||
<script> | ||
if (window.testRunner) | ||
testRunner.dumpAsText(); | ||
document.body.offsetHeight; | ||
details.outerText = "some content"; | ||
document.defaultView.find("some"); | ||
|
||
function justify() { | ||
document.execCommand("justifyCenter", 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
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