@@ -32,35 +32,35 @@ export default function getBoundingClientRect(element) {
3232 rect = element . getBoundingClientRect ( ) ;
3333 }
3434
35- let currentElement = element
35+ // let currentElement = element
3636
37- while (
38- currentElement &&
39- currentElement . ownerDocument &&
40- currentElement . ownerDocument . defaultView &&
41- currentElement . ownerDocument . defaultView . frameElement
42- ) {
43- currentElement = currentElement . ownerDocument . defaultView . frameElement
44- const computedStyle = getComputedStyle ( currentElement )
45- const borderOffset = {
46- left : parseInt ( computedStyle . borderLeftWidth || '0' ) ,
47- top : parseInt ( computedStyle . borderTopWidth || '0' ) ,
48- }
49- const iframeRect = currentElement . getBoundingClientRect ( )
50- const offsettedPos = {
51- top : rect . top + iframeRect . top + borderOffset . top ,
52- left : rect . left + iframeRect . left + borderOffset . left ,
53- bottom : rect . bottom + iframeRect . top + borderOffset . top ,
54- right : rect . right + iframeRect . left + borderOffset . left ,
55- }
56- rect = {
57- ...rect ,
58- top : offsettedPos . top ,
59- left : offsettedPos . left ,
60- bottom : offsettedPos . bottom ,
61- right : offsettedPos . right ,
62- }
63- }
37+ // while (
38+ // currentElement &&
39+ // currentElement.ownerDocument &&
40+ // currentElement.ownerDocument.defaultView &&
41+ // currentElement.ownerDocument.defaultView.frameElement
42+ // ) {
43+ // currentElement = currentElement.ownerDocument.defaultView.frameElement
44+ // const computedStyle = getComputedStyle(currentElement)
45+ // const borderOffset = {
46+ // left: parseInt(computedStyle.borderLeftWidth || '0'),
47+ // top: parseInt(computedStyle.borderTopWidth || '0'),
48+ // }
49+ // const iframeRect = currentElement.getBoundingClientRect()
50+ // const offsettedPos = {
51+ // top: rect.top + iframeRect.top + borderOffset.top,
52+ // left: rect.left + iframeRect.left + borderOffset.left,
53+ // bottom: rect.bottom + iframeRect.top + borderOffset.top,
54+ // right: rect.right + iframeRect.left + borderOffset.left,
55+ // }
56+ // rect = {
57+ // ...rect,
58+ // top: offsettedPos.top,
59+ // left: offsettedPos.left,
60+ // bottom: offsettedPos.bottom,
61+ // right: offsettedPos.right,
62+ // }
63+ // }
6464 }
6565 catch ( e ) { }
6666
0 commit comments