Vixen
dd8b0a81
csharp
public enum LegacyTextAlign

CSS Text §7.1's three legacy text-align values, which move a block container's block-level children.

Read the guide page for this →

Remarks

⚠ This is not text-align, and the difference is the reason it has its own name and its own enum. text-align: center centres the inline content of a block container and leaves its block-level children exactly where §10.3.3 put them. -webkit-center — the behaviour <center> had, kept alive because pages depend on it — centres the child boxes as well, which is a block-layout rule that needs no line box and no inline formatting context. A field called TextAlign holding both sets of keywords would have to behave differently for each, so it holds only the set this store implements.

⚠ Reachable from a stylesheet, and for most of its life it was not. This field, its setter and LayoutTree.Block.LegacyTextAlignOffset all existed with sixteen Taffy fixtures on them, and the only caller of the setter in the whole repository was the corpus harness — LayoutStyleBuilder never read text-align into it. So the algorithm was implemented, conformance-tested, green, and unreachable, which is this repository's commonest defect shape and is invisible precisely because a harness counts as a caller. ⚠ Two defects were stacked, each hiding the other's symptom: even once the bridge read the keyword, StyleValueParser sent anything beginning with - down its numeric path, so -webkit-center came back as an unparseable value rather than as a word.

⚠ Physical, and they do not flip with Direction. Left is the left in an RTL container too — the keywords predate writing-mode-relative alignment and were never respecified in terms of it. block_text_align_center_rtl in the Taffy corpus is that pin exactly.

text-align proper — the inline-axis distribution of the items on a line box — is TextAlign, a separate field on the same struct. ⚠ This paragraph used to say it was "a separate, unwritten thing"; the second half stopped being true and the first half is what the two enums are. It still has no oracle in either corpus, for the reason InlineKnownGaps.txt opens with, so its fixtures are closed-form rather than recorded.

Fields and properties (4)

  • None

    None of the three was written, so block-level children sit at the inline start.

  • Left

    -webkit-left: against the container's left content edge in both directions.

  • Center

    -webkit-center: centred in the container's content box.

  • Right

    -webkit-right: against the container's right content edge in both directions.

Used by (6)

  • KeywordsVixen.Ui
  • LayoutStyleVixen.Ui.Layout
  • LayoutStyleBridgeTestsVixen.Ui.Tests
  • LayoutStyleBuilderVixen.Ui
  • LayoutTreeVixen.Ui.Layout
  • TaffyStyleMapVixen.Ui.Layout.Tests