Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge r176978 - Inline elements whose parents have small line-height …
…are laid out too low https://bugs.webkit.org/show_bug.cgi?id=139375 Reviewed by Dave Hyatt. Source/WebCore: This is a port of the Blink patch at https://src.chromium.org/viewvc/blink?revision=155253&view=revision. When laying out inline elements, we try to align leaf children's parents' baselines across the entire line. However, if you set line-height: 0px on a span, the entire InlineBox which represents that span will have a height of 0, and therefore be laid out entirely on the baseline. In addition, we will try to vertically center the leaf text in the span's InlineBox, which means the leaf text will be vertically centered on the baseline. All the other major browsers do not have this behavior; instead, they line up the boxes as you would expect. This bug led to a rendering problem on the front page of the New York Times. Here is the ChangeLog from the Blink patch: Fix baseline position when it is outside the element's box Specifically, we shouldn't force the baseline to be inside the element. IE and FF don't do this, and it's incompatible with the CSS 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 It doesn't have a special case for "baseline is outside of the element's margin box". Test: fast/text/small-line-height.html * rendering/RenderBlock.cpp: (WebCore::RenderBlock::baselinePosition): LayoutTests: Add fast/text/small-line-height.html for a simple example. In addition, update existing tests. * fast/forms/textfield-overflow-by-value-update-expected.txt: * fast/regions/cssom/client-rects-inline-complex.html: * fast/regions/overflow/overflow-region-inline-expected.html: * fast/text/small-line-height-expected.html: Added. * fast/text/small-line-height.html: Added. * platform/mac/fast/box-sizing/box-sizing-expected.png: * platform/mac/fast/box-sizing/box-sizing-expected.txt: * platform/mac/fast/forms/search-vertical-alignment-expected.png: * platform/mac/fast/forms/search-vertical-alignment-expected.txt: * platform/mac/fast/forms/textfield-overflow-by-value-update-expected.png: Removed. * platform/mac/fast/multicol/client-rects-expected.png: * platform/mac/fast/multicol/client-rects-expected.txt: * platform/mac/fast/multicol/client-rects-spanners-complex-expected.png: * platform/mac/fast/multicol/client-rects-spanners-complex-expected.txt: * platform/mac/fast/multicol/client-rects-spanners-expected.png: * platform/mac/fast/multicol/client-rects-spanners-expected.txt: * platform/mac/fast/multicol/layers-split-across-columns-expected.png: * platform/mac/fast/multicol/layers-split-across-columns-expected.txt: * platform/mac/fast/multicol/newmulticol/client-rects-expected.png: * platform/mac/fast/multicol/newmulticol/client-rects-expected.txt: Canonical link: https://commits.webkit.org/154760.266@webkitgtk/2.6 git-svn-id: https://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.6@178335 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
1 parent
ee513bf
commit ef84d8c
Showing
24 changed files
with
788 additions
and
689 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
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 800x34 | ||
RenderBlock {HTML} at (0,0) size 800x34 | ||
RenderBody {BODY} at (8,8) size 784x18 | ||
RenderTextControl {INPUT} at (0,12) size 102x2 [bgcolor=#FFFFFF] | ||
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] | ||
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
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
</head> | ||
<body> | ||
WordAnother word | ||
</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,8 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
</head> | ||
<body> | ||
<span style="display: inline-block; line-height: 0px;">Word</span>Another word | ||
</body> | ||
</html> |
Binary file added
BIN
+24.7 KB
...sts/platform/mac-mountainlion/fast/forms/search-vertical-alignment-expected.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Binary file modified
BIN
+2.89 KB
(110%)
LayoutTests/platform/mac/fast/box-sizing/box-sizing-expected.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
105 changes: 53 additions & 52 deletions
105
LayoutTests/platform/mac/fast/box-sizing/box-sizing-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,90 +1,91 @@ | ||
layer at (0,0) size 785x909 | ||
layer at (0,0) size 785x953 | ||
RenderView at (0,0) size 785x600 | ||
layer at (0,0) size 785x909 | ||
RenderBlock {HTML} at (0,0) size 785x910 | ||
RenderBody {BODY} at (8,8) size 769x894 | ||
RenderBlock (anonymous) at (0,0) size 769x18 | ||
RenderText {#text} at (0,0) size 373x18 | ||
text run at (0,0) width 373: "All of the boxes below should be 20x20 and look identical." | ||
RenderBlock {H1} at (0,39) size 769x38 | ||
layer at (0,0) size 785x953 | ||
RenderBlock {HTML} at (0,0) size 785x954 | ||
RenderBody {BODY} at (8,8) size 769x938 | ||
RenderBlock (anonymous) at (0,0) size 769x36 | ||
RenderText {#text} at (0,0) size 733x36 | ||
text run at (0,0) width 733: "All of the boxes below should be 20x20 and look identical, except for the rightmost box in the Inline Blocks section," | ||
text run at (0,18) width 491: "which should look the same but be raised above the other three in that section." | ||
RenderBlock {H1} at (0,57) size 769x38 | ||
RenderText {#text} at (0,0) size 203x37 | ||
text run at (0,0) width 203: "Normal Blocks" | ||
RenderBlock {DIV} at (5,97) size 20x21 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)] | ||
RenderBlock {DIV} at (5,127) size 20x21 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)] | ||
RenderBlock {DIV} at (5,157) size 20x21 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)] | ||
RenderBlock {DIV} at (5,187) size 20x21 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)] | ||
RenderBlock {DIV} at (5,115) size 20x21 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)] | ||
RenderBlock {DIV} at (5,145) size 20x21 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)] | ||
RenderBlock {DIV} at (5,175) size 20x21 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)] | ||
RenderBlock {DIV} at (5,205) size 20x21 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)] | ||
RenderBR {BR} at (6,6) size 0x18 | ||
RenderBR {BR} at (6,24) size 0x18 | ||
RenderBR {BR} at (6,42) size 0x18 | ||
RenderBlock {H1} at (0,229) size 769x38 | ||
RenderBlock {H1} at (0,247) size 769x38 | ||
RenderText {#text} at (0,0) size 178x37 | ||
text run at (0,0) width 178: "Inline Blocks" | ||
RenderBlock (anonymous) at (0,287) size 769x41 | ||
RenderBlock {DIV} at (5,10) size 20x20 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)] | ||
RenderBlock {DIV} at (35,10) size 20x20 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)] | ||
RenderBlock {DIV} at (65,10) size 20x20 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)] | ||
RenderBlock (anonymous) at (0,305) size 769x67 | ||
RenderBlock {DIV} at (5,36) size 20x20 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)] | ||
RenderBlock {DIV} at (35,36) size 20x20 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)] | ||
RenderBlock {DIV} at (65,36) size 20x20 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)] | ||
RenderBlock {DIV} at (95,10) size 20x20 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)] | ||
RenderBR {BR} at (6,6) size 0x18 | ||
RenderBR {BR} at (6,24) size 0x18 | ||
RenderBR {BR} at (6,42) size 0x18 | ||
RenderText {#text} at (0,0) size 0x0 | ||
RenderBlock {H1} at (0,349) size 769x38 | ||
RenderBlock {H1} at (0,393) size 769x38 | ||
RenderText {#text} at (0,0) size 241x37 | ||
text run at (0,0) width 241: "Positioned Blocks" | ||
RenderBlock (anonymous) at (0,407) size 769x19 | ||
RenderBlock (anonymous) at (0,451) size 769x19 | ||
RenderBR {BR} at (0,0) size 0x18 | ||
RenderBlock {H1} at (0,447) size 769x38 | ||
RenderBlock {H1} at (0,491) size 769x38 | ||
RenderText {#text} at (0,0) size 210x37 | ||
text run at (0,0) width 210: "Floating blocks" | ||
RenderBlock (floating) {DIV} at (5,515) size 20x21 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)] | ||
RenderBlock (floating) {DIV} at (35,515) size 20x21 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)] | ||
RenderBlock (floating) {DIV} at (65,515) size 20x21 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)] | ||
RenderBlock (floating) {DIV} at (95,515) size 20x21 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)] | ||
RenderBlock (floating) {DIV} at (5,559) size 20x21 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)] | ||
RenderBlock (floating) {DIV} at (35,559) size 20x21 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)] | ||
RenderBlock (floating) {DIV} at (65,559) size 20x21 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)] | ||
RenderBlock (floating) {DIV} at (95,559) size 20x21 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)] | ||
RenderBR {BR} at (6,6) size 0x18 | ||
RenderBR {BR} at (6,24) size 0x18 | ||
RenderBR {BR} at (6,42) size 0x18 | ||
RenderBlock (anonymous) at (0,505) size 769x41 | ||
RenderBlock (anonymous) at (0,549) size 769x41 | ||
RenderBR {BR} at (120,0) size 0x18 | ||
RenderBlock {H1} at (0,566) size 769x38 | ||
RenderBlock {H1} at (0,610) size 769x38 | ||
RenderText {#text} at (0,0) size 210x37 | ||
text run at (0,0) width 210: "Normal Images" | ||
RenderBlock (anonymous) at (0,625) size 769x41 | ||
RenderBlock (anonymous) at (0,669) size 769x41 | ||
RenderImage {IMG} at (5,10) size 20x20 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)] | ||
RenderImage {IMG} at (35,10) size 20x20 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)] | ||
RenderImage {IMG} at (65,10) size 20x20 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)] | ||
RenderImage {IMG} at (95,10) size 20x20 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)] | ||
RenderText {#text} at (0,0) size 0x0 | ||
RenderBlock {H1} at (0,686) size 769x38 | ||
RenderBlock {H1} at (0,730) size 769x38 | ||
RenderText {#text} at (0,0) size 248x37 | ||
text run at (0,0) width 248: "Positioned Images" | ||
RenderBlock (anonymous) at (0,745) size 769x19 | ||
RenderBlock (anonymous) at (0,789) size 769x19 | ||
RenderBR {BR} at (0,0) size 0x18 | ||
RenderBlock {H1} at (0,784) size 769x38 | ||
RenderBlock {H1} at (0,828) size 769x38 | ||
RenderText {#text} at (0,0) size 220x37 | ||
text run at (0,0) width 220: "Floating Images" | ||
RenderImage {IMG} at (5,853) size 20x21 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)] | ||
RenderImage {IMG} at (35,853) size 20x21 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)] | ||
RenderImage {IMG} at (65,853) size 20x21 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)] | ||
RenderImage {IMG} at (95,853) size 20x21 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)] | ||
RenderBlock (anonymous) at (0,843) size 769x41 | ||
RenderImage {IMG} at (5,897) size 20x21 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)] | ||
RenderImage {IMG} at (35,897) size 20x21 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)] | ||
RenderImage {IMG} at (65,897) size 20x21 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)] | ||
RenderImage {IMG} at (95,897) size 20x21 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)] | ||
RenderBlock (anonymous) at (0,887) size 769x41 | ||
RenderBR {BR} at (120,0) size 0x18 | ||
RenderBlock {HR} at (0,891) size 769x3 [border: (1px inset #000000)] | ||
layer at (13,426) size 20x20 | ||
RenderBlock (positioned) {DIV} at (13,425) size 20x21 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)] | ||
layer at (43,426) size 20x20 | ||
RenderBlock (positioned) {DIV} at (43,425) size 20x21 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)] | ||
layer at (73,426) size 20x20 | ||
RenderBlock (positioned) {DIV} at (73,425) size 20x21 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)] | ||
layer at (103,426) size 20x20 | ||
RenderBlock (positioned) {DIV} at (103,425) size 20x21 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)] | ||
RenderBlock {HR} at (0,935) size 769x3 [border: (1px inset #000000)] | ||
layer at (13,470) size 20x20 | ||
RenderBlock (positioned) {DIV} at (13,469) size 20x21 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)] | ||
layer at (43,470) size 20x20 | ||
RenderBlock (positioned) {DIV} at (43,469) size 20x21 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)] | ||
layer at (73,470) size 20x20 | ||
RenderBlock (positioned) {DIV} at (73,469) size 20x21 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)] | ||
layer at (103,470) size 20x20 | ||
RenderBlock (positioned) {DIV} at (103,469) size 20x21 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)] | ||
RenderBR {BR} at (6,6) size 0x18 | ||
RenderBR {BR} at (6,24) size 0x18 | ||
RenderBR {BR} at (6,42) size 0x18 | ||
layer at (13,763) size 20x20 | ||
RenderImage {IMG} at (13,763) size 20x21 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)] | ||
layer at (43,763) size 20x20 | ||
RenderImage {IMG} at (43,763) size 20x21 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)] | ||
layer at (73,763) size 20x20 | ||
RenderImage {IMG} at (73,763) size 20x21 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)] | ||
layer at (103,763) size 20x20 | ||
RenderImage {IMG} at (103,763) size 20x21 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)] | ||
layer at (13,807) size 20x20 | ||
RenderImage {IMG} at (13,807) size 20x21 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)] | ||
layer at (43,807) size 20x20 | ||
RenderImage {IMG} at (43,807) size 20x21 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)] | ||
layer at (73,807) size 20x20 | ||
RenderImage {IMG} at (73,807) size 20x21 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)] | ||
layer at (103,807) size 20x20 | ||
RenderImage {IMG} at (103,807) size 20x21 [color=#FFFFFF] [bgcolor=#FFA500] [border: (2px solid #000000)] |
Binary file removed
BIN
-10.3 KB
...utTests/platform/mac/fast/forms/textfield-overflow-by-value-update-expected.png
Binary file not shown.
Binary file modified
BIN
+255 Bytes
(100%)
LayoutTests/platform/mac/fast/multicol/client-rects-expected.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.