Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
a4d877c
LibWeb: Count crossings of the style system's FFI boundary
awesomekling Jul 21, 2026
e631ebe
Meta: Add style FFI baseline workloads
awesomekling Jul 21, 2026
4b59dfc
LibWeb: Install a Rust-readable initial value table
awesomekling Jul 21, 2026
f90a1a8
LibWeb: Select longhand values natively in the Rust style core
awesomekling Jul 21, 2026
9de1a4a
LibWeb: Batch longhand stores that need no computation
awesomekling Jul 21, 2026
1ca5610
LibWeb: Absolutize plain longhand values natively in the driver
awesomekling Jul 21, 2026
db2a10c
LibWeb: Compute border widths and spacing longhands in the driver
awesomekling Jul 21, 2026
b90d9f9
LibWeb: Compute corner shapes and math-depth in the driver
awesomekling Jul 21, 2026
e9894f7
LibWeb: Compute the font cluster natively and defer the rest to batches
awesomekling Jul 21, 2026
dbccbc8
LibWeb: Build the inherited box style group in Rust
awesomekling Jul 21, 2026
047daf7
LibWeb: Build the inherited table style group in Rust
awesomekling Jul 21, 2026
d26ac36
LibWeb: Add descriptor-driven style group building to the core
awesomekling Jul 21, 2026
5d0f5d5
LibWeb: Build the alignment style group through the descriptors
awesomekling Jul 21, 2026
4254801
LibWeb: Build the text reset style group through the descriptors
awesomekling Jul 21, 2026
2ce1304
LibWeb: Build the effects style group through the descriptors
awesomekling Jul 21, 2026
98ef33b
LibWeb: Build the misc reset style group through the descriptors
awesomekling Jul 21, 2026
1d29547
LibWeb: Build the inherited text style group through the descriptors
awesomekling Jul 21, 2026
5c119d2
LibWeb: Build the inherited UI style group through the descriptors
awesomekling Jul 21, 2026
b85a806
LibWeb: Build the sizing style group through the descriptors
awesomekling Jul 21, 2026
05cc04a
LibWeb: Build the transform style group through the descriptors
awesomekling Jul 21, 2026
c96610a
LibWeb: Build the mask style group through the descriptors
awesomekling Jul 21, 2026
bb39883
LibWeb: Build the grid style group through the descriptors
awesomekling Jul 21, 2026
db04d99
LibWeb: Build the animation style group through the descriptors
awesomekling Jul 21, 2026
4e9bbf6
LibWeb: Build the SVG reset style group through the descriptors
awesomekling Jul 21, 2026
5aba9fa
LibWeb: Build the inherited SVG style group through the descriptors
awesomekling Jul 21, 2026
26c3114
LibWeb: Build the inherited list style group through the descriptors
awesomekling Jul 21, 2026
6324e70
LibWeb: Build the content and anchor style groups through descriptors
awesomekling Jul 21, 2026
15eae6e
LibWeb: Build the box style group through the descriptors
awesomekling Jul 21, 2026
8e023ff
LibWeb: Build the surround style group through the descriptors
awesomekling Jul 21, 2026
35f3791
LibWeb: Build the border style group through the descriptors
awesomekling Jul 21, 2026
b92d120
LibWeb: Build the background style group through the descriptors
awesomekling Jul 21, 2026
133dec3
LibWeb: Run the whole cascade as one bulk Rust operation per element
awesomekling Jul 21, 2026
994b811
LibWeb: Delete dead code hidden by allow(dead_code) in the style crate
awesomekling Jul 21, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,050 changes: 1,697 additions & 353 deletions Libraries/LibWeb/CSS/ComputedValues.cpp

Large diffs are not rendered by default.

30 changes: 28 additions & 2 deletions Libraries/LibWeb/CSS/ComputedValues.h
Original file line number Diff line number Diff line change
Expand Up @@ -960,7 +960,7 @@ class WEB_API ComputedValues final : public RefCounted<ComputedValues> {
Yes,
};

static NonnullRefPtr<ComputedValues const> create(ComputedProperties const&, DOM::Document const&, StyleScope const&, ColorResolutionContext);
static NonnullRefPtr<ComputedValues const> create(ComputedProperties const&, DOM::Document const&, StyleScope const&, ColorResolutionContext, ComputedValues const* inherit_parent = nullptr);

