diff --git a/Tests/LibWeb/Text/expected/css/getComputedStyle-print-all.txt b/Tests/LibWeb/Text/expected/css/getComputedStyle-print-all.txt index 2d6f319f057..7e1523719d3 100644 --- a/Tests/LibWeb/Text/expected/css/getComputedStyle-print-all.txt +++ b/Tests/LibWeb/Text/expected/css/getComputedStyle-print-all.txt @@ -86,6 +86,7 @@ clip-rule: nonzero color: rgb(0, 0, 0) column-count: auto column-gap: auto +column-span: none column-width: auto content: normal content-visibility: visible @@ -124,7 +125,7 @@ grid-row-start: auto grid-template-areas: grid-template-columns: grid-template-rows: -height: 2142px +height: 2159px image-rendering: auto inline-size: auto inset-block-end: auto diff --git a/Userland/Libraries/LibWeb/CSS/ComputedValues.h b/Userland/Libraries/LibWeb/CSS/ComputedValues.h index 80c898f4beb..638cff0c096 100644 --- a/Userland/Libraries/LibWeb/CSS/ComputedValues.h +++ b/Userland/Libraries/LibWeb/CSS/ComputedValues.h @@ -165,6 +165,7 @@ public: static CSS::GridAutoFlow grid_auto_flow() { return CSS::GridAutoFlow {}; } static ColumnCount column_count() { return ColumnCount::make_auto(); } static CSS::Size column_gap() { return CSS::Size::make_auto(); } + static CSS::ColumnSpan column_span() { return CSS::ColumnSpan::None; } static CSS::Size column_width() { return CSS::Size::make_auto(); } static CSS::Size row_gap() { return CSS::Size::make_auto(); } static CSS::BorderCollapse border_collapse() { return CSS::BorderCollapse::Separate; } @@ -419,6 +420,7 @@ public: CSS::GridTrackPlacement const& grid_row_start() const { return m_noninherited.grid_row_start; } CSS::ColumnCount column_count() const { return m_noninherited.column_count; } CSS::Size const& column_gap() const { return m_noninherited.column_gap; } + CSS::ColumnSpan const& column_span() const { return m_noninherited.column_span; } CSS::Size const& column_width() const { return m_noninherited.column_width; } CSS::Size const& row_gap() const { return m_noninherited.row_gap; } CSS::BorderCollapse border_collapse() const { return m_inherited.border_collapse; } @@ -621,6 +623,7 @@ protected: CSS::GridTrackPlacement grid_row_start { InitialValues::grid_row_start() }; CSS::ColumnCount column_count { InitialValues::column_count() }; CSS::Size column_gap { InitialValues::column_gap() }; + CSS::ColumnSpan column_span { InitialValues::column_span() }; CSS::Size column_width { InitialValues::column_width() }; CSS::Size row_gap { InitialValues::row_gap() }; Vector> grid_template_areas { InitialValues::grid_template_areas() }; @@ -753,6 +756,7 @@ public: void set_grid_row_start(CSS::GridTrackPlacement value) { m_noninherited.grid_row_start = value; } void set_column_count(CSS::ColumnCount value) { m_noninherited.column_count = value; } void set_column_gap(CSS::Size const& column_gap) { m_noninherited.column_gap = column_gap; } + void set_column_span(CSS::ColumnSpan const& column_span) { m_noninherited.column_span = column_span; } void set_column_width(CSS::Size const& column_width) { m_noninherited.column_width = column_width; } 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_inherited.border_collapse = border_collapse; } diff --git a/Userland/Libraries/LibWeb/CSS/Enums.json b/Userland/Libraries/LibWeb/CSS/Enums.json index 8382f7cde8b..50b3c3f0816 100644 --- a/Userland/Libraries/LibWeb/CSS/Enums.json +++ b/Userland/Libraries/LibWeb/CSS/Enums.json @@ -101,6 +101,10 @@ "right", "both" ], + "column-span": [ + "none", + "all" + ], "content-visibility": [ "visible", "auto", diff --git a/Userland/Libraries/LibWeb/CSS/Properties.json b/Userland/Libraries/LibWeb/CSS/Properties.json index 8002c2f158a..de8fb7e4121 100644 --- a/Userland/Libraries/LibWeb/CSS/Properties.json +++ b/Userland/Libraries/LibWeb/CSS/Properties.json @@ -960,6 +960,14 @@ ], "percentages-resolve-to": "length" }, + "column-span": { + "animation-type": "discrete", + "inherited": false, + "initial": "none", + "valid-types": [ + "column-span" + ] + }, "column-width": { "animation-type": "by-computed-value", "inherited": false, diff --git a/Userland/Libraries/LibWeb/CSS/StyleProperties.cpp b/Userland/Libraries/LibWeb/CSS/StyleProperties.cpp index 0304b8d90a2..86121ef3125 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleProperties.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleProperties.cpp @@ -692,6 +692,12 @@ Optional StyleProperties::clear() const return keyword_to_clear(value->to_keyword()); } +Optional StyleProperties::column_span() const +{ + auto value = property(CSS::PropertyID::ColumnSpan); + return keyword_to_column_span(value->to_keyword()); +} + StyleProperties::ContentDataAndQuoteNestingLevel StyleProperties::content(DOM::Element& element, u32 initial_quote_nesting_level) const { auto value = property(CSS::PropertyID::Content); diff --git a/Userland/Libraries/LibWeb/CSS/StyleProperties.h b/Userland/Libraries/LibWeb/CSS/StyleProperties.h index 54f1878ed76..a7de0eb3656 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleProperties.h +++ b/Userland/Libraries/LibWeb/CSS/StyleProperties.h @@ -75,6 +75,7 @@ public: CSS::Display display() const; Optional float_() const; Optional clear() const; + Optional column_span() const; struct ContentDataAndQuoteNestingLevel { CSS::ContentData content_data; u32 final_quote_nesting_level { 0 }; diff --git a/Userland/Libraries/LibWeb/Layout/Node.cpp b/Userland/Libraries/LibWeb/Layout/Node.cpp index 1ade0e89409..5eddfc09f5e 100644 --- a/Userland/Libraries/LibWeb/Layout/Node.cpp +++ b/Userland/Libraries/LibWeb/Layout/Node.cpp @@ -830,6 +830,9 @@ void NodeWithStyle::apply_style(const CSS::StyleProperties& computed_style) if (auto column_count = computed_style.property(CSS::PropertyID::ColumnCount); column_count->is_integer()) computed_values.set_column_count(CSS::ColumnCount::make_integer(column_count->as_integer().integer())); + if (auto column_span = computed_style.column_span(); column_span.has_value()) + computed_values.set_column_span(column_span.value()); + computed_values.set_column_width(computed_style.size_value(CSS::PropertyID::ColumnWidth)); computed_values.set_column_gap(computed_style.size_value(CSS::PropertyID::ColumnGap));