mirror of
https://github.com/bitwarden/browser.git
synced 2025-01-08 19:18:02 +01:00
[PM-5189] Fixing issue within Safari relating to repositioning elements from outer frame
This commit is contained in:
parent
955c28ddb8
commit
fd1676e838
@ -252,7 +252,7 @@ describe("OverlayBackground", () => {
|
||||
await flushPromises();
|
||||
|
||||
expect(subFrameOffsetsSpy[tabId]).toStrictEqual(
|
||||
new Map([[1, { left: 4, top: 4, url: "url", parentFrameIds: [1, 0] }]]),
|
||||
new Map([[1, { left: 4, top: 4, url: "url", parentFrameIds: [0, 1] }]]),
|
||||
);
|
||||
expect(pageDetailsForTabSpy[tabId].size).toBe(2);
|
||||
});
|
||||
@ -279,7 +279,7 @@ describe("OverlayBackground", () => {
|
||||
|
||||
expect(getFrameDetailsSpy).toHaveBeenCalledTimes(1);
|
||||
expect(subFrameOffsetsSpy[tabId]).toStrictEqual(
|
||||
new Map([[1, { left: 0, top: 0, url: "url", parentFrameIds: [] }]]),
|
||||
new Map([[1, { left: 0, top: 0, url: "url", parentFrameIds: [0] }]]),
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -373,7 +373,7 @@ export class OverlayBackground implements OverlayBackgroundInterface {
|
||||
return;
|
||||
}
|
||||
|
||||
const subFrameData: SubFrameOffsetData = { url, top: 0, left: 0, parentFrameIds: [] };
|
||||
const subFrameData: SubFrameOffsetData = { url, top: 0, left: 0, parentFrameIds: [0] };
|
||||
let frameDetails = await BrowserApi.getFrameDetails({ tabId, frameId });
|
||||
|
||||
while (frameDetails && frameDetails.parentFrameId > -1) {
|
||||
@ -406,7 +406,9 @@ export class OverlayBackground implements OverlayBackgroundInterface {
|
||||
|
||||
subFrameData.top += subFrameOffset.top;
|
||||
subFrameData.left += subFrameOffset.left;
|
||||
subFrameData.parentFrameIds.push(frameDetails.parentFrameId);
|
||||
if (!subFrameData.parentFrameIds.includes(frameDetails.parentFrameId)) {
|
||||
subFrameData.parentFrameIds.push(frameDetails.parentFrameId);
|
||||
}
|
||||
|
||||
frameDetails = await BrowserApi.getFrameDetails({
|
||||
tabId,
|
||||
|
@ -1398,7 +1398,7 @@ describe("AutofillOverlayContentService", () => {
|
||||
frameId: subFrameId,
|
||||
left: 0,
|
||||
top: 0,
|
||||
parentFrameIds: [],
|
||||
parentFrameIds: [0],
|
||||
subFrameDepth: 0,
|
||||
},
|
||||
},
|
||||
|
@ -922,7 +922,7 @@ export class AutofillOverlayContentService implements AutofillOverlayContentServ
|
||||
frameId: message.subFrameId,
|
||||
left: 0,
|
||||
top: 0,
|
||||
parentFrameIds: [],
|
||||
parentFrameIds: [0],
|
||||
subFrameDepth: 0,
|
||||
} as SubFrameDataFromWindowMessage,
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user