Vixen
02b45cc4
csharp
public struct LayoutStyle

Everything a node's layout depends on, as one unmanaged value.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

All nine edges are stored, including the Horizontal, Vertical and All shorthands, because CSS resolves them by precedence at read time rather than by expansion at write time: setting All and then Left is not the same document as setting Left and then All, and a store that expanded on write could not tell them apart.

This is around 400 bytes — doc 09's estimate of 120 was made before the edge shorthands and the writing-mode-relative pair were counted. A hundred thousand nodes is therefore about 40 MB in four allocations, against the reference port's several hundred thousand heap objects for the same tree, which is the comparison ADR-006 was actually making.

Fields and properties (25)

  • public static readonly LayoutStyle Default

    A style with every CSS initial value, which is not the same as all zeroes.

  • public Direction Direction

    Which way the inline axis runs.

  • public FlexDirection FlexDirection

    The main axis.

  • public Justify JustifyContent

    Main-axis distribution.

  • public Align AlignContent

    Cross-axis distribution of the lines.

  • public Align AlignItems

    Cross-axis placement of the items.

  • public Align AlignSelf

    This node's own cross-axis placement, overriding its parent's.

  • public PositionType PositionType

    How this node is positioned.

  • public Wrap FlexWrap

    Whether the line wraps.

  • public Overflow Overflow

    What happens to content that does not fit.

  • public Display Display

    Whether the node is laid out at all.

  • public BoxSizing BoxSizing

    What the dimensions measure.

  • public float Flex

    The flex shorthand, if it was the thing that was set.

  • public float FlexGrow

    How much of the leftover space this node takes.

  • public float FlexShrink

    How much of an overflow this node absorbs.

  • public StyleLength FlexBasis

    The main size before growing and shrinking.

  • public float AspectRatio

    The width-to-height ratio the node is forced into.

  • public EdgeLengths Margin

    Outside the border box.

  • public EdgeLengths Position

    The offset applied by Relative and Absolute.

  • public EdgeLengths Padding

    Inside the border, outside the content.

  • public EdgeLengths Border

    Between padding and margin.

  • public GutterLengths Gap

    Between items and between lines.

  • public DimensionLengths Dimensions

    The requested size.

  • public DimensionLengths MinDimensions

    The floor.

  • public DimensionLengths MaxDimensions

    The ceiling.

Used by (7)

  • BridgeFixtureVixen.Ui.Tests
  • ConformanceMeasureVixen.Ui.Layout.Tests
  • LayoutStyleBridgeTestsVixen.Ui.Tests
  • LayoutStyleBuilderVixen.Ui
  • LayoutTreeVixen.Ui.Layout
  • LayoutTreeTestsVixen.Ui.Layout.Tests
  • StyleResolutionVixen.Ui.Layout