Repository navigation
fix: Read no transform from an element the browser computes no style for - #6852
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
elementMatrixthrewFailed to execute 'multiply' on 'DOMMatrixReadOnly': The is2D member is set to true but the input matrix is a 3d matrixwhenever 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-continuityoverlay ofversions/v1.htmlin the application-boundary tests). Its computed style reads""for every property.ownTransform(added in #6795) tookrotate: ""for a turn and parsed its angle as NaN, so the matrix it returned was all NaN withis2Dstill set. Chrome'smultiplyrefuses that matrix, because NaN fails the 3D-member check. A temporary probe inelementMatrixcaptured both cases: the outer matrix was the identity, the own matrix all NaN, and the style tuple["", "", "", "", ""].ownTransformnow returns null when the computeddisplayis 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:
mainwith this exception and pass with the change.pnpm run test:runtimepasses.test_a_turned_box_clips_its_contents_to_its_turned_bandand both cases oftest_a_carried_card_travels_with_the_pointer_when_turned.Closes #6847 — automated triage