Skip to content

fix: Read no transform from an element the browser computes no style for - #6852

Merged
leaf-agent merged 1 commit into
mainfrom
fix/issue-6847
Nov 23, 2026
Merged

leaf-agent merged 1 commit into
mainfrom
fix/issue-6847

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

elementMatrix threw Failed to execute 'multiply' on 'DOMMatrixReadOnly': The is2D member is set to true but the input matrix is a 3d matrix whenever a clip walk or margin layout measured an element the browser computes no style for. Such an element is either out of the document (a detached <lf-tabs> in the comparison tests) or connected inside a document no window shows (the .lf-reply-continuity overlay of versions/v1.html in the application-boundary tests). Its computed style reads "" for every property. ownTransform (added in #6795) took rotate: "" for a turn and parsed its angle as NaN, so the matrix it returned was all NaN with is2D still set. Chrome's multiply refuses that matrix, because NaN fails the 3D-member check. A temporary probe in elementMatrix captured both cases: the outer matrix was the identity, the own matrix all NaN, and the style tuple ["", "", "", "", ""].

ownTransform now returns null when the computed display is empty. An element without a computed style draws no box, so it adds nothing to the map, as its empty bounding rect says. Elements with real transforms are unchanged.

Verification:

Closes #6847 — automated triage

An element out of the document, or in a document no window shows, computes
every style property to an empty string. `ownTransform` read `rotate: ""` as a
turn of NaN degrees, and multiplying the resulting NaN matrix throws in Chrome
("The is2D member is set to true but the input matrix is a 3d matrix"), which
broke the clip walk and margin layout. Such an element draws no box, so it now
adds nothing to the map, as its empty bounding rect says. Measuring one
behaved this way before #6795.

Closes #6847
@leaf-agent
leaf-agent merged commit 4060fb9 into main Nov 23, 2026
7 of 8 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-6847 branch November 23, 2026 07:11
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.

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

1 participant