Aperture UI
Engineer Notes

Web Conformance Test Plan — APHTML Layout Engine

This document defines the conformance test matrix for the APHTML layout engine. Each test case maps to a W3C CSS specification section and is prioritized as P0 (must pass for release), P1 (should pass for release), or P2 (deferred / aspirational).

Web Conformance Test Plan — APHTML Layout Engine

This document defines the conformance test matrix for the APHTML layout engine. Each test case maps to a W3C CSS specification section and is prioritized as P0 (must pass for release), P1 (should pass for release), or P2 (deferred / aspirational).

Tests are structured by formatting context. Each test specifies an HTML/CSS input and the expected LayoutBox output (position, size, margins, padding, border) that Manniquin should validate against a Chrome reference render.


1 Flexbox (CSS Flexible Box Layout Level 1)

All flexbox tests validate that FlexFormattingContextIFlexLayoutProviderYogaFlexLayoutProvider produces spec-conformant results.

1.1 Container Properties

IDPrioritySpec §DescriptionInput SketchExpected
F-001P0§9.1flex-direction: row lays children left-to-right3 children 100px wide in 400px containerx: 0, 100, 200
F-002P0§9.1flex-direction: column lays children top-to-bottom3 children 50px tally: 0, 50, 100
F-003P0§9.1flex-direction: row-reverse reverses order3 childrenFirst child at right edge
F-004P0§9.1flex-direction: column-reverse reverses order3 childrenFirst child at bottom
F-005P0§9.2flex-wrap: wrap wraps children to next line5 × 100px children in 300px container3 on line 1, 2 on line 2
F-006P0§9.2flex-wrap: wrap-reverse wraps upwardSame as F-005Line 2 above line 1
F-007P0§9.2flex-wrap: nowrap shrinks children5 × 100px children in 300px containerAll on one line, each ≤ 60px

1.2 Item Properties

IDPrioritySpec §DescriptionInput SketchExpected
F-010P0§9.7flex-grow distributes extra space2 items, grow 1 & 2 in 300px100px & 200px
F-011P0§9.7flex-shrink reduces oversized items2 × 200px items, shrink 1 & 3 in 300px150px & 50px proportionally
F-012P0§9.8flex-basis: 0 uses content as baseItem with text, basis 0Width = grown share, not content
F-013P0§9.8flex-basis: auto uses item widthItem with width 150px, basis autoStarts at 150px before grow/shrink
F-014P1§9.8flex-basis percentage resolves to containerflex-basis: 50% in 400px containerBase = 200px
F-015P1§9.5order changes visual order3 items with order 3, 1, 2Visual: item2, item3, item1

1.3 Alignment

IDPrioritySpec §DescriptionInput SketchExpected
F-020P0§9.3justify-content: center200px of items in 400pxCentered, 100px start offset
F-021P0§9.3justify-content: space-between3 items in 300px0, 100, 200 (no gaps at edges)
F-022P0§9.3justify-content: space-around3 itemsEqual half-gaps at edges
F-023P0§9.3justify-content: space-evenly3 itemsEqual gaps including edges
F-024P0§9.4align-items: centerItems of varying heightAll vertically centered in line
F-025P0§9.4align-items: stretch (default)Items without explicit heightAll stretch to line height
F-026P0§9.4align-items: flex-start / flex-end / baselineMixed height itemsCorrect alignment per value
F-027P1§9.4align-self overrides align-items per itemOne item with align-self: flex-endThat item at end, others at start
F-028P1§9.4align-content: center (multi-line)Wrapped flex, align-content centerLines centered in cross axis

1.4 Gaps

IDPrioritySpec §DescriptionInput SketchExpected
F-030P0CSS Box Alignment §8gap: 10px between items3 × 80px items in 300px, gap 10pxx: 0, 90, 180
F-031P1CSS Box Alignment §8row-gap + column-gap differWrapped flex, row-gap 5px, col-gap 20pxProper spacing per axis
F-032P1CSS Box Alignment §8Percentage gapcolumn-gap: 10% in 200px container20px gaps

1.5 Auto Margins in Flex

IDPrioritySpec §DescriptionInput SketchExpected
F-040P1§8.1margin-left: auto pushes item rightSingle item in 300px row flexItem at right edge
F-041P1§8.1Opposing auto margins center itemmargin: 0 auto on one itemItem horizontally centered

2 CSS Grid (CSS Grid Layout Level 1)

2.1 Track Definition

