-
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 262277@main) Incorrect float placement when clear is present
https://bugs.webkit.org/show_bug.cgi?id=260202 <rdar://111577468> Reviewed by Antti Koivisto. When no float is present at the clear direction it still needs to "clear" the existing floats. e.g. <div style="float: left"></div> <div style="float: left; clear: right;"></div> (notice we are supposed to clear right, but there's no right float in this context) This patch ensures that we take existing floats into account for the initial position when there's nothing to clear. * LayoutTests/fast/block/float/float-left-with-clear-right-incorrect-position-expected.html: Added. * LayoutTests/fast/block/float/float-left-with-clear-right-incorrect-position.html: Added. * Source/WebCore/layout/floats/FloatingContext.cpp: (WebCore::Layout::FloatingContext::positionForFloat const): (WebCore::Layout::FloatingContext::bottom const): Canonical link: https://commits.webkit.org/266918@main
- Loading branch information
1 parent
30959c8
commit 0c02598
Showing
3 changed files
with
66 additions
and
26 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
LayoutTests/fast/block/float/float-left-with-clear-right-incorrect-position-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,16 @@ | ||
<style> | ||
.container { | ||
width: 50px; | ||
} | ||
|
||
.box { | ||
width: 50px; | ||
height: 50px; | ||
} | ||
</style> | ||
<div class=container> | ||
<div class=box></div> | ||
<div class=box style="background-color: green"></div> | ||
<div class=box></div> | ||
PASS if green box is visible. | ||
</div> |
26 changes: 26 additions & 0 deletions
26
LayoutTests/fast/block/float/float-left-with-clear-right-incorrect-position.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,26 @@ | ||
<style> | ||
.container { | ||
width: 50px; | ||
} | ||
|
||
.float { | ||
width: 50px; | ||
height: 50px; | ||
float: left; | ||
} | ||
|
||
.sibling { | ||
background-color: green; | ||
} | ||
|
||
.clear_box { | ||
clear: right; | ||
background-color: white; | ||
} | ||
</style> | ||
<div class=container> | ||
<div class=float></div> | ||
<div class="float sibling"></div> | ||
<div class="float clear_box"></div> | ||
PASS if green box is visible. | ||
</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