Skip to documentation
SLOP

tiny.css.Storage

Reference tiny.css Storage

Defined in sheet.

The single aligned block one sheet owns for the whole of its life.

API (13)

Actions

Public operations.

Types and contracts

Public types and contracts.

Fields and members

Public fields and members.

No direct callersNo direct callssheetStorage
Static calls · unresolved targets: unknown · external targets: unknown.

Source

Source: lib/css/src/sheet.zig:226

zig
/// The single aligned block one sheet owns for the whole of its life.pub const Storage = struct {    pub const Limits = LimitsType;    pub const Capacity = CapacityType;    pub const claim: alloc_phase.capacity.Declaration = .{        .source = .{            .id = "css.storage",            .kind = .phase_static,            .limit_source = .caller,            .storage = .{                .covered = &.{                    .{                        .id = "flat_active_css_rule_output",                        .lifetime = .steady,                        .detail = "flat active CSS rule output",                    },                    .{                        .id = "flat_selector_output_shared_by_rule_slices",                        .lifetime = .steady,                        .detail = "flat selector, compound, combinator, class, and nth output shared by rule slices",                    },                    .{                        .id = "flat_identifier_interning_table",                        .lifetime = .steady,                        .detail = "flat identifier interning records, probe slots, and folded text arena",                    },                    .{                        .id = "flat_declaration_output_shared_by_rule_slices",                        .lifetime = .steady,                        .detail = "flat authored, lowered, and custom declaration output shared by rule slices",                    },                    .{                        .id = "flat_parser_diagnostic_output",                        .lifetime = .steady,                        .detail = "flat parser diagnostic output",                    },                },                .excluded = &.{                    "caller-owned CSS source bytes borrowed by selectors and declarations",                    "author source discovery and invalidation dependency storage",                    "caller-owned cascade resolver and computed style records",                },            },            .capacity = .{                .inputs = &.{                    alloc_phase.capacity.bindInput(LimitsType, "rules", "rules"),                    alloc_phase.capacity.bindInput(LimitsType, "selectors", "selectors"),                    alloc_phase.capacity.bindInput(LimitsType, "compounds", "compounds"),                    alloc_phase.capacity.bindInput(LimitsType, "combinators", "combinators"),                    alloc_phase.capacity.bindInput(LimitsType, "classes", "classes"),                    alloc_phase.capacity.bindInput(LimitsType, "nths", "nths"),                    alloc_phase.capacity.bindInput(LimitsType, "atoms", "atoms"),                    alloc_phase.capacity.bindInput(LimitsType, "atom_slots", "atom_slots"),                    alloc_phase.capacity.bindInput(LimitsType, "atom_bytes", "atom_bytes"),                    alloc_phase.capacity.bindInput(LimitsType, "declarations", "declarations"),                    alloc_phase.capacity.bindInput(LimitsType, "lowered", "lowered"),                    alloc_phase.capacity.bindInput(LimitsType, "customs", "customs"),                    alloc_phase.capacity.bindInput(LimitsType, "diagnostics", "diagnostics"),                },                .type_selectors = &.{                    alloc_phase.capacity.bindType(Rule, "rule"),                    alloc_phase.capacity.bindType(selector.Selector, "selector"),                    alloc_phase.capacity.bindType(selector.Compound, "compound"),                    alloc_phase.capacity.bindType(selector.Combinator, "combinator"),                    alloc_phase.capacity.bindType(u32, "u32"),                    alloc_phase.capacity.bindType(selector.nth.Nth, "nth"),                    alloc_phase.capacity.bindType(atom.Record, "atom_record"),                    alloc_phase.capacity.bindType(u8, "u8"),                    alloc_phase.capacity.bindType(Declaration, "declaration"),                    alloc_phase.capacity.bindType(value.Declaration, "lowered_declaration"),                    alloc_phase.capacity.bindType(cascade.Custom, "custom"),                    alloc_phase.capacity.bindType([]const u8, "const_u8"),                },                .nodes = &.{                    .{ .input = 0 },                    .{ .scale = .{ .node = 0, .coefficient = .{ .size_of_concrete_type = 0 } } },                    .{ .input = 1 },                    .{ .scale = .{ .node = 2, .coefficient = .{ .size_of_concrete_type = 1 } } },                    .{ .input = 2 },                    .{ .scale = .{ .node = 4, .coefficient = .{ .size_of_concrete_type = 2 } } },                    .{ .input = 3 },                    .{ .scale = .{ .node = 6, .coefficient = .{ .size_of_concrete_type = 3 } } },                    .{ .input = 4 },                    .{ .scale = .{ .node = 8, .coefficient = .{ .size_of_concrete_type = 4 } } },                    .{ .input = 5 },                    .{ .scale = .{ .node = 10, .coefficient = .{ .size_of_concrete_type = 5 } } },                    .{ .input = 6 },                    .{ .scale = .{ .node = 12, .coefficient = .{ .size_of_concrete_type = 6 } } },                    .{ .input = 7 },                    .{ .scale = .{ .node = 14, .coefficient = .{ .size_of_concrete_type = 4 } } },                    .{ .input = 8 },                    .{ .scale = .{ .node = 16, .coefficient = .{ .size_of_concrete_type = 7 } } },                    .{ .input = 9 },                    .{ .scale = .{ .node = 18, .coefficient = .{ .size_of_concrete_type = 8 } } },                    .{ .input = 10 },                    .{ .scale = .{ .node = 20, .coefficient = .{ .size_of_concrete_type = 9 } } },                    .{ .input = 11 },                    .{ .scale = .{ .node = 22, .coefficient = .{ .size_of_concrete_type = 10 } } },                    .{ .input = 12 },                    .{ .scale = .{ .node = 24, .coefficient = .{ .size_of_concrete_type = 11 } } },                    .{ .constant = 0 },                    .{ .alignment = .{ .node = 26, .alignment = .{ .concrete_type = 0 } } },                    .{ .add = .{ .left = 27, .right = 1 } },                    .{ .alignment = .{ .node = 28, .alignment = .{ .concrete_type = 1 } } },                    .{ .add = .{ .left = 29, .right = 3 } },                    .{ .alignment = .{ .node = 30, .alignment = .{ .concrete_type = 2 } } },                    .{ .add = .{ .left = 31, .right = 5 } },                    .{ .alignment = .{ .node = 32, .alignment = .{ .concrete_type = 3 } } },                    .{ .add = .{ .left = 33, .right = 7 } },                    .{ .alignment = .{ .node = 34, .alignment = .{ .concrete_type = 4 } } },                    .{ .add = .{ .left = 35, .right = 9 } },                    .{ .alignment = .{ .node = 36, .alignment = .{ .concrete_type = 5 } } },                    .{ .add = .{ .left = 37, .right = 11 } },                    .{ .alignment = .{ .node = 38, .alignment = .{ .concrete_type = 6 } } },                    .{ .add = .{ .left = 39, .right = 13 } },                    .{ .alignment = .{ .node = 40, .alignment = .{ .concrete_type = 4 } } },                    .{ .add = .{ .left = 41, .right = 15 } },                    .{ .alignment = .{ .node = 42, .alignment = .{ .concrete_type = 7 } } },                    .{ .add = .{ .left = 43, .right = 17 } },                    .{ .alignment = .{ .node = 44, .alignment = .{ .concrete_type = 8 } } },                    .{ .add = .{ .left = 45, .right = 19 } },                    .{ .alignment = .{ .node = 46, .alignment = .{ .concrete_type = 9 } } },                    .{ .add = .{ .left = 47, .right = 21 } },                    .{ .alignment = .{ .node = 48, .alignment = .{ .concrete_type = 10 } } },                    .{ .add = .{ .left = 49, .right = 23 } },                    .{ .alignment = .{ .node = 50, .alignment = .{ .concrete_type = 11 } } },                    .{ .add = .{ .left = 51, .right = 25 } },                    .{ .alignment = .{ .node = 52, .alignment = .{ .literal = 16 } } },                },                .assertions = &.{.{                    .scope = .closure_total,                    .measure = .retained,                    .relation = .exact,                    .expression = 53,                }},            },            .overload = .{                .kind = .reject_before_seal,                .detail = "a count-only parse and checked aligned capacity reject before acquisition; filling the admitted flat slices performs no allocation",            },            .risks = .{                .transitive = .{                    .status = .open,                    .detail = "the parser helpers are allocation-free and witnessed but lack a machine-checked call-graph closure certificate",                },                .foreign = .{                    .status = .excluded,                    .detail = "CSS parsing is a process-local transformation with no callback or operating-system edge",                },            },            .obligations = &.{                .{ .key = "css_capacity_capacity_model", .role = .capacity_model },                .{ .key = "css_capacity_overload", .role = .overload },                .{ .key = "css_acquisition", .role = .custom },                .{ .key = "css_steady_overload", .role = .overload },                .{ .key = "css_steady_foreign_risk", .role = .foreign_risk },            },        },        .bindings = .{            .owner = @This(),            .seal = .{                .family = alloc_phase.capacity.selector(@This().activate),                .premise = .{                    .class = .checked_semantic_fact,                    .authority = .checker,                },            },            .teardown = .{                .family = alloc_phase.capacity.selector(@This().deinit),                .premise = .{                    .class = .checked_semantic_fact,                    .authority = .checker,                },            },        },    };    phase: alloc_phase.capacity.Phase,    limits: LimitsType,    capacity: CapacityType,    bytes: []align(storage_alignment) u8,    placement: Placement,    pub fn init(allocator: Allocator, limits: LimitsType) !Storage {        const capacity = try CapacityType.derive(limits);        const bytes = try allocator.alignedAlloc(u8, .fromByteUnits(storage_alignment), capacity.total_bytes);        return .{            .phase = .initialization,            .limits = limits,            .capacity = capacity,            .bytes = bytes,            .placement = Placement.init(bytes, capacity),        };    }    pub fn activate(self: *Storage) void {        std.debug.assert(self.phase == .initialization);        self.assertStorage();        self.phase = .steady;    }    pub fn admits(self: *const Storage, limits: LimitsType) bool {        std.debug.assert(self.phase == .steady);        return self.placement.admits(limits);    }    pub fn parse(self: *Storage, source: []const u8, media: MediaEnvironment) StyleSheet {        std.debug.assert(self.phase == .steady);        const limits = LimitsType.inspect(source, media) catch unreachable;        std.debug.assert(self.admits(limits));        return build(self.placement, source, media, limits);    }    pub fn deinit(self: *Storage, allocator: Allocator) void {        std.debug.assert(self.phase != .teardown);        self.assertStorage();        self.phase = .teardown;        allocator.free(self.bytes);        self.bytes = &.{};        self.placement.release();    }    fn assertStorage(self: *const Storage) void {        const expected = CapacityType.derive(self.limits) catch unreachable;        std.debug.assert(std.meta.eql(expected, self.capacity));        std.debug.assert(self.bytes.len == self.capacity.total_bytes);        inline for (arrays) |entry| {            std.debug.assert(@field(self.placement, entry.name).len ==                @field(self.capacity.limits, entry.name));        }    }};

