Skip to content

Commit d202555

Browse files
committed
adapt table code to new api
1 parent 81191f1 commit d202555

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

src/web/vaev-layout/table.cpp

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -442,11 +442,11 @@ struct TableFormatingContext : public FormatingContext {
442442
// NOTE: The table does not automatically expand to fill its containing block.
443443
// (https://www.w3.org/TR/CSS22/tables.html#width-layout)
444444

445+
// FIXME: refrain from acessing box.style->sizing directly, use knownSize instead
445446
tableUsedWidth =
446447
box.style->sizing->width == Size::AUTO
447448
? 0_au
448-
: resolve(tree, box, box.style->sizing->width.value, availableXSpace) -
449-
boxBorder.horizontal(); // NOTE: maybe remove this after borderbox param is clearer
449+
: resolve(tree, box, box.style->sizing->width.value, availableXSpace) - boxBorder.horizontal();
450450

451451
auto [columnBorders, sumBorders] = getColumnBorders();
452452

@@ -740,6 +740,7 @@ struct TableFormatingContext : public FormatingContext {
740740
}
741741
}
742742

743+
// MARK: Row heights -------------------------------------------------
743744
// https://www.w3.org/TR/CSS22/tables.html#height-layout
744745
Vec<Au> rowHeight;
745746

@@ -802,17 +803,9 @@ struct TableFormatingContext : public FormatingContext {
802803
}
803804
}
804805
}
805-
806-
for (usize i = 0; i < grid.size.y; ++i) {
807-
Au rowBorderHeight{0};
808-
for (usize j = 0; j < grid.size.x; ++j) {
809-
auto cellVertBorder = bordersGrid.get(i, j).vertical();
810-
rowBorderHeight = max(rowBorderHeight, cellVertBorder);
811-
}
812-
rowHeight[i] += rowBorderHeight;
813-
}
814806
}
815807

808+
// MARK: Build and layout -------------------------------------------------
816809
struct AxisHelper { // FIXME: find me a better name pls
817810
Opt<usize> groupIdx = NONE;
818811
Opt<usize> axisIdx = NONE;

0 commit comments

Comments
 (0)