diff --git a/Tests/LibWeb/Layout/expected/table/border-collapse-is-inherited.txt b/Tests/LibWeb/Layout/expected/table/border-collapse-is-inherited.txt new file mode 100644 index 0000000000..abf0db33f2 --- /dev/null +++ b/Tests/LibWeb/Layout/expected/table/border-collapse-is-inherited.txt @@ -0,0 +1,154 @@ +Viewport <#document> at (0,0) content-size 800x600 children: not-inline + BlockContainer at (0,0) content-size 800x228.34375 [BFC] children: not-inline + BlockContainer <(anonymous)> at (0,0) content-size 800x0 children: inline + TextNode <#text> + BlockContainer at (8,8) content-size 784x212.34375 children: not-inline + BlockContainer <(anonymous)> at (8,8) content-size 784x0 children: inline + TextNode <#text> + BlockContainer at (8,8) content-size 784x212.34375 children: inline + line 0 width: 163.90625, height: 212.34375, bottom: 212.34375, baseline: 13.53125 + frag 0 from BlockContainer start: 0, length: 0, rect: [9,22 161.90625x197.34375] + TextNode <#text> + BlockContainer at (9,22) content-size 161.90625x197.34375 inline-block [BFC] children: not-inline + BlockContainer <(anonymous)> at (9,22) content-size 161.90625x0 children: inline + TextNode <#text> + TableWrapper <(anonymous)> at (9,22) content-size 161.90625x197.34375 inline-block [BFC] children: not-inline + Box <(anonymous)> at (9,22) content-size 161.90625x197.34375 inline-table table-box [TFC] children: not-inline + Box at (9,22) content-size 161.90625x197.34375 table-row-group children: not-inline + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + Box at (9,22) content-size 161.90625x39.46875 table-row children: not-inline + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer at (9,61.46875) content-size 161.90625x39.46875 table-row children: not-inline + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer at (9,100.9375) content-size 161.90625x39.46875 table-row children: not-inline + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer at (9,140.40625) content-size 161.90625x39.46875 table-row children: not-inline + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer at (9,179.875) content-size 161.90625x39.46875 table-row children: not-inline + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer
at (30,33) content-size 14.265625x17.46875 table-cell [BFC] children: inline + line 0 width: 14.265625, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [30,33 14.265625x17.46875] + "A" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer at (86.265625,33) content-size 12.546875x17.46875 table-cell [BFC] children: inline + line 0 width: 9.34375, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [88.265625,33 9.34375x17.46875] + "B" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer at (140.8125,33) content-size 9.09375x17.46875 table-cell [BFC] children: inline + line 0 width: 6.34375, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [141.8125,33 6.34375x17.46875] + "1" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + Box
at (30,72.46875) content-size 14.265625x17.46875 table-cell [BFC] children: inline + line 0 width: 10.3125, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [32,72.46875 10.3125x17.46875] + "C" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer at (86.265625,72.46875) content-size 12.546875x17.46875 table-cell [BFC] children: inline + line 0 width: 11.140625, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [87.265625,72.46875 11.140625x17.46875] + "D" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer at (140.8125,72.46875) content-size 9.09375x17.46875 table-cell [BFC] children: inline + line 0 width: 8.8125, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [140.8125,72.46875 8.8125x17.46875] + "2" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + Box
at (30,111.9375) content-size 14.265625x17.46875 table-cell [BFC] children: inline + line 0 width: 11.859375, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [31,111.9375 11.859375x17.46875] + "E" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer at (86.265625,111.9375) content-size 12.546875x17.46875 table-cell [BFC] children: inline + line 0 width: 12.546875, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [86.265625,111.9375 12.546875x17.46875] + "F" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer at (140.8125,111.9375) content-size 9.09375x17.46875 table-cell [BFC] children: inline + line 0 width: 9.09375, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [140.8125,111.9375 9.09375x17.46875] + "3" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + Box
at (30,151.40625) content-size 14.265625x17.46875 table-cell [BFC] children: inline + line 0 width: 13.234375, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [31,151.40625 13.234375x17.46875] + "G" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer at (86.265625,151.40625) content-size 12.546875x17.46875 table-cell [BFC] children: inline + line 0 width: 12.234375, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [86.265625,151.40625 12.234375x17.46875] + "H" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer at (140.8125,151.40625) content-size 9.09375x17.46875 table-cell [BFC] children: inline + line 0 width: 7.75, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [141.8125,151.40625 7.75x17.46875] + "4" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + Box
at (30,190.875) content-size 14.265625x17.46875 table-cell [BFC] children: inline + line 0 width: 4.59375, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [35,190.875 4.59375x17.46875] + "I" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer at (86.265625,190.875) content-size 12.546875x17.46875 table-cell [BFC] children: inline + line 0 width: 8.90625, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [88.265625,190.875 8.90625x17.46875] + "J" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer at (140.8125,190.875) content-size 9.09375x17.46875 table-cell [BFC] children: inline + line 0 width: 8.453125, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [140.8125,190.875 8.453125x17.46875] + "5" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer <(anonymous)> at (9,22) content-size 0x0 children: inline + TextNode <#text> + TextNode <#text> + BlockContainer <(anonymous)> at (8,220.34375) content-size 784x0 children: inline + TextNode <#text> diff --git a/Tests/LibWeb/Layout/input/table/border-collapse-is-inherited.html b/Tests/LibWeb/Layout/input/table/border-collapse-is-inherited.html new file mode 100644 index 0000000000..8943972a69 --- /dev/null +++ b/Tests/LibWeb/Layout/input/table/border-collapse-is-inherited.html @@ -0,0 +1,71 @@ + + + + + + + Collapsed table + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AB1
CD2
EF3
GH4
IJ5
+
+ + + + + \ No newline at end of file diff --git a/Userland/Libraries/LibWeb/CSS/ComputedValues.h b/Userland/Libraries/LibWeb/CSS/ComputedValues.h index 1a375bda6e..03d348030c 100644 --- a/Userland/Libraries/LibWeb/CSS/ComputedValues.h +++ b/Userland/Libraries/LibWeb/CSS/ComputedValues.h @@ -279,7 +279,7 @@ public: CSS::GridTrackPlacement const& grid_row_start() const { return m_noninherited.grid_row_start; } CSS::Size const& column_gap() const { return m_noninherited.column_gap; } CSS::Size const& row_gap() const { return m_noninherited.row_gap; } - CSS::BorderCollapse border_collapse() const { return m_noninherited.border_collapse; } + CSS::BorderCollapse border_collapse() const { return m_inherited.border_collapse; } Vector> const& grid_template_areas() const { return m_noninherited.grid_template_areas; } CSS::LengthBox const& inset() const { return m_noninherited.inset; } @@ -335,6 +335,7 @@ protected: float font_size { InitialValues::font_size() }; int font_weight { InitialValues::font_weight() }; CSS::FontVariant font_variant { InitialValues::font_variant() }; + CSS::BorderCollapse border_collapse { InitialValues::border_collapse() }; CSS::Length border_spacing_horizontal { InitialValues::border_spacing() }; CSS::Length border_spacing_vertical { InitialValues::border_spacing() }; CSS::CaptionSide caption_side { InitialValues::caption_side() }; @@ -425,7 +426,6 @@ protected: CSS::GridTrackPlacement grid_row_start { InitialValues::grid_row_start() }; CSS::Size column_gap { InitialValues::column_gap() }; CSS::Size row_gap { InitialValues::row_gap() }; - CSS::BorderCollapse border_collapse { InitialValues::border_collapse() }; Vector> grid_template_areas { InitialValues::grid_template_areas() }; Gfx::Color stop_color { InitialValues::stop_color() }; float stop_opacity { InitialValues::stop_opacity() }; @@ -519,7 +519,7 @@ public: void set_grid_row_start(CSS::GridTrackPlacement value) { m_noninherited.grid_row_start = value; } void set_column_gap(CSS::Size const& column_gap) { m_noninherited.column_gap = column_gap; } void set_row_gap(CSS::Size const& row_gap) { m_noninherited.row_gap = row_gap; } - void set_border_collapse(CSS::BorderCollapse const& border_collapse) { m_noninherited.border_collapse = border_collapse; } + void set_border_collapse(CSS::BorderCollapse const& border_collapse) { m_inherited.border_collapse = border_collapse; } void set_grid_template_areas(Vector> const& grid_template_areas) { m_noninherited.grid_template_areas = grid_template_areas; } void set_transition_delay(CSS::Time const& transition_delay) { m_noninherited.transition_delay = transition_delay; }