Skip to content

absolutePositioning

disposition: bound, basis: implementation

A rule of the CSS binding. These keys resolve jointly — no one of them determines any single output, so the rule below is the mapping.

Keys. position, top, bottom, start, end, centerHorizontalOffset, centerVerticalOffset

Operands

Every fact the rule reads. Nothing outside this set participates.

OperandFrom
self.positiondocument
self.topdocument
self.bottomdocument
self.startdocument
self.enddocument
self.centerHorizontalOffsetdocument
self.centerVerticalOffsetdocument
parent.layoutModedocument (ancestor)
context.isRootemitter context

Derived predicates

NameExpressionSource
derived.hasInsets(self.top present or self.bottom present or self.start present or self.end present)position.ts:4-9
derived.parentAutoLayout(parent.layoutMode = HORIZONTAL or parent.layoutMode = VERTICAL)position.ts:18-27 (parentAutoLayout argument)
derived.nonZeroInset(self.top present and self.top ≠ 0 or self.bottom present and self.bottom ≠ 0 or self.start present and self.start ≠ 0 or self.end present and self.end ≠ 0)position.ts:24
derived.opposingAnchors(self.top present and self.bottom present or self.start present and self.end present)position.ts:25

Cases

Ordered — first match wins.

#WhenEmitsWhy
1self.position = ABSOLUTEposition: absolutean explicit position wins outright
2self.position = AUTOposition: static
3self.position absent and context.isRoot = truenothinga root never infers absolute
4self.position absent and derived.hasInsets = falsenothingno coordinates, nothing to infer from
5self.position absent and derived.parentAutoLayout = falseposition: absoluteoutside auto-layout, any coordinate is meaningful
6self.position absent and (derived.nonZeroInset = true or derived.opposingAnchors = true)position: absoluteinside auto-layout only a meaningful coordinate implies absolute
7self.position absentnothinga zero-only single anchor inside auto-layout is canvas noise

Offset cases

Ordered — first match wins.

#WhenEmitsWhy
1self.top presentinset-block-start: <self.top>
2self.bottom presentinset-block-end: <self.bottom>
3self.start presentinset-inline-start: <self.start>
4self.end presentinset-inline-end: <self.end>
5self.centerVerticalOffset present and derived.verticalAnchored = falseinset-block-start: <self.centerVerticalOffset>an edge anchor on the same axis wins; both would put two values on one property
6self.centerHorizontalOffset present and derived.horizontalAnchored = falseinset-inline-start: <self.centerHorizontalOffset>
7(derived.verticalCentred = true or derived.horizontalCentred = true)translate: <-50% on each centred axis, 0 on the other>

css/style/position.ts:4-27 (hasInsets, impliesAbsolute), 42-59, 84-107 (centerDecls). cases decides the position property; insetCases decides the offsets. verticalAnchored/horizontalAnchored are presence of top|bottom and start|end respectively.