diff --git a/.agent/plans/grid_layout_support_plan.md b/.agent/plans/grid_layout_support_plan.md index 486467e8b..d1cc3632f 100644 --- a/.agent/plans/grid_layout_support_plan.md +++ b/.agent/plans/grid_layout_support_plan.md @@ -860,3 +860,66 @@ Do not checkpoint a failing phase as complete. - Existing flex, table, block, inline, and out-of-flow layout tests still pass. - `.agent/rules/html-layout-architecture.md` is updated with `GridLayouter` support and any intentional limitations. + +## Bug Tracking + +### FIXED (43) + +| # | Bug | Test | +|---|-----|------| +| 1 | Stack overflow: `setPixelsSize` on container → re-layout cycle | `UIHTML.GridDownloadLayout` | +| 2 | Missing `mPacking` guard + transaction | `UIHTML.GridDownloadLayout` | +| 3 | `parseTrackList` didn't propagate `hasAutoRepeat`/`autoRepeatTemplate` | `GridParser.autoRepeatExpand` | +| 4 | `expandAutoRepeat` count from max only (ignored `minmax` min) | `GridContainer.autoFitColumnCount` | +| 5 | `expandAutoRepeat` never called from `readContainerStyle` | `GridContainer.autoFitColumnCount` | +| 6 | Items filled parent width: `MatchParent` → fill containing block | `GridContainer.itemWidthStretch` | +| 7 | Items uneven height: `WrapContent` height → each card had its own height | `GridContainer.itemHeightStretch` | +| 8 | `sizeTracksForAxis` uses `mColumnGap` for both axes | `GridContainer.rowGapWorks` | +| 9 | Unsigned underflow `tracks.size()-1` when empty | `GridContainer.emptyGridNoCrash` | +| 10 | Multi-span `cellW`/`cellH` missing internal gaps | `GridContainer.spanningItemWidthIncludesGaps` | +| 11 | `justify-content` space-between/around/evenly as uniform offset | `GridContainer.justifyContentSpaceBetween` | +| 12 | `expandAutoRepeat` appends to end (wrong insertion pos) | `GridParser.autoRepeatPositionInsert` | +| 13 | Row axis auto-fit collapse never implemented | `GridContainer.autoFitRowCount` | +| 14 | Negative line overflow not clamped to 1 | `GridContainer.negativeLineClamped` | +| 15 | P1: Negative `fr` values accepted (`-1fr`) | `GridParser.rejectNegativeFr` | +| 16 | P2: `isNumber()` accepts malformed decimals `12.34.56` | (unit testable) | +| 17 | P3: Nested auto-repeat in fixed-repeat silently drops tracks | (unit testable) | +| 18 | P4: Auto-repeat zero-min tracks collapses to count=1 | `GridContainer.autoRepeatZeroMinFillsContainer` | +| 19 | P7: Custom-idents starting with "span" misinterpreted | (unit testable) | +| 20 | PL1+PL4: Span on definite axis ignored for semi-auto items | `GridContainer.definiteColumnSpanAutoRow` | +| 21 | PL2: Dense mode missing in both-auto placement | `GridContainer.denseAutoPlacement` | +| 22 | PL3: `colLimit` static throughout loop | (implicitly tested) | +| 23 | PL5: Both span drops start span (now uses end span) | (unit testable) | +| 24 | PL6: Named grid lines never resolved | (unit testable) | +| 25 | TS1: Percentage `max` treated as infinite growth limit | (unit testable) | +| 26 | TS2: `FitContent` max treated as infinite growth limit | (unit testable) | +| 27 | TS4: Flex distribution never clamps to growth limits | `GridContainer.flexGrowthLimit` | +| 28 | TS6: Spanning extra clamped to growth limit w/o redistribute | (unit testable) | +| 29 | TS7: `grid-auto-rows`/`grid-auto-columns` properties ignored | `GridContainer.implicitTrackSizing` | +| 30 | I1: `computeIntrinsicWidths` ignores auto-repeat tracks | `GridContainer.intrinsicWidthAutoRepeat` | +| 31 | I2: `computeIntrinsicWidths` uses uninitialized `mColumnGap` | `GridContainer.intrinsicWidthAutoRepeat` | +| 32 | L2: `collapseEmptyAutoFitTracks` may remove implicit tracks | (unit testable) | +| 33 | L3: Track sizing adds gaps for content but cells omit them | `GridContainer.spanningItemWidthIncludesGaps` | +| 34 | TS3: Content-based `max` ignored for `minmax(fixed, auto)` | (implicitly fixed) | +| 35 | L1: `preSizeItemsForRowSizing` doesn't reflow content after width change | (implicitly tested) | +| 36 | L4: Baseline computed as bottom edge — grid not handled in `getBaseline()` | (implicitly tested) | +| 37 | P5: Invalid tokens silently become `Length(0)` | (unit testable) | +| 38 | P6: Malformed bracket tokens flow to function parsing | (unit testable) | +| 39 | TS5: Floating-point error from iterative subtraction | (unit testable) | +| 40 | I3: Auto-repeat expanded once with potentially zero container size | (implicitly tested) | +| 41 | I5: Negative `contentBoxSize` now clamped to 0 | (implicitly tested) | +| 42 | L5: `mPacking` converted to RAII guard (exception-safe) | (implicitly tested) | +| 43 | I4: Span decoupled from `resolvedEnd` — explicit `columnSpan`/`rowSpan` fields | (implicitly tested) | +| 44 | PL7: Auto-placement cursor not advancing past placed items (`cursorCol = c+sw`) | `GridContainer.percentHeightWithAutoParentFallsBackToContent` | +| 45 | PL8: Auto-placement column/row limit growing during iteration (captured `colLimit`/`rowLimit`) | `GridContainer.percentHeightWithAutoParentFallsBackToContent` | +| 46 | L6: `height:100%` / `width:100%` on grid with auto parent → fall back to content-based size | `GridContainer.percentHeightWithAutoParentFallsBackToContent` | +| 47 | TS8: `1fr` tracks get `baseSize=0` when container has indefinite width → size from item intrinsic widths | `GridContainer.frTracksWithPercentWidthAndHeight` | +| 48 | L7: `width:100%`/`height:100%` resolved against small intermediate ancestor → scan all ancestors + scene node for max size | `GridContainer.frTracksWithPercentWidthAndHeight` | +| 49 | L8: Percentage fallback ran AFTER track sizing → rows sized with 0 height. Re-run sizing loop after fallback adjusts container size. | `GridContainer.frTracksWithPercentWidthAndHeight` | +| 50 | L9: `height:100%` resolved against viewport instead of auto → use content-based height (CSS spec: % height on auto parent = auto) | `GridContainer.newsblurReducedGrid` | + +### Stats + +- **Total bugs found**: 50 +- **Fixed**: 50 +- **By severity**: 0 remaining diff --git a/bin/unit_tests/assets/html/grid_download.html b/bin/unit_tests/assets/html/grid_download.html new file mode 100644 index 000000000..9b5bde709 --- /dev/null +++ b/bin/unit_tests/assets/html/grid_download.html @@ -0,0 +1,217 @@ + + + + + +
+