Skip to content

Conversation

@jwxbond
Copy link
Contributor

@jwxbond jwxbond commented Jan 6, 2026

  • Subgrid: Core CSS Grid Level 2 subgrid behaviors covered via Phase 9 integration specs.

Summary by CodeRabbit

  • New Features

    • Full CSS Grid Subgrid support enabling nested grids with inherited tracks, gaps, alignment, placement, and sizing behaviors
  • Documentation

    • CSS Grid docs updated to Phase 9 completion with detailed Subgrid guidance and coverage notes
  • Tests

    • Extensive new integration tests covering subgrid inheritance, alignment, placement, auto-placement, intrinsic sizing, gaps, named lines, nesting, spanning, and track-sizing contributions

✏️ Tip: You can customize this high-level summary in your review settings.

jwxbond added 22 commits January 7, 2026 00:11
  - Marked Phase 9 ✅ complete and removed the “deferred/future” roadmap (CSS_GRID_PLAN.md:708)
  - Added Phase 9 file/test breakdown (14 files, 68 tests) and updated totals to 91 files / 597 tests (CSS_GRID_PLAN.md:209)
  - Updated coverage tables + success metrics and bumped “Last Updated” to 2026-01-06 (CSS_GRID_PLAN.md:101)
@vercel
Copy link

vercel bot commented Jan 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
use-case Ready Ready Preview, Comment Jan 7, 2026 5:19am
vue_usecase Ready Ready Preview, Comment Jan 7, 2026 5:19am

@coderabbitai
Copy link

coderabbitai bot commented Jan 6, 2026

📝 Walkthrough

Walkthrough

Adds full CSS Grid Subgrid support: parsing/serialization (GridSubgrid), rendering/layout integration with subgrid contexts and intrinsic contributions, computed-style serialization, and 14 new integration test suites covering subgrid behavior across many scenarios.

Changes

Cohort / File(s) Summary
Documentation
docs/CSS_GRID_PLAN.md
Moved Subgrid into Phase 9 completed, updated scope, Phase 5/9 wording, test totals, coverage notes, and added Phase 9 details and references.
Minor test tweak
integration_tests/specs/css/css-grid/absolute-positioning/mixed-positioning.ts
Snapshot call changed to await snapshot(0.5) to add a 0.5s delay before capture.
Subgrid Integration Tests
integration_tests/specs/css/css-grid/subgrid/*
abspos.ts, alignment.ts, auto-placement.ts, axis-combinations.ts, basic-inheritance.ts, basic.ts, explicit-placement.ts, gap-inheritance.ts, intrinsic-sizing.ts, mixed-tracks.ts, named-lines.ts, nested-subgrids.ts, spanning-subgrid.ts, track-sizing-contribution.ts
Added 14 test suites exercising subgrid behavior: inheritance, alignment, auto/explicit placement, gaps, intrinsic sizing, mixed tracks, named lines, nesting, spanning, absolute positioning, and track-sizing contributions. Each creates DOM grids/subgrids, snapshots, and asserts bounding measurements.
CSS parsing & model
webf/lib/src/css/grid.dart
Added GridSubgrid class (extends GridTrackSize) with lineNameGroups; extended parseTrackList to recognize subgrid syntax and parse optional line-name groups.
Computed style serialization
webf/lib/src/css/computed_style_declaration.dart
_countLineNameOccurrences handles GridSubgrid lineNameGroups; _gridTrackListToCss serializes a single GridSubgrid as "subgrid" plus line-name groups.
Grid rendering/layout
webf/lib/src/rendering/grid.dart
Added _SubgridAxisContext, pending subgrid state (_pendingSubgridColumns, _pendingSubgridRows, _subgridRowSizeContributions), new helpers (_isSubgridTrackList, _unwrapGridLayoutChild, _sliceLineNameMap, _mergeLineNameMapWithSubgridGroups), context APIs (_setSubgridParentContext, _takeSubgridColumnsContext, _takeSubgridRowsContext, _configureSubgridContextForGridItem), intrinsic contribution resolution, and integrated subgrid-aware sizing, placement, and caching across layout passes.
DOM widget adapter (scroll controllers)
webf/lib/src/dom/element_widget_adapter.dart
Converted element-scoped scroll controllers to state-scoped _scrollControllerX/_scrollControllerY; getters now aggregate from WebFElementWidgetState; updated usage and lifecycle disposal.

Sequence Diagram

sequenceDiagram
    participant Dev as CSS input / Tests
    participant Parser as grid.dart (Parser)
    participant Model as GridSubgrid (css model)
    participant Serializer as computed_style_declaration.dart
    participant Renderer as rendering/grid.dart
    participant Layout as Final Layout

    Dev->>Parser: parse "grid-template-(columns|rows): subgrid [line-names]?"
    activate Parser
    Parser->>Model: create GridSubgrid(lineNameGroups)
    deactivate Parser

    Model->>Serializer: serialize computed style
    activate Serializer
    Serializer->>Dev: output "subgrid [line-names]"
    deactivate Serializer

    Dev->>Renderer: attach element with subgrid tracks
    activate Renderer
    Renderer->>Renderer: _setSubgridParentContext(columns/rows)
    Renderer->>Renderer: _configureSubgridContextForGridItem()
    Renderer->>Renderer: resolve track sizing & intrinsic contributions
    Renderer->>Renderer: place items respecting subgrid tracks/gaps/named lines
    Renderer->>Layout: produce positioned boxes
    deactivate Renderer

    Layout-->>Dev: rendered snapshot / measurements
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

🐰 In rows and columns I hop with glee,
Subgrid tracks inherited, clear to see,
Parsers, renderers, tests all align—
A tiny rabbit cheers layout divine!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding subgrid feature support and corresponding integration tests, which aligns with the substantial code additions across parser, renderer, and test files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom Pre-merge Checks in the settings.


📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9a9a30f and 65d5750.

📒 Files selected for processing (1)
  • webf/lib/src/dom/element_widget_adapter.dart
🧰 Additional context used
📓 Path-based instructions (2)
webf/**/*.dart

📄 CodeRabbit inference engine (webf/CLAUDE.md)

webf/**/*.dart: Follow rules in webf/analysis_options.yaml for Dart code style
Use single quotes for strings in Dart code
File names must use snake_case in Dart
Class names must use PascalCase in Dart
Variables and functions must use camelCase in Dart
Prefer final fields when applicable in Dart code
Lines should be max 120 characters in Dart code
Always free allocated memory in Dart FFI using malloc.free() for toNativeUtf8() allocations
Free FFI allocated memory in finally blocks to ensure cleanup on exceptions
Track ownership of allocated pointers in FFI callbacks
Free NativeValue pointers after converting with fromNativeValue in FFI code
Document memory ownership clearly in FFI async callbacks
Implement WidgetElement to create custom Flutter widgets integrated into WebF's DOM tree
Register custom WidgetElements using WidgetElementRegistry.register(tagName, builder)
Override buildWidget(BuildContext context) method in WidgetElement to build the Flutter widget
Call updateWidget() when attributes change in WidgetElement implementations
Dispose controllers and subscriptions in WidgetElement for memory management
Follow W3C event standards when dispatching events from WidgetElement
Minimize widget rebuilds in WidgetElement for performance optimization
Implement ARIA attributes in WidgetElement when applicable for accessibility

Dart code in webf module must follow naming conventions: snake_case for file names, PascalCase for classes, and camelCase for class members

