-
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.
(REGRESSION: 267587@main) Text indent is incorrect when paragraph is …
…affected by a floating element https://bugs.webkit.org/show_bug.cgi?id=265216 <rdar://problem/118701491> Reviewed by Antti Koivisto. Before 267587@main (which merged all the float constraints codepaths), we ignored the text-indent during the _initial_ constraint computation and adjusted the line rect later. At 267587@main, we started adding the text-indent value twice to the line rect; first while computing the initial constraint and the second time when we would normally add it. * LayoutTests/fast/text/text-indent-with-intrusive-float-expected.html: Added. * LayoutTests/fast/text/text-indent-with-intrusive-float.html: Added. * Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::initialConstraintsForLine const): Let's go back to "before 267587@main" state. (WebCore::Layout::LineBuilder::floatConstrainedRect const): Add some comment and change variable names to reflect what they mean. Canonical link: https://commits.webkit.org/271080@main
- Loading branch information
1 parent
4d59b02
commit b741d4c
Showing
3 changed files
with
43 additions
and
11 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
LayoutTests/fast/text/text-indent-with-intrusive-float-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,14 @@ | ||
<style> | ||
.inline-block { | ||
display: inline-block; | ||
margin-right: 100px; | ||
} | ||
|
||
div { | ||
width: 100px; | ||
height: 100px; | ||
background-color: green; | ||
} | ||
</style> | ||
<div class=inline-block></div><div class=inline-block></div> | ||
<div></div> |
18 changes: 18 additions & 0 deletions
18
LayoutTests/fast/text/text-indent-with-intrusive-float.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,18 @@ | ||
<style> | ||
.inline-block { | ||
display: inline-block; | ||
width: 100px; | ||
height: 100px; | ||
background-color: green; | ||
} | ||
|
||
.float-box { | ||
width: 100px; | ||
height: 100px; | ||
float: left; | ||
background-color: green; | ||
} | ||
</style> | ||
<!-- PASS if text-indent puts a 100px gap between the float and the inline content --> | ||
<div><div class="float-box"></div><div style="text-indent: 100px"><div class=inline-block></div></div></div> | ||
<div><div class="float-box"></div><div style="text-indent: -100px"><div class=inline-block></div></div></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