Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
REGRESSION(r176978): Inline-blocks with overflowing contents have asc…
…ents that are too large https://bugs.webkit.org/show_bug.cgi?id=141783 Reviewed by David Hyatt. Source/WebCore: When we have an inline-block element, and we want to find its baseline (to lay out other elements on the same line) we loop through the element's children and ask them what their baselines are. The children use the location of the top of their last line to compute this value. However, if the child has overflow-y, this might not be the correct calculation. This behavior is in the spec: "The baseline of an 'inline-block' is the baseline of its last line box in the normal flow, unless it has either no in-flow line boxes or if its 'overflow' property has a computed value other than 'visible', in which case the baseline is the bottom margin edge." -- http://www.w3.org/TR/CSS21/visudet.html#leading However, we believe that a better policy is, when overflow is not "visible," to place the baseline at the bottom of the block if the contents overflowed in the Y direction, and to place it at the bottom of the last line if the contents did not overflow in the Y direction. This is partially consistent with previous behavior, and isn't too far from the spec to cause too many breakages. Test: fast/css/inline-block-tricky-baselines.html fast/text/baseline-inline-block.html * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::inlineBlockBaseline): LayoutTests: Update expected results. * css3/flexbox/child-overflow-expected.html: * css3/flexbox/child-overflow.html: * fast/css/inline-block-tricky-baselines-expected.html: Added. * fast/css/inline-block-tricky-baselines.html: Added. * fast/forms/textfield-overflow-by-value-update-expected.txt: * fast/text/baseline-inline-block-expected.html: Added. * fast/text/baseline-inline-block.html: Added. * platform/mac/fast/forms/search-vertical-alignment-expected.txt: Canonical link: https://commits.webkit.org/160545@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@181292 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
12 changed files
with
175 additions
and
17 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
<style> | ||
.container { | ||
display: inline-block; | ||
vertical-align: top; | ||
margin-right: 30px; | ||
} | ||
|
||
|
24 changes: 24 additions & 0 deletions
24
LayoutTests/fast/css/inline-block-tricky-baselines-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,24 @@ | ||
<!DOCTYPE html> | ||
<style> | ||
|
||
.inline-block { | ||
display: inline-block; | ||
} | ||
|
||
.inner { | ||
display: block; | ||
width: 22px; | ||
height: 13px; | ||
overflow: hidden; | ||
} | ||
</style> | ||
<div class="pause inline-block"> | ||
<div class="inner"> | ||
Single | ||
</div> | ||
</div> | ||
<div class="next inline-block"> | ||
<div class="inner"> | ||
Multiple | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<!DOCTYPE html> | ||
<style> | ||
|
||
.inline-block { | ||
display: inline-block; | ||
} | ||
|
||
.inner { | ||
display: block; | ||
width: 22px; | ||
height: 13px; | ||
overflow: hidden; | ||
} | ||
</style> | ||
<div class="pause inline-block"> | ||
<div class="inner"> | ||
Single-line | ||
</div> | ||
</div> | ||
<div class="next inline-block"> | ||
<div class="inner"> | ||
Multiple words that get wrapped | ||
</div> | ||
</div> |
8 changes: 4 additions & 4 deletions
8
LayoutTests/fast/forms/textfield-overflow-by-value-update-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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
layer at (0,0) size 800x600 | ||
RenderView at (0,0) size 800x600 | ||
layer at (0,0) size 800x52 | ||
RenderBlock {HTML} at (0,0) size 800x52 | ||
RenderBody {BODY} at (8,8) size 784x36 | ||
RenderTextControl {INPUT} at (0,0) size 102x2 [bgcolor=#FFFFFF] | ||
layer at (0,0) size 800x34 | ||
RenderBlock {HTML} at (0,0) size 800x34 | ||
RenderBody {BODY} at (8,8) size 784x18 | ||
RenderTextControl {INPUT} at (0,13) size 102x2 [bgcolor=#FFFFFF] | ||
RenderText {#text} at (0,0) size 0x0 | ||
RenderText {#text} at (0,0) size 0x0 |
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,15 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<body> | ||
<div style="background: cyan; width: 100%; height: 352px;"></div> | ||
<div style="background: green; position: absolute; left: 13px; top: 95px; width: 50px; height: 150px; overflow: scroll;"><div style="width: 16px; height: 240px; background: black;"></div></div> | ||
<div style="background: green; position: absolute; left: 84px; top: 90px; width: 60px; height: 160px;"><div style="background: green; position: absolute; left: 5px; top: 5px; width: 50px; height: 150px; overflow: scroll;"><div style="width: 16px; height: 240px; background: black;"></div></div></div> | ||
<div style="background: green; position: absolute; left: 165px; top: 13px; width: 50px; height: 150px;"><div style="width: 16px; height: 240px; background: black;"></div></div> | ||
<div style="background: green; position: absolute; left: 236px; top: 8px; width: 60px; height: 160px;"><div style="background: green; position: absolute; left: 5px; top: 5px; width: 50px; height: 150px;"><div style="width: 16px; height: 240px; background: black;"></div></div></div> | ||
<div style="background: green; position: absolute; left: 312px; top: 184px; width: 60px; height: 160px;"><div style="background: green; position: absolute; left: 5px; top: 5px; width: 50px; height: 150px; overflow: scroll;"><div style="width: 16px; height: 64px; background: black;"></div></div></div> | ||
<div style="background: green; position: absolute; left: 388px; top: 184px; width: 60px; height: 160px;"><div style="background: green; position: absolute; left: 5px; top: 5px; width: 50px; height: 150px;"><div style="width: 16px; height: 64px; background: black;"></div></div></div> | ||
<div style="background: green; position: absolute; left: 469px; top: 189px; width: 50px; height: 150px;"><div style="width: 16px; height: 64px; background: black;"></div></div> | ||
<div style="background: black; position: absolute; left: 540px; top: 237px; width: 16px; height: 16px;"></div> | ||
<div style="background: black; position: absolute; left: 8px; top: 344px; width: 16px; height: 16px;"></div> | ||
</body> | ||
</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,37 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<body> | ||
<div style="background: cyan; font-family: Ahem; -webkit-font-smoothing: none;"> | ||
<div style="display: inline-block; background: green; height: 150px; width: 50px; overflow: scroll; margin: 5px;"> | ||
L<br>L<br>L<br>L<br>L<br>L<br>L<br>L<br>L<br>L<br>L<br>L<br>L<br>L<br>L<br> | ||
</div> | ||
<div style="display: inline-block; background: green;"> | ||
<div style="height: 150px; width: 50px; overflow: scroll; margin: 5px;"> | ||
L<br>L<br>L<br>L<br>L<br>L<br>L<br>L<br>L<br>L<br>L<br>L<br>L<br>L<br>L<br> | ||
</div> | ||
</div> | ||
<div style="display: inline-block; background: green; height: 150px; width: 50px; margin: 5px;"> | ||
L<br>L<br>L<br>L<br>L<br>L<br>L<br>L<br>L<br>L<br>L<br>L<br>L<br>L<br>L<br> | ||
</div> | ||
<div style="display: inline-block; background: green;"> | ||
<div style="height: 150px; width: 50px; margin: 5px;"> | ||
L<br>L<br>L<br>L<br>L<br>L<br>L<br>L<br>L<br>L<br>L<br>L<br>L<br>L<br>L<br> | ||
</div> | ||
</div> | ||
<div style="display: inline-block; background: green;"> | ||
<div style="height: 150px; width: 50px; overflow: scroll; margin: 5px;"> | ||
L<br>L<br>L<br>L<br> | ||
</div> | ||
</div> | ||
<div style="display: inline-block; background: green;"> | ||
<div style="height: 150px; width: 50px; margin: 5px;"> | ||
L<br>L<br>L<br>L<br> | ||
</div> | ||
</div> | ||
<div style="display: inline-block; background: green; height: 150px; width: 50px; margin: 5px;"> | ||
L<br>L<br>L<br>L<br> | ||
</div> | ||
L<br>L | ||
</div> | ||
</body> | ||
</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
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
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