Source: lib/css/src/root.zig:56

zig
pub const Storage = sheet.Storage;
Called byCallsprivate sourcelib.css.src.sheet.WorkspaceensureStoragetest sourcelib.css.src.sheettest: CSS storage parses admitted sou...private sourcelib.css.src.sheet.StorageassertStorageStorageactivate
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsStorageparsePlacementadmitsStorageadmits
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsprivate sourcelib.css.src.sheetcheckCssStorageInittest sourcelib.css.src.sheettest: CSS storage parses admitted sou...private sourcelib.css.src.sheet.Placementreleaseprivate sourcelib.css.src.sheet.StorageassertStorageStoragedeinit
Static calls · unresolved targets: 0 · external targets: 1.
Called byCallsprivate sourcelib.css.src.sheet.WorkspaceensureStorageprivate sourcelib.css.src.sheetcheckCssStorageInittest sourcelib.css.src.sheettest: CSS storage parses admitted sou...PlacementinitStorageinit
Static calls · unresolved targets: 1 · external targets: 1.
Called byCallstest sourcelib.css.src.sheettest: CSS storage parses admitted sou...StorageadmitssheetbuildStorageparse
Static calls · unresolved targets: 1 · external targets: 0.

Audit

Definitions9
Public names18
Members5
Version26.7.0
Revisiondaab053ee433