1
0
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:
Cesar Gonzalez 2024-06-25 13:19:58 -05:00
parent 955c28ddb8
commit fd1676e838
No known key found for this signature in database
GPG Key ID: 3381A5457F8CCECF
4 changed files with 8 additions and 6 deletions

View File

@ -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] }]]),
);
});

View File

@ -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,

View File

@ -1398,7 +1398,7 @@ describe("AutofillOverlayContentService", () => {
frameId: subFrameId,
left: 0,
top: 0,
parentFrameIds: [],
parentFrameIds: [0],
subFrameDepth: 0,
},
},

View File

@ -922,7 +922,7 @@ export class AutofillOverlayContentService implements AutofillOverlayContentServ
frameId: message.subFrameId,
left: 0,
top: 0,
parentFrameIds: [],
parentFrameIds: [0],
subFrameDepth: 0,
} as SubFrameDataFromWindowMessage,
},