Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
17 changes: 17 additions & 0 deletions Libraries/LibWeb/Rust/src/css/computed_value_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ pub enum ComputedSizeKind {
/// immutable Rust style-value identity. Fit-content retains only its
/// argument, and keyword-only forms leave the handle empty.
#[repr(C)]
#[derive(Debug)]
pub struct ComputedStyleValueHandle {
pub pointer: *const std::ffi::c_void,
}

#[repr(C)]
#[derive(Debug)]
pub struct ComputedSize {
pub kind: ComputedSizeKind,
pub value: ComputedStyleValueHandle,
Expand Down Expand Up @@ -367,3 +369,18 @@ pub struct SVGResetValues {
pub vector_effect: u8,
pub shape_rendering: u8,
}

// Registered indices of the style groups the computed-values view reads,
// pinned to the C++ StyleGroupIndex enum by static_asserts in
// LayoutRustBridge.cpp.
pub const STYLE_GROUP_INDEX_INHERITED_TABLE: usize = 0;
pub const STYLE_GROUP_INDEX_GRID: usize = 9;
pub const STYLE_GROUP_INDEX_INHERITED_TEXT: usize = 4;
pub const STYLE_GROUP_INDEX_INHERITED_BOX: usize = 5;
pub const STYLE_GROUP_INDEX_FONT: usize = 6;
pub const STYLE_GROUP_INDEX_SVG_RESET: usize = 8;
pub const STYLE_GROUP_INDEX_BORDER: usize = 17;
pub const STYLE_GROUP_INDEX_ALIGNMENT: usize = 18;
pub const STYLE_GROUP_INDEX_SIZING: usize = 20;
pub const STYLE_GROUP_INDEX_SURROUND: usize = 21;
pub const STYLE_GROUP_INDEX_BOX: usize = 22;
Loading
Loading