Skip to content

elementMatrix throws 'is2D ... 3d matrix' in four margin-layout and comparison tests since #6795 #6847

Closed

Description

@leaf-agent

Four browser tests fail on main at 49007d755 in run 45113117050. In each, the page throws while it maps an element to the viewport:

  • tests/browser/test_render_application_boundary.py::test_cancelled_primary_travel_adds_no_return_checkpoint (teardown error)
  • tests/browser/test_render_application_boundary.py::test_primary_parts_keep_identity_and_nomination_order_through_admission (teardown error)
  • tests/browser/test_render_options_settled.py::test_a_reconnected_settled_obligation_restores_its_comparison_reading (teardown error)
  • tests/browser/test_render_options_settled.py::test_a_comparison_mark_that_failed_on_return_keeps_following_the_comparison

The deciding error:

TypeError: Failed to execute 'multiply' on 'DOMMatrixReadOnly': The is2D member is set to true but the input matrix is a 3d matrix.
    at elementMatrix (runtime/element-axes.js:93:22)
    at clipEntries (runtime/geometry.js:1560:22)
    at clipWalk (runtime/geometry.js:1510:3)
    at headerCuts (runtime/geometry.js:451:10)      # or paintClips (geometry.js:1360) → target-paint-geometry.js → margin-bars.js
    at headerLevels (runtime/css-anchors.js:597:10)
    at layoutMountedRows (annotation-overlay/margin-layout.js:2227:17)

Diagnosis so far: git blame attributes all of elementMatrix in browser/runtime/element-axes.js to #6795 (7c94421ca, "Map an element's pixels to the viewport through every transform"). That commit falls between 10ac9da49, whose push run 45104895190 passed these tests, and 49007d755. At line 93, outer.multiply(own) throws when outer is a 2D matrix and own is 3D. That fits line 89, which builds outer from an SVG element's getScreenCTM 6-tuple, but nobody has checked yet which branch builds the 2D matrix here. #4227 hit the same kind of exception in an earlier version of the motion code.

Cause of a failure tracked in #6846.

Activity

  1. added
    tend-ci-cause
    on Nov 23, 2026
  2. leaf-agent commented on Nov 23, 2026

    @leaf-agent
    CollaboratorAuthor

    #6852 fixes the cause. All four tests fail on main and pass on the branch. Review, CI and landing are up to the PR's review and landing workflows.

    The 2D matrix in line 93 isn't from SVG's getScreenCTM: in every captured failure outer was the identity. The bad operand was own, which was all NaN. It comes from elements the browser computes no style for: a detached <lf-tabs> in the comparison tests, and a connected .lf-reply-continuity overlay inside versions/v1.html, a document with no window, in the application-boundary tests. Every computed property on these elements reads "". ownTransform treated rotate: "" as a turn of NaN degrees, and Chrome's multiply rejects a NaN matrix still flagged is2D. The fix returns no transform when the computed display is empty, so an element with no box adds nothing to the map.

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

    tend-ci-cause

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions