fix(webkit): scroll mobile page with background-attachment: fixed (#33048)

Fixes #31551
Fixes #23573
This commit is contained in:
Yury Semikhatsky 2024-10-10 14:32:27 -07:00 committed by GitHub
parent 7de084b6dc
commit 82fe882004
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 6 deletions

View File

@ -231,6 +231,7 @@ export class WKPage implements PageDelegate {
promises.push(session.send('Page.overrideSetting', { setting: 'PointerLockEnabled', value: !contextOptions.isMobile }));
promises.push(session.send('Page.overrideSetting', { setting: 'InputTypeMonthEnabled', value: contextOptions.isMobile }));
promises.push(session.send('Page.overrideSetting', { setting: 'InputTypeWeekEnabled', value: contextOptions.isMobile }));
promises.push(session.send('Page.overrideSetting', { setting: 'FixedBackgroundsPaintRelativeToDocument', value: contextOptions.isMobile }));
await Promise.all(promises);
}

View File

@ -54,7 +54,7 @@ it.describe('mobile viewport', () => {
}
});
it('should be detectable', async ({ playwright, browser, server, browserName, platform }) => {
it('should be detectable', async ({ playwright, browser }) => {
const iPhone = playwright.devices['iPhone 6'];
const context = await browser.newContext({ ...iPhone });
const page = await context.newPage();
@ -62,7 +62,7 @@ it.describe('mobile viewport', () => {
await context.close();
});
it('should detect touch when applying viewport with touches', async ({ browser, server, browserName, platform }) => {
it('should detect touch when applying viewport with touches', async ({ browser, server }) => {
const context = await browser.newContext({ viewport: { width: 800, height: 600 }, hasTouch: true });
const page = await context.newPage();
await page.goto(server.EMPTY_PAGE);
@ -154,7 +154,7 @@ it.describe('mobile viewport', () => {
await desktopPage.close();
});
it('mouse should work with mobile viewports and cross process navigations', async ({ browser, server, browserName }) => {
it('mouse should work with mobile viewports and cross process navigations', async ({ browser, server }) => {
// @see https://crbug.com/929806
const context = await browser.newContext({ viewport: { width: 360, height: 640 }, isMobile: true });
const page = await context.newPage();
@ -193,8 +193,7 @@ it.describe('mobile viewport', () => {
{ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/31551' },
{ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/23573' },
]
}, async ({ playwright, browser, server, browserName, isLinux, headless }) => {
it.fixme(browserName === 'webkit' && isLinux && headless, 'Fails on WPE apparently due to accelerated compositing + fixed layout');
}, async ({ playwright, browser, server }) => {
const iPhone = playwright.devices['iPhone 12'];
const context = await browser.newContext({ ...iPhone });
const page = await context.newPage();
@ -204,7 +203,7 @@ it.describe('mobile viewport', () => {
await context.close();
});
it('view scale should reset after navigation', async ({ browser, browserName }) => {
it('view scale should reset after navigation', async ({ browser }) => {
it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/26876' });
const context = await browser.newContext({
viewport: { width: 390, height: 664 },