Expand description
Strata Layout: W3C Spec-compliant, Chromium-grade Box Model, Flexbox, and Grid solvers.
§Examples
use strata_layout::tree::LayoutNode;
use strata_style::types::ComputedStyle;
let mut root = LayoutNode::new(ComputedStyle::default());
root.compute_layout(1024.0, 768.0);
assert_eq!(root.geometry.border_box.width, 1024.0);Re-exports§
pub use box_model::clamp_dimension;pub use box_model::clamp_dimension_with_node;pub use box_model::collapse_margins;pub use box_model::resolve_dimension;pub use box_model::resolve_dimension_with_node;pub use exclusions::ExclusionKind;pub use exclusions::ExclusionRect;pub use exclusions::ExclusionSpace;pub use exclusions::LineOpportunity;pub use geometry::LayoutGeometry;pub use geometry::Point;pub use geometry::Rect;pub use geometry::Size;pub use intrinsic::compute_min_max_sizes;pub use intrinsic::MinMaxSizes;pub use positioning::solve_out_of_flow_box;pub use positioning::solve_positioning;pub use positioning::solve_positioning_children;pub use positioning::ContainingBlock;pub use table::border_style_priority;pub use table::resolve_collapsed_border;pub use table::solve_table;pub use table::CollapsedBorderEdge;pub use table::ElementSource;pub use table::TableBorderGrid;pub use text::is_monospace_family;pub use text::layout_inline_text;pub use text::measure_text_bounds;pub use text::measure_text_bounds_ext;pub use text::measure_text_bounds_styled_with_family;pub use text::measure_text_bounds_with_family;pub use text::measure_text_bounds_with_white_space;pub use text::text_measure_cache_stats;pub use tree::clear_layout_overflow;pub use tree::last_layout_overflow;pub use tree::record_layout_overflow;pub use tree::set_on_layout_overflow;pub use tree::solve_anchored_position;pub use tree::AnchorPlacement;pub use tree::FillRule;pub use tree::ImageResource;pub use tree::LayoutDepthGuard;pub use tree::LayoutNode;pub use tree::PortalAnchorSpec;pub use tree::StrokeLineCap;pub use tree::StrokeLineJoin;pub use tree::SvgItem;pub use tree::SvgTextData;pub use tree::ViewportSceneHandle;pub use tree::MAX_LAYOUT_DEPTH;pub use typography::apply_small_caps;pub use typography::bidi_mirror;pub use typography::can_break_between_chars;pub use typography::classify_line_break;pub use typography::is_prohibited_end;pub use typography::is_prohibited_start;pub use typography::AtomicFragment;pub use typography::BidiClass;pub use typography::BidiEngine;pub use typography::BidiRun;pub use typography::CssStrut;pub use typography::FontDatabase;pub use typography::FontHeight;pub use typography::FontMetrics;pub use typography::InlineFormattingContext;pub use typography::InlineItem;pub use typography::InlineLayoutOptions;pub use typography::InlineLayoutResult;pub use typography::InlineTextStyle;pub use typography::LineBox;pub use typography::LineBreakClass;pub use typography::LineBreaker;pub use typography::OpenTypeFeatures;pub use typography::OpenTypeFont;pub use typography::OpenTypeParseError;pub use typography::ShapedGlyph;pub use typography::TextFragment;pub use typography::TextLine;pub use typography::TextShaper;pub use typography::VerticalAlignment;pub use typography::WhiteSpaceMode;pub use wpt::InternalLayoutRegressionSuite;pub use wpt::SpecificationConformanceVector;pub use wpt::WptSuite;pub use wpt::WptTestVector;
Modules§
- box_
model - CSS 2.1 Section 8.3.1 Box Model and Vertical Margin Collapsing Engine.
- exclusions
- W3C CSS Floats & Exclusion Space engine (Blink LayoutNG parity).
- flexbox
- W3C Flexible Box Layout Level 1 Multi-Pass Solver.
- geometry
- Geometry structures for CSS Box Model and subpixel layout snapping.
- grid
- W3C CSS Grid Layout Level 2 Solver.
- intrinsic
- Chromium LayoutNG-parity Intrinsic Min/Max Sizing (
ComputeMinMaxSizes) and shrink-to-fit solver. - positioning
- CSS Positioning Scheme Engine (Relative, Absolute, Fixed, Sticky).
- prelude
- prof
- Opt-in layout profiling counters gated behind
STRATA_PERF_LOG. - table
- W3C CSS 2.1 Chapter 17 Table Layout Engine.
- text
- Intrinsic text dimension measurement, OpenType shaping, and line breaking facade.
- tree
- Layout tree node definition and top-level formatting context dispatcher.
- typography
- High-precision OpenType typography, text shaping, BiDi UAX#9, and Inline Formatting Context.
- wpt
- Internal W3C Specification Conformance & Layout Regression Suite.