Commit
vertical-align
support to match CSS 2.1 §
10.8, and implement `vertical-align: middle` per CSS 2.1 § 10.8.1. `InlineMetrics` has been split into `InlineMetrics` for fragments and `LineMetrics` for lines. Both structures' fields have been renamed in order to more clearly delineate the difference between *space* and *content*. Vertical positioning of fragments has been reworked to take margins and borders into account only for replaced content. This patch fixes the `vertical_align_super_a.html` reftest. Servo now matches the rendering that Gecko and WebKit produce. Additionally, this includes a test for the popular inline-block centering technique described here: https://s.codepen.io/shshaw/fullpage/gEiDt?#Inline-Block
- Loading branch information
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<link rel="match" href="inline_block_centering_ref.html"> | ||
<!-- | ||
Tests that the popular inline-block centering technique works. | ||
See: https://s.codepen.io/shshaw/fullpage/gEiDt?#Inline-Block | ||
--> | ||
<style> | ||
div { | ||
width: 100px; | ||
} | ||
#a { | ||
background: blue; | ||
position: absolute; | ||
height: 100px; | ||
top: 0; | ||
left: 0; | ||
} | ||
#a:after, #b { | ||
display: inline-block; | ||
vertical-align: middle; | ||
} | ||
#a:after { | ||
content: ''; | ||
height: 100%; | ||
} | ||
#b { | ||
background: green; | ||
height: 50px; | ||
} | ||
</style> | ||
<div id=a><div id=b> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<!-- | ||
Tests that the popular inline-block centering technique works. | ||
See: https://s.codepen.io/shshaw/fullpage/gEiDt?#Inline-Block | ||
--> | ||
<style> | ||
div { | ||
position: absolute; | ||
width: 100px; | ||
left: 0; | ||
} | ||
#a { | ||
background: blue; | ||
height: 100px; | ||
top: 0; | ||
} | ||
#b { | ||
background: green; | ||
height: 50px; | ||
top: 25px; | ||
} | ||
</style> | ||
<div id=a><div id=b> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<link rel="match" href="vertical_align_middle_ref.html"> | ||
<style> | ||
html, body { | ||
margin: 0; | ||
} | ||
img { | ||
vertical-align: middle; | ||
} | ||
</style> | ||
<img width=50 height=50 src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYPj/HwADAgH/xCAAOgAAAABJRU5ErkJggg=="><!-- | ||
--><img width=100 height=100 src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgaGD4DwAChAGA2FJdiQAAAABJRU5ErkJggg=="> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<style> | ||
html, body { | ||
margin: 0; | ||
} | ||
div { | ||
position: absolute; | ||
} | ||
#a { | ||
left: 0; | ||
top: 25px; | ||
width: 50px; | ||
height: 50px; | ||
background: blue; | ||
} | ||
#b { | ||
left: 50px; | ||
top: 0; | ||
width: 100px; | ||
height: 100px; | ||
background: green; | ||
} | ||
</style> | ||
<div id=a></div> | ||
<div id=b></div> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ | |
} | ||
div { | ||
color: blue; | ||
margin-top: 100px; | ||
margin-top: 82px; | ||
} | ||
.align { | ||
color: red; | ||
|