LearnNewsExamplesServices
Frontmatter
id4951
titlemain.DomAccess: getBoundingClientRect() does not pass minHeight & minWidth to the app worker
stateClosed
labels
bugstale
assigneestobiu
createdAtSep 27, 2023, 8:35 PM
updatedAtSep 13, 2024, 4:29 AM
githubUrlhttps://github.com/neomjs/neo/issues/4951
authortobiu
commentsCount3
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtSep 13, 2024, 4:29 AM

main.DomAccess: getBoundingClientRect() does not pass minHeight & minWidth to the app worker

Closed v8.1.0 bugstale
tobiu
tobiu commented on Sep 27, 2023, 8:35 PM

related to: https://github.com/neomjs/neo/issues/4950

while we can not use JSON.stringify() for DOMRects, the output will not include custom class field values.

however, we can modify what we get back on class level.

@ExtAnimal

tobiu added the bug label on Sep 27, 2023, 8:35 PM
tobiu assigned to @tobiu on Sep 27, 2023, 8:35 PM
tobiu referenced in commit c22ec67 - "main.DomAccess: getBoundingClientRect() does not pass minHeight & minWidth to the app worker #4951" on Sep 27, 2023, 9:23 PM
tobiu
tobiu Sep 27, 2023, 9:30 PM

the json conversion works (had to add new class fields for it):

Screenshot 2023-09-27 at 21 24 33

we should keep this change.

however, there is a lot more to it. in case we are creating a worker message, we now get the 2 missing values while creating it:

Screenshot 2023-09-27 at 21 21 07

but, the result inside the app worker will convert the result back into DOMRect instances (native code), in which case we lose the custom fields right away:

Screenshot 2023-09-27 at 21 21 31

not sure, if we can even manipulate this part. might(!) be possible.

testing it in firefox => messages containing DOMRects feel slow.

@ExtAnimal: before doing a final change, we should sync on this ticket. my current recommendation is that getBoundingClientRect() inside main.DomAccess should just return a plain object (we can use the new toJSON() method for it) and other non-remote methods could convert it to Rectangle instances.

tobiu referenced in commit d91c921 - "v6.7.3 (#4954) on Sep 28, 2023, 12:55 PM