IDPrioritySpec §DescriptionInput SketchExpected
G-001P0§7.2grid-template-columns: 100px 200px fixed tracks2 itemscol 0 = 100px, col 1 = 200px
G-002P0§7.2grid-template-columns: 1fr 2fr fractional tracks300px containercol 0 = 100px, col 1 = 200px
G-003P0§7.2grid-template-columns: repeat(3, 1fr)300px container3 × 100px columns
G-004P0§7.2grid-template-rows same as above for rows3 explicit row sizesCorrect row heights
G-005P0§7.2grid-template-columns: minmax(100px, 200px)150px containercol = 150px (clamped)
G-006P0§7.2minmax(100px, 1fr) with available space400px, 2 cols: minmax(100,1fr) 200pxcol 0 = 200px, col 1 = 200px
G-007P1§7.2auto track sizingItems of varying sizeTrack sized to largest item
G-008P2§7.2fit-content(200px) trackItem with 150px contentTrack = 150px (not 200px)

2.2 Item Placement

IDPrioritySpec §DescriptionInput SketchExpected
G-010P0§8.1grid-column: 1 / 3 spanning3-col grid, item spans 2Item width = col 1 + col 2
G-011P0§8.1grid-row: 2 / 4 spanning4-row grid, item spans rows 2–3Item height = row 2 + row 3
G-012P0§8.3Auto-placement fills in order6 items, 3-col grid2 rows of 3
G-013P1§8.1Negative line numbersgrid-column: -1 / -3 in 4-col gridSpans last 2 columns
G-014P1§8.1grid-column: span 2 shorthandItem with span 2Covers 2 column tracks

2.3 Named Areas

IDPrioritySpec §DescriptionInput SketchExpected
G-020P1§7.3grid-template-areas with named regions"header header" "nav main"header spans full width, nav + main below
G-021P1§7.3grid-area: header places item into named areaElement with grid-area: headerPlaced at row 1, cols 1–2

2.4 Gaps & Alignment

IDPrioritySpec §DescriptionInput SketchExpected
G-030P0Box Alignment §8gap: 10px between tracks3×3 grid with 10px gap10px between all tracks
G-031P1Box Alignment §8row-gapcolumn-gapDifferent gap valuesCorrect per-axis spacing
G-032P1§10.1justify-items: centerItems smaller than cellCentered in each cell
G-033P1§10.1align-items: endItems shorter than cellAligned to bottom of each cell

