Bug 255937 - [WinCairo]REGRESSION(263118@main): Small viewport does end up in broken screenshots via Page.snapshotRect
Summary: [WinCairo]REGRESSION(263118@main): Small viewport does end up in broken scree...
Status: RESOLVED WORKSFORME
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Windows 10
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-04-25 11:11 PDT by Max Schmitt
Modified: 2023-05-12 02:48 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Max Schmitt 2023-04-25 11:11:06 PDT
If a small viewport like 50x50 is used, on Windows it does not get rendered at all on the window (since its outside of the window). Since still a WebView::onSizeEvent event gets emitted with 50x0, we want to ignore it and not use it as an actual window size in the drawing area.

Thats how it was done before the patch.

Downstream bug: https://github.com/microsoft/playwright/issues/22616
Comment 1 Max Schmitt 2023-04-25 11:14:43 PDT
Pull request: https://github.com/WebKit/WebKit/pull/13158
Comment 2 Fujii Hironori 2023-04-25 13:43:34 PDT
Windows WebKit Playwright is still using non-GPU process mode.
We have to modify MiniBrowser to use non-GPU process mode in MiniBrowser.

diff --git a/Tools/MiniBrowser/win/WebKitBrowserWindow.cpp b/Tools/MiniBrowser/win/WebKitBrowserWindow.cpp
index fac65d82f8ab..ff977c47f1c7 100644
--- a/Tools/MiniBrowser/win/WebKitBrowserWindow.cpp
+++ b/Tools/MiniBrowser/win/WebKitBrowserWindow.cpp
@@ -145,6 +145,10 @@ Ref<BrowserWindow> WebKitBrowserWindow::create(BrowserWindowClient& client, HWND
     WKPreferencesSetMediaCapabilitiesEnabled(preferences.get(), false);
     WKPreferencesSetDeveloperExtrasEnabled(preferences.get(), true);
 
+#if 1 // Don't land this
+    WKPreferencesSetBoolValueForKeyForTesting(preferences.get(), false, createWKString("UseGPUProcessForWebGLEnabled").get());
+#endif
+
     auto pageGroup = adoptWK(WKPageGroupCreateWithIdentifier(createWKString("WinMiniBrowser").get()));
     WKPageGroupSetPreferences(pageGroup.get(), preferences.get());
 

However, I can't see any problems with small window size.
Comment 3 Max Schmitt 2023-05-12 02:48:34 PDT
We have now a minimal viewport of 250x250 which works for us.