Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

fix(merge): 1057 undid 1056 :/ (#358)

Pavel Feldman1776495b4c98
diff --git a/browser_patches/webkit/BUILD_NUMBER b/browser_patches/webkit/BUILD_NUMBER
index c500a5fe3c..9a9755e49a 100644
--- a/browser_patches/webkit/BUILD_NUMBER
+++ b/browser_patches/webkit/BUILD_NUMBER
@@ -1 +1 @@
-1057
+1058
diff --git a/browser_patches/webkit/patches/bootstrap.diff b/browser_patches/webkit/patches/bootstrap.diff
index e1bea3ae04..ff4c8ed9d4 100644
--- a/browser_patches/webkit/patches/bootstrap.diff
+++ b/browser_patches/webkit/patches/bootstrap.diff
@@ -608,10 +608,10 @@ index 0000000000000000000000000000000000000000..79edea03fed4e9be5da96e1275e182a4
+}
diff --git a/Source/JavaScriptCore/inspector/protocol/Emulation.json b/Source/JavaScriptCore/inspector/protocol/Emulation.json
new file mode 100644
-index 0000000000000000000000000000000000000000..ef5e1e4f164f441d433c1ad4d7faabf02dff970e
+index 0000000000000000000000000000000000000000..bcf863e4bba3b99f66e75dabfc4d8c1289cc2b78
--- /dev/null
+++ b/Source/JavaScriptCore/inspector/protocol/Emulation.json
-@@ -0,0 +1,31 @@
+@@ -0,0 +1,32 @@
+{
+ "domain": "Emulation",
+ "availability": ["web"],
@@ -623,7 +623,8 @@ index 0000000000000000000000000000000000000000..ef5e1e4f164f441d433c1ad4d7faabf0
+ "parameters": [
+ { "name": "width", "type": "integer" },
+ { "name": "height", "type": "integer" },
-+ { "name": "deviceScaleFactor", "type": "number" }
++ { "name": "deviceScaleFactor", "type": "number" },
++ { "name": "fixedLayout", "type": "boolean" }
+ ]
+ },
+ {
@@ -5524,7 +5525,7 @@ index d7695088e7cfc4f638f157338754f9f157489749..fd0e1db93b4b6fc094ff47565ca19e83
std::unique_ptr<BackingStore> m_backingStore;
diff --git a/Source/WebKit/UIProcess/InspectorBrowserAgent.cpp b/Source/WebKit/UIProcess/InspectorBrowserAgent.cpp
new file mode 100644
-index 0000000000000000000000000000000000000000..2eed920f0c5c162875f431abb532379d896dd310
+index 0000000000000000000000000000000000000000..60d53cf6af3faa6f484a0a1efa935c505492576b
--- /dev/null
+++ b/Source/WebKit/UIProcess/InspectorBrowserAgent.cpp
@@ -0,0 +1,333 @@
@@ -5655,7 +5656,7 @@ index 0000000000000000000000000000000000000000..2eed920f0c5c162875f431abb532379d
+ RefPtr<WebPageProxy> page = m_client->createPage(errorString, sessionID);
+ if (page == nullptr)
+ return;
-+ page->setPermissionsForAutomation(m_permissions.get(browserContextID ? *browserContextID : String()));
++ page->setPermissionsForAutomation(m_permissions.get(browserContextID ? *browserContextID : ""));
+ *targetID = WebPageInspectorTarget::toTargetID(page->webPageID());
+}
+
@@ -5781,7 +5782,7 @@ index 0000000000000000000000000000000000000000..2eed920f0c5c162875f431abb532379d
+ }
+ set.add(name);
+ }
-+ String key = browserContextID ? *browserContextID : String();
++ String key = browserContextID ? *browserContextID : "";
+ auto it = m_permissions.add(key, Permissions()).iterator;
+ it->value.set(origin, WTFMove(set));
+ Vector<WebPageProxy*> pages;
@@ -6665,10 +6666,10 @@ index 78caedf0c0ce83675569502d150fcc44e5f9868c..a380d778c36fdd718dc506c28fee2349
} // namespace WebKit
diff --git a/Source/WebKit/UIProcess/WebPageInspectorEmulationAgent.cpp b/Source/WebKit/UIProcess/WebPageInspectorEmulationAgent.cpp
new file mode 100644
-index 0000000000000000000000000000000000000000..9d5245ec9f6708a41048e3c3d1663b99c0be7ba7
+index 0000000000000000000000000000000000000000..58e69943a8978790fbe6fa0f478c64dd2895a551
--- /dev/null
+++ b/Source/WebKit/UIProcess/WebPageInspectorEmulationAgent.cpp
-@@ -0,0 +1,62 @@
+@@ -0,0 +1,63 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT license.
+
@@ -6704,9 +6705,10 @@ index 0000000000000000000000000000000000000000..9d5245ec9f6708a41048e3c3d1663b99
+{
+}
+
-+void WebPageInspectorEmulationAgent::setDeviceMetricsOverride(int width, int height, double deviceScaleFactor, Ref<SetDeviceMetricsOverrideCallback>&& callback)
++void WebPageInspectorEmulationAgent::setDeviceMetricsOverride(int width, int height, double deviceScaleFactor, bool fixedlayout, Ref<SetDeviceMetricsOverrideCallback>&& callback)
+{
+ m_page.setCustomDeviceScaleFactor(deviceScaleFactor);
++ m_page.setUseFixedLayout(fixedlayout);
+ platformSetSize(width, height, [callback = WTFMove(callback)](const String& error) {
+ if (error.isEmpty())
+ callback->sendSuccess();
@@ -6733,7 +6735,7 @@ index 0000000000000000000000000000000000000000..9d5245ec9f6708a41048e3c3d1663b99
+} // namespace WebKit
diff --git a/Source/WebKit/UIProcess/WebPageInspectorEmulationAgent.h b/Source/WebKit/UIProcess/WebPageInspectorEmulationAgent.h
new file mode 100644
-index 0000000000000000000000000000000000000000..f519b0716798ac2f0682ad350592503057330f99
+index 0000000000000000000000000000000000000000..71b6e3788c64ae07ef1aeba972dd859db3b2de54
--- /dev/null
+++ b/Source/WebKit/UIProcess/WebPageInspectorEmulationAgent.h
@@ -0,0 +1,44 @@
@@ -6769,7 +6771,7 @@ index 0000000000000000000000000000000000000000..f519b0716798ac2f0682ad3505925030
+ void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*) override;
+ void willDestroyFrontendAndBackend(Inspector::DisconnectReason) override;
+
-+ void setDeviceMetricsOverride(int width, int height, double deviceScaleFactor, Ref<SetDeviceMetricsOverrideCallback>&&) override;
++ void setDeviceMetricsOverride(int width, int height, double deviceScaleFactor, bool fixedlayout, Ref<SetDeviceMetricsOverrideCallback>&&) override;
+ void setJavaScriptEnabled(Inspector::ErrorString&, bool enabled) override;
+ void setAuthCredentials(Inspector::ErrorString&, const String*, const String*) override;
+