about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--src/css/layout.nim2
-rw-r--r--test/layout/table-vert-align-baseline.expected2
-rw-r--r--test/layout/table-vert-align-baseline.html9
3 files changed, 12 insertions, 1 deletions
diff --git a/src/css/layout.nim b/src/css/layout.nim
index 7a28d414..fee0423b 100644
--- a/src/css/layout.nim
+++ b/src/css/layout.nim
@@ -1671,7 +1671,7 @@ proc layoutOuterBlock(fstate: var FlowState; child: BlockBox;
   if float == FloatNone:
     if not fstate.firstBaselineSet:
       fstate.box.state.firstBaseline = child.state.offset.y +
-        child.state.baseline
+        child.state.firstBaseline
       fstate.firstBaselineSet = true
     fstate.box.state.baseline = child.state.offset.y + child.state.baseline
     if textAlign == TextAlignChaCenter:
diff --git a/test/layout/table-vert-align-baseline.expected b/test/layout/table-vert-align-baseline.expected
new file mode 100644
index 00000000..8eec1fd9
--- /dev/null
+++ b/test/layout/table-vert-align-baseline.expected
@@ -0,0 +1,2 @@
+ test test
+      test
diff --git a/test/layout/table-vert-align-baseline.html b/test/layout/table-vert-align-baseline.html
new file mode 100644
index 00000000..25f44827
--- /dev/null
+++ b/test/layout/table-vert-align-baseline.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<table>
+<tr>
+<td style="vertical-align: baseline">
+test
+</td>
+<td style="vertical-align: baseline">
+test<br>
+test