Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions packages/playwright-core/src/server/webkit/wkPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,13 +215,13 @@ export class WKPage implements PageDelegate {
}
if (this._page.fileChooserIntercepted())
promises.push(session.send('Page.setInterceptFileChooserDialog', { enabled: true }));
promises.push(session.send('Page.overrideSetting', { setting: 'DeviceOrientationEventEnabled', value: contextOptions.isMobile }));
promises.push(session.send('Page.overrideSetting', { setting: 'FullScreenEnabled', value: !contextOptions.isMobile }));
promises.push(session.send('Page.overrideSetting', { setting: 'NotificationsEnabled', value: !contextOptions.isMobile }));
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 }));
promises.push(session.send('Page.overrideSetting', { setting: 'PushAPIEnabled', value: !contextOptions.isMobile }));
await Promise.all(promises);
}

Expand Down Expand Up @@ -795,11 +795,8 @@ export class WKPage implements PageDelegate {

private _calculateBootstrapScript(): string {
const scripts: string[] = [];
if (!this._page.browserContext._options.isMobile) {
if (!this._page.browserContext._options.isMobile)
scripts.push('delete window.orientation');
scripts.push('delete window.ondevicemotion');
scripts.push('delete window.ondeviceorientation');
}
scripts.push('if (!window.safari) window.safari = { pushNotification: { toString() { return "[object SafariRemoteNotification]"; } } };');
scripts.push('if (!window.GestureEvent) window.GestureEvent = function GestureEvent() {};');
scripts.push(this._publicKeyCredentialScript());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"ambientlight": false,
"applicationcache": false,
"audio": {
"ogg": "",
"ogg": "probably",
"mp3": "probably",
"opus": "probably",
"wav": "probably",
Expand Down Expand Up @@ -103,7 +103,7 @@
"flexwrap": true,
"focusvisible": true,
"focuswithin": true,
"fontdisplay": false,
"fontdisplay": true,
"fontface": true,
"generatedcontent": true,
"cssgradients": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"ambientlight": false,
"applicationcache": false,
"audio": {
"ogg": "",
"ogg": "probably",
"mp3": "probably",
"opus": "probably",
"wav": "probably",
Expand Down Expand Up @@ -103,7 +103,7 @@
"flexwrap": true,
"focusvisible": true,
"focuswithin": true,
"fontdisplay": false,
"fontdisplay": true,
"fontface": true,
"generatedcontent": true,
"cssgradients": true,
Expand Down Expand Up @@ -342,7 +342,7 @@
"webm": "probably",
"vp9": "probably",
"hls": "probably",
"av1": ""
"av1": "probably"
},
"videocrossorigin": true,
"videoloop": true,
Expand Down
16 changes: 11 additions & 5 deletions tests/library/modernizr.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,12 @@ it('Safari Desktop', async ({ browser, browserName, platform, httpsServer, chann
deviceScaleFactor: 2,
ignoreHTTPSErrors: true,
});
const { actual, expected } = await checkFeatures('safari-18', context, httpsServer);
const { actual, expected } = await checkFeatures('safari-26', context, httpsServer);

expected.pushmanager = false;
expected.devicemotion2 = false;
expected.deviceorientation3 = false;
// Shipping Safari exposes `font-display` as a settable CSS property (element.style.fontDisplay === ''),
// but open-source WebKit keeps it a @font-face descriptor only, so it is undefined here. No runtime
// flag bridges the gap, hence the override.
expected.fontdisplay = false;

delete expected.webglextensions;
delete actual.webglextensions;
Expand Down Expand Up @@ -96,7 +97,7 @@ it('Mobile Safari', async ({ playwright, browser, browserName, platform, httpsSe
...iPhone,
ignoreHTTPSErrors: true,
});
const { actual, expected } = await checkFeatures('mobile-safari-18', context, httpsServer);
const { actual, expected } = await checkFeatures('mobile-safari-26', context, httpsServer);

{
// All platforms.
Expand All @@ -108,6 +109,11 @@ it('Mobile Safari', async ({ playwright, browser, browserName, platform, httpsSe
expected.mediasource = true;
expected.scrolltooptions = false;

// Shipping Safari exposes `font-display` as a settable CSS property (element.style.fontDisplay === ''),
// but open-source WebKit keeps it a @font-face descriptor only, so it is undefined here. No runtime
// flag bridges the gap, hence the override.
expected.fontdisplay = false;

delete expected.webglextensions;
delete actual.webglextensions;
expected.audio = !!expected.audio;
Expand Down
Loading