3 Inline Formatting Context (CSS Text, CSS Inline, UAX #9, UAX #14)

3.1 Line Breaking

IDPrioritySpec §DescriptionInput SketchExpected
I-001P0UAX #14Break at word boundariesLong sentence in 200px containerWords not split mid-word
I-002P0CSS Text §5word-wrap: break-word breaks long words"Supercalifragilisticexpialidocious" in 100pxWord broken to fit
I-003P1UAX #14Break after hyphen"state-of-the-art" in narrow containerBreak at hyphens
I-004P1CSS Text §5CJK character breaking (each char is break opportunity)Chinese text in narrow containerBreaks between any two characters
I-005P2CSS Text §5overflow-wrap: anywhere vs break-wordLong URL in narrow containerBreak anywhere when needed

3.2 BiDi (UAX #9)

IDPrioritySpec §DescriptionInput SketchExpected
I-010P0UAX #9 §3.3LTR paragraph base directionEnglish textLeft-to-right run order
I-011P0UAX #9 §3.3RTL paragraph base directionArabic text with dir="rtl"Right-to-left run order
I-012P1UAX #9 §3.4Mixed LTR+RTL in single paragraphEnglish with embedded ArabicArabic segment visually reversed
I-013P1UAX #9 §3.4Nested BiDi embeddingsLTR > RTL > LTR nestingCorrect per-level reordering
I-014P2UAX #9Neutral characters between runsSpaces and punctuation between LTR/RTLNeutrals follow surrounding direction

3.3 Vertical Alignment

IDPrioritySpec §DescriptionInput SketchExpected
I-020P0CSS Inline §4vertical-align: baseline (default)Mixed font sizes on one lineBaselines aligned
I-021P1CSS Inline §4vertical-align: top / bottomInline element with v-align topAligned to line box top
I-022P1CSS Inline §4vertical-align: middleImage in text lineImage centered on x-height
I-023P1CSS Inline §4line-height affects line box heightline-height: 2 on textLine box = 2 × font-size

4 Block Formatting Context (CSS Box Model Level 3)

4.1 Box Model

IDPrioritySpec §DescriptionInput SketchExpected
B-001P0§8Margin / padding / border applied correctlymargin: 10px; padding: 5px; border: 2pxContent offset by 17px from container
B-002P0§8.3Margin collapsing between siblingsTwo blocks with margin 20px each20px gap (not 40px)
B-003P0§8.3Margin collapsing parent-childParent no padding/border, child margin-top 20pxParent shifts down by 20px
B-004P1§8.3Padding/border prevents margin collapseParent with 1px border, child margin-top 20pxChild 20px inside parent
B-005P0§10.2box-sizing: content-box (default)Width 200px, padding 10px, border 2pxTotal = 224px
B-006P0§10.2box-sizing: border-boxWidth 200px, padding 10px, border 2pxTotal = 200px, content = 176px

4.2 Sizing

IDPrioritySpec §DescriptionInput SketchExpected
B-010P0§10.3width: auto fills containing blockBlock in 400px containerWidth = 400px − margins
B-011P0§10.6height: auto shrinks to contentBlock with 3 × 50px childrenHeight = 150px
B-012P0§10.4Percentage width resolves to parentwidth: 50% in 400px containerWidth = 200px
B-013P1§10.4min-width / max-width clampWidth 100px, min-width 150pxActual = 150px
B-014P1§10.7min-height / max-height clampHeight 300px, max-height 200pxActual = 200px

4.3 Positioning

IDPrioritySpec §DescriptionInput SketchExpected
B-020P0§9.3position: relative offsets from normal positiontop: 10px; left: 20pxVisual offset, siblings unaffected
B-021P0§9.6position: absolute removes from flowAbsolute child in relative parentPositioned relative to parent
B-022P1§9.6Absolute with top/right/bottom/leftAll four insets specifiedCorrectly sized and placed
B-023P1§9.6position: fixed relative to viewportFixed elementPositioned relative to viewport (ICB)

4.4 Overflow

IDPrioritySpec §DescriptionInput SketchExpected
B-030P0CSS Overflow §3overflow: hidden clips contentChild taller than parent with overflow hiddenChild visually clipped
B-031P1CSS Overflow §3overflow: scroll provides scrollbarSame as above with overflow scrollScrollable area created
B-032P1CSS Overflow §3overflow: auto only scrolls when neededContent fits vs. overflowsScrollbar only when needed

5 CSS Intrinsic Sizing (CSS Intrinsic & Extrinsic Sizing Level 3)

IDPrioritySpec §DescriptionInput SketchExpected
S-001P1§4.1min-content widthFlex/grid child with width: min-contentWidth = widest unbreakable word
S-002P1§4.2max-content widthSame with width: max-contentWidth = full unwrapped line
S-003P2§4.3fit-content(200px)Block with fit-contentWidth = min(max-content, max(min-content, 200px))

6 Visual / Paint (CSS Backgrounds, Borders, Outlines)

IDPrioritySpec §DescriptionInput SketchExpected
V-001P0CSS BG §5border-radius renders rounded cornersborder-radius: 10pxRounded corners visible
V-002P0CSS BG §3background-color fills content + paddingBlue background with paddingColor extends to padding edge
V-003P1CSS UI §4outline does not affect layoutoutline: 2px solid redNo box model impact
V-004P1CSS UI §4outline-offset: 5pxOutline with offset5px gap between border and outline
V-005P1CSS BG §5border-style: dashed / dotted / doubleVarious border stylesCorrect rendering per style
V-006P2CSS Maskingclip-path: circle(50%)Circular clip on elementContent clipped to circle

Running Tests

  1. Manniquin: Each test case should produce a reference image via Chrome and a test image via AperturePlayer. Manniquin compares pixel-by-pixel with a configurable tolerance (default 1% pixel diff threshold).
  2. Layout Unit Tests: For pure layout validation (no paint), compare LayoutBox output fields directly:
    • Position: x, y relative to containing block
    • Size: width, height (content box or border box depending on box-sizing)
    • Box model: margin_top/right/bottom/left, padding_top/right/bottom/left, border_top/right/bottom/left
    • Flex: flex_grow, flex_shrink, flex_basis, order
  3. Test HTML files: Place in Data/UnitTests/Layout/ with naming convention {ID}.html (e.g., F-001.html).
  4. Regression Gate: All P0 tests must pass before merging layout changes. P1 tests are tracked as known issues if failing.
Copyright © 2026