webf/**/*.dart: Always free allocated memory in Dart FFI
Use malloc.free() for toNativeUtf8() allocations in Dart FFI
Track pointer ownership in callbacks within Dart FFI

Files:

  • webf/lib/src/dom/element_widget_adapter.dart
{bridge/**/*.{cc,h},webf/**/*.dart}

📄 CodeRabbit inference engine (CLAUDE.md)

Document memory ownership clearly in FFI implementations

Files:

  • webf/lib/src/dom/element_widget_adapter.dart
🧠 Learnings (10)
📚 Learning: 2025-12-08T23:28:00.818Z
Learnt from: CR
Repo: openwebf/webf PR: 0
File: webf/CLAUDE.md:0-0
Timestamp: 2025-12-08T23:28:00.818Z
Learning: Applies to webf/**/*.dart : Call updateWidget() when attributes change in WidgetElement implementations

Applied to files:

  • webf/lib/src/dom/element_widget_adapter.dart
📚 Learning: 2025-12-08T23:28:00.818Z
Learnt from: CR
Repo: openwebf/webf PR: 0
File: webf/CLAUDE.md:0-0
Timestamp: 2025-12-08T23:28:00.818Z
Learning: Applies to webf/**/*.dart : Minimize widget rebuilds in WidgetElement for performance optimization

Applied to files:

  • webf/lib/src/dom/element_widget_adapter.dart
📚 Learning: 2025-12-08T23:28:00.818Z
Learnt from: CR
Repo: openwebf/webf PR: 0
File: webf/CLAUDE.md:0-0
Timestamp: 2025-12-08T23:28:00.818Z
Learning: Applies to webf/**/*.dart : Implement WidgetElement to create custom Flutter widgets integrated into WebF's DOM tree

Applied to files:

  • webf/lib/src/dom/element_widget_adapter.dart
📚 Learning: 2025-12-08T23:28:00.818Z
Learnt from: CR
Repo: openwebf/webf PR: 0
File: webf/CLAUDE.md:0-0
Timestamp: 2025-12-08T23:28:00.818Z
Learning: Applies to webf/**/*.dart : Dispose controllers and subscriptions in WidgetElement for memory management

Applied to files:

  • webf/lib/src/dom/element_widget_adapter.dart
📚 Learning: 2025-12-08T23:28:00.818Z
Learnt from: CR
Repo: openwebf/webf PR: 0
File: webf/CLAUDE.md:0-0
Timestamp: 2025-12-08T23:28:00.818Z
Learning: Applies to webf/**/*.dart : Implement ARIA attributes in WidgetElement when applicable for accessibility

Applied to files:

  • webf/lib/src/dom/element_widget_adapter.dart
📚 Learning: 2025-12-08T23:28:00.818Z
Learnt from: CR
Repo: openwebf/webf PR: 0
File: webf/CLAUDE.md:0-0
Timestamp: 2025-12-08T23:28:00.818Z
Learning: Applies to webf/**/*.dart : Follow W3C event standards when dispatching events from WidgetElement

Applied to files:

  • webf/lib/src/dom/element_widget_adapter.dart
📚 Learning: 2025-12-08T23:28:00.818Z
Learnt from: CR
Repo: openwebf/webf PR: 0
File: webf/CLAUDE.md:0-0
Timestamp: 2025-12-08T23:28:00.818Z
Learning: Applies to webf/**/*.dart : Override buildWidget(BuildContext context) method in WidgetElement to build the Flutter widget

Applied to files:

  • webf/lib/src/dom/element_widget_adapter.dart
📚 Learning: 2025-12-08T23:28:00.818Z
Learnt from: CR
Repo: openwebf/webf PR: 0
File: webf/CLAUDE.md:0-0
Timestamp: 2025-12-08T23:28:00.818Z
Learning: Applies to webf/**/*.dart : Prefer final fields when applicable in Dart code

Applied to files:

  • webf/lib/src/dom/element_widget_adapter.dart
📚 Learning: 2025-12-13T16:32:47.644Z
Learnt from: CR
Repo: openwebf/webf PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-13T16:32:47.644Z
Learning: Applies to webf/**/*.dart : Track pointer ownership in callbacks within Dart FFI

Applied to files:

  • webf/lib/src/dom/element_widget_adapter.dart
📚 Learning: 2025-12-08T23:28:00.818Z
Learnt from: CR
Repo: openwebf/webf PR: 0
File: webf/CLAUDE.md:0-0
Timestamp: 2025-12-08T23:28:00.818Z
Learning: Applies to webf/test/**/*_test.dart : When testing with WebFController, wait for initialization with: await controller.controlledInitCompleter.future

Applied to files:

  • webf/lib/src/dom/element_widget_adapter.dart
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: Build Android Bridge
  • GitHub Check: build_windows_bridge (Debug)
  • GitHub Check: Analyze (c-cpp)
  • GitHub Check: Analyze (rust)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (1)
webf/lib/src/dom/element_widget_adapter.dart (1)

93-111: LGTM! Clean refactoring of scroll controller ownership.

The refactoring correctly moves ScrollController ownership from the element to WebFElementWidgetState, which is the appropriate lifecycle scope for Flutter resources. The implementation properly handles:

  • Lazy initialization: Controllers are created only when needed (lines 319, 353, 371-372)
  • Public access: Getters aggregate controllers from states using the established forEachState pattern
  • Encapsulation: Private state fields with public element-level accessors
  • Memory management: Both controllers are explicitly disposed and nulled in the state's dispose method

Based on coding guidelines, the disposal pattern correctly ensures cleanup of Flutter resources.

Also applies to: 193-194, 315-379, 414-415, 441-444


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI Agents
In @integration_tests/specs/css/css-grid/subgrid/basic.ts:
- Line 8: The test sets grid.style.width = '400px' which exceeds the testing
window max of 340px; update the assignment in the test to use a width <= '340px'
(e.g., '340px' or smaller) and, if needed, adjust the gridTemplateColumns values
in the same test (references: grid.style.width and
grid.style.gridTemplateColumns) so the column definitions still fit and preserve
the test's intent.
🧹 Nitpick comments (7)
integration_tests/specs/css/css-grid/subgrid/alignment.ts (1)

122-125: Consider removing unused variables.

Lines 123-125 retrieve bounding rectangles but only items[1] is used in the subsequent assertion. Variables item1Rect and subgridRect are never referenced.

🔎 Proposed cleanup
-    const items = Array.from(subgrid.children) as HTMLElement[];
-    const item1Rect = items[0].getBoundingClientRect();
-    const item2Rect = items[1].getBoundingClientRect();
-    const subgridRect = subgrid.getBoundingClientRect();
-
-    expect(items[1].getBoundingClientRect().width).toBe(60);
+    const items = Array.from(subgrid.children) as HTMLElement[];
+    expect(items[1].getBoundingClientRect().width).toBe(60);
webf/lib/src/css/grid.dart (1)

533-549: Consider stricter token boundary validation for the subgrid keyword.

The check at line 534 uses trimmed.toLowerCase().startsWith('subgrid'), which could theoretically match strings like "subgridfunction" or "subgrid-custom". While the subsequent line-name token validation (lines 543-544) correctly rejects these cases by returning an empty list, it would be more explicit and spec-compliant to verify that "subgrid" is a complete token—either followed by whitespace or at the end of the input.

Example: Add a check like:

final int endIdx = 7;
if (trimmed.length > 7 && !trimmed[7].contains(RegExp(r'\s'))) {
  // "subgrid" is not a complete token
  return _parseTrackListInternal(trimmed, renderStyle, propertyName, axis);
}

