Skip to content

Commit 6a3e489

Browse files
committed
test: 多段iframeの位置計算対応をコメントアウトしてテストが通ることを確認
1 parent cc206af commit 6a3e489

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

packages/popper/src/utils/getBoundingClientRect.js

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)