RefPtr<StyleValue const> computed_style_value(PropertyID, WithAnimationsApplied = WithAnimationsApplied::Yes) const;
RefPtr<StyleValue const> computed_style_value_for_inheritance(PropertyID, WithAnimationsApplied = WithAnimationsApplied::Yes) const;
Expand Down Expand Up @@ -1655,7 +1655,8 @@ class WEB_API ComputedValues final : public RefCounted<ComputedValues> {

struct TextResetValues {
static constexpr size_t style_group_index = to_underlying(StyleGroupIndex::TextResetValues);
Vector<TextDecorationLine> text_decoration_line { InitialValues::text_decoration_line() };
// NB: A computed text-decoration-line of none is the empty list.
Vector<TextDecorationLine> text_decoration_line {};
TextDecorationThickness text_decoration_thickness { TextDecorationThickness::Auto {} };
TextDecorationStyle text_decoration_style { InitialValues::text_decoration_style() };
Color text_decoration_color { InitialValues::color() };
Expand Down Expand Up @@ -1892,6 +1893,31 @@ class ComputedValues::Mutator final {
void set_base_values(NonnullRefPtr<ComputedValues const> value) { m_values.m_base_values = move(value); }
void set_animated_properties(AnimatedProperties const*);

// Adopts Rust-built group payloads, which arrive already carrying this
// reference.
void adopt_inherited_box_group(void* payload) { m_values.m_inherited.box.adopt(payload); }
void adopt_inherited_table_group(void* payload) { m_values.m_inherited.table.adopt(payload); }
void adopt_alignment_group(void* payload) { m_values.m_noninherited.alignment.adopt(payload); }
void adopt_text_reset_group(void* payload) { m_values.m_noninherited.text_reset.adopt(payload); }
void adopt_effects_group(void* payload) { m_values.m_noninherited.effects.adopt(payload); }
void adopt_misc_reset_group(void* payload) { m_values.m_noninherited.misc.adopt(payload); }
void adopt_inherited_text_group(void* payload) { m_values.m_inherited.text.adopt(payload); }
void adopt_inherited_ui_group(void* payload) { m_values.m_inherited.ui.adopt(payload); }
void adopt_sizing_group(void* payload) { m_values.m_noninherited.sizing.adopt(payload); }
void adopt_transform_group(void* payload) { m_values.m_noninherited.transform.adopt(payload); }
void adopt_mask_group(void* payload) { m_values.m_noninherited.mask_data.adopt(payload); }
void adopt_grid_group(void* payload) { m_values.m_noninherited.grid.adopt(payload); }
void adopt_animation_group(void* payload) { m_values.m_noninherited.animation.adopt(payload); }
void adopt_svg_reset_group(void* payload) { m_values.m_noninherited.svg_reset.adopt(payload); }
void adopt_inherited_svg_group(void* payload) { m_values.m_inherited.svg.adopt(payload); }
void adopt_inherited_list_group(void* payload) { m_values.m_inherited.list.adopt(payload); }
void adopt_content_group(void* payload) { m_values.m_noninherited.content_data.adopt(payload); }
void adopt_anchor_group(void* payload) { m_values.m_noninherited.anchor.adopt(payload); }
void adopt_box_group(void* payload) { m_values.m_noninherited.box.adopt(payload); }
void adopt_surround_group(void* payload) { m_values.m_noninherited.surround.adopt(payload); }
void adopt_border_group(void* payload) { m_values.m_noninherited.border.adopt(payload); }
void adopt_background_group(void* payload) { m_values.m_noninherited.background.adopt(payload); }

void set_aspect_ratio(AspectRatio aspect_ratio)
{
if (m_values.m_noninherited.box->aspect_ratio == aspect_ratio)
Expand Down
1 change: 1 addition & 0 deletions Libraries/LibWeb/CSS/Rust/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,7 @@ fn main() -> Result<(), Box<dyn Error>> {
&[
manifest_dir.join("src/style_value.rs"),
manifest_dir.join("src/calc.rs"),
manifest_dir.join("src/ffi_stats.rs"),
],
&out_dir,
&ffi_out_dir,
Expand Down
Loading