This makes the intent clearer and aligns with CSS tokenization rules, though the current implementation works correctly in practice due to downstream validation.

integration_tests/specs/css/css-grid/subgrid/abspos.ts (1)

54-104: Add a comment explaining why this test is skipped.

The test is skipped using xit() without any explanation. Adding a comment would help other developers understand whether this is a known limitation, a work-in-progress feature, or a test that needs fixing.

🔎 Suggested comment format
+  // TODO: This test is skipped because [reason - e.g., "grid-column placement 
+  // for absolutely positioned items in subgrids is not yet supported"]
   xit('absolutely positioned item with grid-column placement in subgrid', async () => {

Based on coding guidelines.

integration_tests/specs/css/css-grid/subgrid/mixed-tracks.ts (1)

1-254: Comprehensive mixed-track subgrid coverage; consider staying within 340px where possible

These six tests exercise subgrid behavior with fixed+fr, minmax+auto, intrinsic+fr, repeat patterns, fit-content, and complex mixed tracks. They:

  • Use async/await with waitForFrame() and snapshot(),
  • Clean up via parent.remove(),
  • Assert widths via getBoundingClientRect() in a way that matches the configured tracks.

The only minor nit is that some parents use explicit widths (400–500px), while the harness notes a 340px max window width. Layout will still work (overflow is fine), but if you see snapshot cropping, you might want to tune these widths down closer to 340px in a follow-up.

webf/lib/src/rendering/grid.dart (3)

43-55: Subgrid axis context plumbing is sound; add a brief comment for future maintainers

The _SubgridAxisContext struct plus _pendingSubgridColumns/_pendingSubgridRows and _setSubgridParentContext / _takeSubgrid*Context give a clear, single-consumer handoff from parent grid to subgrid. _configureSubgridContextForGridItem correctly:

  • Detects grid-template-rows/columns: subgrid,
  • Slices the parent track sizes and line-name maps by the item’s span, and
  • Marks when row sizes are not yet definite so a second layout pass can use final heights.

This design looks correct and contained. A short doc comment on _setSubgridParentContext explaining that it must be called by the parent grid just before laying out a subgrid child would make the ownership/ordering constraints obvious when someone revisits this code.

Also applies to: 113-148, 264-323


2599-2719: Intrinsic width contribution logic (including nested subgrids) is correct but dense

The resolveIntrinsicWidthContribution / applyIntrinsicWidthContributionToColumns pair, together with the nested-subgrid path, implement:

  • Per-item min/max intrinsic width contributions (respecting white-space, min-width, width: min/max-content, and aspect-ratio),
  • Distribution of those contributions across auto/min-content/max-content and flex tracks,
  • Special handling for fit-content() and minmax(<intrinsic>, <fixed>) range tracks, and
  • A second, inner auto-placement run to derive per-column intrinsic contributions for subgrid columns, including padding/border insets and sliced line-name maps.

Semantically this lines up with how browsers size auto/content-based and flex tracks, and the nested-subgrid branch correctly forwards contributions from subgrid items up into the parent’s columns rather than treating the subgrid container as opaque.

Given how much logic is embedded in this one block, you might consider extracting these helpers (and possibly the nested-subgrid intrinsic loop) into a small internal helper class or separate private methods to keep _performGridLayout more navigable. Behaviorally, though, it looks sound.

Also applies to: 2726-2890, 3027-3230


3607-3766: Row-size propagation from subgrids and relayout flags are reasonable; minor clarity tweak possible

The new flow:

  • Tracks whether any subgrid row context had non-definite sizes via relayoutForSubgridRows,
  • Captures per-row contributions from subgrid children into _subgridRowSizeContributions on the subgrid,
  • Lets the parent, during Pass 2, either:
    • Consume those contributions into implicitRowHeights (when the child is a subgrid in rows), or
    • Fall back to the existing marginBox-based spanning logic, and
  • Forces a second child relayout pass when either implicit-row stretch or subgrid rows require updated constraints, rewiring contexts via _configureSubgridContextForGridItem before the second layout().

This should avoid double-counting contributions (via skipSelfRowContribution) and give subgrid rows a chance to pick up final heights without perturbing non-subgrid grids.

The only suggestion is to add a short comment near relayoutForSubgridRows explaining that it is used solely to trigger the second-pass child layout with final row sizes, and that the first pass is responsible for populating the parent’s row/implicit heights from subgrid contributions.

Also applies to: 4172-4255, 4436-4445

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 12a1f11 and 9a9a30f.

⛔ Files ignored due to path filters (72)
  • integration_tests/snapshots/css/css-grid/grid-definition/template-areas-advanced.ts.790ccafa2.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/grid-definition/template-areas-advanced.ts.bfcda8ab1.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/placement/area-based.ts.20700f2d1.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/abspos.ts.844e9ce31.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/abspos.ts.9cc463101.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/abspos.ts.e4bf40821.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/alignment.ts.706783171.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/alignment.ts.7c6d606a1.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/alignment.ts.8874d64c1.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/alignment.ts.d7ffb7ea1.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/auto-placement.ts.503709cf1.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/auto-placement.ts.5ceaf30b1.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/auto-placement.ts.7e8b75f21.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/auto-placement.ts.972d30c01.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/axis-combinations.ts.4502d2f61.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/axis-combinations.ts.58ac4ee41.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/axis-combinations.ts.873f9db01.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/axis-combinations.ts.9156da731.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/axis-combinations.ts.b1d919721.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/axis-combinations.ts.b2fbd7bd1.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/basic-inheritance.ts.189290721.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/basic-inheritance.ts.434ce9411.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/basic-inheritance.ts.651b3ae01.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/basic-inheritance.ts.ab8dc5a81.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/basic-inheritance.ts.cfd039121.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/basic-inheritance.ts.dccd66681.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/basic.ts.978250541.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/basic.ts.f94b85c51.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/explicit-placement.ts.339e0d361.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/explicit-placement.ts.6dafdb201.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/explicit-placement.ts.aba104b01.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/explicit-placement.ts.d4f55b061.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/gap-inheritance.ts.11a28ad91.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/gap-inheritance.ts.1d4f65861.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/gap-inheritance.ts.2cde28b31.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/gap-inheritance.ts.8fb5465e1.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/gap-inheritance.ts.a28a34c71.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/gap-inheritance.ts.b6b1a7a71.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/intrinsic-sizing.ts.37f5d62f1.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/intrinsic-sizing.ts.42f0e6ed1.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/intrinsic-sizing.ts.806bcfba1.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/intrinsic-sizing.ts.c996c5521.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/intrinsic-sizing.ts.e074960f1.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/intrinsic-sizing.ts.f768ec3c1.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/mixed-tracks.ts.41c3e35c1.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/mixed-tracks.ts.bc24fdd61.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/mixed-tracks.ts.cb0702dc1.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/mixed-tracks.ts.cf169f9e1.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/mixed-tracks.ts.e140b0ad1.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/mixed-tracks.ts.e9c2cf981.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/named-lines.ts.9b07aaee1.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/named-lines.ts.a98fb59b1.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/named-lines.ts.e76ed0c41.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/named-lines.ts.ef9167261.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/named-lines.ts.f5f5f8e41.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/nested-subgrids.ts.52688aa11.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/nested-subgrids.ts.6e2d65331.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/nested-subgrids.ts.7a8f862e1.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/nested-subgrids.ts.ab8df25d1.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/spanning-subgrid.ts.179cccfd1.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/spanning-subgrid.ts.2ba7bfb11.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/spanning-subgrid.ts.2edb0a211.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/spanning-subgrid.ts.71239b5d1.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/spanning-subgrid.ts.80010a071.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/spanning-subgrid.ts.d74ca5171.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/track-sizing-contribution.ts.11fe95b71.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/track-sizing-contribution.ts.3c9f6df01.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/track-sizing-contribution.ts.9a7fe5be1.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/track-sizing-contribution.ts.a2df471a1.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/track-sizing-contribution.ts.c86b1b921.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/subgrid/track-sizing-contribution.ts.f38600a81.png is excluded by !**/*.png
  • integration_tests/snapshots/css/css-grid/template-areas.ts.455eb0b51.png is excluded by !**/*.png
📒 Files selected for processing (19)
  • docs/CSS_GRID_PLAN.md
  • integration_tests/specs/css/css-grid/absolute-positioning/mixed-positioning.ts
  • integration_tests/specs/css/css-grid/subgrid/abspos.ts
  • integration_tests/specs/css/css-grid/subgrid/alignment.ts
  • integration_tests/specs/css/css-grid/subgrid/auto-placement.ts
  • integration_tests/specs/css/css-grid/subgrid/axis-combinations.ts
  • integration_tests/specs/css/css-grid/subgrid/basic-inheritance.ts
  • integration_tests/specs/css/css-grid/subgrid/basic.ts
  • integration_tests/specs/css/css-grid/subgrid/explicit-placement.ts
  • integration_tests/specs/css/css-grid/subgrid/gap-inheritance.ts
  • integration_tests/specs/css/css-grid/subgrid/intrinsic-sizing.ts
  • integration_tests/specs/css/css-grid/subgrid/mixed-tracks.ts
  • integration_tests/specs/css/css-grid/subgrid/named-lines.ts
  • integration_tests/specs/css/css-grid/subgrid/nested-subgrids.ts
  • integration_tests/specs/css/css-grid/subgrid/spanning-subgrid.ts
  • integration_tests/specs/css/css-grid/subgrid/track-sizing-contribution.ts
  • webf/lib/src/css/computed_style_declaration.dart
  • webf/lib/src/css/grid.dart
  • webf/lib/src/rendering/grid.dart
🧰 Additional context used
📓 Path-based instructions (6)
integration_tests/specs/**/*.ts

📄 CodeRabbit inference engine (integration_tests/CLAUDE.md)

integration_tests/specs/**/*.ts: Place tests in appropriate directories under specs/ (css/, dom/, or window/)
Use TypeScript (.ts extension) for test files
Use done() callback for async tests
Use snapshot() for visual regression tests to capture current rendering
Use simulateClick with coordinates for hit testing tests
Test assets should reference files in assets/ directory
Use fdescribe() instead of describe() to run only specific test specs (Jasmine feature)
Use fit() instead of it() to run only specific test cases
Snapshots are stored as images for comparison and failed snapshots generate diff images
The max width of testing window is 340px
Test specs will always pass if there are no existing snapshots
Group related tests in describe blocks
Each test should be independent
Remove created elements after tests (test cleanup)
Use clear, descriptive test names
Test behavior, not implementation
Include edge cases and error conditions in tests
Batch DOM operations to minimize reflows
Use async/await and proper async patterns for asynchronous operations in tests
Measure operations using performance.now() for timing in performance-critical tests

Files:

  • integration_tests/specs/css/css-grid/subgrid/track-sizing-contribution.ts
  • integration_tests/specs/css/css-grid/subgrid/nested-subgrids.ts
  • integration_tests/specs/css/css-grid/absolute-positioning/mixed-positioning.ts
  • integration_tests/specs/css/css-grid/subgrid/abspos.ts
  • integration_tests/specs/css/css-grid/subgrid/auto-placement.ts
  • integration_tests/specs/css/css-grid/subgrid/basic.ts
  • integration_tests/specs/css/css-grid/subgrid/axis-combinations.ts
  • integration_tests/specs/css/css-grid/subgrid/mixed-tracks.ts
  • integration_tests/specs/css/css-grid/subgrid/alignment.ts
  • integration_tests/specs/css/css-grid/subgrid/named-lines.ts
  • integration_tests/specs/css/css-grid/subgrid/explicit-placement.ts
  • integration_tests/specs/css/css-grid/subgrid/gap-inheritance.ts
  • integration_tests/specs/css/css-grid/subgrid/intrinsic-sizing.ts
  • integration_tests/specs/css/css-grid/subgrid/basic-inheritance.ts
  • integration_tests/specs/css/css-grid/subgrid/spanning-subgrid.ts
docs/**/*.md

📄 CodeRabbit inference engine (CLAUDE.md)

docs/**/*.md: Clarify that WebF builds Flutter apps, not web apps in documentation
Provide complete, runnable examples in documentation
Include WebFControllerManager setup in code examples within documentation
Structure documentation information hierarchically
Test all code examples provided in documentation

Files:

  • docs/CSS_GRID_PLAN.md
webf/**/*.dart

📄 CodeRabbit inference engine (webf/CLAUDE.md)

webf/**/*.dart: Follow rules in webf/analysis_options.yaml for Dart code style
Use single quotes for strings in Dart code
File names must use snake_case in Dart
Class names must use PascalCase in Dart
Variables and functions must use camelCase in Dart
Prefer final fields when applicable in Dart code
Lines should be max 120 characters in Dart code
Always free allocated memory in Dart FFI using malloc.free() for toNativeUtf8() allocations
Free FFI allocated memory in finally blocks to ensure cleanup on exceptions
Track ownership of allocated pointers in FFI callbacks
Free NativeValue pointers after converting with fromNativeValue in FFI code
Document memory ownership clearly in FFI async callbacks
Implement WidgetElement to create custom Flutter widgets integrated into WebF's DOM tree
Register custom WidgetElements using WidgetElementRegistry.register(tagName, builder)
Override buildWidget(BuildContext context) method in WidgetElement to build the Flutter widget
Call updateWidget() when attributes change in WidgetElement implementations
Dispose controllers and subscriptions in WidgetElement for memory management
Follow W3C event standards when dispatching events from WidgetElement
Minimize widget rebuilds in WidgetElement for performance optimization
Implement ARIA attributes in WidgetElement when applicable for accessibility

Dart code in webf module must follow naming conventions: snake_case for file names, PascalCase for classes, and camelCase for class members

webf/**/*.dart: Always free allocated memory in Dart FFI
Use malloc.free() for toNativeUtf8() allocations in Dart FFI
Track pointer ownership in callbacks within Dart FFI

Files:

  • webf/lib/src/css/computed_style_declaration.dart
  • webf/lib/src/css/grid.dart
  • webf/lib/src/rendering/grid.dart
webf/lib/src/css/**/*.dart

📄 CodeRabbit inference engine (webf/CLAUDE.md)

Use CSSRenderStyle for style computation and storage in Dart CSS code

Files:

  • webf/lib/src/css/computed_style_declaration.dart
  • webf/lib/src/css/grid.dart
{bridge/**/*.{cc,h},webf/**/*.dart}

📄 CodeRabbit inference engine (CLAUDE.md)

Document memory ownership clearly in FFI implementations

Files:

  • webf/lib/src/css/computed_style_declaration.dart
  • webf/lib/src/css/grid.dart
  • webf/lib/src/rendering/grid.dart
webf/lib/src/rendering/**/*.dart

📄 CodeRabbit inference engine (webf/CLAUDE.md)

Use RenderBoxModel as base class for layout in Dart rendering code

Files:

  • webf/lib/src/rendering/grid.dart
🧠 Learnings (25)
📚 Learning: 2025-12-08T23:27:27.888Z
Learnt from: CR
Repo: openwebf/webf PR: 0
File: integration_tests/CLAUDE.md:0-0
Timestamp: 2025-12-08T23:27:27.888Z
Learning: Applies to integration_tests/specs/**/*.ts : Place tests in appropriate directories under `specs/` (css/, dom/, or window/)

Applied to files:

  • integration_tests/specs/css/css-grid/subgrid/track-sizing-contribution.ts
  • integration_tests/specs/css/css-grid/subgrid/nested-subgrids.ts
  • integration_tests/specs/css/css-grid/absolute-positioning/mixed-positioning.ts
  • integration_tests/specs/css/css-grid/subgrid/abspos.ts
  • integration_tests/specs/css/css-grid/subgrid/auto-placement.ts
  • docs/CSS_GRID_PLAN.md
  • integration_tests/specs/css/css-grid/subgrid/basic.ts
  • integration_tests/specs/css/css-grid/subgrid/axis-combinations.ts
  • integration_tests/specs/css/css-grid/subgrid/mixed-tracks.ts
  • integration_tests/specs/css/css-grid/subgrid/alignment.ts
  • integration_tests/specs/css/css-grid/subgrid/named-lines.ts
  • integration_tests/specs/css/css-grid/subgrid/explicit-placement.ts
  • integration_tests/specs/css/css-grid/subgrid/gap-inheritance.ts
  • integration_tests/specs/css/css-grid/subgrid/intrinsic-sizing.ts
  • integration_tests/specs/css/css-grid/subgrid/basic-inheritance.ts
  • integration_tests/specs/css/css-grid/subgrid/spanning-subgrid.ts
📚 Learning: 2025-12-08T23:27:27.888Z
Learnt from: CR
Repo: openwebf/webf PR: 0
File: integration_tests/CLAUDE.md:0-0
Timestamp: 2025-12-08T23:27:27.888Z
Learning: Applies to integration_tests/specs/**/*.ts : Batch DOM operations to minimize reflows

Applied to files:

  • integration_tests/specs/css/css-grid/subgrid/track-sizing-contribution.ts
  • integration_tests/specs/css/css-grid/subgrid/nested-subgrids.ts
  • integration_tests/specs/css/css-grid/absolute-positioning/mixed-positioning.ts
  • integration_tests/specs/css/css-grid/subgrid/abspos.ts
  • integration_tests/specs/css/css-grid/subgrid/auto-placement.ts
  • docs/CSS_GRID_PLAN.md
  • integration_tests/specs/css/css-grid/subgrid/basic.ts
  • integration_tests/specs/css/css-grid/subgrid/axis-combinations.ts
  • integration_tests/specs/css/css-grid/subgrid/mixed-tracks.ts
  • integration_tests/specs/css/css-grid/subgrid/alignment.ts
  • integration_tests/specs/css/css-grid/subgrid/named-lines.ts
  • integration_tests/specs/css/css-grid/subgrid/explicit-placement.ts
  • integration_tests/specs/css/css-grid/subgrid/gap-inheritance.ts
  • integration_tests/specs/css/css-grid/subgrid/intrinsic-sizing.ts
  • integration_tests/specs/css/css-grid/subgrid/basic-inheritance.ts
  • integration_tests/specs/css/css-grid/subgrid/spanning-subgrid.ts
📚 Learning: 2025-12-08T23:27:27.888Z
Learnt from: CR
Repo: openwebf/webf PR: 0
File: integration_tests/CLAUDE.md:0-0
Timestamp: 2025-12-08T23:27:27.888Z
Learning: Applies to integration_tests/specs/**/*.ts : The max width of testing window is 340px

Applied to files:

  • integration_tests/specs/css/css-grid/subgrid/track-sizing-contribution.ts
  • integration_tests/specs/css/css-grid/subgrid/mixed-tracks.ts
  • integration_tests/specs/css/css-grid/subgrid/intrinsic-sizing.ts
  • integration_tests/specs/css/css-grid/subgrid/spanning-subgrid.ts
📚 Learning: 2025-12-08T23:27:27.888Z
Learnt from: CR
Repo: openwebf/webf PR: 0
File: integration_tests/CLAUDE.md:0-0
Timestamp: 2025-12-08T23:27:27.888Z
Learning: Applies to integration_tests/specs/**/*.ts : Use `snapshot()` for visual regression tests to capture current rendering

Applied to files:

  • integration_tests/specs/css/css-grid/subgrid/track-sizing-contribution.ts
  • integration_tests/specs/css/css-grid/subgrid/nested-subgrids.ts
  • integration_tests/specs/css/css-grid/absolute-positioning/mixed-positioning.ts
  • integration_tests/specs/css/css-grid/subgrid/abspos.ts
  • integration_tests/specs/css/css-grid/subgrid/auto-placement.ts
  • integration_tests/specs/css/css-grid/subgrid/basic.ts
  • integration_tests/specs/css/css-grid/subgrid/axis-combinations.ts
  • integration_tests/specs/css/css-grid/subgrid/mixed-tracks.ts
  • integration_tests/specs/css/css-grid/subgrid/alignment.ts
  • integration_tests/specs/css/css-grid/subgrid/named-lines.ts
  • integration_tests/specs/css/css-grid/subgrid/explicit-placement.ts
  • integration_tests/specs/css/css-grid/subgrid/gap-inheritance.ts
  • integration_tests/specs/css/css-grid/subgrid/intrinsic-sizing.ts
  • integration_tests/specs/css/css-grid/subgrid/basic-inheritance.ts
  • integration_tests/specs/css/css-grid/subgrid/spanning-subgrid.ts
📚 Learning: 2025-12-08T23:27:27.888Z
Learnt from: CR
Repo: openwebf/webf PR: 0
File: integration_tests/CLAUDE.md:0-0
Timestamp: 2025-12-08T23:27:27.888Z
Learning: Applies to integration_tests/specs/**/*.ts : Test behavior, not implementation

Applied to files:

  • integration_tests/specs/css/css-grid/subgrid/track-sizing-contribution.ts
  • integration_tests/specs/css/css-grid/subgrid/nested-subgrids.ts
  • integration_tests/specs/css/css-grid/absolute-positioning/mixed-positioning.ts
  • integration_tests/specs/css/css-grid/subgrid/abspos.ts
  • integration_tests/specs/css/css-grid/subgrid/auto-placement.ts
  • integration_tests/specs/css/css-grid/subgrid/basic.ts
  • integration_tests/specs/css/css-grid/subgrid/axis-combinations.ts
  • integration_tests/specs/css/css-grid/subgrid/mixed-tracks.ts
  • integration_tests/specs/css/css-grid/subgrid/alignment.ts
  • integration_tests/specs/css/css-grid/subgrid/named-lines.ts
  • integration_tests/specs/css/css-grid/subgrid/explicit-placement.ts
  • integration_tests/specs/css/css-grid/subgrid/gap-inheritance.ts
  • integration_tests/specs/css/css-grid/subgrid/intrinsic-sizing.ts
  • integration_tests/specs/css/css-grid/subgrid/basic-inheritance.ts
  • integration_tests/specs/css/css-grid/subgrid/spanning-subgrid.ts
📚 Learning: 2025-12-08T23:27:27.888Z
Learnt from: CR
Repo: openwebf/webf PR: 0
File: integration_tests/CLAUDE.md:0-0
Timestamp: 2025-12-08T23:27:27.888Z
Learning: Applies to integration_tests/specs/**/*.ts : Measure operations using `performance.now()` for timing in performance-critical tests

Applied to files:

  • integration_tests/specs/css/css-grid/subgrid/track-sizing-contribution.ts
  • integration_tests/specs/css/css-grid/subgrid/mixed-tracks.ts
  • integration_tests/specs/css/css-grid/subgrid/intrinsic-sizing.ts
📚 Learning: 2025-12-08T23:27:27.888Z
Learnt from: CR
Repo: openwebf/webf PR: 0
File: integration_tests/CLAUDE.md:0-0
Timestamp: 2025-12-08T23:27:27.888Z
Learning: Applies to integration_tests/specs/**/*.ts : Group related tests in describe blocks

Applied to files:

  • integration_tests/specs/css/css-grid/subgrid/track-sizing-contribution.ts
  • integration_tests/specs/css/css-grid/subgrid/nested-subgrids.ts
  • integration_tests/specs/css/css-grid/subgrid/abspos.ts
  • integration_tests/specs/css/css-grid/subgrid/auto-placement.ts
  • integration_tests/specs/css/css-grid/subgrid/basic.ts
  • integration_tests/specs/css/css-grid/subgrid/axis-combinations.ts
  • integration_tests/specs/css/css-grid/subgrid/mixed-tracks.ts
  • integration_tests/specs/css/css-grid/subgrid/alignment.ts
  • integration_tests/specs/css/css-grid/subgrid/named-lines.ts
  • integration_tests/specs/css/css-grid/subgrid/explicit-placement.ts
  • integration_tests/specs/css/css-grid/subgrid/gap-inheritance.ts
  • integration_tests/specs/css/css-grid/subgrid/intrinsic-sizing.ts
  • integration_tests/specs/css/css-grid/subgrid/basic-inheritance.ts
  • integration_tests/specs/css/css-grid/subgrid/spanning-subgrid.ts
📚 Learning: 2025-12-08T23:27:27.888Z
Learnt from: CR
Repo: openwebf/webf PR: 0
File: integration_tests/CLAUDE.md:0-0
Timestamp: 2025-12-08T23:27:27.888Z
Learning: Applies to integration_tests/specs/**/*.ts : Snapshots are stored as images for comparison and failed snapshots generate diff images

Applied to files:

  • integration_tests/specs/css/css-grid/subgrid/nested-subgrids.ts
  • integration_tests/specs/css/css-grid/absolute-positioning/mixed-positioning.ts
  • integration_tests/specs/css/css-grid/subgrid/abspos.ts
  • integration_tests/specs/css/css-grid/subgrid/basic.ts
  • integration_tests/specs/css/css-grid/subgrid/axis-combinations.ts
  • integration_tests/specs/css/css-grid/subgrid/alignment.ts
  • integration_tests/specs/css/css-grid/subgrid/named-lines.ts
  • integration_tests/specs/css/css-grid/subgrid/intrinsic-sizing.ts
  • integration_tests/specs/css/css-grid/subgrid/basic-inheritance.ts
  • integration_tests/specs/css/css-grid/subgrid/spanning-subgrid.ts
📚 Learning: 2025-12-08T23:27:27.888Z
Learnt from: CR
Repo: openwebf/webf PR: 0
File: integration_tests/CLAUDE.md:0-0
Timestamp: 2025-12-08T23:27:27.888Z
Learning: Applies to integration_tests/specs/**/*.ts : Include edge cases and error conditions in tests

Applied to files:

  • integration_tests/specs/css/css-grid/subgrid/nested-subgrids.ts
  • integration_tests/specs/css/css-grid/subgrid/abspos.ts
  • integration_tests/specs/css/css-grid/subgrid/auto-placement.ts
  • integration_tests/specs/css/css-grid/subgrid/axis-combinations.ts
  • integration_tests/specs/css/css-grid/subgrid/mixed-tracks.ts
  • integration_tests/specs/css/css-grid/subgrid/named-lines.ts
  • integration_tests/specs/css/css-grid/subgrid/basic-inheritance.ts
  • integration_tests/specs/css/css-grid/subgrid/spanning-subgrid.ts
📚 Learning: 2025-12-08T23:27:27.888Z
Learnt from: CR
Repo: openwebf/webf PR: 0
File: integration_tests/CLAUDE.md:0-0
Timestamp: 2025-12-08T23:27:27.888Z
Learning: Applies to integration_tests/specs/**/*.ts : Each test should be independent

Applied to files:

  • integration_tests/specs/css/css-grid/subgrid/nested-subgrids.ts
  • integration_tests/specs/css/css-grid/subgrid/axis-combinations.ts
  • integration_tests/specs/css/css-grid/subgrid/mixed-tracks.ts
  • integration_tests/specs/css/css-grid/subgrid/alignment.ts
  • integration_tests/specs/css/css-grid/subgrid/named-lines.ts
  • integration_tests/specs/css/css-grid/subgrid/spanning-subgrid.ts
📚 Learning: 2025-12-08T23:27:27.888Z
Learnt from: CR
Repo: openwebf/webf PR: 0
File: integration_tests/CLAUDE.md:0-0
Timestamp: 2025-12-08T23:27:27.888Z
Learning: Applies to integration_tests/specs/**/*.ts : Use clear, descriptive test names

Applied to files:

  • integration_tests/specs/css/css-grid/subgrid/nested-subgrids.ts
  • integration_tests/specs/css/css-grid/subgrid/auto-placement.ts
  • integration_tests/specs/css/css-grid/subgrid/basic.ts
  • integration_tests/specs/css/css-grid/subgrid/axis-combinations.ts
  • integration_tests/specs/css/css-grid/subgrid/mixed-tracks.ts
  • integration_tests/specs/css/css-grid/subgrid/alignment.ts
  • integration_tests/specs/css/css-grid/subgrid/named-lines.ts
  • integration_tests/specs/css/css-grid/subgrid/explicit-placement.ts
  • integration_tests/specs/css/css-grid/subgrid/intrinsic-sizing.ts
  • integration_tests/specs/css/css-grid/subgrid/basic-inheritance.ts
  • integration_tests/specs/css/css-grid/subgrid/spanning-subgrid.ts
📚 Learning: 2025-12-08T23:27:27.888Z
Learnt from: CR
Repo: openwebf/webf PR: 0
File: integration_tests/CLAUDE.md:0-0
Timestamp: 2025-12-08T23:27:27.888Z
Learning: Applies to integration_tests/specs/**/*.ts : Remove created elements after tests (test cleanup)

Applied to files:

  • integration_tests/specs/css/css-grid/subgrid/nested-subgrids.ts
  • integration_tests/specs/css/css-grid/subgrid/alignment.ts
  • integration_tests/specs/css/css-grid/subgrid/named-lines.ts
  • integration_tests/specs/css/css-grid/subgrid/explicit-placement.ts
  • integration_tests/specs/css/css-grid/subgrid/intrinsic-sizing.ts
  • integration_tests/specs/css/css-grid/subgrid/basic-inheritance.ts
📚 Learning: 2025-12-08T23:28:00.818Z
Learnt from: CR
Repo: openwebf/webf PR: 0
File: webf/CLAUDE.md:0-0
Timestamp: 2025-12-08T23:28:00.818Z
Learning: Applies to webf/integration_tests/specs/**/*.dart : Use snapshot tests in integration_tests/specs/ for visual regression testing with await snapshot()

Applied to files:

  • integration_tests/specs/css/css-grid/absolute-positioning/mixed-positioning.ts
  • docs/CSS_GRID_PLAN.md
📚 Learning: 2025-12-08T23:27:27.888Z
Learnt from: CR
Repo: openwebf/webf PR: 0
File: integration_tests/CLAUDE.md:0-0
Timestamp: 2025-12-08T23:27:27.888Z
Learning: Applies to integration_tests/specs/**/*.ts : Test specs will always pass if there are no existing snapshots

Applied to files:

  • integration_tests/specs/css/css-grid/absolute-positioning/mixed-positioning.ts
📚 Learning: 2025-12-08T23:27:27.888Z
Learnt from: CR
Repo: openwebf/webf PR: 0
File: integration_tests/CLAUDE.md:0-0
Timestamp: 2025-12-08T23:27:27.888Z
Learning: Applies to integration_tests/specs/**/*.ts : Use async/await and proper async patterns for asynchronous operations in tests

Applied to files:

  • integration_tests/specs/css/css-grid/absolute-positioning/mixed-positioning.ts
  • integration_tests/specs/css/css-grid/subgrid/auto-placement.ts
  • integration_tests/specs/css/css-grid/subgrid/axis-combinations.ts
  • integration_tests/specs/css/css-grid/subgrid/alignment.ts
  • integration_tests/specs/css/css-grid/subgrid/basic-inheritance.ts
📚 Learning: 2025-12-08T23:27:27.888Z
Learnt from: CR
Repo: openwebf/webf PR: 0
File: integration_tests/CLAUDE.md:0-0
Timestamp: 2025-12-08T23:27:27.888Z
Learning: Applies to integration_tests/specs/**/*.ts : Use `simulateClick` with coordinates for hit testing tests

Applied to files:

  • integration_tests/specs/css/css-grid/absolute-positioning/mixed-positioning.ts
📚 Learning: 2025-12-08T23:27:27.888Z
Learnt from: CR
Repo: openwebf/webf PR: 0
File: integration_tests/CLAUDE.md:0-0
Timestamp: 2025-12-08T23:27:27.888Z
Learning: Applies to integration_tests/specs/**/*.ts : Test assets should reference files in `assets/` directory

Applied to files:

  • integration_tests/specs/css/css-grid/subgrid/abspos.ts
📚 Learning: 2025-12-08T23:28:00.818Z
Learnt from: CR
Repo: openwebf/webf PR: 0
File: webf/CLAUDE.md:0-0
Timestamp: 2025-12-08T23:28:00.818Z
Learning: Applies to webf/test/**/*_test.dart : Access render objects in tests to verify layout calculations

Applied to files:

  • docs/CSS_GRID_PLAN.md
📚 Learning: 2025-12-08T23:28:00.818Z
Learnt from: CR
Repo: openwebf/webf PR: 0
File: webf/CLAUDE.md:0-0
Timestamp: 2025-12-08T23:28:00.818Z
Learning: Use widget unit tests to verify rendering changes with: cd webf && flutter test test/src/rendering/

Applied to files:

  • docs/CSS_GRID_PLAN.md
📚 Learning: 2025-12-08T23:28:00.818Z
Learnt from: CR
Repo: openwebf/webf PR: 0
File: webf/CLAUDE.md:0-0
Timestamp: 2025-12-08T23:28:00.818Z
Learning: Applies to webf/test/**/*_test.dart : Use WebFWidgetTestUtils.prepareWidgetTest() to test HTML/CSS rendering in widget unit tests

Applied to files:

  • docs/CSS_GRID_PLAN.md
📚 Learning: 2025-12-08T23:28:11.651Z
Learnt from: CR
Repo: openwebf/webf PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-08T23:28:11.651Z
Learning: Applies to webf/test/**/*.dart : Dart/Flutter widget and unit tests must be placed in `webf/test/` and use `WebFWidgetTestUtils` and `pumpAndSettle()` where needed

Applied to files:

  • docs/CSS_GRID_PLAN.md
📚 Learning: 2025-12-08T23:28:00.818Z
Learnt from: CR
Repo: openwebf/webf PR: 0
File: webf/CLAUDE.md:0-0
Timestamp: 2025-12-08T23:28:00.818Z
Learning: Applies to webf/lib/src/rendering/**/*.dart : Use RenderBoxModel as base class for layout in Dart rendering code

Applied to files:

  • docs/CSS_GRID_PLAN.md
  • webf/lib/src/css/grid.dart
  • webf/lib/src/rendering/grid.dart
📚 Learning: 2025-12-08T23:28:00.818Z
Learnt from: CR
Repo: openwebf/webf PR: 0
File: webf/CLAUDE.md:0-0
Timestamp: 2025-12-08T23:28:00.818Z
Learning: Applies to webf/lib/src/css/**/*.dart : Use CSSRenderStyle for style computation and storage in Dart CSS code

Applied to files:

  • docs/CSS_GRID_PLAN.md
  • webf/lib/src/css/computed_style_declaration.dart
  • webf/lib/src/css/grid.dart
  • webf/lib/src/rendering/grid.dart
📚 Learning: 2025-12-08T23:28:11.651Z
Learnt from: CR
Repo: openwebf/webf PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-08T23:28:11.651Z
Learning: Applies to cli/test/**/*.test.ts : TypeScript test files must use `.test.ts` extension and target at least 70% code coverage for core modules

Applied to files:

  • docs/CSS_GRID_PLAN.md
📚 Learning: 2025-12-08T23:28:00.818Z
Learnt from: CR
Repo: openwebf/webf PR: 0
File: webf/CLAUDE.md:0-0
Timestamp: 2025-12-08T23:28:00.818Z
Learning: Applies to webf/**/*.dart : Follow rules in webf/analysis_options.yaml for Dart code style

Applied to files:

  • webf/lib/src/css/computed_style_declaration.dart
🧬 Code graph analysis (1)
integration_tests/specs/css/css-grid/subgrid/abspos.ts (1)
bridge/core/dom/node.cc (1)
  • parent (691-691)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: build_windows_bridge (Debug)
  • GitHub Check: build_bridge
  • GitHub Check: Analyze (rust)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Analyze (c-cpp)
🔇 Additional comments (16)
integration_tests/specs/css/css-grid/absolute-positioning/mixed-positioning.ts (1)

208-208: Verify the need for the snapshot delay.

The added 0.5-second delay before snapshot capture suggests a rendering timing issue. Since waitForFrame() is already called on Line 207, the additional delay may indicate that the overlay positioning requires extra time to stabilize with the new subgrid implementation.

Consider investigating whether this delay is masking an underlying rendering issue or if it's truly necessary for the overlay test case. If the delay is required, document why this specific test needs more time than others.

webf/lib/src/css/computed_style_declaration.dart (2)

929-933: LGTM! GridSubgrid line name counting implemented correctly.

The addition correctly handles GridSubgrid by iterating through its lineNameGroups and counting occurrences of the target line name. This aligns with the new subgrid support introduced in this PR.


967-976: LGTM! GridSubgrid CSS serialization implemented correctly.

The special-case handling for a single GridSubgrid track correctly serializes it as "subgrid" followed by its line-name groups in CSS format. The logic appropriately skips empty groups and formats the output according to the CSS Grid Level 2 subgrid syntax.

integration_tests/specs/css/css-grid/subgrid/spanning-subgrid.ts (1)

1-267: LGTM! Comprehensive subgrid spanning test suite.

The test suite effectively covers subgrid spanning scenarios across columns, rows, and both axes. The implementation follows integration test best practices:

  • Clear, descriptive test names
  • Proper async patterns with waitForFrame() and snapshot()
  • Batched DOM operations to minimize reflows
  • Independent tests with proper cleanup via parent.remove()
  • Appropriate use of toBeCloseTo() with tolerance for dimension assertions

Based on learnings and coding guidelines.

integration_tests/specs/css/css-grid/subgrid/intrinsic-sizing.ts (1)

1-250: LGTM! Thorough intrinsic sizing test coverage.

The test suite comprehensively validates subgrid intrinsic sizing behavior across various parent track configurations including min-content, max-content, fit-content, and mixed track types. The implementation demonstrates:

  • Well-chosen test scenarios covering different intrinsic sizing modes
  • Appropriate assertions matching each scenario's constraints
  • Proper handling of edge cases like text wrapping
  • Consistent test structure with proper cleanup
  • Good use of whiteSpace: 'nowrap' where content should not wrap

Based on learnings and coding guidelines.

integration_tests/specs/css/css-grid/subgrid/nested-subgrids.ts (1)

1-204: LGTM! Well-structured nested subgrid test suite.

The test suite effectively validates nested subgrid behavior across multiple nesting levels and configurations. Notable strengths include:

  • Progressive testing from simple (2-level) to complex (3-level) nesting
  • Coverage of both full-span and partial-span nested subgrids
  • Validation of track inheritance across both axes
  • Clear visual distinction between nesting levels using decreasing padding values
  • Accurate dimensional assertions accounting for inherited track sizing and padding

Based on learnings and coding guidelines.

integration_tests/specs/css/css-grid/subgrid/explicit-placement.ts (1)

1-253: LGTM!

The explicit placement tests are well-structured, follow coding guidelines, and provide comprehensive coverage of subgrid placement scenarios. The inline comments (lines 55, 119) helpfully explain the padding behavior being tested.

integration_tests/specs/css/css-grid/subgrid/gap-inheritance.ts (1)

1-239: LGTM!

The gap inheritance tests provide excellent coverage of various gap scenarios, including edge cases like zero gaps and percentage-based gaps. The test at line 121 specifically validates the important behavior that a subgrid's own gap declaration doesn't override the inherited gap.

integration_tests/specs/css/css-grid/subgrid/auto-placement.ts (1)

1-195: LGTM!

The auto-placement tests comprehensively cover subgrid auto-placement behavior across multiple scenarios. The inline comments (lines 35-36, 82) provide helpful context for understanding the expected padding behavior.

integration_tests/specs/css/css-grid/subgrid/abspos.ts (1)

1-1: LGTM!

The active tests for absolutely positioned elements with subgrids are well-structured and cover important layout scenarios including containing block relationships and positioning behavior.

Also applies to: 2-52, 106-215

docs/CSS_GRID_PLAN.md (2)

16-18: Subgrid moved into in-scope features and Phase 9 marked complete

The updated non-goals, next-steps wording, and TODO checklist correctly treat Subgrid as an in-scope Level 2 feature while keeping masonry and other advanced modules out of scope. The Phase 9 checkbox and description are consistent with the rest of the document and with the new subgrid test files in this PR. No changes needed here.

Also applies to: 78-84, 85-96


209-226: Phase 9/Subgrid coverage numbers and phase summary look internally consistent

I rechecked the arithmetic:

  • Phase breakdown (including initial 11 files) sums to 91 files and 597 tests.
  • The Subgrid section lists 14 files and 68 tests, which aligns with the Phase 9 row and the updated WPT distribution table (175 WPT Subgrid tests vs 68 covered here).
  • The coverage notes, success metrics, and “All phases complete” bullets are consistent with the counts and file lists.

This documentation accurately reflects the new subgrid integration tests and overall grid coverage.

Also applies to: 234-247, 708-727, 791-806, 809-820

integration_tests/specs/css/css-grid/subgrid/axis-combinations.ts (1)

1-261: Well-structured subgrid axis-combination tests with good behavioral assertions

The six tests cover key axis combinations (columns-only, rows-only, both axes, auto rows, regular+subgrid siblings, and spanning subset of tracks), follow the harness patterns (await waitForFrame(), await snapshot(), and cleanup via parent.remove()), and assert on concrete geometry rather than implementation details. This is a solid, behavior-focused suite and should give good regression signal around the new subgrid axis logic.

webf/lib/src/rendering/grid.dart (3)

1271-1291: Line-name slicing/merging for subgrids appears correct

_sliceLineNameMap and _mergeLineNameMapWithSubgridGroups:

  • Rebase line indices into a local 0-based space for a subgrid span,
  • Preserve ordering and deduplicate indices per name, and
  • Respect lineCount bounds when merging subgrid lineNameGroups.

Using an inclusive endLineIndex here (and passing start .. start + span or start + sizes.length) matches the fact that there are trackCount + 1 grid lines. This should give subgrids the right view of named lines while keeping parent and child maps independent.

Also applies to: 1293-1322


2008-2021: Subgrid detection and fallback behavior look robust

The _performGridLayout changes:

  • Detect grid-template-*-list == [GridSubgrid] via _isSubgridTrackList,
  • Pull contexts from the parent with _takeSubgrid*Context(),
  • Override colGap/rowGap using the inherited subgrid gaps, and
  • Materialize “virtual” fixed or auto tracks based on whether inherited sizes are definite, including padding/border insets on the first/last tracks.

If a grid declares subgrid but the parent didn’t provide a context, you clear colsDef/rowsDef and effectively treat it as a non-subgrid grid, which is a sane, fail-soft behavior. This all looks good and should not disturb non-subgrid grids.

Also applies to: 2041-2058, 2069-2114, 2141-2187, 2199-2223


2344-2411: Pre-pass for implicit columns referenced by definite placements is a good fix

The new row-flow-only pre-pass that scans placementChildren and uses _resolveLineRequirementIndex to determine requiredColumns, followed by _ensureImplicitColumns(...), ensures:

  • Implicit columns required by definite line-based placements exist before auto placement runs, and
  • The auto-placement cursor doesn’t wrap too early in row-flow when later items reference implicit columns.

The logic respects both start and end line requirements and minimum spans, and it’s guarded by colSizes.isNotEmpty and row-flow, so it shouldn’t regress existing layouts.

grid.style.gridTemplateColumns = '[start] 100px [mid] 1fr [end] 80px';
grid.style.gridTemplateRows = '40px 40px';
grid.style.columnGap = '12px';
grid.style.width = '400px';
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Reduce grid width to comply with testing window constraints.

The grid width is set to 400px, but the coding guidelines specify that the max width of the testing window is 340px. This may cause rendering issues or test inconsistencies.

🔎 Proposed fix
-    grid.style.width = '400px';
+    grid.style.width = '340px';

You may also need to adjust the gridTemplateColumns values to fit within the new width constraint while maintaining the test's intent.

Based on coding guidelines.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
grid.style.width = '400px';
grid.style.width = '340px';
🤖 Prompt for AI Agents
In @integration_tests/specs/css/css-grid/subgrid/basic.ts at line 8, The test
sets grid.style.width = '400px' which exceeds the testing window max of 340px;
update the assignment in the test to use a width <= '340px' (e.g., '340px' or
smaller) and, if needed, adjust the gridTemplateColumns values in the same test
(references: grid.style.width and grid.style.gridTemplateColumns) so the column
definitions still fit and preserve the test's intent.

@andycall andycall merged commit 6a6ed56 into main Jan 7, 2026
33 of 36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants