happy-dom icon indicating copy to clipboard operation
happy-dom copied to clipboard

element.getBoundingClientRect().toJSON() does not exist

Open dragonofdeath opened this issue 1 year ago • 0 comments

Describe the bug element.getBoundingClientRect().toJSON() throws as its not implemented.

getBoundingClientRect() returns DOMRect which inherits its properties from DOMRectReadOnly and it has toJSON method, which is listed in mdn and is supported by all browsers. In my jsdom based tests I was using jsdom-pollyfill to solve the usecase and the implementaction code it is was using is something like this https://github.com/remirror/remirror/blob/main/packages/jest-remirror/src/jsdom-polyfills.ts#L90-L92 Would you mind PR adding this method?

dragonofdeath avatar Nov 14 '23 07:11 dragonofdeath