You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
LibWeb/Layout: Spec-comment Table "algorithm for processing rows"
Some of this is rearranged for clarity, but it's mostly the exact same
code. Steps 3, 10, 11, and 15 are new, but don't have any effect until
we implement downward-growing cells.
// 1. If yheight is equal to ycurrent, then increase yheight by 1. (ycurrent is never greater than yheight.)
24
27
if (y_height == y_current)
25
28
y_height++;
26
29
27
-
x_current = 0;
30
+
// 2. Let xcurrent be 0.
31
+
size_t x_current = 0;
28
32
33
+
// FIXME: 3. Run the algorithm for growing downward-growing cells.
34
+
35
+
// 4. If the tr element being processed has no td or th element children, then increase ycurrent by 1, abort
36
+
// this set of steps, and return to the algorithm above.
37
+
// NB: The remaining steps already accomplish the same thing in this case.
38
+
39
+
// 5. Let current cell be the first td or th element child in the tr element being processed.
29
40
for (auto* child = row.first_child(); child; child = child->next_sibling()) {
30
-
if (child->display().is_table_cell()) {
31
-
// Cells: While x_current is less than x_width and the slot with coordinate (x_current, y_current) already has a cell assigned to it, increase x_current by 1.
32
-
while (x_current < x_width && table_grid.m_occupancy_grid.contains(GridPosition { x_current, y_current }))
33
-
x_current++;
34
-
35
-
Box const* box = static_cast<Box const*>(child);
36
-
if (x_current == x_width)
37
-
x_width++;
38
-
39
-
size_t colspan = 1, rowspan = 1;
40
-
if (box->dom_node() && is<HTML::HTMLTableCellElement>(*box->dom_node())) {
0 commit comments