Skip to content

Close remaining CSS layout gaps with browser-referenced geometry contracts #240

Description

@wieslawsoltes

Current layout checkpoint — 20 September 2026

Exact merged heads: WebScene a46b62e14eb197603f7e227c1558afb9088633b0; AppScene 97702daeb9ad71341ced7226f0aa966dc77ea53c; unchanged Code OSS 645f29cc3176500b4b5762ba887cf2a7f0ffdf2c; local vscode-demo e4b98e5470cd7856aff3dfd6843c8e125d7db933 (clean, intentionally unpushed). Open consolidations remain WebScene #76 085bba760fa571c8f08ea866dc5dd1ec27c4d376, AppScene #65 ce66ef6ceb776b3f14e129f853bfc08b5c5e608c, and vscode-demo #1; do not merge them. One-agent mode is active.

Focused layout slices recorded here are merged through the later isolation, text-wrap, word-break/overflow-wrap, retained image fit/alignment, overscroll and touch-action work now present on current main. No focused layout branch is active.

Continue implementation only from a reduced current-main geometry defect. Browser/native geometry, mutation scope, 4,096-node bounds, editor/Settings/Explorer/terminal pixels, package and cross-RID acceptance remain deferred.

Parent tracker: #235

Problem

Remaining CSS layout gaps surface as product-specific visual differences. We need browser-referenced, product-neutral geometry contracts across the layout algorithms used by desktop applications.

Proposed work

  • Inventory layout features used by unchanged VS Code after Fix catalog script and logical sizing compatibility #148 lands.
  • Expand contracts for physical/logical axes, intrinsic/min/max sizing, percentage resolution, box sizing, margin/padding/border, absolute/fixed/sticky positioning, overflow/scrolling, flex, grid, tables, and native form controls.
  • Compare bounding rectangles, scroll metrics, baselines, and computed values with Chromium.
  • Exercise dynamic insertion/removal, resize, writing-mode changes, and inherited/custom-property inputs.
  • Add layout/scene counters and representative performance budgets.

Acceptance

#148 owns its current logical sizing, responsive grid, scrolling, and catalog layout changes; do not duplicate them.

Activity

  1. wieslawsoltes commented on Sep 17, 2026

    @wieslawsoltes
    CollaboratorAuthor

    Focused implementation candidate is ready on current main d7720a63: commit 01c12edac7e4186b1eb1930d5b4270e698f7cd63, branch fix/generated-content-line-height-240.

    The reduced Chromium/native contract isolated the generated-content geometry gap. For a 40px ::before, native stored unitless line-height:1 and line-height:5 as literal pixel lengths, producing heights [60,1,5,2]; Chromium produces [60,40,200,2] for inherited 1.5, authored 1, authored 5, and explicit 2px. The fix preserves <number> as a multiplier until the generated box font size is known, uses the same representation in retained text publication, and removes the old paint-only “positive values <=4 are multipliers” heuristic. Dynamic class mutation restores 40→60→200→40 geometry and retained scene strings carry exact 40/60/200/2 line heights.

    Exact-current gates:

    • Chromium authority: 1/1 documents, 5/5 subtests, 324 ms.
    • Native WPT: 1/1 documents, 5/5 subtests, 282 ms.
    • Focused native dimension-variable-compatibility: pass, including adjacent font-relative/layout cases and retained text-resource assertions.
    • 4,096 generated boxes, 20 mutation/layout cycles: p95 115.67 ms, max 130.74 ms; V8 heap 678,776→678,776 bytes after low memory; peak RSS 40,845,312→61,784,064 bytes (20.0 MiB growth, 64 MiB bound); DOM node and pseudo storage return to baseline bounds.

    The four changed paths have zero overlap with merged #312’s parser/resource paths and do not touch #286’s CSS parsing/cascade or oracle/profile paths. This is a focused #240 tranche; it does not close the broader layout issue.

  2. wieslawsoltes commented on Sep 17, 2026

    @wieslawsoltes
    CollaboratorAuthor

    The generated-content unitless line-height slice is complete and merged via #322 as 4ccadd1333c54e91e83e65234e783685964ae1d9.

    This closes the measured gap where a 40px pseudo-element incorrectly treated unitless values as pixels: Chromium/native now agree on [60, 40, 200, 2] for inherited 1.5, own 1, own 5, and explicit 2px. Dynamic restoration, retained text-resource geometry, browser/native WPT, the V8-free shared CSS service, a 4,096-node × 20-cycle bound, and the exact Native Linux document/compiler gate pass. The final profile was p95 106.36 ms, max 106.70 ms, unchanged V8 heap, and +19.98 MiB RSS.

    #240 remains open for its other independent layout gaps.

  3. wieslawsoltes commented on Sep 18, 2026

    @wieslawsoltes
    CollaboratorAuthor

    Implementation merged via #444 at d28995e2a8cd898a6ba5a3f43baffe091ccda18a from exact source 597b387f69a2346808faea308e6ef6c9e63bea02 on base ac235def2417569b949af14ff18fd99153c88dbd.

    The focused slice exposes and retains aspect-ratio, carries it into generated pseudo boxes, applies a preferred ratio when one axis is definite in ordinary/flex/grid/floating/positioned layout, accounts for content-box versus border-box edges, serializes computed style, and includes ratio changes in layout equality.

    No validation was run under the implementation-only instruction. Outstanding debt remains exactly the browser/native geometry matrix, invalid-value and min/max transfer coverage, dynamic mutation and pseudo coverage, the 4,096-box performance/heap/RSS/lifecycle/idle-publication gate, and exact-package Code OSS editor watermark, banner, and aquarium regions. This issue is reopened to retain that debt after the PR's Closes directive automatically closed it.

  4. wieslawsoltes commented on Sep 19, 2026

    @wieslawsoltes
    CollaboratorAuthor

    Implementation-first re-audit at WebScene 488b9790 found no documented browser-reduced product-used layout defect beyond implemented owners. #439 aspect-ratio behavior is merged; its remaining geometry/mutation/performance/lifecycle/package matrix is validation debt. The developer-owned #112 worktree was left untouched. No code or runtime validation was run; git diff --check passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    vscode-oss/plannedPlanned for the AppScene/WebScene VS Code OSS integration

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions