forked from WebKit/WebKit-http
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[LFC][IFC] Incorrect middle alignment for inline boxes when line-heig…
…ht is present https://bugs.webkit.org/show_bug.cgi?id=225166 <rdar://77272112> Reviewed by Simon Fraser. Source/WebCore: Let's use the layout bounds instead of the baseline when computing the inline box's baseline offset from the root inline box's baseline. The difference here is that the layout bounds (per spec) is adjusted with the line-height value. These two values (layout bounds's ascent and the inline box's baseline) resolve to the same value as long as the line-height property is not set. Tests: fast/inline/incorrect-middle-alignment-with-line-height.html fast/inline/incorrect-middle-baseline-alignment-with-line-height.html * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::LineBoxBuilder::computeLineBoxHeightAndAlignInlineLevelBoxesVertically): LayoutTests: * fast/inline/incorrect-middle-alignment-with-line-height-expected.html: Added. * fast/inline/incorrect-middle-alignment-with-line-height.html: Added. * fast/inline/incorrect-middle-baseline-alignment-with-line-height-expected.html: Added. * fast/inline/incorrect-middle-baseline-alignment-with-line-height.html: Added. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@276767 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
zalan@apple.com
committed
Apr 29, 2021
1 parent
c60eb53
commit c752df2
Showing
7 changed files
with
83 additions
and
2 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
14 changes: 14 additions & 0 deletions
14
LayoutTests/fast/inline/incorrect-middle-alignment-with-line-height-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> | ||
table { | ||
font-family: Ahem; | ||
font-size: 20px; | ||
line-height: 10; | ||
background-color: green; | ||
border-spacing: 0px; | ||
} | ||
td { | ||
padding-top: 50px; | ||
vertical-align: baseline; | ||
} | ||
</style> | ||
<div><table><td style="height: 300px; width: 0px;"></td><td>middle align with line-height</td></table></div> |
14 changes: 14 additions & 0 deletions
14
LayoutTests/fast/inline/incorrect-middle-alignment-with-line-height.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> | ||
table { | ||
font-family: Ahem; | ||
font-size: 20px; | ||
line-height: 10; | ||
background-color: green; | ||
border-spacing: 0px; | ||
} | ||
|
||
td { | ||
vertical-align: middle; | ||
} | ||
</style> | ||
<div><table><td style="height: 300px; width: 0px;"></td><td>middle align with line-height</td></table></div> |
10 changes: 10 additions & 0 deletions
10
LayoutTests/fast/inline/incorrect-middle-baseline-alignment-with-line-height-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,10 @@ | ||
<style> | ||
div { | ||
font-family: Ahem; | ||
font-size: 20px; | ||
background-color: green; | ||
height: 112px; | ||
padding-top: 90px; | ||
} | ||
</style> | ||
<div>middle align with line-height</div> |
12 changes: 12 additions & 0 deletions
12
LayoutTests/fast/inline/incorrect-middle-baseline-alignment-with-line-height.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,12 @@ | ||
<style> | ||
div { | ||
font-family: Ahem; | ||
font-size: 20px; | ||
line-height: 10; | ||
background-color: green; | ||
} | ||
span { | ||
vertical-align: middle; | ||
} | ||
</style> | ||
<div><span>middle align with line-height</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
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