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
"-webkit-box-decoration-break: clone" with left and right padding cau…
…ses unexpected wrapping of inline content https://bugs.webkit.org/show_bug.cgi?id=259188 <rdar://problem/112197978> Reviewed by Antti Koivisto. This bug is specific to shrink-to-fit content with "-webkit-box-decoration-break: clone" when the content is supposed to fit the current line. The fix is about accounting for the accumulated decoration end width when adjusting the available width for the continuous content. We already do that for content on the current line and this patch adjusts it for the current continuous content as well. * LayoutTests/fast/inline/shrink-to-fit-content-with-decoration-clone-expected.html: Added. * LayoutTests/fast/inline/shrink-to-fit-content-with-decoration-clone.html: Added. * Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp: (WebCore::Layout::LineCandidate::InlineContent::setAccumulatedClonedDecorationEnd): (WebCore::Layout::LineCandidate::InlineContent::accumulatedClonedDecorationEnd const): (WebCore::Layout::LineCandidate::InlineContent::reset): (WebCore::Layout::LineBuilder::candidateContentForLine): (WebCore::Layout::availableWidth): Canonical link: https://commits.webkit.org/266051@main
- Loading branch information
1 parent
59c4d69
commit e05c6e3
Showing
3 changed files
with
62 additions
and
3 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
LayoutTests/fast/inline/shrink-to-fit-content-with-decoration-clone-expected.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,19 @@ | ||
<style> | ||
.shrink_to_fit { | ||
float: left; | ||
font-size: 10px; | ||
background-color: green; | ||
margin-left: 5px; | ||
} | ||
|
||
span { | ||
padding-right: 20px; | ||
} | ||
</style> | ||
<div class=shrink_to_fit><span>Pass if no wrap</span></div> | ||
<div class=shrink_to_fit><span>Pass if no wrap</span></div> | ||
<div class=shrink_to_fit><span><span>Pass if no wrap</span></span></div> | ||
<div class=shrink_to_fit><span>Pass if no wrap</span></div> | ||
<div class=shrink_to_fit><span>Pass if no wrap</span></div> | ||
<div class=shrink_to_fit><span><span style="padding-right: 0px">Pass if no wrap</span></span></div> | ||
<div class=shrink_to_fit><span>Pass <span>if no wrap</span></span></div> |
21 changes: 21 additions & 0 deletions
21
LayoutTests/fast/inline/shrink-to-fit-content-with-decoration-clone.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,21 @@ | ||
<style> | ||
.shrink_to_fit { | ||
float: left; | ||
font-size: 10px; | ||
background-color: green; | ||
margin-left: 5px; | ||
} | ||
|
||
.decoration_clone { | ||
padding-right: 20px; | ||
overflow-wrap: break-word; | ||
-webkit-box-decoration-break: clone; | ||
} | ||
</style> | ||
<div class=shrink_to_fit><span style="padding-right: 20px">Pass if no wrap</span></div> | ||
<div class=shrink_to_fit><span class=decoration_clone>Pass if no wrap</span></div> | ||
<div class=shrink_to_fit><span class=decoration_clone><span class=decoration_clone>Pass if no wrap</span></span></div> | ||
<div class=shrink_to_fit><span class=decoration_clone>Pass if no wrap</span></div> | ||
<div class=shrink_to_fit><span class=decoration_clone>Pass if no wrap</span></div> | ||
<div class=shrink_to_fit><span class=decoration_clone><span>Pass if no wrap</span></div> | ||
<div class=shrink_to_fit><span class=decoration_clone>Pass <span class=decoration_clone>if no wrap</span></span></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