Skip to content

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

chore: roll browser_patches to 070414d1d (#43154)

Dmitry Gozmane99c0b1d973b
diff --git a/browser_patches/webkit/UPSTREAM_CONFIG.sh b/browser_patches/webkit/UPSTREAM_CONFIG.sh
index 5b92483d98..3cdcf9f054 100644
--- a/browser_patches/webkit/UPSTREAM_CONFIG.sh
+++ b/browser_patches/webkit/UPSTREAM_CONFIG.sh
@@ -1,3 +1,3 @@
REMOTE_URL="https://github.com/WebKit/WebKit.git"
BASE_BRANCH="main"
-BASE_REVISION="56453fdfe0b0ca6258c23e6453b34f70b885d13f"
+BASE_REVISION="5b391e6d3b14d549908dad2c6695999291313f30"
diff --git a/browser_patches/webkit/embedder/Playwright/mac/AppDelegate.m b/browser_patches/webkit/embedder/Playwright/mac/AppDelegate.m
index c9c08a8f45..4a7702c1ef 100644
--- a/browser_patches/webkit/embedder/Playwright/mac/AppDelegate.m
+++ b/browser_patches/webkit/embedder/Playwright/mac/AppDelegate.m
@@ -213,6 +213,7 @@ const NSActivityOptions ActivityOptions =
[configuration _setWebSQLDatabaseDirectory:webSqlDirectory];
}
[configuration setProxyConfiguration:[self proxyConfiguration:_proxyServer WithBypassList:_proxyBypassList]];
+ [configuration setPreventsSystemHTTPProxyAuthentication:YES];
dataStore = [[WKWebsiteDataStore alloc] _initWithConfiguration:configuration];
}
@@ -334,6 +335,10 @@ const NSActivityOptions ActivityOptions =
NSRect windowRect = firstScreen ? NSOffsetRect(rect, -10000, [firstScreen frame].size.height - rect.size.height + 10000) : rect;
NSWindow* window = [[NSWindow alloc] initWithContentRect:windowRect styleMask:NSWindowStyleMaskBorderless backing:(NSBackingStoreType)_NSBackingStoreUnbuffered defer:YES];
+ // Mission Control scales its layout to the bounding box of all normal windows,
+ // including this off-screen one. https://github.com/microsoft/playwright/issues/42265
+ window.collectionBehavior = NSWindowCollectionBehaviorTransient | NSWindowCollectionBehaviorIgnoresCycle;
+
WKWebView* webView = [[WKWebView alloc] initWithFrame:[window.contentView bounds] configuration:configuration];
if (!webView)
return nil;
@@ -366,6 +371,7 @@ const NSActivityOptions ActivityOptions =
if (!proxyBypassList || ![proxyBypassList length])
proxyBypassList = _proxyBypassList;
[dataStoreConfiguration setProxyConfiguration:[self proxyConfiguration:proxyServer WithBypassList:proxyBypassList]];
+ [dataStoreConfiguration setPreventsSystemHTTPProxyAuthentication:YES];
browserContext.dataStore = [[[WKWebsiteDataStore alloc] _initWithConfiguration:dataStoreConfiguration] autorelease];
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
diff --git a/browser_patches/webkit/embedder/Playwright/win/WinMain.cpp b/browser_patches/webkit/embedder/Playwright/win/WinMain.cpp
index 585e1778b0..67034c6982 100644
--- a/browser_patches/webkit/embedder/Playwright/win/WinMain.cpp
+++ b/browser_patches/webkit/embedder/Playwright/win/WinMain.cpp
@@ -34,6 +34,7 @@
#include "PlaywrightLibResource.h"
#include "PlaywrightReplace.h"
#include <WebKit/WKContext.h>
+#include <WebCore/PlatformPasteboard.h>
#include <WebKit/WKWebsiteDataStoreConfigurationRef.h>
#include <WebKit/WKWebsiteDataStoreRef.h>
#include <WebKit/WKWebsiteDataStoreRefCurl.h>
@@ -86,6 +87,7 @@ int WINAPI wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance,
InitCommonControlsEx(&InitCtrlEx);
g_options = parseCommandLine();
+ WebCore::PlatformPasteboard::setIsolated(g_options.headless);
if (g_options.inspectorPipe) {
WKInspectorInitializeRemoteInspectorPipe(
configureDataStore,
diff --git a/browser_patches/webkit/patches/bootstrap.diff b/browser_patches/webkit/patches/bootstrap.diff
index 57610ffc47..ab31e39a60 100644
--- a/browser_patches/webkit/patches/bootstrap.diff
+++ b/browser_patches/webkit/patches/bootstrap.diff
@@ -1,8 +1,8 @@
diff --git a/Source/JavaScriptCore/CMakeLists.txt b/Source/JavaScriptCore/CMakeLists.txt
-index 1d2c0b6e19b19f8efb9db3d2e82d0d1439622459..5261698b09b1fb17bc6f00d56afd106bfc75324b 100644
+index 87ea1b8e7ac2de62951f36f02d92be1a1d8fcb5c..0c44d93252e8dbfac483151c384495b28454a759 100644
--- a/Source/JavaScriptCore/CMakeLists.txt
+++ b/Source/JavaScriptCore/CMakeLists.txt
-@@ -1703,21 +1703,26 @@ set(JavaScriptCore_INSPECTOR_DOMAINS
+@@ -1696,21 +1696,26 @@ set(JavaScriptCore_INSPECTOR_DOMAINS
${JAVASCRIPTCORE_DIR}/inspector/protocol/CSS.json
${JAVASCRIPTCORE_DIR}/inspector/protocol/Canvas.json
${JAVASCRIPTCORE_DIR}/inspector/protocol/Console.json
@@ -30,10 +30,10 @@ index 1d2c0b6e19b19f8efb9db3d2e82d0d1439622459..5261698b09b1fb17bc6f00d56afd106b
${JAVASCRIPTCORE_DIR}/inspector/protocol/ServiceWorker.json
${JAVASCRIPTCORE_DIR}/inspector/protocol/Storage.json
diff --git a/Source/JavaScriptCore/DerivedSources-input.xcfilelist b/Source/JavaScriptCore/DerivedSources-input.xcfilelist
-index 742f12c0f4e3247fac9c48500bdf23c21d2cc7c9..0a43918bfad11b59647cd586e8727d240baef31d 100644
+index 823516f63e9d7af95519b30062c7bd5a8cfa50bc..cb25b4df1f81126678867d29ca169f1d7f29652e 100644
--- a/Source/JavaScriptCore/DerivedSources-input.xcfilelist
+++ b/Source/JavaScriptCore/DerivedSources-input.xcfilelist
-@@ -96,20 +96,25 @@ $(PROJECT_DIR)/inspector/protocol/CPUProfiler.json
+@@ -94,20 +94,25 @@ $(PROJECT_DIR)/inspector/protocol/CPUProfiler.json
$(PROJECT_DIR)/inspector/protocol/CSS.json
$(PROJECT_DIR)/inspector/protocol/Canvas.json
$(PROJECT_DIR)/inspector/protocol/Console.json
@@ -60,10 +60,10 @@ index 742f12c0f4e3247fac9c48500bdf23c21d2cc7c9..0a43918bfad11b59647cd586e8727d24
$(PROJECT_DIR)/inspector/protocol/Security.json
$(PROJECT_DIR)/inspector/protocol/ServiceWorker.json
diff --git a/Source/JavaScriptCore/DerivedSources.make b/Source/JavaScriptCore/DerivedSources.make
-index 49802c7c4d5f37fe293e121cb556b48e508bc29b..3b40df8dea961f0f26ab4706601e8fca6ed0dedd 100644
+index 60cac27e1306968b6703aa8a583673d2b34af12d..5204855452f73239bb8f7625b27bad45fcb4c4f2 100644
--- a/Source/JavaScriptCore/DerivedSources.make
+++ b/Source/JavaScriptCore/DerivedSources.make
-@@ -290,21 +290,26 @@ INSPECTOR_DOMAINS := \
+@@ -287,21 +287,26 @@ INSPECTOR_DOMAINS := \
$(JavaScriptCore)/inspector/protocol/CSS.json \
$(JavaScriptCore)/inspector/protocol/Canvas.json \
$(JavaScriptCore)/inspector/protocol/Console.json \
@@ -364,7 +364,7 @@ index 0b7d732f036fce96b01bd06f4c47f5d471a0ab38..9f33772e175ac35eb6662d127dc51e1f
// FrontendChannel
FrontendChannel::ConnectionType connectionType() const;
diff --git a/Source/JavaScriptCore/inspector/protocol/DOM.json b/Source/JavaScriptCore/inspector/protocol/DOM.json
-index e5da964502fbc1dad22c59fd178d7cc6e64b185e..241c18989deb8bbc4608b6190afe4aacbbd11c74 100644
+index 63139ffd3c570588c46d0c829a286549881a0fde..33e4c29e62305d3acdcb006c57a0db1263e2aadf 100644
--- a/Source/JavaScriptCore/inspector/protocol/DOM.json
+++ b/Source/JavaScriptCore/inspector/protocol/DOM.json
@@ -80,6 +80,16 @@
@@ -445,10 +445,10 @@ index e5da964502fbc1dad22c59fd178d7cc6e64b185e..241c18989deb8bbc4608b6190afe4aac
"events": [
diff --git a/Source/JavaScriptCore/inspector/protocol/Dialog.json b/Source/JavaScriptCore/inspector/protocol/Dialog.json
new file mode 100644
-index 0000000000000000000000000000000000000000..79edea03fed4e9be5da96e1275e182a479cb7a0a
+index 0000000000000000000000000000000000000000..3bf5b947be1ffece616dc5e0b506b9e484b21475
--- /dev/null
+++ b/Source/JavaScriptCore/inspector/protocol/Dialog.json
-@@ -0,0 +1,36 @@
+@@ -0,0 +1,40 @@
+{
+ "domain": "Dialog",
+ "description": "Actions and events related to alert boxes.",
@@ -482,6 +482,10 @@ index 0000000000000000000000000000000000000000..79edea03fed4e9be5da96e1275e182a4
+ { "name": "message", "type": "string", "description": "Message that will be displayed by the dialog."},
+ { "name": "defaultPrompt", "optional": true, "type": "string", "description": "Default dialog prompt."}
+ ]
++ },
++ {
++ "name": "javascriptDialogClosed",
++ "description": "Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) has been closed."
+ }
+ ]
+}
@@ -831,10 +835,10 @@ index 0000000000000000000000000000000000000000..1c43b476603325fa412bcfded9163e7a
+ ]
+}
diff --git a/Source/JavaScriptCore/inspector/protocol/Network.json b/Source/JavaScriptCore/inspector/protocol/Network.json
-index 9b26b53e22fd5ddbb6aaf3b4cfaf7180b665e357..22e85b3c2b79606ca2da401f6e93f4e7a10975bc 100644
+index cabc2fddcd2554293ef8cc453f3e745d6eb93431..272ae1554f73f3ce27202deca76a8b8922bf4674 100644
--- a/Source/JavaScriptCore/inspector/protocol/Network.json
+++ b/Source/JavaScriptCore/inspector/protocol/Network.json
-@@ -361,6 +361,13 @@
+@@ -362,6 +362,13 @@
"parameters": [
{ "name": "bytesPerSecondLimit", "type": "integer", "optional": true, "description": "Limits the bytes per second of requests if positive. Removes any limits if zero or not provided." }
]
@@ -849,7 +853,7 @@ index 9b26b53e22fd5ddbb6aaf3b4cfaf7180b665e357..22e85b3c2b79606ca2da401f6e93f4e7
],
"events": [
diff --git a/Source/JavaScriptCore/inspector/protocol/Page.json b/Source/JavaScriptCore/inspector/protocol/Page.json
-index 992301813442154b80c1feffa63ca86389130154..439318d8a9465279cc1722c45e36e0f64c907d30 100644
+index ad54db00c6d5e8af1af4af07da660f9a22553d7e..8bdd3294cfb6b7a50865033f1f8dc7ef04dc95e7 100644
--- a/Source/JavaScriptCore/inspector/protocol/Page.json
+++ b/Source/JavaScriptCore/inspector/protocol/Page.json
@@ -27,7 +27,9 @@
@@ -935,7 +939,7 @@ index 992301813442154b80c1feffa63ca86389130154..439318d8a9465279cc1722c45e36e0f6
{
"name": "overrideSetting",
"description": "Allows the frontend to override the inspected page's settings.",
-@@ -287,6 +327,28 @@
+@@ -288,6 +328,28 @@
{ "name": "media", "type": "string", "description": "Media type to emulate. Empty string disables the override." }
]
},
@@ -964,7 +968,7 @@ index 992301813442154b80c1feffa63ca86389130154..439318d8a9465279cc1722c45e36e0f6
{
"name": "snapshotNode",
"description": "Capture a snapshot of the specified node that does not include unrelated layers.",
-@@ -307,10 +369,13 @@
+@@ -308,10 +370,13 @@
{ "name": "y", "type": "integer", "description": "Y coordinate" },
{ "name": "width", "type": "integer", "description": "Rectangle width" },
{ "name": "height", "type": "integer", "description": "Rectangle height" },
@@ -980,7 +984,7 @@ index 992301813442154b80c1feffa63ca86389130154..439318d8a9465279cc1722c45e36e0f6
]
},
{
-@@ -325,12 +390,54 @@
+@@ -326,12 +391,54 @@
{
"name": "setScreenSizeOverride",
"description": "Overrides screen size exposed to DOM and used in media queries for testing with provided values.",
@@ -1036,7 +1040,7 @@ index 992301813442154b80c1feffa63ca86389130154..439318d8a9465279cc1722c45e36e0f6
}
],
"events": [
-@@ -338,14 +445,16 @@
+@@ -339,14 +446,16 @@
"name": "domContentEventFired",
"targetTypes": ["page"],
"parameters": [
@@ -1055,7 +1059,7 @@ index 992301813442154b80c1feffa63ca86389130154..439318d8a9465279cc1722c45e36e0f6
]
},
{
-@@ -355,6 +464,14 @@
+@@ -356,6 +465,14 @@
{ "name": "frame", "$ref": "Frame", "description": "Frame object." }
]
},
@@ -1070,7 +1074,7 @@ index 992301813442154b80c1feffa63ca86389130154..439318d8a9465279cc1722c45e36e0f6
{
"name": "frameDetached",
"description": "Fired when frame has been detached from its parent.",
-@@ -362,6 +479,22 @@
+@@ -363,6 +480,22 @@
{ "name": "frameId", "$ref": "Network.FrameId", "description": "Id of the frame that has been detached." }
]
},
@@ -1093,7 +1097,7 @@ index 992301813442154b80c1feffa63ca86389130154..439318d8a9465279cc1722c45e36e0f6
{
"name": "defaultUserPreferencesDidChange",
"description": "Fired when the default value of a user preference changes at the system level.",
-@@ -369,6 +502,42 @@
+@@ -370,6 +503,42 @@
"parameters": [
{ "name": "preferences", "type": "array", "items": { "$ref": "UserPreference" }, "description": "List of user preferences that can be overriden and their new system (default) values." }
]
@@ -1600,7 +1604,7 @@ index 6af957ee69490bad4443e90161adc2230c329105..1270e77b913578ba8965fdd30c4bd446
private:
enum class ArgumentRequirement { No, Yes };
diff --git a/Source/ThirdParty/skia/CMakeLists.txt b/Source/ThirdParty/skia/CMakeLists.txt
-index 93b6d8992c6efd5fc5046c5f2954cd3179f29579..81814c2241012aedb0c785ce972aa5fa5a627791 100644
+index 4ba7d73c7f8b75b83de5e93cec7990c7e5a0f741..5b638aacaef0a4feb8908541923455d2b462c1a3 100644
--- a/Source/ThirdParty/skia/CMakeLists.txt
+++ b/Source/ThirdParty/skia/CMakeLists.txt
@@ -10,6 +10,8 @@ if (USE_SKIA_ENCODERS)
@@ -1612,7 +1616,7 @@ index 93b6d8992c6efd5fc5046c5f2954cd3179f29579..81814c2241012aedb0c785ce972aa5fa
if (ANDROID)
find_package(EXPAT REQUIRED)
endif ()
-@@ -970,6 +972,7 @@ endif ()
+@@ -973,6 +975,7 @@ endif ()
target_link_libraries(Skia PRIVATE
JPEG::JPEG
PNG::PNG
@@ -1620,11 +1624,42 @@ index 93b6d8992c6efd5fc5046c5f2954cd3179f29579..81814c2241012aedb0c785ce972aa5fa
)
WEBKIT_ADD_TARGET_CXX_FLAGS(Skia
+diff --git a/Source/ThirdParty/skia/include/core/SkStrikeRef.h b/Source/ThirdParty/skia/include/core/SkStrikeRef.h
+index 60cf73693734238c441007303195873998a65bd6..ca53a42367bb53084f80295cb218c93483018d56 100644
+--- a/Source/ThirdParty/skia/include/core/SkStrikeRef.h
++++ b/Source/ThirdParty/skia/include/core/SkStrikeRef.h
+@@ -87,7 +87,9 @@ public:
+
+ private:
+ friend class SkFont;
+- SkStrikeRef(sk_sp<SkStrike> strike, SkScalar strikeToSourceScale);
++ SkStrikeRef(sk_sp<SkStrike> strike, SkScalar strikeToSourceScale)
++ : fStrike(std::move(strike))
++ , fStrikeToSourceScale(strikeToSourceScale) {}
+
+ sk_sp<SkStrike> fStrike;
+ SkScalar fStrikeToSourceScale = 0;
+diff --git a/Source/ThirdParty/skia/src/core/SkStrikeRef.cpp b/Source/ThirdParty/skia/src/core/SkStrikeRef.cpp
+index 6e972031061c4c51c85e8eec75104c29ef621453..b59bf4909c9d8d929eab4ccd0f24aa39223c83d1 100644
+--- a/Source/ThirdParty/skia/src/core/SkStrikeRef.cpp
++++ b/Source/ThirdParty/skia/src/core/SkStrikeRef.cpp
+@@ -33,11 +33,6 @@ SkStrikeRef& SkStrikeRef::operator=(const SkStrikeRef&) = default;
+ SkStrikeRef::SkStrikeRef(SkStrikeRef&&) = default;
+ SkStrikeRef& SkStrikeRef::operator=(SkStrikeRef&&) = default;
+
+-SkStrikeRef::SkStrikeRef(sk_sp<SkStrike> strike,
+- SkScalar strikeToSourceScale)
+- : fStrike(std::move(strike))
+- , fStrikeToSourceScale(strikeToSourceScale) {}
+-
+ void SkStrikeRef::getWidths(SkSpan<const SkGlyphID> glyphs, SkSpan<SkScalar> widths) const {
+ this->getWidthsBounds(glyphs, widths, {});
+ }
diff --git a/Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml b/Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml
-index e589b9153e24c0b6ba8bead6596e5cf9122f3e60..b925c490c0e7c01c2b7a3bb6a99c5eb11435655e 100644
+index ecb49ae4e3c0618edebe390410e1cc06a3f8248b..6129082d0f374716cccb086d8ad0123968d3034e 100644
--- a/Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml
+++ b/Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml
-@@ -185,6 +185,7 @@ AccentColorEnabled:
+@@ -200,6 +200,7 @@ AccentColorEnabled:
"PLATFORM(COCOA) || USE(THEME_ADWAITA)": true
default: false
@@ -1632,33 +1667,16 @@ index e589b9153e24c0b6ba8bead6596e5cf9122f3e60..b925c490c0e7c01c2b7a3bb6a99c5eb1
AccessHandleEnabled:
type: bool
status: mature
-@@ -196,7 +197,7 @@ AccessHandleEnabled:
- default: false
+@@ -212,7 +213,7 @@ AccessHandleEnabled:
WebKit:
"PLATFORM(COCOA)" : true
+ "PLATFORM(GTK) || PLATFORM(WPE)" : true
- default: false
+ default: true
WebCore:
"PLATFORM(COCOA)" : true
- default: false
-@@ -653,6 +654,7 @@ ApplePayEnabled:
- richJavaScript: true
-
- # FIXME: This is on by default in WebKit2 PLATFORM(COCOA). Perhaps we should consider turning it on for WebKitLegacy as well.
-+# Playwright: enable on all platforms to align with Safari.
- AsyncClipboardAPIEnabled:
- type: bool
- status: mature
-@@ -663,7 +665,7 @@ AsyncClipboardAPIEnabled:
- default: false
- WebKit:
- "PLATFORM(COCOA) || PLATFORM(GTK) || PLATFORM(WPE)" : true
-- default: false
-+ default: true
- WebCore:
- default: false
-
-@@ -960,13 +962,10 @@ BlobFileAccessEnforcementEnabled:
+ "PLATFORM(GTK) || PLATFORM(WPE)" : true
+@@ -1007,13 +1008,10 @@ BlobFileAccessEnforcementEnabled:
sharedPreferenceForWebProcess: true
defaultValue:
WebKitLegacy:
@@ -1672,7 +1690,7 @@ index e589b9153e24c0b6ba8bead6596e5cf9122f3e60..b925c490c0e7c01c2b7a3bb6a99c5eb1
default: false
BlockMediaLayerRehostingInWebContentProcess:
-@@ -2306,6 +2305,7 @@ CrossOriginEmbedderPolicyEnabled:
+@@ -2411,6 +2409,7 @@ CrossOriginEmbedderPolicyEnabled:
WebCore:
default: false
@@ -1680,24 +1698,7 @@ index e589b9153e24c0b6ba8bead6596e5cf9122f3e60..b925c490c0e7c01c2b7a3bb6a99c5eb1
CrossOriginOpenerPolicyEnabled:
type: bool
status: stable
-@@ -2379,6 +2379,7 @@ DOMAudioSessionFullEnabled:
- WebCore:
- default: false
-
-+# Playwright: enable on all platforms to align with Safari.
- DOMPasteAccessRequestsEnabled:
- type: bool
- status: internal
-@@ -2390,7 +2391,7 @@ DOMPasteAccessRequestsEnabled:
- default: false
- WebKit:
- "PLATFORM(IOS) || PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(WPE) || PLATFORM(VISION)": true
-- default: false
-+ default: true
- WebCore:
- default: false
-
-@@ -2471,10 +2472,10 @@ DataListElementEnabled:
+@@ -2576,10 +2575,10 @@ DataListElementEnabled:
WebKitLegacy:
default: false
WebKit:
@@ -1710,7 +1711,7 @@ index e589b9153e24c0b6ba8bead6596e5cf9122f3e60..b925c490c0e7c01c2b7a3bb6a99c5eb1
default: false
sharedPreferenceForWebProcess: true
-@@ -2716,7 +2717,7 @@ DirectoryUploadEnabled:
+@@ -2837,7 +2836,7 @@ DirectoryUploadEnabled:
WebKitLegacy:
default: false
WebKit:
@@ -1719,7 +1720,7 @@ index e589b9153e24c0b6ba8bead6596e5cf9122f3e60..b925c490c0e7c01c2b7a3bb6a99c5eb1
default: false
WebCore:
default: false
-@@ -3232,6 +3233,7 @@ FileReaderAPIEnabled:
+@@ -3354,6 +3353,7 @@ FileReaderAPIEnabled:
default: true
disableInLockdownMode: true
@@ -1727,15 +1728,16 @@ index e589b9153e24c0b6ba8bead6596e5cf9122f3e60..b925c490c0e7c01c2b7a3bb6a99c5eb1
FileSystemEnabled:
type: bool
status: mature
-@@ -3243,13 +3245,14 @@ FileSystemEnabled:
- default: false
+@@ -3366,7 +3366,7 @@ FileSystemEnabled:
WebKit:
"PLATFORM(COCOA)" : true
+ "PLATFORM(GTK) || PLATFORM(WPE)" : true
- default: false
+ default: true
WebCore:
"PLATFORM(COCOA)" : true
- default: false
+ "PLATFORM(GTK) || PLATFORM(WPE)" : true
+@@ -3374,6 +3374,7 @@ FileSystemEnabled:
disableInLockdownMode: true
sharedPreferenceForWebProcess: true
@@ -1743,7 +1745,7 @@ index e589b9153e24c0b6ba8bead6596e5cf9122f3e60..b925c490c0e7c01c2b7a3bb6a99c5eb1
FileSystemHandleSerializationEnabled:
type: bool
status: stable
-@@ -3261,13 +3264,14 @@ FileSystemHandleSerializationEnabled:
+@@ -3385,13 +3386,14 @@ FileSystemHandleSerializationEnabled:
default: false
WebKit:
"PLATFORM(COCOA)" : true
@@ -1759,16 +1761,16 @@ index e589b9153e24c0b6ba8bead6596e5cf9122f3e60..b925c490c0e7c01c2b7a3bb6a99c5eb1
FileSystemWritableStreamEnabled:
type: bool
status: stable
-@@ -3279,7 +3283,7 @@ FileSystemWritableStreamEnabled:
- default: false
+@@ -3404,7 +3406,7 @@ FileSystemWritableStreamEnabled:
WebKit:
"PLATFORM(COCOA)" : true
+ "PLATFORM(GTK) || PLATFORM(WPE)": true
- default: false
+ default: true
WebCore:
"PLATFORM(COCOA)" : true
- default: false
-@@ -3446,10 +3450,10 @@ FullScreenEnabled:
+ "PLATFORM(GTK) || PLATFORM(WPE)": true
+@@ -3559,10 +3561,10 @@ FullScreenEnabled:
WebKitLegacy:
default: false
WebKit:
@@ -1781,7 +1783,7 @@ index e589b9153e24c0b6ba8bead6596e5cf9122f3e60..b925c490c0e7c01c2b7a3bb6a99c5eb1
default: false
sharedPreferenceForWebProcess: true
-@@ -3790,7 +3794,7 @@ HardwareAccelerationEnabled:
+@@ -3913,7 +3915,7 @@ HardwareAccelerationEnabled:
status: internal
humanReadableName: "Hardware acceleration"
humanReadableDescription: "Enable hardware acceleration"
@@ -1790,16 +1792,7 @@ index e589b9153e24c0b6ba8bead6596e5cf9122f3e60..b925c490c0e7c01c2b7a3bb6a99c5eb1
defaultValue:
WebKitLegacy:
default: true
-@@ -4255,7 +4259,7 @@ InputTypeColorEnabled:
- WebKitLegacy:
- default: false
- WebKit:
-- "PLATFORM(COCOA) && !PLATFORM(WATCHOS) || PLATFORM(GTK)": true
-+ "PLATFORM(COCOA) && !PLATFORM(WATCHOS) || PLATFORM(GTK) || PLATFORM(WPE)": true
- default: false
- WebCore:
- default: false
-@@ -4288,7 +4292,7 @@ InputTypeDateEnabled:
+@@ -4439,7 +4441,7 @@ InputTypeDateEnabled:
"PLATFORM(IOS_FAMILY)": true
default: false
WebKit:
@@ -1808,7 +1801,7 @@ index e589b9153e24c0b6ba8bead6596e5cf9122f3e60..b925c490c0e7c01c2b7a3bb6a99c5eb1
default: false
WebCore:
default: false
-@@ -4304,7 +4308,7 @@ InputTypeDateTimeLocalEnabled:
+@@ -4455,7 +4457,7 @@ InputTypeDateTimeLocalEnabled:
"PLATFORM(IOS_FAMILY)": true
default: false
WebKit:
@@ -1817,7 +1810,7 @@ index e589b9153e24c0b6ba8bead6596e5cf9122f3e60..b925c490c0e7c01c2b7a3bb6a99c5eb1
default: false
WebCore:
default: false
-@@ -4337,7 +4341,7 @@ InputTypeTimeEnabled:
+@@ -4488,7 +4490,7 @@ InputTypeTimeEnabled:
"PLATFORM(IOS_FAMILY)": true
default: false
WebKit:
@@ -1826,7 +1819,7 @@ index e589b9153e24c0b6ba8bead6596e5cf9122f3e60..b925c490c0e7c01c2b7a3bb6a99c5eb1
default: false
WebCore:
default: false
-@@ -4399,6 +4403,7 @@ InspectorMaximumResourcesContentSize:
+@@ -4550,6 +4552,7 @@ InspectorMaximumResourcesContentSize:
"PLATFORM(WPE)": 50
default: 200
@@ -1834,7 +1827,7 @@ index e589b9153e24c0b6ba8bead6596e5cf9122f3e60..b925c490c0e7c01c2b7a3bb6a99c5eb1
InspectorStartsAttached:
type: bool
status: embedder
-@@ -4406,7 +4411,7 @@ InspectorStartsAttached:
+@@ -4557,7 +4560,7 @@ InspectorStartsAttached:
exposed: [ WebKit ]
defaultValue:
WebKit:
@@ -1843,7 +1836,7 @@ index e589b9153e24c0b6ba8bead6596e5cf9122f3e60..b925c490c0e7c01c2b7a3bb6a99c5eb1
InspectorSupportsShowingCertificate:
type: bool
-@@ -6144,6 +6149,7 @@ MuteCameraOnMicrophoneInterruptionEnabled:
+@@ -6310,6 +6313,7 @@ MuteCameraOnMicrophoneInterruptionEnabled:
WebCore:
default: false
@@ -1851,7 +1844,7 @@ index e589b9153e24c0b6ba8bead6596e5cf9122f3e60..b925c490c0e7c01c2b7a3bb6a99c5eb1
NavigationAPIEnabled:
type: bool
status: stable
-@@ -6154,10 +6160,10 @@ NavigationAPIEnabled:
+@@ -6320,10 +6324,10 @@ NavigationAPIEnabled:
WebKitLegacy:
default: false
WebKit:
@@ -1863,8 +1856,8 @@ index e589b9153e24c0b6ba8bead6596e5cf9122f3e60..b925c490c0e7c01c2b7a3bb6a99c5eb1
+ "PLATFORM(COCOA) || PLATFORM(GTK) || PLATFORM(WPE) || PLATFORM(WIN)": true
default: false
- NavigatorUserAgentDataJavaScriptAPIEnabled:
-@@ -6753,7 +6759,7 @@ PointerLockEnabled:
+ NavigationAPIPrecommitHandlerEnabled:
+@@ -6936,7 +6940,7 @@ PointerLockEnabled:
"PLATFORM(IOS_FAMILY)": false
default: true
WebCore:
@@ -1873,7 +1866,7 @@ index e589b9153e24c0b6ba8bead6596e5cf9122f3e60..b925c490c0e7c01c2b7a3bb6a99c5eb1
PopoverAttributeEnabled:
type: bool
-@@ -7430,7 +7436,7 @@ ScreenOrientationAPIEnabled:
+@@ -7627,7 +7631,7 @@ ScreenOrientationAPIEnabled:
WebKitLegacy:
default: false
WebKit:
@@ -1882,7 +1875,7 @@ index e589b9153e24c0b6ba8bead6596e5cf9122f3e60..b925c490c0e7c01c2b7a3bb6a99c5eb1
WebCore:
default: false
sharedPreferenceForWebProcess: true
-@@ -8432,6 +8438,7 @@ StandardFontFamily:
+@@ -8659,6 +8663,7 @@ StandardFontFamily:
WebCore:
default: '""_str'
@@ -1890,34 +1883,35 @@ index e589b9153e24c0b6ba8bead6596e5cf9122f3e60..b925c490c0e7c01c2b7a3bb6a99c5eb1
StorageAPIEnabled:
type: bool
status: stable
-@@ -8443,11 +8450,12 @@ StorageAPIEnabled:
- default: false
+@@ -8671,12 +8676,13 @@ StorageAPIEnabled:
WebKit:
"PLATFORM(COCOA)" : true
+ "PLATFORM(GTK) || PLATFORM(WPE)": true
- default: false
+ default: true
WebCore:
"PLATFORM(COCOA)" : true
+ "PLATFORM(GTK) || PLATFORM(WPE)": true
default: false
+# Playwright: enable on all platforms to align with Safari.
StorageAPIEstimateEnabled:
type: bool
status: stable
-@@ -8459,7 +8467,7 @@ StorageAPIEstimateEnabled:
- default: false
+@@ -8689,7 +8695,7 @@ StorageAPIEstimateEnabled:
WebKit:
"PLATFORM(COCOA)" : true
+ "PLATFORM(GTK) || PLATFORM(WPE)": true
- default: false
+ default: true
WebCore:
"PLATFORM(COCOA)" : true
- default: false
+ "PLATFORM(GTK) || PLATFORM(WPE)": true
diff --git a/Source/WTF/wtf/PlatformEnable.h b/Source/WTF/wtf/PlatformEnable.h
-index 08d8ea5a09bb3bf0f644b7563bea9e3e4b7ec25f..55ebb869c2412cfd4820c3b87fc79f514223462c 100644
+index f245b4783994286055256034a846000dc0918ff5..dc182d2b9b9afc15baa03b8c03b3593c9c96773a 100644
--- a/Source/WTF/wtf/PlatformEnable.h
+++ b/Source/WTF/wtf/PlatformEnable.h
-@@ -455,7 +455,7 @@
+@@ -451,7 +451,7 @@
// ORIENTATION_EVENTS should never get enabled on Desktop, only Mobile.
#if !defined(ENABLE_ORIENTATION_EVENTS)
@@ -1926,7 +1920,7 @@ index 08d8ea5a09bb3bf0f644b7563bea9e3e4b7ec25f..55ebb869c2412cfd4820c3b87fc79f51
#endif
#if OS(WINDOWS)
-@@ -572,7 +572,7 @@
+@@ -568,7 +568,7 @@
#endif
#if !defined(ENABLE_TOUCH_EVENTS)
@@ -1936,7 +1930,7 @@ index 08d8ea5a09bb3bf0f644b7563bea9e3e4b7ec25f..55ebb869c2412cfd4820c3b87fc79f51
#if !defined(ENABLE_CSS_TAP_HIGHLIGHT_COLOR) && ENABLE(TOUCH_EVENTS)
diff --git a/Source/WTF/wtf/PlatformEnableCocoa.h b/Source/WTF/wtf/PlatformEnableCocoa.h
-index a0fcba3553385614729d64ea37817795fb9e121d..d18617518fcb7a8c3cd8ec8be93ba1d46aa04b6c 100644
+index 53e5da84657f3c5555d2cb7f6bd2533ff8e70b4f..3792ce367cb0d86a2ff569f19deb8a59ecf23c1d 100644
--- a/Source/WTF/wtf/PlatformEnableCocoa.h
+++ b/Source/WTF/wtf/PlatformEnableCocoa.h
@@ -843,7 +843,7 @@
@@ -1993,10 +1987,10 @@ index 97424bd2608e685e1508f54bcb339f43ddcd187b..3728400291efc5462c46d7b92b9734e0
using WTF::KB;
using WTF::MB;
diff --git a/Source/WebCore/DerivedSources.make b/Source/WebCore/DerivedSources.make
-index 6f2ea0fe530e94a3372c8ab699aacbc7820e73df..1d68b0907b26431b4639e4d5d4f7d2588ba38cb0 100644
+index 978959e012cb2fd0f5610011029dc94e9a38440a..1856780823ddd7cf736334c16903537e5597f50a 100644
--- a/Source/WebCore/DerivedSources.make
+++ b/Source/WebCore/DerivedSources.make
-@@ -1259,6 +1259,10 @@ JS_BINDING_IDLS := \
+@@ -1271,6 +1271,10 @@ JS_BINDING_IDLS := \
$(WebCore)/dom/SubscriberCallback.idl \
$(WebCore)/dom/SubscriptionObserver.idl \
$(WebCore)/dom/SubscriptionObserverCallback.idl \
@@ -2007,7 +2001,7 @@ index 6f2ea0fe530e94a3372c8ab699aacbc7820e73df..1d68b0907b26431b4639e4d5d4f7d258
$(WebCore)/dom/Text.idl \
$(WebCore)/dom/TextDecoder.idl \
$(WebCore)/dom/TextDecoderStream.idl \
-@@ -1885,9 +1889,6 @@ JS_BINDING_IDLS := \
+@@ -1886,9 +1890,6 @@ JS_BINDING_IDLS := \
ADDITIONAL_BINDING_IDLS = \
DocumentTouch.idl \
GestureEvent.idl \
@@ -2033,10 +2027,10 @@ index f468a12c6cae3ecc22fd9d7eacccb55c199f4dab..7fdb15208f24e4c91267c7d9fb776b77
}
diff --git a/Source/WebCore/PlatformWin.cmake b/Source/WebCore/PlatformWin.cmake
-index f86ea769e299e1f892a777282ac863f4d37769c7..45c5ec2270555eea7b025c318945225f95ac8883 100644
+index d8c429c87c08905cd2f0b8175e4a73a2e51edb08..1952fdfd94aba6c8b1fa1a985d6b080fd5eb66bb 100644
--- a/Source/WebCore/PlatformWin.cmake
+++ b/Source/WebCore/PlatformWin.cmake
-@@ -218,6 +218,7 @@ if (USE_CAIRO)
+@@ -219,6 +219,7 @@ if (USE_CAIRO)
platform/graphics/win/cairo/MediaPlayerPrivateMediaFoundationCairo.cpp
platform/win/cairo/DragImageWinCairo.cpp
@@ -2045,10 +2039,10 @@ index f86ea769e299e1f892a777282ac863f4d37769c7..45c5ec2270555eea7b025c318945225f
elseif (USE_SKIA)
list(APPEND WebCore_SOURCES
diff --git a/Source/WebCore/SourcesCocoa.txt b/Source/WebCore/SourcesCocoa.txt
-index ea53c6dc3e609b275d81c3156eb770778f644589..1d61331cef78986be26890b44bf7896acef2977b 100644
+index 74bcb111b39d482cafc336d19ffec9ceefd5e172..54c423eb30d06df6b4a4749d63728f708b2eaf43 100644
--- a/Source/WebCore/SourcesCocoa.txt
+++ b/Source/WebCore/SourcesCocoa.txt
-@@ -749,3 +749,9 @@ testing/cocoa/WebViewVisualIdentificationOverlay.mm @nonARC
+@@ -750,3 +750,9 @@ testing/cocoa/WebViewVisualIdentificationOverlay.mm @nonARC
platform/graphics/angle/GraphicsContextGLANGLE.cpp @no-unify // ANGLE headers redefine GL types/macros that collide with system OpenGL.
platform/graphics/cocoa/GraphicsContextGLCocoa.mm @nonARC @no-unify // ANGLE headers redefine GL types/macros that collide with system OpenGL.
platform/graphics/cv/GraphicsContextGLCVCocoa.mm @nonARC @no-unify // ANGLE headers redefine GL types/macros that collide with system OpenGL.
@@ -2087,10 +2081,10 @@ index 39f5f71efa4e15ee6a07709bb21aa18c1a9c8389..16ec8acbdaf6d1a465280f592c7fb43e
+JSSpeechSynthesisErrorEventInit.cpp
+JSSpeechSynthesisEventInit.cpp
diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj
-index 84ed8bf7f5ca2a46f0e34d0f6e9fdac956143153..39963d9c37f5afe4c52be2fa003c144b5edad84c 100644
+index 7765b458889852ef8315597e55f7d726b93bb06f..bb15911efa4a93efefddcd191b67ef7dc058b2c0 100644
--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj
-@@ -7098,6 +7098,13 @@
+@@ -7100,6 +7100,13 @@
E5F67D962B65CDBE00CC30DE /* AttachmentAssociatedElement.h in Headers */ = {isa = PBXBuildFile; fileRef = E5F67D932B65CC2400CC30DE /* AttachmentAssociatedElement.h */; settings = {ATTRIBUTES = (Private, ); }; };
E6F93CF6265A334D32D41777 /* FrameCSSAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C0F6A57EB56935552649019 /* FrameCSSAgent.h */; };
E71467B324ABAEF200FB2F50 /* AudioNodeOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = E71467B124ABAEF100FB2F50 /* AudioNodeOptions.h */; };
@@ -2104,7 +2098,7 @@ index 84ed8bf7f5ca2a46f0e34d0f6e9fdac956143153..39963d9c37f5afe4c52be2fa003c144b
E71467B624ABAF1D00FB2F50 /* PannerOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = E71467B524ABAF1D00FB2F50 /* PannerOptions.h */; };
E755E89224C7434B009F7C23 /* PeriodicWaveConstraints.h in Headers */ = {isa = PBXBuildFile; fileRef = E755E88F24C7434B009F7C23 /* PeriodicWaveConstraints.h */; };
E755E89924C7461D009F7C23 /* PeriodicWaveOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = E755E89624C7461D009F7C23 /* PeriodicWaveOptions.h */; };
-@@ -23256,6 +23263,14 @@
+@@ -23344,6 +23351,14 @@
F00DCAFE000000000000A002 /* StyleWhiteSpaceTrim.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = StyleWhiteSpaceTrim.cpp; sourceTree = "<group>"; };
F088343F2E721B29001B2348 /* AXLocalFrame.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AXLocalFrame.h; sourceTree = "<group>"; };
F08834402E721B33001B2348 /* AXLocalFrame.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = AXLocalFrame.cpp; sourceTree = "<group>"; };
@@ -2119,7 +2113,7 @@ index 84ed8bf7f5ca2a46f0e34d0f6e9fdac956143153..39963d9c37f5afe4c52be2fa003c144b
F12171F316A8BC63000053CA /* WebVTTElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebVTTElement.cpp; sourceTree = "<group>"; };
F12171F416A8BC63000053CA /* WebVTTElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebVTTElement.h; sourceTree = "<group>"; };
F2462F05A319D5DE971FCFBC /* UnifiedSource60-header-RenderStyleGetters.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = "UnifiedSource60-header-RenderStyleGetters.cpp"; sourceTree = "<group>"; };
-@@ -31398,6 +31413,11 @@
+@@ -31590,6 +31605,11 @@
BC4A5324256055590028C592 /* TextDirectionSubmenuInclusionBehavior.h */,
2D4F96F11A1ECC240098BF88 /* TextIndicator.cpp */,
2D4F96F21A1ECC240098BF88 /* TextIndicator.h */,
@@ -2131,7 +2125,7 @@ index 84ed8bf7f5ca2a46f0e34d0f6e9fdac956143153..39963d9c37f5afe4c52be2fa003c144b
F48570A42644C76D00C05F71 /* TranslationContextMenuInfo.h */,
D640B24C2E3058C800EB6C49 /* UADataValues.h */,
D640B24E2E3058C800EB6C49 /* UADataValues.idl */,
-@@ -39643,6 +39663,8 @@
+@@ -39816,6 +39836,8 @@
29E4D8DF16B0940F00C84704 /* PlatformSpeechSynthesizer.h */,
1AD8F81A11CAB9E900E93E54 /* PlatformStrategies.cpp */,
1AD8F81911CAB9E900E93E54 /* PlatformStrategies.h */,
@@ -2140,7 +2134,7 @@ index 84ed8bf7f5ca2a46f0e34d0f6e9fdac956143153..39963d9c37f5afe4c52be2fa003c144b
FE3DC9932D0C063C0021B6FC /* PlatformTZoneImpls.cpp */,
0FD7C21D23CE41E30096D102 /* PlatformWheelEvent.cpp */,
935C476A09AC4D4F00A6AAB4 /* PlatformWheelEvent.h */,
-@@ -42673,6 +42695,7 @@
+@@ -42865,6 +42887,7 @@
AD6E71AB1668899D00320C13 /* DocumentSharedObjectPool.h */,
6BDB5DC1227BD3B800919770 /* DocumentStorageAccess.cpp */,
6BDB5DC0227BD3B800919770 /* DocumentStorageAccess.h */,
@@ -2148,7 +2142,7 @@ index 84ed8bf7f5ca2a46f0e34d0f6e9fdac956143153..39963d9c37f5afe4c52be2fa003c144b
7CE7FA5B1EF882300060C9D6 /* DocumentTouch.cpp */,
7CE7FA591EF882300060C9D6 /* DocumentTouch.h */,
A8185F3209765765005826D9 /* DocumentType.cpp */,
-@@ -47915,6 +47938,8 @@
+@@ -48108,6 +48131,8 @@
F4E90A3C2B52038E002DA469 /* PlatformTextAlternatives.h in Headers */,
0F7D07331884C56C00B4AF86 /* PlatformTextTrack.h in Headers */,
074E82BB18A69F0E007EF54C /* PlatformTimeRanges.h in Headers */,
@@ -2157,7 +2151,7 @@ index 84ed8bf7f5ca2a46f0e34d0f6e9fdac956143153..39963d9c37f5afe4c52be2fa003c144b
CDD08ABD277E542600EA3755 /* PlatformTrackConfiguration.h in Headers */,
CD1F9B022700323D00617EB6 /* PlatformVideoColorPrimaries.h in Headers */,
CD1F9B01270020B700617EB6 /* PlatformVideoColorSpace.h in Headers */,
-@@ -49596,6 +49621,7 @@
+@@ -49799,6 +49824,7 @@
0F54DD081881D5F5003EEDBB /* Touch.h in Headers */,
71B7EE0D21B5C6870031C1EF /* TouchAction.h in Headers */,
0F54DD091881D5F5003EEDBB /* TouchEvent.h in Headers */,
@@ -2165,7 +2159,7 @@ index 84ed8bf7f5ca2a46f0e34d0f6e9fdac956143153..39963d9c37f5afe4c52be2fa003c144b
0F54DD0A1881D5F5003EEDBB /* TouchList.h in Headers */,
070334D71459FFD5008D8D45 /* TrackBase.h in Headers */,
513C7B6E2E7C2E7A00079881 /* TrackInfo.h in Headers */,
-@@ -50874,7 +50900,9 @@
+@@ -51080,7 +51106,9 @@
2D22830323A8470700364B7E /* CursorMac.mm in Sources */,
5CBD59592280E926002B22AA /* CustomHeaderFields.cpp in Sources */,
07E4BDBF2A3A5FAB000D5509 /* DictationCaretAnimator.cpp in Sources */,
@@ -2175,7 +2169,7 @@ index 84ed8bf7f5ca2a46f0e34d0f6e9fdac956143153..39963d9c37f5afe4c52be2fa003c144b
7CE6CBFD187F394900D46BF5 /* FormatConverter.cpp in Sources */,
4667EA3E2968D9DA00BAB1E2 /* GameControllerHapticEffect.mm in Sources */,
46FE73D32968E52000B8064C /* GameControllerHapticEngines.mm in Sources */,
-@@ -50972,6 +51000,9 @@
+@@ -51178,6 +51206,9 @@
072F696F2E755BFA00281FC5 /* TextListParser.cpp in Sources */,
BE39137129B267F500FA5D4F /* TextTransformCocoa.cpp in Sources */,
51DF6D800B92A18E00C2DC85 /* ThreadCheck.mm in Sources */,
@@ -2213,10 +2207,10 @@ index dd3d322ac58e6bf566d4ad8064dbbb06b18c06c4..bd61c5cdb72a1c340000b454f510e521
case ForcedAccessibilityValue::On:
return true;
diff --git a/Source/WebCore/dom/DataTransfer.cpp b/Source/WebCore/dom/DataTransfer.cpp
-index 18549ec7ba7a8fd63ffc895aa3f61e38e2f8a27f..df73e3ba571cf096600d0a042883220a6711ec16 100644
+index e247171d29b7ec2e68fcaef1227050c12f4cfdda..25e23e880894aba83bb90f8118da97de16f34e32 100644
--- a/Source/WebCore/dom/DataTransfer.cpp
+++ b/Source/WebCore/dom/DataTransfer.cpp
-@@ -531,6 +531,14 @@ Ref<DataTransfer> DataTransfer::createForDrag(const Document& document)
+@@ -554,6 +554,14 @@ Ref<DataTransfer> DataTransfer::createForDrag(const Document& document)
return adoptRef(*new DataTransfer(StoreMode::ReadWrite, Pasteboard::createForDragAndDrop(PagePasteboardContext::create(document.pageID())), Type::DragAndDropData));
}
@@ -2450,10 +2444,10 @@ index 45372483e32f88363809c77b4a2523c4d992867e..1154cce160d8ab8e4e948960799a7e1a
void FrameInspectorController::disconnectFrontend(Inspector::FrontendChannel& frontendChannel)
diff --git a/Source/WebCore/inspector/InspectorIdentifierRegistry.cpp b/Source/WebCore/inspector/InspectorIdentifierRegistry.cpp
-index 769ff5f40ad82e729dc15144a96e8f2197813b2f..d5cd6c2948129fcc5ffeb001090d20fa8f56e4e5 100644
+index 448a960f7e1190e787fefd4970215a03ac7a6943..ba603ffd00b5f1ed6d64359866e41b06b39bae59 100644
--- a/Source/WebCore/inspector/InspectorIdentifierRegistry.cpp
+++ b/Source/WebCore/inspector/InspectorIdentifierRegistry.cpp
-@@ -64,20 +64,22 @@ Protocol::Network::FrameId LegacyIdentifierRegistry::frameId(const WebCore::Fram
+@@ -65,20 +65,22 @@ Protocol::Network::FrameId LegacyIdentifierRegistry::frameId(const WebCore::Fram
{
if (!frame)
return emptyString();
@@ -2484,7 +2478,7 @@ index 769ff5f40ad82e729dc15144a96e8f2197813b2f..d5cd6c2948129fcc5ffeb001090d20fa
}
WebCore::LocalFrame* LegacyIdentifierRegistry::assertFrame(Protocol::ErrorString& errorString, const Protocol::Network::FrameId& frameId)
-@@ -90,15 +92,19 @@ WebCore::LocalFrame* LegacyIdentifierRegistry::assertFrame(Protocol::ErrorString
+@@ -91,15 +93,19 @@ WebCore::LocalFrame* LegacyIdentifierRegistry::assertFrame(Protocol::ErrorString
Protocol::Network::FrameId LegacyIdentifierRegistry::takeFrame(const WebCore::Frame& frame)
{
@@ -2509,10 +2503,10 @@ index 769ff5f40ad82e729dc15144a96e8f2197813b2f..d5cd6c2948129fcc5ffeb001090d20fa
// --- BackendIdentifierRegistry ---
diff --git a/Source/WebCore/inspector/InspectorInstrumentation.cpp b/Source/WebCore/inspector/InspectorInstrumentation.cpp
-index 04a4d2d337145cdb0cc3e0f6e24f6106caeac71e..95c7b1e417e2a8578f7bd9708b727591480efca3 100644
+index 30d3ab0aa328514a32d957ffaea6c427adacdf51..cfea4b58d3dc1aca52fa717a2515e7c9ef0cc307 100644
--- a/Source/WebCore/inspector/InspectorInstrumentation.cpp
+++ b/Source/WebCore/inspector/InspectorInstrumentation.cpp
-@@ -686,6 +686,12 @@ void InspectorInstrumentation::applyUserAgentOverrideImpl(InstrumentingAgents& i
+@@ -712,6 +712,12 @@ void InspectorInstrumentation::applyUserAgentOverrideImpl(InstrumentingAgents& i
pageAgent->applyUserAgentOverride(userAgent);
}
@@ -2525,7 +2519,7 @@ index 04a4d2d337145cdb0cc3e0f6e24f6106caeac71e..95c7b1e417e2a8578f7bd9708b727591
void InspectorInstrumentation::applyEmulatedMediaImpl(InstrumentingAgents& instrumentingAgents, AtomString& media)
{
if (CheckedPtr pageAgent = instrumentingAgents.enabledPageAgent())
-@@ -783,6 +789,12 @@ void InspectorInstrumentation::didFailLoadingImpl(InstrumentingAgents& instrumen
+@@ -809,6 +815,12 @@ void InspectorInstrumentation::didFailLoadingImpl(InstrumentingAgents& instrumen
consoleAgent->didFailLoading(identifier, error); // This should come AFTER resource notification, front-end relies on this.
}
@@ -2538,7 +2532,7 @@ index 04a4d2d337145cdb0cc3e0f6e24f6106caeac71e..95c7b1e417e2a8578f7bd9708b727591
void InspectorInstrumentation::willLoadXHRSynchronouslyImpl(InstrumentingAgents& instrumentingAgents)
{
if (CheckedPtr networkAgent = instrumentingAgents.enabledNetworkAgent())
-@@ -815,20 +827,17 @@ void InspectorInstrumentation::didReceiveScriptResponseImpl(InstrumentingAgents&
+@@ -841,20 +853,17 @@ void InspectorInstrumentation::didReceiveScriptResponseImpl(InstrumentingAgents&
void InspectorInstrumentation::domContentLoadedEventFiredImpl(InstrumentingAgents& instrumentingAgents, LocalFrame& frame)
{
@@ -2562,7 +2556,7 @@ index 04a4d2d337145cdb0cc3e0f6e24f6106caeac71e..95c7b1e417e2a8578f7bd9708b727591
}
void InspectorInstrumentation::frameDetachedFromParentImpl(InstrumentingAgents& instrumentingAgents, LocalFrame& frame)
-@@ -924,12 +933,6 @@ void InspectorInstrumentation::frameDocumentUpdatedImpl(InstrumentingAgents& ins
+@@ -948,12 +957,6 @@ void InspectorInstrumentation::frameDocumentUpdatedImpl(InstrumentingAgents& ins
pageDOMDebuggerAgent->frameDocumentUpdated(frame);
}
@@ -2575,7 +2569,7 @@ index 04a4d2d337145cdb0cc3e0f6e24f6106caeac71e..95c7b1e417e2a8578f7bd9708b727591
void InspectorInstrumentation::frameStartedLoadingImpl(InstrumentingAgents& instrumentingAgents, LocalFrame& frame)
{
if (frame.isMainFrame()) {
-@@ -960,6 +963,12 @@ void InspectorInstrumentation::accessibilitySettingsDidChangeImpl(InstrumentingA
+@@ -984,6 +987,12 @@ void InspectorInstrumentation::accessibilitySettingsDidChangeImpl(InstrumentingA
inspectorPageAgent->accessibilitySettingsDidChange();
}
@@ -2588,7 +2582,7 @@ index 04a4d2d337145cdb0cc3e0f6e24f6106caeac71e..95c7b1e417e2a8578f7bd9708b727591
#if ENABLE(DARK_MODE_CSS)
void InspectorInstrumentation::defaultAppearanceDidChangeImpl(InstrumentingAgents& instrumentingAgents)
{
-@@ -1009,6 +1018,12 @@ void InspectorInstrumentation::interceptResponseImpl(InstrumentingAgents& instru
+@@ -1033,6 +1042,12 @@ void InspectorInstrumentation::interceptResponseImpl(InstrumentingAgents& instru
networkAgent->interceptResponse(response, identifier, WTF::move(handler));
}
@@ -2601,8 +2595,8 @@ index 04a4d2d337145cdb0cc3e0f6e24f6106caeac71e..95c7b1e417e2a8578f7bd9708b727591
// JavaScriptCore InspectorDebuggerAgent should know Console MessageTypes.
static bool NODELETE isConsoleAssertMessage(MessageSource source, MessageType type)
{
-@@ -1146,6 +1161,12 @@ void InspectorInstrumentation::consoleStopRecordingCanvasImpl(InstrumentingAgent
- canvasAgent->consoleStopRecordingCanvas(context);
+@@ -1182,6 +1197,12 @@ void InspectorInstrumentation::consoleStopRecordingCanvasImpl(InstrumentingAgent
+ canvasAgent->consoleStopRecordingCanvas(device);
}
+void InspectorInstrumentation::bindingCalledImpl(InstrumentingAgents& instrumentingAgents, JSC::JSGlobalObject* globalObject, const String& name, const String& arg)
@@ -2614,7 +2608,7 @@ index 04a4d2d337145cdb0cc3e0f6e24f6106caeac71e..95c7b1e417e2a8578f7bd9708b727591
void InspectorInstrumentation::didDispatchDOMStorageEventImpl(InstrumentingAgents& instrumentingAgents, const String& key, const String& oldValue, const String& newValue, StorageType storageType, const SecurityOrigin& securityOrigin)
{
if (auto* domStorageAgent = instrumentingAgents.enabledDOMStorageAgent())
-@@ -1439,6 +1460,36 @@ void InspectorInstrumentation::renderLayerDestroyedImpl(InstrumentingAgents& ins
+@@ -1567,6 +1588,36 @@ void InspectorInstrumentation::renderLayerDestroyedImpl(InstrumentingAgents& ins
layerTreeAgent->renderLayerDestroyed(renderLayer);
}
@@ -2652,10 +2646,10 @@ index 04a4d2d337145cdb0cc3e0f6e24f6106caeac71e..95c7b1e417e2a8578f7bd9708b727591
{
return globalScope.inspectorController().m_instrumentingAgents;
diff --git a/Source/WebCore/inspector/InspectorInstrumentation.h b/Source/WebCore/inspector/InspectorInstrumentation.h
-index a34d1717de7dda3c71191019ff2c3fb90a4f6e0c..ad62c71e239a1414b4bfc96e170f037b31b0f5d1 100644
+index c0eae47d4a95065b3b154f57c8457abb1b754280..43fa9e66da2833be8a507512ae945701f8e47d6a 100644
--- a/Source/WebCore/inspector/InspectorInstrumentation.h
+++ b/Source/WebCore/inspector/InspectorInstrumentation.h
-@@ -47,6 +47,7 @@
+@@ -50,6 +50,7 @@
#include "Page.h"
#include "RenderElement.h"
#include "RenderObjectDocument.h"
@@ -2663,15 +2657,15 @@ index a34d1717de7dda3c71191019ff2c3fb90a4f6e0c..ad62c71e239a1414b4bfc96e170f037b
#include "ResourceLoader.h"
#include "ResourceLoaderIdentifier.h"
#include "ScriptExecutionContext.h"
-@@ -83,6 +84,7 @@ class Document;
- class DocumentLoader;
+@@ -87,6 +88,7 @@ class DocumentLoader;
class DocumentThreadableLoader;
class EventListener;
+ class GPUDevice;
+class HTMLInputElement;
class HTTPHeaderMap;
class InspectorTimelineAgent;
class InstrumentingAgents;
-@@ -208,6 +210,7 @@ public:
+@@ -212,6 +214,7 @@ public:
static void didRecalculateStyle(Document&);
static void didScheduleStyleRecalculation(Document&);
static void applyUserAgentOverride(LocalFrame&, String&);
@@ -2679,7 +2673,7 @@ index a34d1717de7dda3c71191019ff2c3fb90a4f6e0c..ad62c71e239a1414b4bfc96e170f037b
static void applyEmulatedMedia(LocalFrame&, AtomString&);
static void flexibleBoxRendererBeganLayout(const RenderObject&);
-@@ -220,6 +223,7 @@ public:
+@@ -224,6 +227,7 @@ public:
static void didReceiveData(LocalFrame*, ResourceLoaderIdentifier, const SharedBuffer*, int encodedDataLength);
static void didFinishLoading(LocalFrame*, DocumentLoader*, ResourceLoaderIdentifier, const NetworkLoadMetrics&, ResourceLoader*);
static void didFailLoading(LocalFrame*, DocumentLoader*, ResourceLoaderIdentifier, const ResourceError&);
@@ -2687,7 +2681,7 @@ index a34d1717de7dda3c71191019ff2c3fb90a4f6e0c..ad62c71e239a1414b4bfc96e170f037b
static void willSendRequest(ServiceWorkerGlobalScope&, ResourceLoaderIdentifier, ResourceRequest&);
static void didReceiveResourceResponse(ServiceWorkerGlobalScope&, ResourceLoaderIdentifier, const ResourceResponse&);
-@@ -245,11 +249,11 @@ public:
+@@ -249,11 +253,11 @@ public:
static void frameDetachedFromParent(LocalFrame&);
static void didCommitLoad(LocalFrame&, DocumentLoader*);
static void frameDocumentUpdated(LocalFrame&);
@@ -2700,7 +2694,7 @@ index a34d1717de7dda3c71191019ff2c3fb90a4f6e0c..ad62c71e239a1414b4bfc96e170f037b
#if ENABLE(DARK_MODE_CSS)
static void defaultAppearanceDidChange(Page&);
#endif
-@@ -260,6 +264,7 @@ public:
+@@ -264,6 +268,7 @@ public:
static bool shouldInterceptResponse(const LocalFrame&, const ResourceResponse&);
static void interceptRequest(ResourceLoader&, Function<void(const ResourceRequest&)>&&);
static void interceptResponse(const LocalFrame&, const ResourceResponse&, ResourceLoaderIdentifier, CompletionHandler<void(const ResourceResponse&, RefPtr<FragmentedSharedBuffer>)>&&);
@@ -2708,15 +2702,15 @@ index a34d1717de7dda3c71191019ff2c3fb90a4f6e0c..ad62c71e239a1414b4bfc96e170f037b
static void addMessageToConsole(LocalFrame&, std::unique_ptr<Inspector::ConsoleMessage>);
static void addMessageToConsole(WorkerOrWorkletGlobalScope&, std::unique_ptr<Inspector::ConsoleMessage>);
-@@ -285,6 +290,7 @@ public:
- static void stopProfiling(WorkerOrWorkletGlobalScope&, const String& title);
- static void consoleStartRecordingCanvas(CanvasRenderingContext&, JSC::JSGlobalObject&, JSC::JSObject* options);
+@@ -291,6 +296,7 @@ public:
+ static void consoleStartRecordingCanvas(GPUDevice&, JSC::JSGlobalObject&, JSC::JSObject* options);
static void consoleStopRecordingCanvas(CanvasRenderingContext&);
+ static void consoleStopRecordingCanvas(GPUDevice&);
+ static void bindingCalled(Page& , JSC::JSGlobalObject*, const String& name, const String& arg);
static void performanceMark(ScriptExecutionContext&, const String&, std::optional<MonotonicTime>);
-@@ -342,6 +348,12 @@ public:
+@@ -358,6 +364,12 @@ public:
static void layerTreeDidChange(Page*);
static void renderLayerDestroyed(Page*, const RenderLayer&);
@@ -2729,7 +2723,7 @@ index a34d1717de7dda3c71191019ff2c3fb90a4f6e0c..ad62c71e239a1414b4bfc96e170f037b
static void frontendCreated();
static void frontendDeleted();
static bool hasFrontends() { return InspectorInstrumentationPublic::hasFrontends(); }
-@@ -440,6 +452,7 @@ private:
+@@ -456,6 +468,7 @@ private:
static void didRecalculateStyleImpl(InstrumentingAgents&, Document&);
static void didScheduleStyleRecalculationImpl(InstrumentingAgents&, Document&);
static void applyUserAgentOverrideImpl(InstrumentingAgents&, String&);
@@ -2737,7 +2731,7 @@ index a34d1717de7dda3c71191019ff2c3fb90a4f6e0c..ad62c71e239a1414b4bfc96e170f037b
static void applyEmulatedMediaImpl(InstrumentingAgents&, AtomString&);
static void flexibleBoxRendererBeganLayoutImpl(InstrumentingAgents&, const RenderObject&);
-@@ -454,6 +467,7 @@ private:
+@@ -470,6 +483,7 @@ private:
static void didReceiveDataImpl(InstrumentingAgents&, ResourceLoaderIdentifier, const SharedBuffer*, int encodedDataLength);
static void didFinishLoadingImpl(InstrumentingAgents&, ResourceLoaderIdentifier, DocumentLoader*, const NetworkLoadMetrics&, ResourceLoader*);
static void didFailLoadingImpl(InstrumentingAgents&, ResourceLoaderIdentifier, DocumentLoader*, const ResourceError&);
@@ -2745,7 +2739,7 @@ index a34d1717de7dda3c71191019ff2c3fb90a4f6e0c..ad62c71e239a1414b4bfc96e170f037b
static void willLoadXHRSynchronouslyImpl(InstrumentingAgents&);
static void didLoadXHRSynchronouslyImpl(InstrumentingAgents&);
static void scriptImportedImpl(InstrumentingAgents&, ResourceLoaderIdentifier, const String& sourceString);
-@@ -464,11 +478,11 @@ private:
+@@ -480,11 +494,11 @@ private:
static void frameDetachedFromParentImpl(InstrumentingAgents&, LocalFrame&);
static void didCommitLoadImpl(InstrumentingAgents&, LocalFrame&, DocumentLoader*);
static void frameDocumentUpdatedImpl(InstrumentingAgents&, LocalFrame&);
@@ -2758,7 +2752,7 @@ index a34d1717de7dda3c71191019ff2c3fb90a4f6e0c..ad62c71e239a1414b4bfc96e170f037b
#if ENABLE(DARK_MODE_CSS)
static void defaultAppearanceDidChangeImpl(InstrumentingAgents&);
#endif
-@@ -479,6 +493,7 @@ private:
+@@ -495,6 +509,7 @@ private:
static bool shouldInterceptResponseImpl(InstrumentingAgents&, const ResourceResponse&);
static void interceptRequestImpl(InstrumentingAgents&, ResourceLoader&, Function<void(const ResourceRequest&)>&&);
static void interceptResponseImpl(InstrumentingAgents&, const ResourceResponse&, ResourceLoaderIdentifier, CompletionHandler<void(const ResourceResponse&, RefPtr<FragmentedSharedBuffer>)>&&);
@@ -2766,15 +2760,15 @@ index a34d1717de7dda3c71191019ff2c3fb90a4f6e0c..ad62c71e239a1414b4bfc96e170f037b
static void addMessageToConsoleImpl(InstrumentingAgents&, std::unique_ptr<Inspector::ConsoleMessage>);
-@@ -493,6 +508,7 @@ private:
- static void stopProfilingImpl(InstrumentingAgents&, const String& title);
- static void consoleStartRecordingCanvasImpl(InstrumentingAgents&, CanvasRenderingContext&, JSC::JSGlobalObject&, JSC::JSObject* options);
+@@ -511,6 +526,7 @@ private:
+ static void consoleStartRecordingCanvasImpl(InstrumentingAgents&, GPUDevice&, JSC::JSGlobalObject&, JSC::JSObject* options);
static void consoleStopRecordingCanvasImpl(InstrumentingAgents&, CanvasRenderingContext&);
+ static void consoleStopRecordingCanvasImpl(InstrumentingAgents&, GPUDevice&);
+ static void bindingCalledImpl(InstrumentingAgents&, JSC::JSGlobalObject*, const String& name, const String& arg);
static void performanceMarkImpl(InstrumentingAgents&, const String& label, std::optional<MonotonicTime>);
static void didEnqueueFirstContentfulPaintImpl(InstrumentingAgents&);
-@@ -549,6 +565,12 @@ private:
+@@ -577,6 +593,12 @@ private:
static void layerTreeDidChangeImpl(InstrumentingAgents&);
static void renderLayerDestroyedImpl(InstrumentingAgents&, const RenderLayer&);
@@ -2787,7 +2781,7 @@ index a34d1717de7dda3c71191019ff2c3fb90a4f6e0c..ad62c71e239a1414b4bfc96e170f037b
static InstrumentingAgents& NODELETE instrumentingAgents(Page&);
static InstrumentingAgents& NODELETE instrumentingAgents(const LocalFrame&);
static InstrumentingAgents& NODELETE instrumentingAgents(const LocalFrameView&);
-@@ -1091,6 +1113,12 @@ inline void InspectorInstrumentation::applyUserAgentOverride(LocalFrame& frame,
+@@ -1119,6 +1141,12 @@ inline void InspectorInstrumentation::applyUserAgentOverride(LocalFrame& frame,
applyUserAgentOverrideImpl(protect(instrumentingAgents(frame)), userAgent);
}
@@ -2800,7 +2794,7 @@ index a34d1717de7dda3c71191019ff2c3fb90a4f6e0c..ad62c71e239a1414b4bfc96e170f037b
inline void InspectorInstrumentation::applyEmulatedMedia(LocalFrame& frame, AtomString& media)
{
FAST_RETURN_IF_NO_FRONTENDS(void());
-@@ -1189,6 +1217,12 @@ inline void InspectorInstrumentation::didFailLoading(ServiceWorkerGlobalScope& g
+@@ -1217,6 +1245,12 @@ inline void InspectorInstrumentation::didFailLoading(ServiceWorkerGlobalScope& g
didFailLoadingImpl(protect(instrumentingAgents(globalScope)), identifier, nullptr, error);
}
@@ -2813,7 +2807,7 @@ index a34d1717de7dda3c71191019ff2c3fb90a4f6e0c..ad62c71e239a1414b4bfc96e170f037b
inline void InspectorInstrumentation::continueAfterXFrameOptionsDenied(LocalFrame& frame, ResourceLoaderIdentifier identifier, DocumentLoader& loader, const ResourceResponse& response)
{
// Treat the same as didReceiveResponse.
-@@ -1272,12 +1306,6 @@ inline void InspectorInstrumentation::frameDocumentUpdated(LocalFrame& frame)
+@@ -1300,12 +1334,6 @@ inline void InspectorInstrumentation::frameDocumentUpdated(LocalFrame& frame)
frameDocumentUpdatedImpl(protect(instrumentingAgents(frame)), frame);
}
@@ -2826,7 +2820,7 @@ index a34d1717de7dda3c71191019ff2c3fb90a4f6e0c..ad62c71e239a1414b4bfc96e170f037b
inline void InspectorInstrumentation::frameStartedLoading(LocalFrame& frame)
{
FAST_RETURN_IF_NO_FRONTENDS(void());
-@@ -1302,6 +1330,12 @@ inline void InspectorInstrumentation::accessibilitySettingsDidChange(Page& page)
+@@ -1330,6 +1358,12 @@ inline void InspectorInstrumentation::accessibilitySettingsDidChange(Page& page)
accessibilitySettingsDidChangeImpl(protect(instrumentingAgents(page)));
}
@@ -2839,7 +2833,7 @@ index a34d1717de7dda3c71191019ff2c3fb90a4f6e0c..ad62c71e239a1414b4bfc96e170f037b
#if ENABLE(DARK_MODE_CSS)
inline void InspectorInstrumentation::defaultAppearanceDidChange(Page& page)
{
-@@ -1351,6 +1385,13 @@ inline void InspectorInstrumentation::interceptResponse(const LocalFrame& frame,
+@@ -1379,6 +1413,13 @@ inline void InspectorInstrumentation::interceptResponse(const LocalFrame& frame,
interceptResponseImpl(protect(instrumentingAgents(frame)), response, identifier, WTF::move(handler));
}
@@ -2853,7 +2847,7 @@ index a34d1717de7dda3c71191019ff2c3fb90a4f6e0c..ad62c71e239a1414b4bfc96e170f037b
inline void InspectorInstrumentation::didDispatchDOMStorageEvent(Page& page, const String& key, const String& oldValue, const String& newValue, StorageType storageType, const SecurityOrigin& securityOrigin)
{
FAST_RETURN_IF_NO_FRONTENDS(void());
-@@ -1701,6 +1742,11 @@ inline void InspectorInstrumentation::didEnqueueLargestContentfulPaint(ScriptExe
+@@ -1821,6 +1862,11 @@ inline void InspectorInstrumentation::didEnqueueLargestContentfulPaint(ScriptExe
didEnqueueLargestContentfulPaintImpl(*agents, entry);
}
@@ -2865,7 +2859,7 @@ index a34d1717de7dda3c71191019ff2c3fb90a4f6e0c..ad62c71e239a1414b4bfc96e170f037b
inline void InspectorInstrumentation::didRequestAnimationFrame(ScriptExecutionContext& scriptExecutionContext, int callbackId)
{
FAST_RETURN_IF_NO_FRONTENDS(void());
-@@ -1757,6 +1803,39 @@ inline void InspectorInstrumentation::renderLayerDestroyed(Page* page, const Ren
+@@ -1877,6 +1923,39 @@ inline void InspectorInstrumentation::renderLayerDestroyed(Page* page, const Ren
renderLayerDestroyedImpl(*agents, renderLayer);
}
@@ -3500,10 +3494,10 @@ index 8f83cc5eaca550bbcea167c98b944f704d9a9cb1..2f655b6534f1428a23907e1cada99c24
void discardBindings();
diff --git a/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp b/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp
-index ee4e3193ac1f14a3985cb1e9c01bb97abb2800c7..57e3ad2d0b21c9f4a0565b733b75f91b9732f1b2 100644
+index 7e67b6e8ea0542be9a3ee2c55448fa9f075765d5..2182a590559393df08a396426478209818e33426 100644
--- a/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp
+++ b/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp
-@@ -62,6 +62,7 @@
+@@ -61,6 +61,7 @@
#include "LocalFrame.h"
#include "MIMETypeRegistry.h"
#include "MemoryCache.h"
@@ -3511,7 +3505,7 @@ index ee4e3193ac1f14a3985cb1e9c01bb97abb2800c7..57e3ad2d0b21c9f4a0565b733b75f91b
#include "Page.h"
#include "PlatformStrategies.h"
#include "ProgressTracker.h"
-@@ -277,7 +278,7 @@ static Ref<Inspector::Protocol::Network::Request> buildObjectForResourceRequest(
+@@ -278,7 +279,7 @@ static Ref<Inspector::Protocol::Network::Request> buildObjectForResourceRequest(
if (request.httpBody() && !request.httpBody()->isEmpty()) {
auto bytes = protect(request.httpBody())->flatten();
@@ -3520,7 +3514,7 @@ index ee4e3193ac1f14a3985cb1e9c01bb97abb2800c7..57e3ad2d0b21c9f4a0565b733b75f91b
}
if (resourceLoader) {
-@@ -329,6 +330,8 @@ RefPtr<Inspector::Protocol::Network::Response> InspectorNetworkAgent::buildObjec
+@@ -330,6 +331,8 @@ RefPtr<Inspector::Protocol::Network::Response> InspectorNetworkAgent::buildObjec
.setSource(responseSource(response.source()))
.release();
@@ -3529,7 +3523,7 @@ index ee4e3193ac1f14a3985cb1e9c01bb97abb2800c7..57e3ad2d0b21c9f4a0565b733b75f91b
if (resourceLoader) {
auto* metrics = response.deprecatedNetworkLoadMetricsOrNull();
responseObject->setTiming(buildObjectForTiming(metrics ? *metrics : NetworkLoadMetrics::emptyMetrics(), *resourceLoader));
-@@ -523,7 +526,7 @@ void InspectorNetworkAgent::didReceiveResponse(ResourceLoaderIdentifier identifi
+@@ -524,7 +527,7 @@ void InspectorNetworkAgent::didReceiveResponse(ResourceLoaderIdentifier identifi
// 'Raw' is used for loading worker scripts, and those should stay as 'Script' and not change to 'XHR' type.
if (type != newType && newType != ResourceType::XHR && newType != ResourceType::Other)
type = newType;
@@ -3538,7 +3532,7 @@ index ee4e3193ac1f14a3985cb1e9c01bb97abb2800c7..57e3ad2d0b21c9f4a0565b733b75f91b
// FIXME: <webkit.org/b/216125> 304 Not Modified responses for XHR/Fetch do not have all their information from the cache.
if (isNotModified && (type == ResourceType::XHR || type == ResourceType::Fetch) && (!cachedResource || !cachedResource->encodedSize())) {
if (auto previousResourceData = m_resourcesData->dataForURL(response.url().string())) {
-@@ -534,12 +537,12 @@ void InspectorNetworkAgent::didReceiveResponse(ResourceLoaderIdentifier identifi
+@@ -535,12 +538,12 @@ void InspectorNetworkAgent::didReceiveResponse(ResourceLoaderIdentifier identifi
m_resourcesData->maybeAddResourceData(requestId, buffer);
});
}
@@ -3554,7 +3548,7 @@ index ee4e3193ac1f14a3985cb1e9c01bb97abb2800c7..57e3ad2d0b21c9f4a0565b733b75f91b
resourceResponse->setString("source"_s, Inspector::Protocol::Helpers::getEnumConstantValue(Inspector::Protocol::Network::Response::Source::DiskCache));
}
}
-@@ -618,6 +621,9 @@ void InspectorNetworkAgent::didFailLoading(ResourceLoaderIdentifier identifier,
+@@ -619,6 +622,9 @@ void InspectorNetworkAgent::didFailLoading(ResourceLoaderIdentifier identifier,
String requestId = IdentifiersFactory::requestId(identifier.toUInt64());
if (loader && m_resourcesData->resourceType(requestId) == ResourceType::Document) {
@@ -3564,7 +3558,7 @@ index ee4e3193ac1f14a3985cb1e9c01bb97abb2800c7..57e3ad2d0b21c9f4a0565b733b75f91b
RefPtr frame = loader->frame();
if (frame && frame->loader().documentLoader() && frame->document()) {
m_resourcesData->addResourceSharedBuffer(requestId,
-@@ -853,6 +859,7 @@ Inspector::Protocol::ErrorStringOr<void> InspectorNetworkAgent::disable()
+@@ -854,6 +860,7 @@ Inspector::Protocol::ErrorStringOr<void> InspectorNetworkAgent::disable()
Ref { m_instrumentingAgents.get() }->setEnabledNetworkAgent(nullptr);
m_resourcesData->clear();
m_extraRequestHeaders.clear();
@@ -3572,7 +3566,7 @@ index ee4e3193ac1f14a3985cb1e9c01bb97abb2800c7..57e3ad2d0b21c9f4a0565b733b75f91b
continuePendingRequests();
continuePendingResponses();
-@@ -1177,6 +1184,11 @@ void InspectorNetworkAgent::interceptResponse(const ResourceResponse& response,
+@@ -1166,6 +1173,11 @@ void InspectorNetworkAgent::interceptResponse(const ResourceResponse& response,
m_frontendDispatcher->responseIntercepted(requestId, resourceResponse.releaseNonNull());
}
@@ -3584,7 +3578,7 @@ index ee4e3193ac1f14a3985cb1e9c01bb97abb2800c7..57e3ad2d0b21c9f4a0565b733b75f91b
Inspector::Protocol::ErrorStringOr<void> InspectorNetworkAgent::interceptContinue(const Inspector::Protocol::Network::RequestId& requestId, Inspector::Protocol::Network::NetworkStage networkStage)
{
switch (networkStage) {
-@@ -1304,13 +1316,22 @@ Inspector::Protocol::ErrorStringOr<void> InspectorNetworkAgent::interceptRequest
+@@ -1293,13 +1305,22 @@ Inspector::Protocol::ErrorStringOr<void> InspectorNetworkAgent::interceptRequest
response.setHTTPStatusCode(status);
response.setHTTPStatusText(String { statusText });
HTTPHeaderMap explicitHeaders;
@@ -3608,7 +3602,7 @@ index ee4e3193ac1f14a3985cb1e9c01bb97abb2800c7..57e3ad2d0b21c9f4a0565b733b75f91b
loader->didReceiveResponse(WTF::move(response), [loader, buffer = data.releaseNonNull()]() {
if (loader->reachedTerminalState())
return;
-@@ -1374,6 +1395,12 @@ Inspector::Protocol::ErrorStringOr<void> InspectorNetworkAgent::setEmulatedCondi
+@@ -1363,6 +1384,12 @@ Inspector::Protocol::ErrorStringOr<void> InspectorNetworkAgent::setEmulatedCondi
#endif // ENABLE(INSPECTOR_NETWORK_THROTTLING)
@@ -3622,7 +3616,7 @@ index ee4e3193ac1f14a3985cb1e9c01bb97abb2800c7..57e3ad2d0b21c9f4a0565b733b75f91b
{
auto searchResult = Inspector::Protocol::Page::SearchResult::create()
diff --git a/Source/WebCore/inspector/agents/InspectorNetworkAgent.h b/Source/WebCore/inspector/agents/InspectorNetworkAgent.h
-index 2bc20b47670897ae8148949ca5353a183da3f0e2..ac8373e781f13ba7b89e8ed7d681de1204d424fc 100644
+index 2288d719081b3fd6ae5249ea1bc60aa284660375..fe54923274030ef59c3b1c0b5c596968acf25dc9 100644
--- a/Source/WebCore/inspector/agents/InspectorNetworkAgent.h
+++ b/Source/WebCore/inspector/agents/InspectorNetworkAgent.h
@@ -36,6 +36,8 @@
@@ -3634,7 +3628,7 @@ index 2bc20b47670897ae8148949ca5353a183da3f0e2..ac8373e781f13ba7b89e8ed7d681de12
#include "WebSocket.h"
#include <JavaScriptCore/ContentSearchUtilities.h>
#include <JavaScriptCore/InspectorBackendDispatchers.h>
-@@ -106,6 +108,7 @@ public:
+@@ -107,6 +109,7 @@ public:
#if ENABLE(INSPECTOR_NETWORK_THROTTLING)
Inspector::Protocol::ErrorStringOr<void> setEmulatedConditions(std::optional<int>&& bytesPerSecondLimit) final;
#endif
@@ -3642,15 +3636,15 @@ index 2bc20b47670897ae8148949ca5353a183da3f0e2..ac8373e781f13ba7b89e8ed7d681de12
// InspectorInstrumentation
void NODELETE willRecalculateStyle();
-@@ -138,6 +141,7 @@ public:
+@@ -139,6 +142,7 @@ public:
bool shouldInterceptResponse(const ResourceResponse&);
void interceptResponse(const ResourceResponse&, ResourceLoaderIdentifier, CompletionHandler<void(const ResourceResponse&, RefPtr<FragmentedSharedBuffer>)>&&);
void interceptRequest(ResourceLoader&, Function<void(const ResourceRequest&)>&&);
+ void setStoppingLoadingDueToProcessSwap(bool);
- void searchOtherRequests(const JSC::Yarr::RegularExpression&, Ref<JSON::ArrayOf<Inspector::Protocol::Page::SearchResult>>&);
+ void searchOtherRequests(const JSC::Yarr::RegularExpression&, Ref<JSON::ArrayOf<Inspector::Protocol::Page::SearchResult>>&, const HashSet<String>& alreadySearchedURLs);
void searchInRequest(Inspector::Protocol::ErrorString&, const Inspector::Protocol::Network::RequestId&, const String& query, bool caseSensitive, bool isRegex, RefPtr<JSON::ArrayOf<Inspector::Protocol::GenericTypes::SearchMatch>>&);
-@@ -194,6 +198,7 @@ private:
+@@ -195,6 +199,7 @@ private:
bool m_loadingXHRSynchronously { false };
bool m_interceptionEnabled { false };
bool m_clearResourceDataOnNavigate { true };
@@ -3659,7 +3653,7 @@ index 2bc20b47670897ae8148949ca5353a183da3f0e2..ac8373e781f13ba7b89e8ed7d681de12
} // namespace WebCore
diff --git a/Source/WebCore/inspector/agents/InspectorPageAgent.cpp b/Source/WebCore/inspector/agents/InspectorPageAgent.cpp
-index 1f9af03c8e6b5cbaf8ddd95c1bcc6f70d305ddde..db268018b4a6d671365d5bf9faf701d63f5d2028 100644
+index 440cabbd3138184d69e3b45bf0f74ad16d170b13..bf49ade58cfdbf8f4b6fc83d4e5e68c0a0f8c9c0 100644
--- a/Source/WebCore/inspector/agents/InspectorPageAgent.cpp
+++ b/Source/WebCore/inspector/agents/InspectorPageAgent.cpp
@@ -32,6 +32,7 @@
@@ -3695,7 +3689,7 @@ index 1f9af03c8e6b5cbaf8ddd95c1bcc6f70d305ddde..db268018b4a6d671365d5bf9faf701d6
#include "LocalFrame.h"
#include "LocalFrameView.h"
#include "MIMETypeRegistry.h"
-@@ -64,24 +69,33 @@
+@@ -64,25 +69,34 @@
#include "PageInspectorController.h"
#include "PageRuntimeAgent.h"
#include "RemoteFrame.h"
@@ -3719,6 +3713,7 @@ index 1f9af03c8e6b5cbaf8ddd95c1bcc6f70d305ddde..db268018b4a6d671365d5bf9faf701d6
+#include <JavaScriptCore/JSDateMath.h>
#include <JavaScriptCore/RegularExpression.h>
+#include <wtf/DateMath.h>
+ #include <wtf/HashSet.h>
#include <wtf/ListHashSet.h>
+#include <wtf/NeverDestroyed.h>
#include <wtf/Stopwatch.h>
@@ -3729,7 +3724,7 @@ index 1f9af03c8e6b5cbaf8ddd95c1bcc6f70d305ddde..db268018b4a6d671365d5bf9faf701d6
#include <wtf/text/StringBuilder.h>
#if ENABLE(APPLICATION_MANIFEST)
-@@ -103,6 +117,11 @@ using namespace Inspector;
+@@ -104,6 +118,11 @@ using namespace Inspector;
WTF_MAKE_TZONE_ALLOCATED_IMPL(InspectorPageAgent);
@@ -3741,7 +3736,7 @@ index 1f9af03c8e6b5cbaf8ddd95c1bcc6f70d305ddde..db268018b4a6d671365d5bf9faf701d6
InspectorOverlay& InspectorPageAgent::overlay() const
{
return m_overlay.get();
-@@ -113,6 +132,7 @@ InspectorPageAgent::InspectorPageAgent(PageAgentContext& context, InspectorBacke
+@@ -114,6 +133,7 @@ InspectorPageAgent::InspectorPageAgent(PageAgentContext& context, InspectorBacke
, m_frontendDispatcher(makeUniqueRef<Inspector::PageFrontendDispatcher>(context.frontendRouter))
, m_backendDispatcher(Inspector::PageBackendDispatcher::create(protect(context.backendDispatcher), this))
, m_inspectedPage(context.inspectedPage)
@@ -3749,7 +3744,7 @@ index 1f9af03c8e6b5cbaf8ddd95c1bcc6f70d305ddde..db268018b4a6d671365d5bf9faf701d6
, m_client(client)
, m_overlay(overlay)
{
-@@ -143,12 +163,20 @@ Inspector::Protocol::ErrorStringOr<void> InspectorPageAgent::enable()
+@@ -144,12 +164,20 @@ Inspector::Protocol::ErrorStringOr<void> InspectorPageAgent::enable()
defaultUserPreferencesDidChange();
@@ -3770,7 +3765,7 @@ index 1f9af03c8e6b5cbaf8ddd95c1bcc6f70d305ddde..db268018b4a6d671365d5bf9faf701d6
std::ignore = setShowPaintRects(false);
#if !PLATFORM(IOS_FAMILY)
-@@ -216,6 +244,22 @@ Inspector::Protocol::ErrorStringOr<void> InspectorPageAgent::reload(std::optiona
+@@ -210,6 +238,22 @@ Inspector::Protocol::ErrorStringOr<void> InspectorPageAgent::reload(std::optiona
return { };
}
@@ -3793,8 +3788,8 @@ index 1f9af03c8e6b5cbaf8ddd95c1bcc6f70d305ddde..db268018b4a6d671365d5bf9faf701d6
Inspector::Protocol::ErrorStringOr<void> InspectorPageAgent::overrideUserAgent(const String& value)
{
m_userAgentOverride = value;
-@@ -236,6 +280,13 @@ void InspectorPageAgent::overrideSettingByModifyingValue(std::optional<bool>& sa
- }
+@@ -217,6 +261,13 @@ Inspector::Protocol::ErrorStringOr<void> InspectorPageAgent::overrideUserAgent(c
+ return { };
}
+Inspector::Protocol::ErrorStringOr<void> InspectorPageAgent::overridePlatform(const String& value)
@@ -3807,7 +3802,7 @@ index 1f9af03c8e6b5cbaf8ddd95c1bcc6f70d305ddde..db268018b4a6d671365d5bf9faf701d6
Inspector::Protocol::ErrorStringOr<void> InspectorPageAgent::overrideSetting(Inspector::Protocol::Page::Setting setting, std::optional<bool>&& value)
{
auto& inspectedPageSettings = m_inspectedPage->settings();
-@@ -249,6 +300,12 @@ Inspector::Protocol::ErrorStringOr<void> InspectorPageAgent::overrideSetting(Ins
+@@ -230,6 +281,12 @@ Inspector::Protocol::ErrorStringOr<void> InspectorPageAgent::overrideSetting(Ins
inspectedPageSettings.setAuthorAndUserStylesEnabledInspectorOverride(value);
return { };
@@ -3820,7 +3815,7 @@ index 1f9af03c8e6b5cbaf8ddd95c1bcc6f70d305ddde..db268018b4a6d671365d5bf9faf701d6
case Inspector::Protocol::Page::Setting::FixedBackgroundsPaintRelativeToDocument:
inspectedPageSettings.setFixedBackgroundsPaintRelativeToDocumentInspectorOverride(value);
return { };
-@@ -321,6 +378,12 @@ Inspector::Protocol::ErrorStringOr<void> InspectorPageAgent::overrideSetting(Ins
+@@ -296,6 +353,12 @@ Inspector::Protocol::ErrorStringOr<void> InspectorPageAgent::overrideSetting(Ins
inspectedPageSettings.setShowRepaintCounterInspectorOverride(value);
return { };
@@ -3833,7 +3828,7 @@ index 1f9af03c8e6b5cbaf8ddd95c1bcc6f70d305ddde..db268018b4a6d671365d5bf9faf701d6
case Inspector::Protocol::Page::Setting::WebSecurityEnabled:
inspectedPageSettings.setWebSecurityEnabledInspectorOverride(value);
return { };
-@@ -744,15 +807,16 @@ Inspector::Protocol::ErrorStringOr<void> InspectorPageAgent::setShowPaintRects(b
+@@ -728,15 +791,16 @@ Inspector::Protocol::ErrorStringOr<void> InspectorPageAgent::setShowPaintRects(b
return { };
}
@@ -3855,7 +3850,7 @@ index 1f9af03c8e6b5cbaf8ddd95c1bcc6f70d305ddde..db268018b4a6d671365d5bf9faf701d6
}
void InspectorPageAgent::frameNavigated(LocalFrame& frame)
-@@ -760,6 +824,22 @@ void InspectorPageAgent::frameNavigated(LocalFrame& frame)
+@@ -744,6 +808,22 @@ void InspectorPageAgent::frameNavigated(LocalFrame& frame)
m_frontendDispatcher->frameNavigated(buildObjectForFrame(&frame));
}
@@ -3878,7 +3873,7 @@ index 1f9af03c8e6b5cbaf8ddd95c1bcc6f70d305ddde..db268018b4a6d671365d5bf9faf701d6
void InspectorPageAgent::frameDetached(LocalFrame& frame)
{
auto identifier = m_inspectedPage->inspectorController().identifierRegistry().takeFrame(frame);
-@@ -832,6 +912,12 @@ void InspectorPageAgent::defaultUserPreferencesDidChange()
+@@ -816,6 +896,12 @@ void InspectorPageAgent::defaultUserPreferencesDidChange()
m_frontendDispatcher->defaultUserPreferencesDidChange(WTF::move(defaultUserPreferences));
}
@@ -3891,7 +3886,7 @@ index 1f9af03c8e6b5cbaf8ddd95c1bcc6f70d305ddde..db268018b4a6d671365d5bf9faf701d6
#if ENABLE(DARK_MODE_CSS)
void InspectorPageAgent::defaultAppearanceDidChange()
{
-@@ -845,6 +931,9 @@ void InspectorPageAgent::didClearWindowObjectInWorld(LocalFrame& frame, DOMWrapp
+@@ -829,6 +915,9 @@ void InspectorPageAgent::didClearWindowObjectInWorld(LocalFrame& frame, DOMWrapp
return;
if (m_bootstrapScript.isEmpty())
@@ -3901,7 +3896,7 @@ index 1f9af03c8e6b5cbaf8ddd95c1bcc6f70d305ddde..db268018b4a6d671365d5bf9faf701d6
return;
if (auto* pageRuntimeAgent = Ref { m_instrumentingAgents.get() }->enabledPageRuntimeAgent()) {
-@@ -897,6 +986,51 @@ void InspectorPageAgent::didRecalculateStyle()
+@@ -881,6 +970,51 @@ void InspectorPageAgent::didRecalculateStyle()
protect(overlay())->update();
}
@@ -3953,7 +3948,7 @@ index 1f9af03c8e6b5cbaf8ddd95c1bcc6f70d305ddde..db268018b4a6d671365d5bf9faf701d6
Ref<Inspector::Protocol::Page::Frame> InspectorPageAgent::buildObjectForFrame(LocalFrame* frame)
{
ASSERT_ARG(frame, frame);
-@@ -1007,6 +1141,12 @@ void InspectorPageAgent::applyUserAgentOverride(String& userAgent)
+@@ -991,6 +1125,12 @@ void InspectorPageAgent::applyUserAgentOverride(String& userAgent)
userAgent = m_userAgentOverride;
}
@@ -3966,7 +3961,7 @@ index 1f9af03c8e6b5cbaf8ddd95c1bcc6f70d305ddde..db268018b4a6d671365d5bf9faf701d6
void InspectorPageAgent::applyEmulatedMedia(AtomString& media)
{
if (!m_emulatedMedia.isEmpty())
-@@ -1022,7 +1162,7 @@ Inspector::Protocol::ErrorStringOr<String> InspectorPageAgent::snapshotNode(Insp
+@@ -1006,7 +1146,7 @@ Inspector::Protocol::ErrorStringOr<String> InspectorPageAgent::snapshotNode(Insp
RefPtr node = domAgent->assertNode(errorString, nodeId);
if (!node)
return makeUnexpected(errorString);
@@ -3975,7 +3970,7 @@ index 1f9af03c8e6b5cbaf8ddd95c1bcc6f70d305ddde..db268018b4a6d671365d5bf9faf701d6
RefPtr localMainFrame = m_inspectedPage->localMainFrame();
if (!localMainFrame)
return makeUnexpected("Main frame isn't local"_s);
-@@ -1033,11 +1173,16 @@ Inspector::Protocol::ErrorStringOr<String> InspectorPageAgent::snapshotNode(Insp
+@@ -1017,11 +1157,16 @@ Inspector::Protocol::ErrorStringOr<String> InspectorPageAgent::snapshotNode(Insp
return encodeDataURL(WTF::move(snapshot), "image/png"_s);
}
@@ -3993,7 +3988,7 @@ index 1f9af03c8e6b5cbaf8ddd95c1bcc6f70d305ddde..db268018b4a6d671365d5bf9faf701d6
IntRect rectangle(x, y, width, height);
RefPtr localMainFrame = m_inspectedPage->localMainFrame();
-@@ -1047,9 +1192,67 @@ Inspector::Protocol::ErrorStringOr<String> InspectorPageAgent::snapshotRect(int
+@@ -1031,9 +1176,67 @@ Inspector::Protocol::ErrorStringOr<String> InspectorPageAgent::snapshotRect(int
if (!snapshot)
return makeUnexpected("Could not capture snapshot"_s);
@@ -4062,7 +4057,7 @@ index 1f9af03c8e6b5cbaf8ddd95c1bcc6f70d305ddde..db268018b4a6d671365d5bf9faf701d6
#if ENABLE(WEB_ARCHIVE) && USE(CF)
Inspector::Protocol::ErrorStringOr<String> InspectorPageAgent::archive()
{
-@@ -1066,7 +1269,6 @@ Inspector::Protocol::ErrorStringOr<String> InspectorPageAgent::archive()
+@@ -1050,7 +1253,6 @@ Inspector::Protocol::ErrorStringOr<String> InspectorPageAgent::archive()
}
#endif
@@ -4070,7 +4065,7 @@ index 1f9af03c8e6b5cbaf8ddd95c1bcc6f70d305ddde..db268018b4a6d671365d5bf9faf701d6
Inspector::Protocol::ErrorStringOr<void> InspectorPageAgent::setScreenSizeOverride(std::optional<int>&& width, std::optional<int>&& height)
{
if (width.has_value() != height.has_value())
-@@ -1084,6 +1286,86 @@ Inspector::Protocol::ErrorStringOr<void> InspectorPageAgent::setScreenSizeOverri
+@@ -1068,6 +1270,86 @@ Inspector::Protocol::ErrorStringOr<void> InspectorPageAgent::setScreenSizeOverri
localMainFrame->setOverrideScreenSize(FloatSize(width.value_or(0), height.value_or(0)));
return { };
}
@@ -4159,7 +4154,7 @@ index 1f9af03c8e6b5cbaf8ddd95c1bcc6f70d305ddde..db268018b4a6d671365d5bf9faf701d6
} // namespace WebCore
diff --git a/Source/WebCore/inspector/agents/InspectorPageAgent.h b/Source/WebCore/inspector/agents/InspectorPageAgent.h
-index 61b8642bfa281e8c2eff276ef8a28571a689625e..fdcc34eb08456b03dfe816ea77563c672186ceac 100644
+index 4e55d0ac71a9af2066dc0384b788e54c5b105e0c..f0a825e8f574a1e310a0e5fe616fce68999906f0 100644
--- a/Source/WebCore/inspector/agents/InspectorPageAgent.h
+++ b/Source/WebCore/inspector/agents/InspectorPageAgent.h
@@ -43,10 +43,12 @@
@@ -4183,7 +4178,7 @@ index 61b8642bfa281e8c2eff276ef8a28571a689625e..fdcc34eb08456b03dfe816ea77563c67
class InspectorOverlay;
class LocalFrame;
class Page;
-@@ -70,6 +73,9 @@ public:
+@@ -69,6 +72,9 @@ public:
InspectorPageAgent(PageAgentContext&, InspectorBackendClient*, InspectorOverlay&);
~InspectorPageAgent();
@@ -4193,7 +4188,7 @@ index 61b8642bfa281e8c2eff276ef8a28571a689625e..fdcc34eb08456b03dfe816ea77563c67
// InspectorAgentBase
void didCreateFrontendAndBackend();
void willDestroyFrontendAndBackend(Inspector::DisconnectReason);
-@@ -78,7 +84,10 @@ public:
+@@ -77,7 +83,10 @@ public:
Inspector::Protocol::ErrorStringOr<void> enable();
Inspector::Protocol::ErrorStringOr<void> disable();
Inspector::Protocol::ErrorStringOr<void> reload(std::optional<bool>&& ignoreCache, std::optional<bool>&& revalidateAllResources);
@@ -4204,7 +4199,7 @@ index 61b8642bfa281e8c2eff276ef8a28571a689625e..fdcc34eb08456b03dfe816ea77563c67
Inspector::Protocol::ErrorStringOr<void> overrideSetting(Inspector::Protocol::Page::Setting, std::optional<bool>&& value);
Inspector::Protocol::ErrorStringOr<void> overrideUserPreference(Inspector::Protocol::Page::UserPreferenceName, std::optional<Inspector::Protocol::Page::UserPreferenceValue>&&);
Inspector::Protocol::ErrorStringOr<Ref<JSON::ArrayOf<Inspector::Protocol::Page::Cookie>>> getCookies();
-@@ -94,41 +103,60 @@ public:
+@@ -93,41 +102,60 @@ public:
#endif
Inspector::Protocol::ErrorStringOr<void> setShowPaintRects(bool);
Inspector::Protocol::ErrorStringOr<void> setEmulatedMedia(const String&);
@@ -4270,7 +4265,7 @@ index 61b8642bfa281e8c2eff276ef8a28571a689625e..fdcc34eb08456b03dfe816ea77563c67
InspectorOverlay& NODELETE overlay() const;
-@@ -145,10 +173,12 @@ private:
+@@ -142,14 +170,20 @@ private:
const Ref<Inspector::PageBackendDispatcher> m_backendDispatcher;
WeakRef<Page> m_inspectedPage;
@@ -4283,10 +4278,7 @@ index 61b8642bfa281e8c2eff276ef8a28571a689625e..fdcc34eb08456b03dfe816ea77563c67
AtomString m_emulatedMedia;
String m_bootstrapScript;
bool m_isFirstLayoutAfterOnLoad { false };
-@@ -158,6 +188,10 @@ private:
- std::optional<bool> m_notificationsEnabledBeforeOverride;
- std::optional<bool> m_pointerLockEnabledBeforeOverride;
- std::optional<bool> m_pushAPIEnabledBeforeOverride;
+ bool m_showPaintRects { false };
+
+ bool m_interceptFileChooserDialog { false };
+ bool m_bypassCSP { false };
@@ -4578,10 +4570,10 @@ index bf342183297cc32124acad4e05b15f70f4647840..03cab23eeb3f831514c0c5ff2b87ec25
} // namespace WebCore
diff --git a/Source/WebCore/loader/CookieJar.h b/Source/WebCore/loader/CookieJar.h
-index c2f9d5d90ff590154ef39132453194c162be0cc5..ff36e34f9e5963f1deaa41341174a7fd312ae25f 100644
+index 3cb70eeb1f2334cdb7a9be8c3a3869ce835d13e6..003210b498de38fc81a058bb12e15c8384045f2f 100644
--- a/Source/WebCore/loader/CookieJar.h
+++ b/Source/WebCore/loader/CookieJar.h
-@@ -48,6 +48,7 @@ class NetworkStorageSession;
+@@ -49,6 +49,7 @@ class NetworkStorageSession;
class StorageSessionProvider;
struct SameSiteInfo;
enum class ShouldPartitionCookie : bool;
@@ -4589,7 +4581,7 @@ index c2f9d5d90ff590154ef39132453194c162be0cc5..ff36e34f9e5963f1deaa41341174a7fd
class WEBCORE_EXPORT CookieJar : public RefCountedAndCanMakeWeakPtr<CookieJar> {
public:
-@@ -82,6 +83,9 @@ public:
+@@ -85,6 +86,9 @@ public:
virtual void clearCache() { }
virtual void clearCacheForHost(const String&) { }
@@ -4600,7 +4592,7 @@ index c2f9d5d90ff590154ef39132453194c162be0cc5..ff36e34f9e5963f1deaa41341174a7fd
protected:
static SameSiteInfo sameSiteInfo(const Document&, IsForDOMCookieAccess = IsForDOMCookieAccess::No);
diff --git a/Source/WebCore/loader/DocumentLoader.cpp b/Source/WebCore/loader/DocumentLoader.cpp
-index 41badde9eb6da258e02d68b710faf1bb437b8e5d..df3de6c52bbe0d870a2d3e5cab37b57bb2874ef7 100644
+index 402fb189b440ba0d031dd301075645994f785c73..168424028177dce79abdf78fcbb5a8b98569aaba 100644
--- a/Source/WebCore/loader/DocumentLoader.cpp
+++ b/Source/WebCore/loader/DocumentLoader.cpp
@@ -784,8 +784,10 @@ void DocumentLoader::willSendRequest(ResourceRequest&& newRequest, const Resourc
@@ -4614,7 +4606,7 @@ index 41badde9eb6da258e02d68b710faf1bb437b8e5d..df3de6c52bbe0d870a2d3e5cab37b57b
switch (navigationPolicyDecision) {
case NavigationPolicyDecision::IgnoreLoad:
case NavigationPolicyDecision::LoadWillContinueInAnotherProcess:
-@@ -1599,11 +1601,17 @@ void DocumentLoader::detachFromFrame(LoadWillContinueInAnotherProcess loadWillCo
+@@ -1580,11 +1582,17 @@ void DocumentLoader::detachFromFrame(LoadWillContinueInAnotherProcess loadWillCo
if (auto navigationID = std::exchange(m_navigationID, { }))
frame->loader().client().documentLoaderDetached(*navigationID, loadWillContinueInAnotherProcess);
@@ -4635,10 +4627,10 @@ index 41badde9eb6da258e02d68b710faf1bb437b8e5d..df3de6c52bbe0d870a2d3e5cab37b57b
{
m_navigationID = navigationID;
diff --git a/Source/WebCore/loader/DocumentLoader.h b/Source/WebCore/loader/DocumentLoader.h
-index cab81d56267ee64dcc52d3c01f85b9688c36beb4..994364140be2e668a035aaf6fc303b427f4d932f 100644
+index cae4942a1d29d327711d7090f971fc6916996694..3acbbaf125788666919aa446da6d9460e20275af 100644
--- a/Source/WebCore/loader/DocumentLoader.h
+++ b/Source/WebCore/loader/DocumentLoader.h
-@@ -210,6 +210,8 @@ public:
+@@ -181,6 +181,8 @@ public:
WEBCORE_EXPORT virtual void detachFromFrame(LoadWillContinueInAnotherProcess);
@@ -4648,10 +4640,10 @@ index cab81d56267ee64dcc52d3c01f85b9688c36beb4..994364140be2e668a035aaf6fc303b42
WEBCORE_EXPORT SubresourceLoader* NODELETE mainResourceLoader() const;
WEBCORE_EXPORT RefPtr<FragmentedSharedBuffer> mainResourceData() const;
diff --git a/Source/WebCore/loader/FrameLoader.cpp b/Source/WebCore/loader/FrameLoader.cpp
-index a31d6a5c190128118d53a53278813456fc1ce072..521530c5986b61c013fdd0cf38352454dc8c5fa2 100644
+index 53df415bd33121e6fb697e5824baf8ddbdc356c8..908b53a9895830b45da25ec51dd18f6e8d35c1e7 100644
--- a/Source/WebCore/loader/FrameLoader.cpp
+++ b/Source/WebCore/loader/FrameLoader.cpp
-@@ -1424,6 +1424,7 @@ void FrameLoader::loadInSameDocument(URL url, RefPtr<SerializedScriptValue> stat
+@@ -1427,6 +1427,7 @@ void FrameLoader::loadInSameDocument(URL url, RefPtr<SerializedScriptValue> stat
}
m_client->dispatchDidNavigateWithinPage();
@@ -4659,7 +4651,7 @@ index a31d6a5c190128118d53a53278813456fc1ce072..521530c5986b61c013fdd0cf38352454
document->statePopped(stateObject ? stateObject.releaseNonNull() : SerializedScriptValue::nullValue());
m_client->dispatchDidPopStateWithinPage();
-@@ -1982,6 +1983,7 @@ void FrameLoader::loadWithDocumentLoader(DocumentLoader* loader, FrameLoadType t
+@@ -1986,6 +1987,7 @@ void FrameLoader::loadWithDocumentLoader(DocumentLoader* loader, FrameLoadType t
const String& httpMethod = loader->request().httpMethod();
if (shouldPerformFragmentNavigation(isFormSubmission, httpMethod, policyChecker().loadType(), newURL) && !loader->substituteData().isValid()) {
@@ -4667,17 +4659,23 @@ index a31d6a5c190128118d53a53278813456fc1ce072..521530c5986b61c013fdd0cf38352454
RefPtr oldDocumentLoader = m_documentLoader;
NavigationAction action { protect(frame->document()).releaseNonNull(), loader->request(), InitiatedByMainFrame::Unknown, loader->isRequestFromClientOrUserInput(), policyChecker().loadType(), isFormSubmission };
-@@ -2023,7 +2025,9 @@ void FrameLoader::loadWithDocumentLoader(DocumentLoader* loader, FrameLoadType t
+@@ -2027,6 +2029,7 @@ void FrameLoader::loadWithDocumentLoader(DocumentLoader* loader, FrameLoadType t
auto policyDecisionMode = loader->triggeringAction().isFromNavigationAPI() ? PolicyDecisionMode::Synchronous : PolicyDecisionMode::Asynchronous;
RELEASE_ASSERT(!isBackForwardLoadType(policyChecker().loadType()) || history().provisionalItem());
+ InspectorInstrumentation::willCheckNavigationPolicy(m_frame);
- policyChecker().checkNavigationPolicy(ResourceRequest(loader->request()), ResourceResponse { } /* redirectResponse */, loader, WTF::move(formSubmission), [this, protectedThis = Ref { *this }, allowNavigationToInvalidURL, shouldRestoreFromBackForwardCache, completionHandler = completionHandlerCaller.release()] (const ResourceRequest& request, WeakPtr<const FormSubmission>&& weakFormSubmission, NavigationPolicyDecision navigationPolicyDecision) mutable {
+ policyChecker().checkNavigationPolicy(ResourceRequest(loader->request()), ResourceResponse { } /* redirectResponse */, loader, WTF::move(formSubmission), [
+ this,
+ protectedThis = Ref { *this },
+@@ -2035,6 +2038,7 @@ void FrameLoader::loadWithDocumentLoader(DocumentLoader* loader, FrameLoadType t
+ expectedPolicyDocumentLoader = RefPtr { loader },
+ completionHandler = completionHandlerCaller.release()
+ ] (const ResourceRequest& request, WeakPtr<const FormSubmission>&& weakFormSubmission, NavigationPolicyDecision navigationPolicyDecision) mutable {
+ InspectorInstrumentation::didCheckNavigationPolicy(m_frame, navigationPolicyDecision != NavigationPolicyDecision::ContinueLoad);
- continueLoadAfterNavigationPolicy(request, RefPtr { weakFormSubmission.get() }.get(), navigationPolicyDecision, allowNavigationToInvalidURL, shouldRestoreFromBackForwardCache);
- completionHandler();
- }, IsSameDocumentNavigation::No, policyDecisionMode, determineNavigationType(type, NavigationHistoryBehavior::Auto));
-@@ -3399,10 +3403,15 @@ String FrameLoader::userAgent(const URL& url) const
+ // A download attribute check is not cancelled by the navigation that follows it, so it can be
+ // answered once a newer navigation owns m_policyDocumentLoader. Continuing would tear that
+ // newer navigation down; the download, if any, has already started.
+@@ -3408,10 +3412,15 @@ String FrameLoader::userAgent(const URL& url) const
String FrameLoader::navigatorPlatform() const
{
@@ -4695,7 +4693,7 @@ index a31d6a5c190128118d53a53278813456fc1ce072..521530c5986b61c013fdd0cf38352454
}
void FrameLoader::dispatchOnloadEvents()
-@@ -3861,6 +3870,8 @@ void FrameLoader::receivedMainResourceError(const ResourceError& error, LoadWill
+@@ -3885,6 +3894,8 @@ void FrameLoader::receivedMainResourceError(const ResourceError& error, LoadWill
}
if (frame->page())
checkLoadComplete(loadWillContinueInAnotherProcess);
@@ -4704,7 +4702,7 @@ index a31d6a5c190128118d53a53278813456fc1ce072..521530c5986b61c013fdd0cf38352454
}
void FrameLoader::continueFragmentScrollAfterNavigationPolicy(const ResourceRequest& request, const SecurityOrigin* requesterOrigin, bool shouldContinue, NavigationHistoryBehavior historyHandling)
-@@ -4890,9 +4901,6 @@ String FrameLoader::referrer() const
+@@ -4933,9 +4944,6 @@ String FrameLoader::referrer() const
void FrameLoader::dispatchDidClearWindowObjectsInAllWorlds()
{
@@ -4714,7 +4712,7 @@ index a31d6a5c190128118d53a53278813456fc1ce072..521530c5986b61c013fdd0cf38352454
Vector<Ref<DOMWrapperWorld>> worlds;
ScriptController::getAllWorlds(worlds);
for (auto& world : worlds)
-@@ -4902,13 +4910,12 @@ void FrameLoader::dispatchDidClearWindowObjectsInAllWorlds()
+@@ -4945,13 +4953,12 @@ void FrameLoader::dispatchDidClearWindowObjectsInAllWorlds()
void FrameLoader::dispatchDidClearWindowObjectInWorld(DOMWrapperWorld& world)
{
Ref frame = m_frame.get();
@@ -4769,10 +4767,10 @@ index 3acb026789c46395be3f8cd6b837ebf207e215f7..a4e3c1e69fbbb108badd23f32e879423
}
diff --git a/Source/WebCore/loader/cache/CachedResourceLoader.cpp b/Source/WebCore/loader/cache/CachedResourceLoader.cpp
-index 468e3e21901869f2329f7817be6544bf363402f1..eab156b13b22ae63d4d29352797120a14a5255ef 100644
+index 6a6dfd23a149416adccf33f0bd0758cce61709ff..d96da7726d9f6dc075c0d2c388a5754e3a662b7b 100644
--- a/Source/WebCore/loader/cache/CachedResourceLoader.cpp
+++ b/Source/WebCore/loader/cache/CachedResourceLoader.cpp
-@@ -1177,8 +1177,11 @@ ResourceErrorOr<Ref<CachedResource>> CachedResourceLoader::requestResource(Cache
+@@ -1197,8 +1197,11 @@ ResourceErrorOr<Ref<CachedResource>> CachedResourceLoader::requestResource(Cache
request.updateReferrerPolicy(document ? document->referrerPolicy() : ReferrerPolicy::Default);
@@ -4786,7 +4784,7 @@ index 468e3e21901869f2329f7817be6544bf363402f1..eab156b13b22ae63d4d29352797120a1
if (RefPtr documentLoader = m_documentLoader) {
bool madeHTTPS { request.resourceRequest().wasSchemeOptimisticallyUpgraded() };
-@@ -1837,8 +1840,9 @@ Vector<Ref<SVGImage>> CachedResourceLoader::allCachedSVGImages() const
+@@ -1854,8 +1857,9 @@ Vector<Ref<SVGImage>> CachedResourceLoader::allCachedSVGImages() const
ResourceErrorOr<Ref<CachedResource>> CachedResourceLoader::preload(CachedResource::Type type, CachedResourceRequest&& request)
{
@@ -4799,10 +4797,10 @@ index 468e3e21901869f2329f7817be6544bf363402f1..eab156b13b22ae63d4d29352797120a1
RefPtr document = m_document;
ASSERT(document);
diff --git a/Source/WebCore/page/ChromeClient.h b/Source/WebCore/page/ChromeClient.h
-index 8bd12ba1ab6a74fed98b2cbb26b98703eb2f23c7..dfa8975427020e0a88ab54068b2934f35c8b5976 100644
+index e9e22bae0eab669639168e9ee095f58f6f7f0056..76c5435dddcf97a0b7fc5352f779bbdf30815921 100644
--- a/Source/WebCore/page/ChromeClient.h
+++ b/Source/WebCore/page/ChromeClient.h
-@@ -406,7 +406,7 @@ public:
+@@ -408,7 +408,7 @@ public:
#endif
#if ENABLE(ORIENTATION_EVENTS)
@@ -4812,10 +4810,10 @@ index 8bd12ba1ab6a74fed98b2cbb26b98703eb2f23c7..dfa8975427020e0a88ab54068b2934f3
virtual RefPtr<ColorChooser> createColorChooser(ColorChooserClient&, const Color&) = 0;
diff --git a/Source/WebCore/page/EventHandler.cpp b/Source/WebCore/page/EventHandler.cpp
-index bc433bf1b86799119d8b9c0bd27f57e71d74de5f..c6899c71012f0bb7756d0ed98be30cc2fea89c12 100644
+index 1bdedbdc6f990206c4826645e80d777311ebb300..ccc9b3c30696ac7657b9666e64cac36625de8529 100644
--- a/Source/WebCore/page/EventHandler.cpp
+++ b/Source/WebCore/page/EventHandler.cpp
-@@ -4839,6 +4839,12 @@ bool EventHandler::handleDrag(const MouseEventWithHitTestResults& event, CheckDr
+@@ -4846,6 +4846,12 @@ bool EventHandler::handleDrag(const MouseEventWithHitTestResults& event, CheckDr
if (!document)
return false;
@@ -4828,7 +4826,7 @@ index bc433bf1b86799119d8b9c0bd27f57e71d74de5f..c6899c71012f0bb7756d0ed98be30cc2
dragState().dataTransfer = DataTransfer::createForDrag(*document);
auto hasNonDefaultPasteboardData = HasNonDefaultPasteboardData::No;
-@@ -5442,6 +5448,7 @@ static HitTestResult hitTestResultInFrame(LocalFrame* frame, const LayoutPoint&
+@@ -5449,6 +5455,7 @@ static HitTestResult hitTestResultInFrame(LocalFrame* frame, const LayoutPoint&
return result;
}
@@ -4836,7 +4834,7 @@ index bc433bf1b86799119d8b9c0bd27f57e71d74de5f..c6899c71012f0bb7756d0ed98be30cc2
Expected<bool, RemoteFrameGeometryTransformer> EventHandler::handleTouchEvent(const PlatformTouchEvent& event)
{
Ref frame = m_frame.get();
-@@ -5573,7 +5580,7 @@ Expected<bool, RemoteFrameGeometryTransformer> EventHandler::handleTouchEvent(co
+@@ -5580,7 +5587,7 @@ Expected<bool, RemoteFrameGeometryTransformer> EventHandler::handleTouchEvent(co
if (!targetFrame)
continue;
@@ -4845,7 +4843,7 @@ index bc433bf1b86799119d8b9c0bd27f57e71d74de5f..c6899c71012f0bb7756d0ed98be30cc2
RefPtr<EventTarget> pointerTarget = touchTarget;
if (pointState != PlatformTouchPoint::TouchPressed) {
-@@ -5669,6 +5676,7 @@ Expected<bool, RemoteFrameGeometryTransformer> EventHandler::handleTouchEvent(co
+@@ -5676,6 +5683,7 @@ Expected<bool, RemoteFrameGeometryTransformer> EventHandler::handleTouchEvent(co
return swallowedEvent;
}
@@ -4854,10 +4852,10 @@ index bc433bf1b86799119d8b9c0bd27f57e71d74de5f..c6899c71012f0bb7756d0ed98be30cc2
#if ENABLE(TOUCH_EVENTS)
diff --git a/Source/WebCore/page/FocusController.cpp b/Source/WebCore/page/FocusController.cpp
-index a6b68958cf92e510c32a5f8f5109bd043c8d39cd..62785de429c7025a7c022d991eaf82cdd5942911 100644
+index 4620d693278f5d7ba2f9a7d26002599fe9860d7f..3dbf01b9faf852640c04a19959be76db54e9c840 100644
--- a/Source/WebCore/page/FocusController.cpp
+++ b/Source/WebCore/page/FocusController.cpp
-@@ -705,13 +705,14 @@ bool FocusController::relinquishFocusToChrome(FocusDirection direction)
+@@ -708,13 +708,14 @@ bool FocusController::relinquishFocusToChrome(FocusDirection direction)
return false;
Ref page = m_page.get();
@@ -4875,10 +4873,10 @@ index a6b68958cf92e510c32a5f8f5109bd043c8d39cd..62785de429c7025a7c022d991eaf82cd
}
diff --git a/Source/WebCore/page/FrameConsoleClient.cpp b/Source/WebCore/page/FrameConsoleClient.cpp
-index bc7d6367981561914f4e0acbd2f9efabce6eb42f..4802a6d571a9f5d2fa032dbb5b61abce46d0209c 100644
+index 7907ddf8b8de35d34e67f15d7a1d56c8ed01dc6c..a28a474ba3e7ffe2f56116ef91a0d3dab38e0e69 100644
--- a/Source/WebCore/page/FrameConsoleClient.cpp
+++ b/Source/WebCore/page/FrameConsoleClient.cpp
-@@ -476,4 +476,12 @@ void FrameConsoleClient::screenshot(JSC::JSGlobalObject* lexicalGlobalObject, Re
+@@ -483,4 +483,12 @@ void FrameConsoleClient::screenshot(JSC::JSGlobalObject* lexicalGlobalObject, Re
addMessage(makeUnique<Inspector::ConsoleMessage>(MessageSource::ConsoleAPI, MessageType::Image, MessageLevel::Log, dataURL, ScriptArguments::create(lexicalGlobalObject, WTF::move(adjustedArguments)), lexicalGlobalObject, /* requestIdentifier */ 0, timestamp));
}
@@ -4989,7 +4987,7 @@ index 4e43a48341c52ac028f48dfdf8620fa75f9eb0d1..bb23998151b69451ff749e0c39c739bc
}
diff --git a/Source/WebCore/page/LocalFrame.cpp b/Source/WebCore/page/LocalFrame.cpp
-index aec99afaf767a4346d2929133c202b78b71d2e8c..10f1d3496234e40cb46a584d1db0266d9e564f0e 100644
+index 1ca8cd54d2b6e3136a57e1c7193aee3486d29638..66c12176b505fc098e74bf5f934f1db60daa1a04 100644
--- a/Source/WebCore/page/LocalFrame.cpp
+++ b/Source/WebCore/page/LocalFrame.cpp
@@ -93,6 +93,7 @@
@@ -5017,7 +5015,7 @@ index aec99afaf767a4346d2929133c202b78b71d2e8c..10f1d3496234e40cb46a584d1db0266d
return 0;
}
#endif // ENABLE(ORIENTATION_EVENTS)
-@@ -1683,7 +1685,6 @@ String LocalFrame::frameURLProtocol() const
+@@ -1690,7 +1692,6 @@ String LocalFrame::frameURLProtocol() const
return ""_s;
}
@@ -5025,16 +5023,17 @@ index aec99afaf767a4346d2929133c202b78b71d2e8c..10f1d3496234e40cb46a584d1db0266d
static bool nodeIsMouseFocusable(Node& node)
{
-@@ -1933,7 +1934,6 @@ RefPtr<Node> LocalFrame::nodeRespondingToDoubleClickEvent(const FloatPoint& view
- return qualifyingNodeAtViewportLocation(viewportLocation, adjustedViewportLocation, WTF::move(ancestorRespondingToDoubleClickEvent), ShouldApproximate::Yes);
+@@ -1949,8 +1950,6 @@ RefPtr<LocalDOMWindow> LocalFrame::windowWithDoubleClickEventListener() const
+ return window;
}
-#endif // PLATFORM(COCOA)
-
+-
} // namespace WebCore
+ #undef FRAME_RELEASE_LOG_ERROR
diff --git a/Source/WebCore/page/LocalFrame.h b/Source/WebCore/page/LocalFrame.h
-index 04ba5a1ede9495bad18c532676b2121c09c407d9..614217e465ff12a26f35b69f3f82e8b6d0ce06b4 100644
+index afe6998f4744ab9718c7e8e4523f94d347dfafff..ca4183795c9ff376a30569277a407975fec052d3 100644
--- a/Source/WebCore/page/LocalFrame.h
+++ b/Source/WebCore/page/LocalFrame.h
@@ -29,6 +29,7 @@
@@ -5063,15 +5062,15 @@ index 04ba5a1ede9495bad18c532676b2121c09c407d9..614217e465ff12a26f35b69f3f82e8b6
RefPtr<Node> betterApproximateNode(const IntPoint& testPoint, const NodeQualifier&, Node* best, Node* failedNode, IntPoint& bestPoint, IntRect& bestRect, const IntRect& testRect);
WEBCORE_EXPORT RefPtr<Node> nodeRespondingToInteraction(const FloatPoint& viewportLocation, FloatPoint& adjustedViewportLocation);
-@@ -244,7 +242,6 @@ public:
- WEBCORE_EXPORT RefPtr<Node> nodeRespondingToDoubleClickEvent(const FloatPoint& viewportLocation, FloatPoint& adjustedViewportLocation);
-
+@@ -246,7 +244,6 @@ public:
static bool nodeWillRespondToMouseEvents(Node&);
+
+ WEBCORE_EXPORT RefPtr<LocalDOMWindow> windowWithDoubleClickEventListener() const;
-#endif // PLATFORM(COCOA)
#if PLATFORM(IOS_FAMILY)
const ViewportArguments& viewportArguments() const LIFETIME_BOUND;
-@@ -322,6 +319,7 @@ public:
+@@ -324,6 +321,7 @@ public:
WEBCORE_EXPORT FloatSize screenSize() const;
void setOverrideScreenSize(FloatSize&&);
@@ -5080,7 +5079,7 @@ index 04ba5a1ede9495bad18c532676b2121c09c407d9..614217e465ff12a26f35b69f3f82e8b6
void NODELETE selfOnlyRef();
void selfOnlyDeref();
diff --git a/Source/WebCore/page/Navigation.cpp b/Source/WebCore/page/Navigation.cpp
-index 7f2902f5c6c462780638e8e70c885af71eea0e51..181ed5b30713e868a32c3c721edad72ce05c0507 100644
+index 04acec56a84bf665c0214c4b73d673f33ce69cf0..5dd83b1a55be9255a95f3cb1432cefe3984a1390 100644
--- a/Source/WebCore/page/Navigation.cpp
+++ b/Source/WebCore/page/Navigation.cpp
@@ -47,6 +47,7 @@
@@ -5091,7 +5090,7 @@ index 7f2902f5c6c462780638e8e70c885af71eea0e51..181ed5b30713e868a32c3c721edad72c
#include "JSDOMConvertAny.h"
#include "JSDOMConvertInterface.h"
#include "JSDOMGlobalObject.h"
-@@ -1195,6 +1196,8 @@ void Navigation::setupInterceptionState(NavigateEvent& event, NavigationNavigati
+@@ -1229,6 +1230,8 @@ void Navigation::setupInterceptionState(NavigateEvent& event, NavigationNavigati
// Only notify committed now if there are no handlers to wait for
auto shouldNotifyCommited = event.handlers().isEmpty() ? ShouldNotifyCommitted::Yes : ShouldNotifyCommitted::No;
updateForNavigation(entry->associatedHistoryItem(), navigationType, ShouldCopyStateObjectFromCurrentEntry::No, shouldNotifyCommited);
@@ -5100,20 +5099,20 @@ index 7f2902f5c6c462780638e8e70c885af71eea0e51..181ed5b30713e868a32c3c721edad72c
}
}
} else if (navigationType == NavigationNavigationType::Reload) {
-@@ -1203,6 +1206,8 @@ void Navigation::setupInterceptionState(NavigateEvent& event, NavigationNavigati
+@@ -1237,6 +1240,8 @@ void Navigation::setupInterceptionState(NavigateEvent& event, NavigationNavigati
} else if (navigationType == NavigationNavigationType::Push || navigationType == NavigationNavigationType::Replace) {
auto historyHandling = navigationType == NavigationNavigationType::Replace ? NavigationHistoryBehavior::Replace : NavigationHistoryBehavior::Push;
frame()->loader().updateURLAndHistory(destination.url(), classicHistoryAPIState, historyHandling);
+
+ InspectorInstrumentation::didNavigateWithinPage(*frame());
}
- }
+ if (RefPtr transition = m_transition)
diff --git a/Source/WebCore/page/Page.cpp b/Source/WebCore/page/Page.cpp
-index 0d836d72a7a6aff23e492c8949ca74e28590161e..9c6bab0e0d5e0a0df35b05409632b1f6d5800a05 100644
+index db8155c36c3b0af7e0fc8daa5b672ea5ddd2f342..c54015cd152da85ccf8c03609d160429517d7769 100644
--- a/Source/WebCore/page/Page.cpp
+++ b/Source/WebCore/page/Page.cpp
-@@ -699,6 +699,44 @@ void Page::setOverrideViewportArguments(const std::optional<ViewportArguments>&
+@@ -704,6 +704,44 @@ void Page::setOverrideViewportArguments(const std::optional<ViewportArguments>&
localTopDocument->updateViewportArguments();
}
@@ -5158,7 +5157,7 @@ index 0d836d72a7a6aff23e492c8949ca74e28590161e..9c6bab0e0d5e0a0df35b05409632b1f6
ScrollingCoordinator* Page::scrollingCoordinator()
{
if (!m_scrollingCoordinator && m_settings->scrollingCoordinatorEnabled()) {
-@@ -4403,6 +4441,26 @@ void Page::setUseDarkAppearanceOverride(std::optional<bool> valueOverride)
+@@ -4495,6 +4533,26 @@ void Page::setUseDarkAppearanceOverride(std::optional<bool> valueOverride)
appearanceDidChange();
}
@@ -5186,10 +5185,10 @@ index 0d836d72a7a6aff23e492c8949ca74e28590161e..9c6bab0e0d5e0a0df35b05409632b1f6
{
if (insets == m_fullscreenInsets)
diff --git a/Source/WebCore/page/Page.h b/Source/WebCore/page/Page.h
-index b89dc96b0a6cc8ea7558bbd6a3ff1c1745df1134..f20e292c6ee83df54db0a92d7566fd68c0e8265e 100644
+index a870b84132ea2e111b29ef5b9ea6283b5d4bac96..8137169322428d5c2033abbef43f22cac8664dcd 100644
--- a/Source/WebCore/page/Page.h
+++ b/Source/WebCore/page/Page.h
-@@ -410,6 +410,9 @@ public:
+@@ -415,6 +415,9 @@ public:
const ViewportArguments* overrideViewportArguments() const LIFETIME_BOUND { return m_overrideViewportArguments.get(); }
WEBCORE_EXPORT void setOverrideViewportArguments(const std::optional<ViewportArguments>&);
@@ -5199,7 +5198,7 @@ index b89dc96b0a6cc8ea7558bbd6a3ff1c1745df1134..f20e292c6ee83df54db0a92d7566fd68
static void refreshPlugins(bool reload);
WEBCORE_EXPORT PluginData& pluginData();
void clearPluginData();
-@@ -496,6 +499,10 @@ public:
+@@ -509,6 +512,10 @@ public:
#if ENABLE(DRAG_SUPPORT)
DragController& dragController() LIFETIME_BOUND { return m_dragController.get(); }
const DragController& dragController() const LIFETIME_BOUND { return m_dragController.get(); }
@@ -5210,7 +5209,7 @@ index b89dc96b0a6cc8ea7558bbd6a3ff1c1745df1134..f20e292c6ee83df54db0a92d7566fd68
#endif
FocusController& focusController() const { return m_focusController; }
#if ENABLE(CONTEXT_MENUS)
-@@ -689,6 +696,10 @@ public:
+@@ -706,6 +713,10 @@ public:
WEBCORE_EXPORT void setUseColorAppearance(bool useDarkAppearance, bool useElevatedUserInterfaceLevel);
bool defaultUseDarkAppearance() const { return m_useDarkAppearance; }
void setUseDarkAppearanceOverride(std::optional<bool>);
@@ -5221,7 +5220,7 @@ index b89dc96b0a6cc8ea7558bbd6a3ff1c1745df1134..f20e292c6ee83df54db0a92d7566fd68
#if ENABLE(TEXT_AUTOSIZING)
float textAutosizingWidth() const { return m_textAutosizingWidth; }
-@@ -1150,6 +1161,11 @@ public:
+@@ -1173,6 +1184,11 @@ public:
WEBCORE_EXPORT void setInteractionRegionsEnabled(bool);
#endif
@@ -5233,7 +5232,7 @@ index b89dc96b0a6cc8ea7558bbd6a3ff1c1745df1134..f20e292c6ee83df54db0a92d7566fd68
#if ENABLE(DEVICE_ORIENTATION) && PLATFORM(IOS_FAMILY)
DeviceOrientationUpdateProvider* deviceOrientationUpdateProvider() const { return m_deviceOrientationUpdateProvider.get(); }
#endif
-@@ -1490,6 +1506,9 @@ private:
+@@ -1515,6 +1531,9 @@ private:
#if ENABLE(DRAG_SUPPORT)
const UniqueRef<DragController> m_dragController;
@@ -5243,7 +5242,7 @@ index b89dc96b0a6cc8ea7558bbd6a3ff1c1745df1134..f20e292c6ee83df54db0a92d7566fd68
#endif
const UniqueRef<FocusController> m_focusController;
#if ENABLE(CONTEXT_MENUS)
-@@ -1567,6 +1586,8 @@ private:
+@@ -1592,6 +1611,8 @@ private:
bool m_useElevatedUserInterfaceLevel { false };
bool m_useDarkAppearance { false };
std::optional<bool> m_useDarkAppearanceOverride;
@@ -5252,7 +5251,7 @@ index b89dc96b0a6cc8ea7558bbd6a3ff1c1745df1134..f20e292c6ee83df54db0a92d7566fd68
#if ENABLE(TEXT_AUTOSIZING)
float m_textAutosizingWidth { 0 };
-@@ -1745,6 +1766,11 @@ private:
+@@ -1772,6 +1793,11 @@ private:
#endif
std::unique_ptr<ViewportArguments> m_overrideViewportArguments;
@@ -5502,10 +5501,10 @@ index 9e2964b6e5f27f3a9c9f39e95b37de574cd52b1b..20e211ebc0217e6f4e66118fd98a7eb4
bool m_disallowFileAccess { false };
};
diff --git a/Source/WebCore/platform/Pasteboard.h b/Source/WebCore/platform/Pasteboard.h
-index de2f5bf37b1e7b3b31156cc21d96536ab2eff154..052463df3476fc9f929db9275345459067b07115 100644
+index 844687bbf3636c9cd64621e41a092d35ed61cd29..679cc1d9a584f17b98606e1f73f8d98ffaf2b19d 100644
--- a/Source/WebCore/platform/Pasteboard.h
+++ b/Source/WebCore/platform/Pasteboard.h
-@@ -322,6 +322,7 @@ public:
+@@ -323,6 +323,7 @@ public:
COMPtr<IDataObject> dataObject() const { return m_dataObject; }
WEBCORE_EXPORT void setExternalDataObject(IDataObject*);
const DragDataMap& dragDataMap() const LIFETIME_BOUND { return m_dragDataMap; }
@@ -5513,14 +5512,14 @@ index de2f5bf37b1e7b3b31156cc21d96536ab2eff154..052463df3476fc9f929db92753454590
void writeURLToWritableDataObject(const URL&, const String&);
COMPtr<WCDataObject> writableDataObject() const { return m_writableDataObject; }
void writeImageToDataObject(Element&, const URL&); // FIXME: Layering violation.
-@@ -393,6 +394,7 @@ private:
- COMPtr<IDataObject> m_dataObject;
- COMPtr<WCDataObject> m_writableDataObject;
+@@ -396,6 +397,7 @@ private:
DragDataMap m_dragDataMap;
+ // Drag and drop pasteboards use their own data object, so only the copy and paste pasteboard is backed by the clipboard.
+ bool m_forCopyAndPaste { false };
+ bool m_forDrag = false;
+ int64_t m_changeCount { 0 };
#endif
};
-
diff --git a/Source/WebCore/platform/PlatformKeyboardEvent.h b/Source/WebCore/platform/PlatformKeyboardEvent.h
index 071f9fa0e6cfaa84d9b077e39a64bec9361ead9a..fdd0ec667cc7e2f59bd2d21c5c381ae54dde06d9 100644
--- a/Source/WebCore/platform/PlatformKeyboardEvent.h
@@ -5534,19 +5533,39 @@ index 071f9fa0e6cfaa84d9b077e39a64bec9361ead9a..fdd0ec667cc7e2f59bd2d21c5c381ae5
#endif
diff --git a/Source/WebCore/platform/PlatformPasteboard.h b/Source/WebCore/platform/PlatformPasteboard.h
-index be45b4c0967f2805a4b44e014f053a68c4ed900a..bb8771678618125f5f9f5e818e888bb5d9823d87 100644
+index 2ff9c3157cb525b02429287ddc39c39aa21ffb52..6784c90c13d66c7097cd4a20100f7ed94240455a 100644
--- a/Source/WebCore/platform/PlatformPasteboard.h
+++ b/Source/WebCore/platform/PlatformPasteboard.h
-@@ -64,6 +64,9 @@ enum class PasteboardDataLifetime : bool { Persistent, Ephemeral };
+@@ -51,6 +51,9 @@ namespace WebCore {
+ class Color;
+ class SharedBuffer;
+ class PasteboardCustomData;
++#if PLATFORM(WIN)
++class PlatformPasteboardBackend;
++#endif
+ class SelectionData;
+ struct PasteboardBuffer;
+ struct PasteboardImage;
+@@ -64,6 +67,9 @@ enum class PasteboardDataLifetime : bool { Persistent, Ephemeral };
class PlatformPasteboard {
public:
WEBCORE_EXPORT explicit PlatformPasteboard(const String& pasteboardName);
-+#if PLATFORM(MAC)
++#if PLATFORM(MAC) || PLATFORM(WIN)
+ WEBCORE_EXPORT static void setIsolated(bool);
+#endif
#if PLATFORM(IOS_FAMILY) || USE(LIBWPE)
WEBCORE_EXPORT PlatformPasteboard();
WEBCORE_EXPORT void updateSupportedTypeIdentifiers(const Vector<String>& types);
+@@ -134,6 +140,9 @@ private:
+ struct wpe_pasteboard* m_pasteboard;
+ int64_t m_changeCount { 0 };
+ #endif
++#if PLATFORM(WIN)
++ PlatformPasteboardBackend* m_backend { nullptr };
++#endif
+ };
+
+ } // namespace WebCore
diff --git a/Source/WebCore/platform/PlatformScreen.cpp b/Source/WebCore/platform/PlatformScreen.cpp
index 154251118cd47168a9c058e89b5f9823ea83747d..7f914c97cf9cc5c843df07c3663018b1a918131b 100644
--- a/Source/WebCore/platform/PlatformScreen.cpp
@@ -5635,10 +5654,10 @@ index 2c16bb535045e0f0658bb9f407ce1022e05fdc83..51df761fd09917fbf14a58c06a4016cf
#if ENABLE(TOUCH_EVENTS)
diff --git a/Source/WebCore/platform/adwaita/AdwaitaScrollbarPainter.h b/Source/WebCore/platform/adwaita/AdwaitaScrollbarPainter.h
-index 6bf01bfe47a8802f53435afc946d5208c7d55533..ebc7558fdb9db1046f5d9f52b4cecc6e5057828e 100644
+index a251b8f6a5e05997594a2962e7fcb3fab49a27b2..fd95b909650098869d44c8860a525051fc6996f8 100644
--- a/Source/WebCore/platform/adwaita/AdwaitaScrollbarPainter.h
+++ b/Source/WebCore/platform/adwaita/AdwaitaScrollbarPainter.h
-@@ -37,7 +37,7 @@ class GraphicsContext;
+@@ -36,7 +36,7 @@ class GraphicsContext;
namespace AdwaitaScrollbarPainter {
@@ -5672,28 +5691,6 @@ index 515ddea3cd42796efa9f41ad74be07a7447c337e..36db42e2a0822d5609b39046191f05a1
#include <wtf/TZoneMalloc.h>
namespace WebCore {
-diff --git a/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h b/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h
-index 3b2f98484435fa2ca3d25bd157f7e6ab334986ec..385b7808e97fada2a7e26a56172004da71b87c1c 100644
---- a/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h
-+++ b/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h
-@@ -95,12 +95,12 @@ public:
- return !m_currentFilters.isEmpty();
- }
-
-- void setShowDebugBorder(bool);
-- void setDebugBorderColor(Color);
-- void setDebugBorderWidth(float);
-+ WEBCORE_EXPORT void setShowDebugBorder(bool);
-+ WEBCORE_EXPORT void setDebugBorderColor(Color);
-+ WEBCORE_EXPORT void setDebugBorderWidth(float);
-
-- void setShowRepaintCounter(bool);
-- void setRepaintCount(int);
-+ WEBCORE_EXPORT void setShowRepaintCounter(bool);
-+ WEBCORE_EXPORT void setRepaintCount(int);
-
- WEBCORE_EXPORT void setContentsLayer(TextureMapperPlatformLayer*);
- void setAnimations(const TextureMapperAnimations&);
diff --git a/Source/WebCore/platform/graphics/win/ComplexTextControllerUniscribe.cpp b/Source/WebCore/platform/graphics/win/ComplexTextControllerUniscribe.cpp
index 775df102268b397e6c96e8b93296a7dbe6afcd26..cdbb7b79bde8ba30bc2b0f6bb579b44de72d7fc7 100644
--- a/Source/WebCore/platform/graphics/win/ComplexTextControllerUniscribe.cpp
@@ -6126,7 +6123,7 @@ index e47f5bade7c0a27e8a27f8dc95b51174f025b4a6..016efe9bc0898bb648a33973e771b49e
Vector<String> PlatformPasteboard::typesSafeForDOMToReadAndWrite(const String&) const
diff --git a/Source/WebCore/platform/mac/PlatformPasteboardMac.mm b/Source/WebCore/platform/mac/PlatformPasteboardMac.mm
-index 3f9d8eedeae2668ae3fdca0d0cb3bea1e2b958e2..ddc9911b07f2f1115f452c70cf917ecfb0b6f1f6 100644
+index 4c7546cbf536c46e48192fdcae06b9e316b0a245..25267cb85016f7eded4b1beebced3a2380296277 100644
--- a/Source/WebCore/platform/mac/PlatformPasteboardMac.mm
+++ b/Source/WebCore/platform/mac/PlatformPasteboardMac.mm
@@ -79,8 +79,25 @@ void PlatformPasteboard::performAsDataOwner(DataOwnerType, NOESCAPE Function<voi
@@ -6156,7 +6153,7 @@ index 3f9d8eedeae2668ae3fdca0d0cb3bea1e2b958e2..ddc9911b07f2f1115f452c70cf917ecf
{
ASSERT(pasteboardName);
}
-@@ -365,7 +382,7 @@ URL PlatformPasteboard::url()
+@@ -368,7 +385,7 @@ URL PlatformPasteboard::url()
int64_t PlatformPasteboard::copy(const String& fromPasteboard)
{
@@ -6195,7 +6192,7 @@ index df27a094a0b2239892c96b4f5835826bcf8d7540..3bbea5c96110c0ae70d944b7f6fb018e
m_commonHeaders.append(CommonHeader { name, value });
}
diff --git a/Source/WebCore/platform/network/NetworkStorageSession.h b/Source/WebCore/platform/network/NetworkStorageSession.h
-index 9d66f1a7d0e19a92f19c932725dfddc64c22e13b..76cad8774303333062a9687621884e8ef2f111ce 100644
+index e6a9e8af101bf2aa3ee5cd963bf770dca83749fa..aa467e9aa7bbfaff7056e3b81585158f5b474c35 100644
--- a/Source/WebCore/platform/network/NetworkStorageSession.h
+++ b/Source/WebCore/platform/network/NetworkStorageSession.h
@@ -200,6 +200,7 @@ public:
@@ -6207,7 +6204,7 @@ index 9d66f1a7d0e19a92f19c932725dfddc64c22e13b..76cad8774303333062a9687621884e8e
WEBCORE_EXPORT HTTPCookieAcceptPolicy cookieAcceptPolicy() const;
WEBCORE_EXPORT void setCookie(const Cookie&);
diff --git a/Source/WebCore/platform/network/ResourceResponseBase.cpp b/Source/WebCore/platform/network/ResourceResponseBase.cpp
-index 6e637dae2c780dec6068b3c18a1d1d685d548315..4d05da21e9b3f3a65d080158f2c5d545cbb47266 100644
+index 4a7da70e5fe43de0092ed803d4238bf2f8930951..edcdd21658f9dd6f8487c8926093e72ed585fb9f 100644
--- a/Source/WebCore/platform/network/ResourceResponseBase.cpp
+++ b/Source/WebCore/platform/network/ResourceResponseBase.cpp
@@ -21,7 +21,7 @@
@@ -6380,7 +6377,7 @@ index 6e637dae2c780dec6068b3c18a1d1d685d548315..4d05da21e9b3f3a65d080158f2c5d545
*source,
*type,
diff --git a/Source/WebCore/platform/network/ResourceResponseBase.h b/Source/WebCore/platform/network/ResourceResponseBase.h
-index bbf59c72869b76e3a38ebbad5857dffcbb558a2d..39f1e7d3b4d8267cdd6b96b421328ec8d7483cd2 100644
+index 3283122f2be31f24b65761cb3d3cf9722f1d41a1..12cdeae56df8cbbdcbd555a6d13d386e287c2047 100644
--- a/Source/WebCore/platform/network/ResourceResponseBase.h
+++ b/Source/WebCore/platform/network/ResourceResponseBase.h
@@ -21,7 +21,7 @@
@@ -6615,7 +6612,7 @@ index 2eaf11c3c0739754768810694c0016d7a21a7951..f25e84fe43e2590829146a1d134776ec
#if USE(HARFBUZZ)
diff --git a/Source/WebCore/platform/win/ClipboardUtilitiesWin.cpp b/Source/WebCore/platform/win/ClipboardUtilitiesWin.cpp
-index 8e6023c5f1200884723bd0871bf602ba4a37ad04..582365cfb1c9a109308d0133922ee4d2bc0ae7db 100644
+index 0bdfec3af0a6995cf855e75074a473b3f7ef0d0d..ad27a29ffab9fe91ee02db1d78e355ed53059b29 100644
--- a/Source/WebCore/platform/win/ClipboardUtilitiesWin.cpp
+++ b/Source/WebCore/platform/win/ClipboardUtilitiesWin.cpp
@@ -39,6 +39,7 @@
@@ -6626,7 +6623,7 @@ index 8e6023c5f1200884723bd0871bf602ba4a37ad04..582365cfb1c9a109308d0133922ee4d2
namespace WebCore {
-@@ -690,7 +691,10 @@ template<typename T> void getStringData(IDataObject* data, FORMATETC* format, Ve
+@@ -696,7 +697,10 @@ template<typename T> void getStringData(IDataObject* data, FORMATETC* format, Ve
STGMEDIUM store;
if (FAILED(data->GetData(format, &store)))
return;
@@ -6639,7 +6636,7 @@ index 8e6023c5f1200884723bd0871bf602ba4a37ad04..582365cfb1c9a109308d0133922ee4d2
ReleaseStgMedium(&store);
}
diff --git a/Source/WebCore/platform/win/ClipboardUtilitiesWin.h b/Source/WebCore/platform/win/ClipboardUtilitiesWin.h
-index 6ffe5f9345576be626ded3470c74a0ff661af98b..dbcfc108a67d580d6f6ab7cb3125973ebab3e613 100644
+index 970ce981ba35a844fe0e08ea14c42a0a317b9521..a27f83a8496ce81a549ab167d05a5df81543541c 100644
--- a/Source/WebCore/platform/win/ClipboardUtilitiesWin.h
+++ b/Source/WebCore/platform/win/ClipboardUtilitiesWin.h
@@ -34,6 +34,7 @@ namespace WebCore {
@@ -6648,8 +6645,8 @@ index 6ffe5f9345576be626ded3470c74a0ff661af98b..dbcfc108a67d580d6f6ab7cb3125973e
class DocumentFragment;
+class Pasteboard;
- HGLOBAL createGlobalData(const String&);
- HGLOBAL createGlobalData(const Vector<char>&);
+ UINT customDataClipboardFormat();
+
diff --git a/Source/WebCore/platform/win/DragDataWin.cpp b/Source/WebCore/platform/win/DragDataWin.cpp
index 0379437d84807e4a8d3846afac5ec8a70e743e70..5b0461bf12535d4900ffaddc2a87826280505233 100644
--- a/Source/WebCore/platform/win/DragDataWin.cpp
@@ -6703,10 +6700,10 @@ index f6c0cc49e9c39686bb5a5b36c29762173f2b4d1f..f396b564ee4aa7203d1728ff84608373
OptionSet<PlatformEvent::Modifier> PlatformKeyboardEvent::currentStateOfModifierKeys()
diff --git a/Source/WebCore/platform/win/PasteboardWin.cpp b/Source/WebCore/platform/win/PasteboardWin.cpp
-index d079788986aedd2800a9870e9d4325a1d6fe98fe..24c1e2d4493c8afd95bfdfb7a088333427373a77 100644
+index 1409804b62b7ff647fd62d387a300592602bc95f..4142a4b3bd2efc988b89625eae2c28f7bc3b955c 100644
--- a/Source/WebCore/platform/win/PasteboardWin.cpp
+++ b/Source/WebCore/platform/win/PasteboardWin.cpp
-@@ -1145,7 +1145,21 @@ void Pasteboard::writeCustomData(const Vector<PasteboardCustomData>& data)
+@@ -1165,7 +1165,21 @@ void Pasteboard::writeCustomData(const Vector<PasteboardCustomData>& data, Paste
}
clear();
@@ -6728,7 +6725,7 @@ index d079788986aedd2800a9870e9d4325a1d6fe98fe..24c1e2d4493c8afd95bfdfb7a0883334
if (::OpenClipboard(m_owner)) {
const auto& customData = data.first();
customData.forEachPlatformStringOrBuffer([](auto& type, auto& stringOrBuffer) {
-@@ -1184,4 +1198,25 @@ void Pasteboard::write(const Color&)
+@@ -1204,4 +1218,25 @@ void Pasteboard::write(const Color&)
{
}
@@ -6754,11 +6751,327 @@ index d079788986aedd2800a9870e9d4325a1d6fe98fe..24c1e2d4493c8afd95bfdfb7a0883334
+}
+
} // namespace WebCore
+diff --git a/Source/WebCore/platform/win/PlatformPasteboardWin.cpp b/Source/WebCore/platform/win/PlatformPasteboardWin.cpp
+index 8069b725bf87da90dc79d2d1490e3654768d3706..ed9624c4fade7f1890e8ac1f5e1896a56966ca97 100644
+--- a/Source/WebCore/platform/win/PlatformPasteboardWin.cpp
++++ b/Source/WebCore/platform/win/PlatformPasteboardWin.cpp
+@@ -35,8 +35,10 @@
+ #include "SharedBuffer.h"
+ #include "WebCoreInstanceHandle.h"
+ #include <windows.h>
++#include <wtf/HashMap.h>
+ #include <wtf/ListHashSet.h>
+ #include <wtf/MainThread.h>
++#include <wtf/NeverDestroyed.h>
+ #include <wtf/text/WTFString.h>
+
+ namespace WebCore {
+@@ -58,26 +60,6 @@ static HWND clipboardOwner()
+ return owner;
+ }
+
+-PlatformPasteboard::PlatformPasteboard(const String&)
+-{
+-}
+-
+-void PlatformPasteboard::performAsDataOwner(DataOwnerType, NOESCAPE Function<void()>&& actions)
+-{
+- actions();
+-}
+-
+-int64_t PlatformPasteboard::changeCount() const
+-{
+- return ::GetClipboardSequenceNumber();
+-}
+-
+-void PlatformPasteboard::getTypes(Vector<String>& types) const
+-{
+- if (::IsClipboardFormatAvailable(CF_UNICODETEXT) || ::IsClipboardFormatAvailable(CF_TEXT))
+- types.append(textPlainContentTypeAtom());
+-}
+-
+ static String readClipboardString(UINT format)
+ {
+ if (!::IsClipboardFormatAvailable(format) || !::OpenClipboard(clipboardOwner()))
+@@ -98,35 +80,194 @@ static String readClipboardString(UINT format)
+ return string;
+ }
+
+-std::optional<PasteboardCustomData> PlatformPasteboard::readCustomData() const
++// The caller is responsible for having opened the clipboard.
++static void setClipboardData(UINT format, HGLOBAL data)
+ {
+- if (!::IsClipboardFormatAvailable(customDataClipboardFormat()) || !::OpenClipboard(clipboardOwner()))
+- return std::nullopt;
++ if (!data)
++ return;
++ if (!::SetClipboardData(format, data))
++ ::GlobalFree(data);
++}
+
+- std::optional<PasteboardCustomData> customData;
+- if (HANDLE data = ::GetClipboardData(customDataClipboardFormat())) {
+- // Custom data is a serialized buffer rather than text, so it is read by length.
+- auto size = ::GlobalSize(data);
+- if (auto* bytes = static_cast<const uint8_t*>(::GlobalLock(data))) {
+- customData = PasteboardCustomData::fromPersistenceDecoder({ { bytes, size } });
+- ::GlobalUnlock(data);
++static String plainText(const PasteboardCustomData& data)
++{
++ String text;
++ data.forEachPlatformStringOrBuffer([&](auto& type, auto& value) {
++ if (type == textPlainContentTypeAtom() && std::holds_alternative<String>(value))
++ text = std::get<String>(value);
++ });
++ return text;
++}
++
++class PlatformPasteboardBackend {
++public:
++ virtual ~PlatformPasteboardBackend() = default;
++
++ virtual int64_t changeCount() const = 0;
++ virtual void getTypes(Vector<String>&) const = 0;
++ virtual std::optional<PasteboardCustomData> readCustomData() const = 0;
++ virtual String readString(size_t index, const String& type) const = 0;
++ virtual int64_t write(const PasteboardCustomData&) = 0;
++};
++
++class SystemPlatformPasteboard final : public PlatformPasteboardBackend {
++public:
++ int64_t changeCount() const final
++ {
++ return ::GetClipboardSequenceNumber();
++ }
++
++ void getTypes(Vector<String>& types) const final
++ {
++ if (::IsClipboardFormatAvailable(CF_UNICODETEXT) || ::IsClipboardFormatAvailable(CF_TEXT))
++ types.append(textPlainContentTypeAtom());
++ }
++
++ std::optional<PasteboardCustomData> readCustomData() const final
++ {
++ if (!::IsClipboardFormatAvailable(customDataClipboardFormat()) || !::OpenClipboard(clipboardOwner()))
++ return std::nullopt;
++
++ std::optional<PasteboardCustomData> customData;
++ if (HANDLE data = ::GetClipboardData(customDataClipboardFormat())) {
++ // Custom data is a serialized buffer rather than text, so it is read by length.
++ auto size = ::GlobalSize(data);
++ if (auto* bytes = static_cast<const uint8_t*>(::GlobalLock(data))) {
++ customData = PasteboardCustomData::fromPersistenceDecoder({ { bytes, size } });
++ ::GlobalUnlock(data);
++ }
+ }
++ ::CloseClipboard();
++ return customData;
+ }
+- ::CloseClipboard();
+- return customData;
++
++ String readString(size_t index, const String& type) const final
++ {
++ // The clipboard holds a single item.
++ if (index || !type.startsWith(textPlainContentTypeAtom()))
++ return { };
++
++ auto text = readClipboardString(CF_UNICODETEXT);
++ return text.isNull() ? readClipboardString(CF_TEXT) : text;
++ }
++
++ int64_t write(const PasteboardCustomData& data) final
++ {
++ auto text = plainText(data);
++ if (text.isNull() || !::OpenClipboard(clipboardOwner()))
++ return changeCount();
++
++ if (!::EmptyClipboard()) {
++ ::CloseClipboard();
++ return changeCount();
++ }
++
++ replaceNewlinesWithWindowsStyleNewlines(text);
++ setClipboardData(CF_UNICODETEXT, createGlobalData(text));
++
++ if (data.hasSameOriginCustomData() || !data.origin().isEmpty())
++ setClipboardData(customDataClipboardFormat(), createGlobalData(data.createSharedBuffer()->span()));
++
++ ::CloseClipboard();
++ return changeCount();
++ }
++};
++
++class IsolatedPlatformPasteboard final : public PlatformPasteboardBackend {
++public:
++ int64_t changeCount() const final
++ {
++ return m_changeCount;
++ }
++
++ void getTypes(Vector<String>& types) const final
++ {
++ if (m_pasteboard.contains(textPlainContentTypeAtom()))
++ types.append(textPlainContentTypeAtom());
++ }
++
++ std::optional<PasteboardCustomData> readCustomData() const final
++ {
++ return m_customData;
++ }
++
++ String readString(size_t index, const String& type) const final
++ {
++ if (index || !type.startsWith(textPlainContentTypeAtom()))
++ return { };
++ return m_pasteboard.get(textPlainContentTypeAtom());
++ }
++
++ int64_t write(const PasteboardCustomData& data) final
++ {
++ auto text = plainText(data);
++ if (text.isNull())
++ return changeCount();
++
++ m_pasteboard.clear();
++ m_pasteboard.set(textPlainContentTypeAtom(), text);
++ m_customData = data.hasSameOriginCustomData() || !data.origin().isEmpty() ? std::optional { data } : std::nullopt;
++ return ++m_changeCount;
++ }
++
++private:
++ // This is intentionally process wide: one browser shares one clipboard across all of its contexts and pages.
++ UncheckedKeyHashMap<String, String> m_pasteboard;
++ std::optional<PasteboardCustomData> m_customData;
++ int64_t m_changeCount { 0 };
++};
++
++static PlatformPasteboardBackend& systemPlatformPasteboard()
++{
++ static NeverDestroyed<SystemPlatformPasteboard> pasteboard;
++ return pasteboard.get();
+ }
+
+-String PlatformPasteboard::readString(size_t index, const String& type) const
++static PlatformPasteboardBackend& isolatedPlatformPasteboard()
+ {
+- // The clipboard holds a single item.
+- if (index)
+- return { };
++ static NeverDestroyed<IsolatedPlatformPasteboard> pasteboard;
++ return pasteboard.get();
++}
+
+- if (!type.startsWith(textPlainContentTypeAtom()))
+- return { };
++static PlatformPasteboardBackend*& selectedPlatformPasteboard()
++{
++ static PlatformPasteboardBackend* pasteboard = &systemPlatformPasteboard();
++ return pasteboard;
++}
++
++void PlatformPasteboard::setIsolated(bool isolated)
++{
++ selectedPlatformPasteboard() = isolated ? &isolatedPlatformPasteboard() : &systemPlatformPasteboard();
++}
++
++PlatformPasteboard::PlatformPasteboard(const String&)
++ : m_backend(selectedPlatformPasteboard())
++{
++}
+
+- auto text = readClipboardString(CF_UNICODETEXT);
+- return text.isNull() ? readClipboardString(CF_TEXT) : text;
++void PlatformPasteboard::performAsDataOwner(DataOwnerType, NOESCAPE Function<void()>&& actions)
++{
++ actions();
++}
++
++int64_t PlatformPasteboard::changeCount() const
++{
++ return m_backend->changeCount();
++}
++
++void PlatformPasteboard::getTypes(Vector<String>& types) const
++{
++ m_backend->getTypes(types);
++}
++
++std::optional<PasteboardCustomData> PlatformPasteboard::readCustomData() const
++{
++ return m_backend->readCustomData();
++}
++
++String PlatformPasteboard::readString(size_t index, const String& type) const
++{
++ return m_backend->readString(index, type);
+ }
+
+ Vector<String> PlatformPasteboard::typesSafeForDOMToReadAndWrite(const String& origin) const
+@@ -138,8 +279,10 @@ Vector<String> PlatformPasteboard::typesSafeForDOMToReadAndWrite(const String& o
+ domTypes.add(type);
+ }
+
+- if (::IsClipboardFormatAvailable(CF_UNICODETEXT) || ::IsClipboardFormatAvailable(CF_TEXT))
+- domTypes.add(textPlainContentTypeAtom());
++ Vector<String> types;
++ getTypes(types);
++ for (auto& type : types)
++ domTypes.add(type);
+
+ return copyToVector(domTypes);
+ }
+@@ -175,44 +318,9 @@ int PlatformPasteboard::count() const
+ return types.isEmpty() ? 0 : 1;
+ }
+
+-// The caller is responsible for having opened the clipboard.
+-static void setClipboardData(UINT format, HGLOBAL data)
+-{
+- if (!data)
+- return;
+- if (!::SetClipboardData(format, data))
+- ::GlobalFree(data);
+-}
+-
+ int64_t PlatformPasteboard::write(const PasteboardCustomData& data, PasteboardDataLifetime)
+ {
+- String text;
+- data.forEachPlatformStringOrBuffer([&](auto& type, auto& value) {
+- if (type != textPlainContentTypeAtom() || !std::holds_alternative<String>(value))
+- return;
+- text = std::get<String>(value);
+- });
+- if (text.isNull())
+- return changeCount();
+-
+- // A failed write leaves the clipboard, and so its change count, alone.
+- if (!::OpenClipboard(clipboardOwner()))
+- return changeCount();
+-
+- if (!::EmptyClipboard()) {
+- ::CloseClipboard();
+- return changeCount();
+- }
+-
+- replaceNewlinesWithWindowsStyleNewlines(text);
+- setClipboardData(CF_UNICODETEXT, createGlobalData(text));
+-
+- if (data.hasSameOriginCustomData() || !data.origin().isEmpty())
+- setClipboardData(customDataClipboardFormat(), createGlobalData(data.createSharedBuffer()->span()));
+-
+- ::CloseClipboard();
+-
+- return changeCount();
++ return m_backend->write(data);
+ }
+
+ int64_t PlatformPasteboard::write(const Vector<PasteboardCustomData>& data, PasteboardDataLifetime pasteboardDataLifetime)
diff --git a/Source/WebCore/rendering/RenderLayerCompositor.cpp b/Source/WebCore/rendering/RenderLayerCompositor.cpp
-index 0a0539b6186c74c0b51c5c6f747ce501b65b09db..a369e4f1751d00938e8253d9769b9dcb8b289935 100644
+index b45e8a6b35c038990e2eb02bedc5a07995d14a10..d0e848251a859f542ca449f2ce4c0a28d3ed3bae 100644
--- a/Source/WebCore/rendering/RenderLayerCompositor.cpp
+++ b/Source/WebCore/rendering/RenderLayerCompositor.cpp
-@@ -1067,8 +1067,10 @@ bool RenderLayerCompositor::updateCompositingLayers(CompositingUpdateType update
+@@ -1069,8 +1069,10 @@ bool RenderLayerCompositor::updateCompositingLayers(CompositingUpdateType update
return false;
}
@@ -6770,7 +7083,7 @@ index 0a0539b6186c74c0b51c5c6f747ce501b65b09db..a369e4f1751d00938e8253d9769b9dcb
bool isPageScroll = !updateRootArg || updateRootArg == &rootRenderLayer();
CheckedPtr updateRoot = &rootRenderLayer();
diff --git a/Source/WebCore/rendering/RenderTextControl.cpp b/Source/WebCore/rendering/RenderTextControl.cpp
-index 803d0ca2a31978a0dff80bd8fce59fa835cb9b68..4e533b9ab9016dd503a15a352c7dc7311e5cfaf8 100644
+index b42b77dc3e6be98ff3d4b95624ba0c81b676ee26..b1994051f7550c8e60077d13e06651ee5428d953 100644
--- a/Source/WebCore/rendering/RenderTextControl.cpp
+++ b/Source/WebCore/rendering/RenderTextControl.cpp
@@ -260,13 +260,13 @@ void RenderTextControl::layoutExcludedChildren(RelayoutChildren relayoutChildren
@@ -6803,10 +7116,10 @@ index 4d3cc813b6dfe35c26ae57d6d8221754e79ce10e..8d2c14fa19dab737fdfd1ad4fffc3c30
#endif
diff --git a/Source/WebCore/workers/WorkerConsoleClient.cpp b/Source/WebCore/workers/WorkerConsoleClient.cpp
-index 03a2f715a535fc93c035076a07ec2047cd16ef49..db27ba21ede7d96c3635dab610fad619316f02dc 100644
+index 96e09005f27db417c1413a99fda5bb3d8549f281..71ace783c222ac273fbab7bf2887e482ac017625 100644
--- a/Source/WebCore/workers/WorkerConsoleClient.cpp
+++ b/Source/WebCore/workers/WorkerConsoleClient.cpp
-@@ -260,4 +260,6 @@ void WorkerConsoleClient::screenshot(JSC::JSGlobalObject* lexicalGlobalObject, R
+@@ -267,4 +267,6 @@ void WorkerConsoleClient::screenshot(JSC::JSGlobalObject* lexicalGlobalObject, R
InspectorInstrumentation::addMessageToConsole(protect(globalScope()), makeUnique<Inspector::ConsoleMessage>(MessageSource::ConsoleAPI, MessageType::Image, MessageLevel::Log, dataURL, ScriptArguments::create(lexicalGlobalObject, WTF::move(adjustedArguments)), lexicalGlobalObject, /* requestIdentifier */ 0, timestamp));
}
@@ -6852,10 +7165,10 @@ index a96118e5fbb7d0259867379dc9d3dfb0640b8ff1..98204c53faf0019cd5211b70ecfac559
info.cfStart = info.createNode();
diff --git a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp b/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp
-index e1ca4d80a092ce2fa88e816ab173b8f2eb8dbe28..18e1a0d1e87a2c86b5a2d1358d62f66455b15fb5 100644
+index 6376de741c8445677857dd3c15ff37cb3263c564..af5974a37651c5a3224af779e9e6d2db212edee1 100644
--- a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp
+++ b/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp
-@@ -100,6 +100,8 @@
+@@ -102,6 +102,8 @@
#if PLATFORM(COCOA)
#include <wtf/FileSystem.h>
@@ -6864,7 +7177,7 @@ index e1ca4d80a092ce2fa88e816ab173b8f2eb8dbe28..18e1a0d1e87a2c86b5a2d1358d62f664
#include <wtf/OSObjectPtr.h>
#include <wtf/spi/darwin/SandboxSPI.h>
#endif
-@@ -1367,6 +1369,14 @@ void NetworkConnectionToWebProcess::clearPageSpecificData(PageIdentifier pageID)
+@@ -1347,6 +1349,14 @@ void NetworkConnectionToWebProcess::clearPageSpecificData(PageIdentifier pageID)
storageSession->clearPageSpecificDataForResourceLoadStatistics(pageID);
}
@@ -6880,10 +7193,10 @@ index e1ca4d80a092ce2fa88e816ab173b8f2eb8dbe28..18e1a0d1e87a2c86b5a2d1358d62f664
{
if (CheckedPtr storageSession = m_networkProcess->storageSession(m_sessionID))
diff --git a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h b/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h
-index a9c081afbf41b3600f903008f31e4952c61e6e9f..4eed3ec4aa2b840be80d0dde54a9fa03bcd6034a 100644
+index 4d33874f00cd15ccb3fad780546bec38ab80a165..2f4e16e4b88c934a3fd2b47bf228c3a545f1e5c2 100644
--- a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h
+++ b/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h
-@@ -404,6 +404,8 @@ private:
+@@ -406,6 +406,8 @@ private:
void clearPageSpecificData(WebCore::PageIdentifier);
@@ -6893,7 +7206,7 @@ index a9c081afbf41b3600f903008f31e4952c61e6e9f..4eed3ec4aa2b840be80d0dde54a9fa03
void logUserInteraction(RegistrableDomain&&);
diff --git a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in b/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in
-index 00fe84f0441ae843c3f572129e0476df5335e4cb..3d001b7f77249b78d240be01e1e23ea6a42f47b4 100644
+index 2acff3ecb6a3f2ed346e9a1065b2c034b316e25b..f0dcd29fff2fe0b73375d687623bdac762c2b76c 100644
--- a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in
+++ b/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in
@@ -86,6 +86,8 @@ messages -> NetworkConnectionToWebProcess WantsDispatchMessage {
@@ -6905,11 +7218,66 @@ index 00fe84f0441ae843c3f572129e0476df5335e4cb..3d001b7f77249b78d240be01e1e23ea6
[EnabledBy=StorageAccessAPIEnabled] RemoveStorageAccessForFrame(WebCore::FrameIdentifier frameID, WebCore::PageIdentifier pageID);
LogUserInteraction(WebCore::RegistrableDomain domain)
ResourceLoadStatisticsUpdated(Vector<WebCore::ResourceLoadStatistics> statistics) -> ()
+diff --git a/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm b/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm
+index ea6fa9e898edba288e540971da4e6703484220b4..68f0a951a890ad748965c6ecf424a4f3af816a42 100644
+--- a/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm
++++ b/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm
+@@ -326,6 +326,8 @@ NetworkDataTaskCocoa::NetworkDataTaskCocoa(NetworkSession& session, NetworkDataT
+ StringView host = url.host();
+ if (session.networkProcess().localhostAliasesForTesting().contains<StringViewHashTranslator>(host) && !host.endsWith("web-platform.test"_s))
+ m_task.get()._hostOverride = adoptNS(nw_endpoint_create_host_with_numeric_port("localhost", url.port().value_or(0))).get();
++ else if (RetainPtr hostOverride = downcast<NetworkSessionCocoa>(session).loopbackProxyHostOverrideForURL(url))
++ m_task.get()._hostOverride = hostOverride.get();
+ #endif
+
+ #if ENABLE(OPT_IN_PARTITIONED_COOKIES) && defined(CFN_COOKIE_ACCEPTS_POLICY_PARTITION) && CFN_COOKIE_ACCEPTS_POLICY_PARTITION
+diff --git a/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.h b/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.h
+index 87af48c0ab1ace075be29646d116e296b5aa6f57..d72bf6a47e648bea622e7c7d8bb9b98eb16c1d87 100644
+--- a/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.h
++++ b/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.h
+@@ -145,6 +145,10 @@ public:
+
+ CFDictionaryRef proxyConfiguration() const { return m_proxyConfiguration.get(); }
+
++#if HAVE(CFNETWORK_HOSTOVERRIDE)
++ RetainPtr<nw_endpoint_t> loopbackProxyHostOverrideForURL(const URL&) const;
++#endif
++
+ bool hasIsolatedSession(const WebCore::RegistrableDomain&) const override;
+ void clearIsolatedSessions() override;
+
diff --git a/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm b/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm
-index e9ab1470b2e7bdb7a4fbf4933e1f27874771574a..df6aae4861d5aca146ca14addb02d9c9386e7b9e 100644
+index 16b80e08c4472badeccf3b497cf52ae0320c3d7c..82aeba10b18dd88109d3bad16e32ea7c34becc27 100644
--- a/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm
+++ b/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm
-@@ -901,6 +901,14 @@ - (void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)data
+@@ -59,7 +59,9 @@
+ #import <WebCore/SharedBuffer.h>
+ #import <WebCore/ThreadableWebSocketChannel.h>
+ #import <WebCore/WebCoreURLResponse.h>
++#import <fnmatch.h>
+ #import <pal/spi/cf/CFNetworkSPI.h>
++#import <pal/spi/cocoa/NetworkSPI.h>
+ #import <wtf/BlockPtr.h>
+ #import <wtf/MainThread.h>
+ #import <wtf/NeverDestroyed.h>
+@@ -619,7 +621,15 @@ - (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didRece
+ }
+ }
+
+- sessionCocoa->continueDidReceiveChallenge(CheckedRef { *_sessionWrapper }, challenge, negotiatedLegacyTLS, taskIdentifier, [self existingTask:task], [completionHandler = makeBlockPtr(completionHandler)] (WebKit::AuthenticationChallengeDisposition disposition, const WebCore::Credential& credential) mutable {
++ sessionCocoa->continueDidReceiveChallenge(CheckedRef { *_sessionWrapper }, challenge, negotiatedLegacyTLS, taskIdentifier, [self existingTask:task], [completionHandler = makeBlockPtr(completionHandler), challenge = RetainPtr { challenge }] (WebKit::AuthenticationChallengeDisposition disposition, const WebCore::Credential& credential) mutable {
++ // Playwright: continue without credential to deliver the 401; with PerformDefaultHandling
++ // NWLoader would retry the failed credential in an infinite loop.
++ if (disposition == WebKit::AuthenticationChallengeDisposition::PerformDefaultHandling && [challenge previousFailureCount]) {
++ NSString *method = [challenge protectionSpace].authenticationMethod;
++ bool isPasswordBased = [method isEqualToString:NSURLAuthenticationMethodDefault] || [method isEqualToString:NSURLAuthenticationMethodHTTPBasic] || [method isEqualToString:NSURLAuthenticationMethodHTTPDigest] || [method isEqualToString:NSURLAuthenticationMethodNTLM] || [method isEqualToString:NSURLAuthenticationMethodNegotiate];
++ if (isPasswordBased)
++ return completionHandler(NSURLSessionAuthChallengeUseCredential, nil);
++ }
+ completionHandler(toNSURLSessionAuthChallengeDisposition(disposition), RetainPtr { credential.nsCredential() }.get());
+ });
+ }
+@@ -901,6 +911,14 @@ - (void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)data
resourceResponse.setDeprecatedNetworkLoadMetrics(WebCore::copyTimingData(taskMetrics.get(), networkDataTask->networkLoadMetrics()));
resourceResponse.setProxyName(WTF::move(proxyName));
@@ -6924,6 +7292,80 @@ index e9ab1470b2e7bdb7a4fbf4933e1f27874771574a..df6aae4861d5aca146ca14addb02d9c9
networkDataTask->didReceiveResponse(WTF::move(resourceResponse), negotiatedLegacyTLS, privateRelayed, [completionHandler = makeBlockPtr(completionHandler), taskIdentifier](WebCore::PolicyAction policyAction) {
#if !LOG_DISABLED
LOG(NetworkSession, "%zu didReceiveResponse completionHandler (%s)", taskIdentifier, toString(policyAction).characters());
+@@ -1651,6 +1669,59 @@ DMFWebsitePolicyMonitor *NetworkSessionCocoa::deviceManagementPolicyMonitor()
+ #endif
+ }
+
++#if HAVE(CFNETWORK_HOSTOVERRIDE)
++// Playwright: NWLoader never routes loopback destinations through a proxy. Overriding the
++// connection endpoint with a non-loopback TEST-NET-1 address makes the proxy apply again; the
++// proxy receives the original absolute-form URL and the override endpoint is never connected to.
++static bool isLoopbackHost(StringView host)
++{
++ if (equalLettersIgnoringASCIICase(host, "localhost"_s) || host.endsWithIgnoringASCIICase(".localhost"_s))
++ return true;
++ if (host == "[::1]"_s || host == "::1"_s)
++ return true;
++ return host.startsWith("127."_s);
++}
++
++// Over-matching is fine here: a matched loopback host is simply not routed through the proxy,
++// which is what the bypass list asks for.
++static bool proxyBypassPatternMatchesHost(NSString *entry, StringView host)
++{
++ String pattern { entry };
++ if (pattern.isEmpty())
++ return false;
++ // CIDR-style IP prefixes like "127/8" or "169.254/16".
++ if (size_t slash = pattern.find('/'); slash != notFound) {
++ String prefix = pattern.left(slash);
++ return equalIgnoringASCIICase(host, prefix) || host.startsWithIgnoringASCIICase(makeString(prefix, '.'));
++ }
++ if (pattern.contains('*') || pattern.contains('?'))
++ return !fnmatch(pattern.utf8().data(), host.utf8().data(), FNM_CASEFOLD);
++ if (pattern.startsWith('.'))
++ return host.endsWithIgnoringASCIICase(pattern);
++ return equalIgnoringASCIICase(host, pattern) || host.endsWithIgnoringASCIICase(makeString('.', pattern));
++}
++
++RetainPtr<nw_endpoint_t> NetworkSessionCocoa::loopbackProxyHostOverrideForURL(const URL& url) const
++{
++ if (!m_proxyConfiguration)
++ return nullptr;
++ // With CONNECT tunneling (https, wss) and SOCKS the proxy would connect to the override endpoint.
++ if (!url.protocolIs("http"_s) && !url.protocolIs("ws"_s))
++ return nullptr;
++ if (![(__bridge NSDictionary *)m_proxyConfiguration.get() objectForKey:@"HTTPProxy"])
++ return nullptr;
++ auto host = url.host();
++ if (!isLoopbackHost(host))
++ return nullptr;
++ RetainPtr exceptions = dynamic_objc_cast<NSArray>([(__bridge NSDictionary *)m_proxyConfiguration.get() objectForKey:@"ExceptionsList"]);
++ for (NSString *entry in exceptions.get()) {
++ if (proxyBypassPatternMatchesHost(entry, host))
++ return nullptr;
++ }
++ return adoptNS(nw_endpoint_create_host_with_numeric_port("192.0.2.1", url.port().value_or(0)));
++}
++#endif // HAVE(CFNETWORK_HOSTOVERRIDE)
++
+ RefPtr<WebSocketTask> NetworkSessionCocoa::createWebSocketTask(WebPageProxyIdentifier webPageProxyID, std::optional<WebCore::FrameIdentifier> frameID, std::optional<WebCore::PageIdentifier> pageID, NetworkSocketChannel& channel, const WebCore::ResourceRequest& request, const String& protocol, const WebCore::ClientOrigin& clientOrigin, bool hadMainFrameMainResourcePrivateRelayed, bool allowPrivacyProxy, OptionSet<WebCore::AdvancedPrivacyProtections> advancedPrivacyProtections, WebCore::StoredCredentialsPolicy storedCredentialsPolicy, WebCore::IsInitiatedByDedicatedWorker isInitiatedByDedicatedWorker)
+ {
+ ASSERT(!request.hasHTTPHeaderField(WebCore::HTTPHeaderName::SecWebSocketProtocol));
+@@ -1700,7 +1771,12 @@ RefPtr<WebSocketTask> NetworkSessionCocoa::createWebSocketTask(WebPageProxyIdent
+
+ Ref sessionSet = sessionSetForPage(webPageProxyID);
+ RetainPtr task = [sessionSet->sessionWithCredentialStorage->session webSocketTaskWithRequest:nsRequest.get()];
+-
++
++#if HAVE(CFNETWORK_HOSTOVERRIDE)
++ if (RetainPtr hostOverride = loopbackProxyHostOverrideForURL(request.url()))
++ task.get()._hostOverride = hostOverride.get();
++#endif
++
+ // Although the WebSocket protocol allows full 64-bit lengths, Chrome and Firefox limit the length to 2^63 - 1.
+ // Use NSIntegerMax instead of 2^63 - 1 for 32-bit systems.
+ task.get().maximumMessageSize = NSIntegerMax;
diff --git a/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp b/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp
index 0a2c25f815f594b2de6168ffd8b083c625e42e1f..682c4584f34d6fab8b576b331561102d34a3751a 100644
--- a/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp
@@ -6937,7 +7379,7 @@ index 0a2c25f815f594b2de6168ffd8b083c625e42e1f..682c4584f34d6fab8b576b331561102d
handleCookieHeaders(request.resourceRequest(), receivedResponse);
diff --git a/Source/WebKit/NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in b/Source/WebKit/NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in
-index 16e3d81551f1d0c04bfa6032c110dc9c0bf056f7..0f20224133c0dd0d24d96c98a4d1a4e5ee55aafe 100644
+index 877d2d82e321c4d6a50aa5ddad5d1b6867aefc69..f304191e545888eb7fdea537191afe011287dbd5 100644
--- a/Source/WebKit/NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in
+++ b/Source/WebKit/NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in
@@ -446,9 +446,11 @@
@@ -6956,10 +7398,10 @@ index 16e3d81551f1d0c04bfa6032c110dc9c0bf056f7..0f20224133c0dd0d24d96c98a4d1a4e5
;; Except deny access to new-style iOS Keychain folders which are UUIDs.
(deny file-read* file-write*
diff --git a/Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp b/Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp
-index a9221bc3fb2964776efd2861b906d681f3e90946..9ea9cbaf290b4e74b558959c3af82cff49c3b3b6 100644
+index fedebbfff5e04e042f4c10e7e110d6f20db644c7..6e154e464832e0294fd206fcab8a24729697f5ba 100644
--- a/Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp
+++ b/Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp
-@@ -428,6 +428,8 @@ void NetworkDataTaskSoup::didSendRequest(GRefPtr<GInputStream>&& inputStream)
+@@ -435,6 +435,8 @@ void NetworkDataTaskSoup::didSendRequest(GRefPtr<GInputStream>&& inputStream)
else
m_inputStream = WTF::move(inputStream);
@@ -6969,7 +7411,7 @@ index a9221bc3fb2964776efd2861b906d681f3e90946..9ea9cbaf290b4e74b558959c3af82cff
}
diff --git a/Source/WebKit/PlatformWin.cmake b/Source/WebKit/PlatformWin.cmake
-index 1003cc3cc60a91e27166ba0891fa63c2d0c27d4c..5d2e09bf814902341a72f4a1cad70a43d0a9b60a 100644
+index 5047c71e169437adaa329bc3188243ad84cf327a..909b5f7dae41ac392acab4ca5490edd0c7ef50eb 100644
--- a/Source/WebKit/PlatformWin.cmake
+++ b/Source/WebKit/PlatformWin.cmake
@@ -55,8 +55,13 @@ list(APPEND WebKit_SOURCES
@@ -6984,9 +7426,9 @@ index 1003cc3cc60a91e27166ba0891fa63c2d0c27d4c..5d2e09bf814902341a72f4a1cad70a43
+ UIProcess/win/WebPageInspectorEmulationAgentWin.cpp
+ UIProcess/win/WebPageInspectorInputAgentWin.cpp
UIProcess/win/WebPageProxyWin.cpp
+ UIProcess/win/WebPasteboardProxyWin.cpp
UIProcess/win/WebPopupMenuProxyWin.cpp
- UIProcess/win/WebProcessPoolWin.cpp
-@@ -72,6 +77,7 @@ list(APPEND WebKit_SOURCES
+@@ -73,6 +78,7 @@ list(APPEND WebKit_SOURCES
WebProcess/MediaCache/WebMediaKeyStorageManager.cpp
WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp
@@ -7007,10 +7449,10 @@ index 0e5d61c47ecacf219296054edea76a254b8583d6..a728605603fd6f13af0166b6680c1b17
#import <WebKit/_WKContentWorldConfiguration.h>
#import <WebKit/_WKElementAction.h>
diff --git a/Source/WebKit/Shared/AuxiliaryProcess.h b/Source/WebKit/Shared/AuxiliaryProcess.h
-index 637e3d973c5576b4f5df7f2b6b1b42e7a17b1870..b942a2f657c6571369ea05fa018589e096d8ebf6 100644
+index e048f72c6e062285c87aac931e769e3b9e3a8f03..ec6381af446f0cf3ed3379991798c3a1dfca1c63 100644
--- a/Source/WebKit/Shared/AuxiliaryProcess.h
+++ b/Source/WebKit/Shared/AuxiliaryProcess.h
-@@ -220,6 +220,11 @@ struct AuxiliaryProcessInitializationParameters {
+@@ -237,6 +237,11 @@ struct AuxiliaryProcessInitializationParameters {
IPC::Connection::Identifier connectionIdentifier;
HashMap<String, String> extraInitializationData;
WTF::AuxiliaryProcessType processType;
@@ -7023,7 +7465,7 @@ index 637e3d973c5576b4f5df7f2b6b1b42e7a17b1870..b942a2f657c6571369ea05fa018589e0
} // namespace WebKit
diff --git a/Source/WebKit/Shared/NativeWebKeyboardEvent.h b/Source/WebKit/Shared/NativeWebKeyboardEvent.h
-index 63cfe7fc9385af4f17293ad0e43997e688401cd8..e22b7ee6001ee06a731f01c4ca3ab2d3e2e525a8 100644
+index 63cfe7fc9385af4f17293ad0e43997e688401cd8..97391304c73e09654e3b69557f069993b79f47b8 100644
--- a/Source/WebKit/Shared/NativeWebKeyboardEvent.h
+++ b/Source/WebKit/Shared/NativeWebKeyboardEvent.h
@@ -33,6 +33,7 @@
@@ -7054,17 +7496,17 @@ index 63cfe7fc9385af4f17293ad0e43997e688401cd8..e22b7ee6001ee06a731f01c4ca3ab2d3
#elif PLATFORM(IOS_FAMILY)
enum class HandledByInputMethod : bool { No, Yes };
NativeWebKeyboardEvent(::WebEvent *, HandledByInputMethod);
-@@ -82,6 +91,10 @@ public:
- #if USE(LIBWPE)
+@@ -83,6 +92,10 @@ public:
enum class HandledByInputMethod : bool { No, Yes };
NativeWebKeyboardEvent(struct wpe_input_keyboard_event*, const String&, bool isAutoRepeat, HandledByInputMethod, std::optional<Vector<WebCore::CompositionUnderline>>&&, std::optional<EditingRange>&&);
+ #endif
+ NativeWebKeyboardEvent(WebEventType type, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, OptionSet<WebEventModifier> modifiers, MonotonicTime timestamp)
+ : WebKeyboardEvent(type, text, unmodifiedText, key, code, keyIdentifier, windowsVirtualKeyCode, nativeVirtualKeyCode, isAutoRepeat, isKeypad, isSystemKey, modifiers, timestamp)
+ {
+ }
- #endif
#if ENABLE(WPE_PLATFORM)
NativeWebKeyboardEvent(WPEEvent*, const String&, bool isAutoRepeat);
+ NativeWebKeyboardEvent(const String&, std::optional<Vector<WebCore::CompositionUnderline>>&&, std::optional<EditingRange>&&);
@@ -92,6 +105,10 @@ public:
NativeWebKeyboardEvent(struct wpe_input_keyboard_event*, const String&, bool isAutoRepeat, HandledByInputMethod, std::optional<Vector<WebCore::CompositionUnderline>>&&, std::optional<EditingRange>&&);
#elif PLATFORM(WIN)
@@ -7077,14 +7519,14 @@ index 63cfe7fc9385af4f17293ad0e43997e688401cd8..e22b7ee6001ee06a731f01c4ca3ab2d3
#if USE(APPKIT)
diff --git a/Source/WebKit/Shared/NativeWebMouseEvent.h b/Source/WebKit/Shared/NativeWebMouseEvent.h
-index 3f1087581732873bef9aab9de8010804a337e3e5..feb044c070a3042b3c4bf2e81078e52d5c8f7382 100644
+index 3f1087581732873bef9aab9de8010804a337e3e5..50e2d2b026c8ae9a41e70a68937b25f1d7b2544d 100644
--- a/Source/WebKit/Shared/NativeWebMouseEvent.h
+++ b/Source/WebKit/Shared/NativeWebMouseEvent.h
@@ -91,6 +91,11 @@ public:
NativeWebMouseEvent(HWND, UINT message, WPARAM, LPARAM, bool, float deviceScaleFactor);
#endif
-+#if PLATFORM(GTK) || USE(LIBWPE) || PLATFORM(WIN)
++#if PLATFORM(GTK) || PLATFORM(WPE) || PLATFORM(WIN)
+ NativeWebMouseEvent(WebEventType type, WebMouseEventButton button, unsigned short buttons, const WebCore::IntPoint& position, const WebCore::IntPoint& globalPosition, float deltaX, float deltaY, float deltaZ, int clickCount, OptionSet<WebEventModifier> modifiers, MonotonicTime timestamp)
+ : WebMouseEvent({type, modifiers, timestamp}, button, buttons, position, globalPosition, deltaX, deltaY, deltaZ, clickCount, 0, WebEventInputSource::UserDriven) { }
+#endif
@@ -7109,10 +7551,10 @@ index b5361fedd7d921f512956d20819c49d425221080..3628908eeaba9dda7c19ded41b6da6e5
NSEvent* nativeEvent() const { return m_nativeEvent.get(); }
#elif PLATFORM(GTK)
diff --git a/Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in b/Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in
-index 82c7216af6265bcd1c0d2e833b90d0e53206249e..83b7ec9bed2b654c7122865981eaf1c0431d8111 100644
+index d9d82330d74c4dabf8808951d4af918538d9fa23..fb09b7947b59508b2c06cb3711ad19096892f4bb 100644
--- a/Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in
+++ b/Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in
-@@ -1779,6 +1779,9 @@ class WebCore::AuthenticationChallenge {
+@@ -1790,6 +1790,9 @@ class WebCore::AuthenticationChallenge {
class WebCore::DragData {
#if PLATFORM(COCOA)
String pasteboardName();
@@ -7135,7 +7577,7 @@ index 219204814dae3776eaa86c1e91724afc8e57f886..e321bc79e283bb7429375e3e1a6d0e67
WebCore::ResourceResponseBase::Source source;
WebCore::ResourceResponseBase::Type type;
diff --git a/Source/WebKit/Shared/WebKeyboardEvent.cpp b/Source/WebKit/Shared/WebKeyboardEvent.cpp
-index fcadde7e024c363ebdf53d1c20436af5d2512e1a..67cd6dce8d6c1bf66e429c29d9ed0a396718cb80 100644
+index fcadde7e024c363ebdf53d1c20436af5d2512e1a..6187033a2dab443ef0e58921f0c5c4b68aeff7c8 100644
--- a/Source/WebKit/Shared/WebKeyboardEvent.cpp
+++ b/Source/WebKit/Shared/WebKeyboardEvent.cpp
@@ -51,6 +51,24 @@ WebKeyboardEvent::WebKeyboardEvent(WebEvent&& event, const String& text, const S
@@ -7192,7 +7634,7 @@ index fcadde7e024c363ebdf53d1c20436af5d2512e1a..67cd6dce8d6c1bf66e429c29d9ed0a39
#endif
-+#if PLATFORM(WIN) || USE(LIBWPE)
++#if PLATFORM(WIN) || USE(LIBWPE) || ENABLE(WPE_PLATFORM)
+
+WebKeyboardEvent::WebKeyboardEvent(WebEventType type, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, OptionSet<WebEventModifier> modifiers, MonotonicTime timestamp)
+ : WebEvent(type, modifiers, timestamp)
@@ -7260,10 +7702,10 @@ index 10729b775bcafe757febb7bc6d9cbfb3ebebff0d..d2633c721c9bf25fd63ac003501b6b69
void setPosition(const WebCore::DoublePoint& position) { m_position = position; }
const WebCore::DoublePoint& globalPosition() const LIFETIME_BOUND { return m_globalPosition; }
diff --git a/Source/WebKit/Shared/WebPageCreationParameters.h b/Source/WebKit/Shared/WebPageCreationParameters.h
-index f912f9204579a2236579e5b18fab58d2cb99c050..4cdaf27988c3949b292e6a238f42cdb9f47aeaf1 100644
+index 84f3c32ea36525c9687184e445f5a230712f0d89..efe9c9ede5f696da0f0f4e24d06f4e5cebea4fee 100644
--- a/Source/WebKit/Shared/WebPageCreationParameters.h
+++ b/Source/WebKit/Shared/WebPageCreationParameters.h
-@@ -319,6 +319,9 @@ struct WebPageCreationParameters {
+@@ -322,6 +322,9 @@ struct WebPageCreationParameters {
WebCore::ShouldRelaxThirdPartyCookieBlocking shouldRelaxThirdPartyCookieBlocking { WebCore::ShouldRelaxThirdPartyCookieBlocking::No };
bool httpsUpgradeEnabled { true };
@@ -7274,10 +7716,10 @@ index f912f9204579a2236579e5b18fab58d2cb99c050..4cdaf27988c3949b292e6a238f42cdb9
#if ENABLE(APP_HIGHLIGHTS)
WebCore::HighlightVisibility appHighlightsVisible { WebCore::HighlightVisibility::Hidden };
diff --git a/Source/WebKit/Shared/WebPageCreationParameters.serialization.in b/Source/WebKit/Shared/WebPageCreationParameters.serialization.in
-index 8db5473446e6c9f107106b05e3dc21f1952e5655..0736e79e6a4157ba163eebbee7395839d441735b 100644
+index f2d0a2f560b9d9e304d625eaf79c4a274d83f167..96301621fe4b777541e408258db05a2e6b70876b 100644
--- a/Source/WebKit/Shared/WebPageCreationParameters.serialization.in
+++ b/Source/WebKit/Shared/WebPageCreationParameters.serialization.in
-@@ -234,6 +234,9 @@ enum class WebCore::UserInterfaceLayoutDirection : bool;
+@@ -235,6 +235,9 @@ enum class WebCore::UserInterfaceLayoutDirection : bool;
bool httpsUpgradeEnabled;
@@ -7618,7 +8060,7 @@ index b321d93d23d0d1862385b022569dc65323e8691c..ba3bcc9bc20b9512b9288cb2d7e5a3d8
JSC::Config::configureForTesting();
else if (!strcmp(argv[i], "-disable-jit"))
diff --git a/Source/WebKit/Sources.txt b/Source/WebKit/Sources.txt
-index 945dbf6d9acae38895d123da3f690f5c4bd8c8d5..ae7919a223276249fa4dd2499b4aa075e3b93c05 100644
+index d045e30eb77a879a9f7d80d25acb58aa693ceedb..b13bb3518be3a979631d87e07d44f1b4f71dca7f 100644
--- a/Source/WebKit/Sources.txt
+++ b/Source/WebKit/Sources.txt
@@ -402,6 +402,7 @@ UIProcess/AboutSchemeHandler.cpp
@@ -7651,7 +8093,7 @@ index 945dbf6d9acae38895d123da3f690f5c4bd8c8d5..ae7919a223276249fa4dd2499b4aa075
UIProcess/RemotePageDrawingAreaProxy.cpp
UIProcess/RemotePageFullscreenManagerProxy.cpp
UIProcess/RemotePagePlaybackSessionManagerProxy.cpp
-@@ -474,6 +479,8 @@ UIProcess/WebOpenPanelResultListenerProxy.cpp
+@@ -475,6 +480,8 @@ UIProcess/WebOpenPanelResultListenerProxy.cpp
UIProcess/WebPageDiagnosticLoggingClient.cpp
UIProcess/WebPageGroup.cpp
UIProcess/WebPageInjectedBundleClient.cpp
@@ -7660,7 +8102,7 @@ index 945dbf6d9acae38895d123da3f690f5c4bd8c8d5..ae7919a223276249fa4dd2499b4aa075
UIProcess/WebPageProxy.cpp
UIProcess/WebPageProxyMessageReceiverRegistration.cpp @cost:3
UIProcess/WebPageProxyTesting.cpp @cost:4
-@@ -641,6 +648,7 @@ UIProcess/Inspector/WebPageDebuggable.cpp
+@@ -643,6 +650,7 @@ UIProcess/Inspector/WebPageDebuggable.cpp
UIProcess/Inspector/WebPageInspectorController.cpp
UIProcess/Inspector/Agents/InspectorBrowserAgent.cpp
@@ -7669,7 +8111,7 @@ index 945dbf6d9acae38895d123da3f690f5c4bd8c8d5..ae7919a223276249fa4dd2499b4aa075
UIProcess/Inspector/Agents/ProxyingNetworkAgent.cpp
UIProcess/Inspector/Agents/ProxyingPageAgent.cpp
diff --git a/Source/WebKit/SourcesCocoa.txt b/Source/WebKit/SourcesCocoa.txt
-index ebe43f94956aeebb732958d0bc5d15d8bbee0212..ab1028667711086223bd0d3fb76337724c589ca1 100644
+index 6480e45d50b79b108bd9bfc9b98f30de3154b4b0..8ea3f602abb4c8239c31b1ed4169a72f33386a1a 100644
--- a/Source/WebKit/SourcesCocoa.txt
+++ b/Source/WebKit/SourcesCocoa.txt
@@ -288,6 +288,7 @@ UIProcess/API/Cocoa/_WKAttachment.mm @nonARC
@@ -7681,13 +8123,13 @@ index ebe43f94956aeebb732958d0bc5d15d8bbee0212..ab1028667711086223bd0d3fb7633772
UIProcess/API/Cocoa/_WKContextMenuElementInfo.mm @nonARC
UIProcess/API/Cocoa/_WKCustomHeaderFields.mm @nonARC @no-unify-when(bundle<=8)
diff --git a/Source/WebKit/SourcesGTK.txt b/Source/WebKit/SourcesGTK.txt
-index 284881144aff05f7001566644e1d252fb2d49ab7..1e3ea6d6f7e6233d158362784f79f56742ff711c 100644
+index 8b2c6fb5a469416463bb9f7d7783927959a5546f..3376fb04f0c094f14569c7eebff711f92ad731db 100644
--- a/Source/WebKit/SourcesGTK.txt
+++ b/Source/WebKit/SourcesGTK.txt
-@@ -134,6 +134,7 @@ UIProcess/API/glib/WebKitAutomationSession.cpp @no-unify
- UIProcess/API/glib/WebKitBackForwardList.cpp @no-unify
+@@ -134,6 +134,7 @@ UIProcess/API/glib/WebKitBackForwardList.cpp @no-unify
UIProcess/API/glib/WebKitBackForwardListItem.cpp @no-unify
UIProcess/API/glib/WebKitClipboardPermissionRequest.cpp @no-unify
+ UIProcess/API/glib/WebKitColorChooserRequest.cpp @no-unify
+UIProcess/API/glib/WebKitBrowserInspector.cpp @no-unify
UIProcess/API/glib/WebKitContextMenuClient.cpp @no-unify
UIProcess/API/glib/WebKitCookieManager.cpp @no-unify
@@ -7730,18 +8172,18 @@ index 284881144aff05f7001566644e1d252fb2d49ab7..1e3ea6d6f7e6233d158362784f79f567
UIProcess/gtk/WebPasteboardProxyGtk.cpp
UIProcess/gtk/WebPopupMenuProxyGtk.cpp
diff --git a/Source/WebKit/SourcesWPE.txt b/Source/WebKit/SourcesWPE.txt
-index cf0a97b4368aebdffe29726bdca39bf88cd68a6b..2a42f9fe8fe92916f818d5f370c1753f5eb1c8bc 100644
+index a3a592603eef50c431b874d561e41444ff65cac9..f60698f61ef31d49e14bcae9e7a97c3a65f3b8c3 100644
--- a/Source/WebKit/SourcesWPE.txt
+++ b/Source/WebKit/SourcesWPE.txt
-@@ -138,6 +138,7 @@ UIProcess/API/glib/WebKitAuthenticationRequest.cpp @no-unify
- UIProcess/API/glib/WebKitAutomationSession.cpp @no-unify
- UIProcess/API/glib/WebKitBackForwardList.cpp @no-unify
+@@ -139,6 +139,7 @@ UIProcess/API/glib/WebKitBackForwardList.cpp @no-unify
UIProcess/API/glib/WebKitBackForwardListItem.cpp @no-unify
+ UIProcess/API/glib/WebKitClipboardPermissionRequest.cpp @no-unify
+ UIProcess/API/glib/WebKitColorChooserRequest.cpp @no-unify
+UIProcess/API/glib/WebKitBrowserInspector.cpp @no-unify
UIProcess/API/glib/WebKitContextMenuClient.cpp @no-unify
UIProcess/API/glib/WebKitCookieManager.cpp @no-unify
UIProcess/API/glib/WebKitCredential.cpp @no-unify
-@@ -243,6 +244,7 @@ UIProcess/Gamepad/wpe/PlatformGamepadWPE.cpp
+@@ -246,6 +247,7 @@ UIProcess/Gamepad/wpe/PlatformGamepadWPE.cpp
UIProcess/geoclue/GeoclueGeolocationProvider.cpp
@@ -7749,7 +8191,7 @@ index cf0a97b4368aebdffe29726bdca39bf88cd68a6b..2a42f9fe8fe92916f818d5f370c1753f
UIProcess/glib/DRMMainDevice.cpp @no-unify
UIProcess/glib/DisplayLinkGLib.cpp
UIProcess/glib/DisplayVBlankMonitor.cpp
-@@ -250,6 +252,7 @@ UIProcess/glib/DisplayVBlankMonitorDRM.cpp
+@@ -253,6 +255,7 @@ UIProcess/glib/DisplayVBlankMonitorDRM.cpp
UIProcess/glib/DisplayVBlankMonitorThreaded.cpp
UIProcess/glib/DisplayVBlankMonitorTimer.cpp
UIProcess/glib/FenceMonitor.cpp
@@ -7757,7 +8199,7 @@ index cf0a97b4368aebdffe29726bdca39bf88cd68a6b..2a42f9fe8fe92916f818d5f370c1753f
UIProcess/glib/ScreenManager.cpp
UIProcess/glib/SystemSettingsManagerProxy.cpp
UIProcess/glib/TextCheckerGLib.cpp
-@@ -288,9 +291,15 @@ UIProcess/soup/WebProcessPoolSoup.cpp
+@@ -291,9 +294,12 @@ UIProcess/soup/WebProcessPoolSoup.cpp
UIProcess/wpe/AcceleratedBackingStore.cpp
UIProcess/wpe/DisplayVBlankMonitorWPE.cpp
@@ -7765,9 +8207,6 @@ index cf0a97b4368aebdffe29726bdca39bf88cd68a6b..2a42f9fe8fe92916f818d5f370c1753f
UIProcess/wpe/ScreenManagerWPE.cpp
UIProcess/wpe/SystemSettingsManagerProxyWPE.cpp
UIProcess/wpe/WPEUtilities.cpp
-+UIProcess/wpe/WebColorPickerWPE.cpp
-+UIProcess/wpe/WebDataListSuggestionsDropdownWPE.cpp
-+UIProcess/wpe/WebDateTimePickerWPE.cpp
+UIProcess/wpe/WebPageInspectorEmulationAgentWPE.cpp
+UIProcess/wpe/WebPageInspectorInputAgentWPE.cpp
UIProcess/wpe/WebPageProxyWPE.cpp
@@ -8066,10 +8505,10 @@ index dcab0400bfdd58f9d16726aba6ce66492f7be34b..a1337cc7ab9f04fea3f51a3003fdb946
NS_ASSUME_NONNULL_END
diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm b/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm
-index 3e6d8606f048a82d9908340d5939c7fad69a7d33..f94bc4bbdb27bebb0b7b887d4a7a80f6e88decbb 100644
+index 35c1be5406a6822a9b24be951e50b4eee885cfa3..5ec4c01c077ea4aa436587c521deb173a099b3a7 100644
--- a/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm
+++ b/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm
-@@ -57,6 +57,7 @@
+@@ -58,6 +58,7 @@
#import "_WKWebPushActionInternal.h"
#import "_WKWebsiteDataStoreConfigurationInternal.h"
#import "_WKWebsiteDataStoreDelegate.h"
@@ -8077,7 +8516,7 @@ index 3e6d8606f048a82d9908340d5939c7fad69a7d33..f94bc4bbdb27bebb0b7b887d4a7a80f6
#import <WebCore/Credential.h>
#import <WebCore/RegistrableDomain.h>
#import <WebCore/ResourceResponse.h>
-@@ -510,6 +511,11 @@ - (void)removeDataOfTypes:(NSSet *)dataTypes modifiedSince:(NSDate *)date comple
+@@ -511,6 +512,11 @@ - (void)removeDataOfTypes:(NSSet *)dataTypes modifiedSince:(NSDate *)date comple
});
}
@@ -8496,7 +8935,7 @@ index 0000000000000000000000000000000000000000..e0b1da48465c850f541532ed961d1b77
+WebKit::WebPageProxy* webkitBrowserInspectorCreateNewPageInContext(WebKitWebContext*);
+void webkitBrowserInspectorQuitApplication();
diff --git a/Source/WebKit/UIProcess/API/glib/WebKitProtocolHandler.cpp b/Source/WebKit/UIProcess/API/glib/WebKitProtocolHandler.cpp
-index 432afab488fb4bd96640ed218c30065070fe8eda..ba050c8b762e81353d22cf232bf45126af1d16a9 100644
+index 8752d807db8ee40bbb3dea00d4bfb340b73b4674..5b9144db4b636307cc6f8b2f3a411f43621696fb 100644
--- a/Source/WebKit/UIProcess/API/glib/WebKitProtocolHandler.cpp
+++ b/Source/WebKit/UIProcess/API/glib/WebKitProtocolHandler.cpp
@@ -160,51 +160,7 @@ static bool canvasAccelerationEnabled(WebKitURISchemeRequest* request)
@@ -8599,7 +9038,7 @@ index 432afab488fb4bd96640ed218c30065070fe8eda..ba050c8b762e81353d22cf232bf45126
#if USE(GBM)
static String preferredBufferFormats(WebKitURISchemeRequest* request, JSON::Array& jsonArray)
{
-@@ -352,6 +267,87 @@ static String preferredBufferFormats(WebKitURISchemeRequest* request, JSON::Arra
+@@ -353,6 +268,87 @@ static String preferredBufferFormats(WebKitURISchemeRequest* request, JSON::Arra
}
#endif // USE(GBM)
#endif // USE(LIBDRM)
@@ -8687,7 +9126,7 @@ index 432afab488fb4bd96640ed218c30065070fe8eda..ba050c8b762e81353d22cf232bf45126
#endif // PLATFORM(GTK) || (PLATFORM(WPE) && ENABLE(WPE_PLATFORM))
static String vblankMonitorType(const DisplayVBlankMonitor& monitor)
-@@ -382,7 +378,6 @@ static String threadedRenderingInfo(const RenderProcessInfo& info)
+@@ -383,7 +379,6 @@ static String threadedRenderingInfo(const RenderProcessInfo& info)
static String supportedBufferFormats(const RenderProcessInfo& info, JSON::Array& jsonArray)
{
StringBuilder builder;
@@ -8695,7 +9134,7 @@ index 432afab488fb4bd96640ed218c30065070fe8eda..ba050c8b762e81353d22cf232bf45126
for (const auto& format : info.supportedBufferFormats) {
StringBuilder jsonStringBuilder;
auto formatName = webkitDrmGetFormatName(format.fourcc);
-@@ -397,7 +392,6 @@ static String supportedBufferFormats(const RenderProcessInfo& info, JSON::Array&
+@@ -398,7 +393,6 @@ static String supportedBufferFormats(const RenderProcessInfo& info, JSON::Array&
}
jsonArray.pushString(jsonStringBuilder.toString());
}
@@ -8703,7 +9142,7 @@ index 432afab488fb4bd96640ed218c30065070fe8eda..ba050c8b762e81353d22cf232bf45126
return builder.toString();
}
#endif
-@@ -734,14 +728,18 @@ void WebKitProtocolHandler::handleGPU(WebKitURISchemeRequest* request, RenderPro
+@@ -741,14 +735,18 @@ void WebKitProtocolHandler::handleGPU(WebKitURISchemeRequest* request, RenderPro
if (showBuffersInfo) {
#if PLATFORM(GTK) || (PLATFORM(WPE) && ENABLE(WPE_PLATFORM))
addTableRow(hardwareAccelerationObject, "Renderer"_s, dmabufRendererWithSupportedBuffers());
@@ -8808,7 +9247,7 @@ index c1945fbe717a42afc1f51d64a80c7de3fa9009ba..ab63fe19b00ecbd64c9421e6eecad3e2
#endif
+int webkitWebContextExistingCount();
diff --git a/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp b/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp
-index e06955b344812da71dd5f2a23ef4a2bba34697c6..b72eeb03f69451ae32eee0abafd5c0e426a8967f 100644
+index 58d0b72de59c0ce83e6bdfb3679e2edcff74af9e..7cd66d5c70f1e27adbbaff47eb9cdbdd13a005d1 100644
--- a/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp
+++ b/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp
@@ -40,6 +40,7 @@
@@ -8819,29 +9258,42 @@ index e06955b344812da71dd5f2a23ef4a2bba34697c6..b72eeb03f69451ae32eee0abafd5c0e4
#include "WebKitAuthenticationRequestPrivate.h"
#include "WebKitBackForwardListPrivate.h"
#include "WebKitContextMenuClient.h"
-@@ -165,6 +166,7 @@ enum {
- CLOSE,
+@@ -118,6 +119,8 @@
+ #endif
- SCRIPT_DIALOG,
-+ SCRIPT_DIALOG_HANDLED,
+ #if PLATFORM(WPE)
++#include "PageClient.h"
++#include "ViewSnapshotStore.h"
+ #include "WPEUtilities.h"
+ #include "WPEWebViewLegacy.h"
+ #include "WPEWebViewPlatform.h"
+@@ -167,6 +170,7 @@ enum {
+ CLOSE,
+
+ SCRIPT_DIALOG,
++ SCRIPT_DIALOG_HANDLED,
DECIDE_POLICY,
PERMISSION_REQUEST,
-@@ -551,6 +553,13 @@ GRefPtr<WebKitOptionMenu> WebKitWebViewClient::showOptionMenu(WebKitPopupMenu& p
+@@ -562,6 +566,17 @@ bool WebKitWebViewClient::runColorChooser(WebKitColorChooserRequest* request)
void WebKitWebViewClient::frameDisplayed(WKWPE::View&)
{
+
+#if USE(SKIA)
-+ sk_sp<SkImage> surface(webkitWebViewBackendTakeScreenshot(m_webView->priv->backend.get()));
-+ if (surface)
-+ getPage(m_webView).inspectorController().didPaint(WTF::move(surface));
++ // Only capture the frame when the screencast is recording: with WPEPlatform the capture reads
++ // the frame back into CPU memory, which is too expensive to do on every frame for nothing.
++ if (getPage(m_webView).inspectorController().screencastActive()) {
++ // This returns the view's committed buffer.
++ if (RefPtr snapshot = getPage(m_webView).pageClient()->takeViewSnapshot(std::nullopt))
++ getPage(m_webView).inspectorController().didPaint(sk_ref_sp(snapshot->image()));
++ }
+#endif
+
{
SetForScope inFrameDisplayedGuard(m_webView->priv->inFrameDisplayed, true);
for (const auto& callback : m_webView->priv->frameDisplayedCallbacks) {
-@@ -658,7 +667,7 @@ static gboolean webkitWebViewDecidePolicy(WebKitWebView*, WebKitPolicyDecision*
+@@ -674,7 +689,7 @@ static gboolean webkitWebViewDecidePolicy(WebKitWebView*, WebKitPolicyDecision*
static gboolean webkitWebViewPermissionRequest(WebKitWebView*, WebKitPermissionRequest* request)
{
@@ -8850,7 +9302,7 @@ index e06955b344812da71dd5f2a23ef4a2bba34697c6..b72eeb03f69451ae32eee0abafd5c0e4
if (WEBKIT_IS_POINTER_LOCK_PERMISSION_REQUEST(request)) {
webkit_permission_request_allow(request);
return TRUE;
-@@ -1006,6 +1015,10 @@ static void webkitWebViewConstructed(GObject* object)
+@@ -1022,6 +1037,10 @@ static void webkitWebViewConstructed(GObject* object)
priv->websitePolicies = adoptGRef(webkit_website_policies_new());
Ref configuration = priv->relatedView && priv->relatedView->priv->configurationForNextRelatedView ? priv->relatedView->priv->configurationForNextRelatedView.releaseNonNull() : webkitWebViewCreatePageConfiguration(webView);
@@ -8861,7 +9313,7 @@ index e06955b344812da71dd5f2a23ef4a2bba34697c6..b72eeb03f69451ae32eee0abafd5c0e4
webkitWebViewCreatePage(webView, WTF::move(configuration));
webkitWebContextWebViewCreated(priv->context.get(), webView);
-@@ -2119,6 +2132,15 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass)
+@@ -2154,6 +2173,15 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass)
G_TYPE_BOOLEAN, 1,
WEBKIT_TYPE_SCRIPT_DIALOG);
@@ -8877,7 +9329,7 @@ index e06955b344812da71dd5f2a23ef4a2bba34697c6..b72eeb03f69451ae32eee0abafd5c0e4
/**
* WebKitWebView::decide-policy:
* @web_view: the #WebKitWebView on which the signal is emitted
-@@ -2953,6 +2975,23 @@ void webkitWebViewRunJavaScriptBeforeUnloadConfirm(WebKitWebView* webView, const
+@@ -2951,6 +2979,23 @@ void webkitWebViewRunJavaScriptBeforeUnloadConfirm(WebKitWebView* webView, const
webkit_script_dialog_unref(webView->priv->currentScriptDialog);
}
@@ -8902,7 +9354,7 @@ index e06955b344812da71dd5f2a23ef4a2bba34697c6..b72eeb03f69451ae32eee0abafd5c0e4
{
if (!webView->priv->currentScriptDialog)
diff --git a/Source/WebKit/UIProcess/API/glib/WebKitWebViewPrivate.h b/Source/WebKit/UIProcess/API/glib/WebKitWebViewPrivate.h
-index 8bff6235bb227ed9e53017f45ce6469dede379fb..34a4c07514c1661ea7e333de5ea674123b809b2f 100644
+index 2d325be75da2629fedaa5961fa6e13f7a330a3b3..987f03ae8155562ea266dc3c663385e7e4d9ee49 100644
--- a/Source/WebKit/UIProcess/API/glib/WebKitWebViewPrivate.h
+++ b/Source/WebKit/UIProcess/API/glib/WebKitWebViewPrivate.h
@@ -67,6 +67,7 @@ void webkitWebViewRunJavaScriptAlert(WebKitWebView*, const CString& message, Fun
@@ -8914,7 +9366,7 @@ index 8bff6235bb227ed9e53017f45ce6469dede379fb..34a4c07514c1661ea7e333de5ea67412
bool webkitWebViewIsScriptDialogRunning(WebKitWebView*, WebKitScriptDialog*);
String webkitWebViewGetCurrentScriptDialogMessage(WebKitWebView*);
diff --git a/Source/WebKit/UIProcess/API/glib/webkit.h.in b/Source/WebKit/UIProcess/API/glib/webkit.h.in
-index 18ced4d6462b2e63ec32556eee8d8a88a205cb8f..b19d962dbf55603bd0a6ad658200b1b6dc95e234 100644
+index 2b43c87ea2289a83f45d1911b95464ca3c6d3d98..74e53dc054979e375a2da0eb5c882cfe509a2a8b 100644
--- a/Source/WebKit/UIProcess/API/glib/webkit.h.in
+++ b/Source/WebKit/UIProcess/API/glib/webkit.h.in
@@ -45,6 +45,7 @@
@@ -8922,11 +9374,11 @@ index 18ced4d6462b2e63ec32556eee8d8a88a205cb8f..b19d962dbf55603bd0a6ad658200b1b6
#include <@API_INCLUDE_PREFIX@/WebKitBackForwardList.h>
#include <@API_INCLUDE_PREFIX@/WebKitBackForwardListItem.h>
+#include <@API_INCLUDE_PREFIX@/WebKitBrowserInspector.h>
- #if PLATFORM(GTK)
#include <@API_INCLUDE_PREFIX@/WebKitClipboardPermissionRequest.h>
#include <@API_INCLUDE_PREFIX@/WebKitColorChooserRequest.h>
+ #include <@API_INCLUDE_PREFIX@/WebKitContextMenu.h>
diff --git a/Source/WebKit/UIProcess/API/gtk/PageClientImpl.cpp b/Source/WebKit/UIProcess/API/gtk/PageClientImpl.cpp
-index 9d7dabca16d734fa1223f9deacc6bbb6894f00c4..fa72a696be81e2f23e4ca5dac4221c0bf5eb67a9 100644
+index 9c0412308aa761f63f739b6dce90b1393504c625..fa334fdd1c233ee083c438520e68f3702f0fb598 100644
--- a/Source/WebKit/UIProcess/API/gtk/PageClientImpl.cpp
+++ b/Source/WebKit/UIProcess/API/gtk/PageClientImpl.cpp
@@ -246,7 +246,7 @@ WebCore::IntPoint PageClientImpl::accessibilityScreenToRootView(const WebCore::I
@@ -8960,7 +9412,7 @@ index 9d7dabca16d734fa1223f9deacc6bbb6894f00c4..fa72a696be81e2f23e4ca5dac4221c0b
void PageClientImpl::didChangeContentSize(const IntSize& size)
diff --git a/Source/WebKit/UIProcess/API/gtk/PageClientImpl.h b/Source/WebKit/UIProcess/API/gtk/PageClientImpl.h
-index c3cc3b4489067a03653036a4f9b436667727f2dc..d3c029ff566473be8b47d5c10ce9dc5455f25d69 100644
+index 3fbe6d9011e54e35ba98c36343a0eab4fcd3426b..b3c05aa434c228ab347fdf8d6981abb4d343e25e 100644
--- a/Source/WebKit/UIProcess/API/gtk/PageClientImpl.h
+++ b/Source/WebKit/UIProcess/API/gtk/PageClientImpl.h
@@ -104,7 +104,7 @@ private:
@@ -9065,7 +9517,7 @@ index 0000000000000000000000000000000000000000..1d6c987019e69d2e1ab97266d0118054
+
+#endif
diff --git a/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp b/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp
-index 12d114c4823bd64b2b836fa76157c44fe8291a07..521db62435bc244e28bd861ce560ff1416d99279 100644
+index ecfe01bc5646a6715f6f786ed128e7b457753696..420cda46b00ecd05620afc604bf7253fefe1c622 100644
--- a/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp
+++ b/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp
@@ -2879,6 +2879,11 @@ void webkitWebViewBaseResetClickCounter(WebKitWebViewBase* webkitWebViewBase)
@@ -9123,7 +9575,7 @@ index d84099f5109a4a0a8a0b51d4f46ce059460b8280..48d56239c4595053696a63fa48c69db0
+
+WebKit::AcceleratedBackingStore* webkitWebViewBaseGetAcceleratedBackingStore(WebKitWebViewBase*);
diff --git a/Source/WebKit/UIProcess/API/wpe/APIViewClient.h b/Source/WebKit/UIProcess/API/wpe/APIViewClient.h
-index 9091ae5198e765c2cfe0584d121afe4f88df3c0e..b0efedec419673ef2bfd0fd79406774e24aa98e9 100644
+index 951a88b53420cd22248582f5888d9299bccd066a..a75fe640470fcad8dd653606e705572ba39be5d7 100644
--- a/Source/WebKit/UIProcess/API/wpe/APIViewClient.h
+++ b/Source/WebKit/UIProcess/API/wpe/APIViewClient.h
@@ -26,6 +26,9 @@
@@ -9149,23 +9601,10 @@ index 9091ae5198e765c2cfe0584d121afe4f88df3c0e..b0efedec419673ef2bfd0fd79406774e
virtual void didChangePageID(WKWPE::View&) { }
virtual void didReceiveUserMessage(WKWPE::View&, WebKit::UserMessage&&, CompletionHandler<void(WebKit::UserMessage&&)>&& completionHandler) { completionHandler(WebKit::UserMessage()); }
diff --git a/Source/WebKit/UIProcess/API/wpe/PageClientImpl.cpp b/Source/WebKit/UIProcess/API/wpe/PageClientImpl.cpp
-index 0f14ad703cc8fe790cd3a13f25caf25aaf10db82..a191cd0c5dd1b05b9bc6bda9c0ca971e0cacb278 100644
+index 0d535dca6e42542185b6edd86aa86a02e23e7498..b2a7c99ebf9e38a82161d6de05a4202a0c1ff463 100644
--- a/Source/WebKit/UIProcess/API/wpe/PageClientImpl.cpp
+++ b/Source/WebKit/UIProcess/API/wpe/PageClientImpl.cpp
-@@ -36,9 +36,12 @@
- #include "WPEWebViewLegacy.h"
- #include "WPEWebViewPlatform.h"
- #include "WebColorPicker.h"
-+#include "WebColorPickerWPE.h"
-+#include "WebDateTimePickerWPE.h"
- #include "WebContextMenuProxy.h"
- #include "WebContextMenuProxyWPE.h"
- #include "WebDataListSuggestionsDropdown.h"
-+#include "WebDataListSuggestionsDropdownWPE.h"
- #include "WebDateTimePicker.h"
- #include "WebKitPopupMenu.h"
- #include <WebCore/ActivityState.h>
-@@ -62,6 +65,12 @@
+@@ -65,6 +65,12 @@
#include <wpe/wpe.h>
#endif
@@ -9178,7 +9617,7 @@ index 0f14ad703cc8fe790cd3a13f25caf25aaf10db82..a191cd0c5dd1b05b9bc6bda9c0ca971e
namespace WebKit {
WTF_MAKE_TZONE_ALLOCATED_IMPL(PageClientImpl);
-@@ -237,7 +246,7 @@ WebCore::IntPoint PageClientImpl::accessibilityScreenToRootView(const WebCore::I
+@@ -240,7 +246,7 @@ WebCore::IntPoint PageClientImpl::accessibilityScreenToRootView(const WebCore::I
WebCore::IntRect PageClientImpl::rootViewToAccessibilityScreen(const WebCore::IntRect& rect)
{
@@ -9187,26 +9626,7 @@ index 0f14ad703cc8fe790cd3a13f25caf25aaf10db82..a191cd0c5dd1b05b9bc6bda9c0ca971e
}
void PageClientImpl::doneWithKeyEvent(const NativeWebKeyboardEvent&, bool)
-@@ -325,14 +334,14 @@ Ref<WebContextMenuProxy> PageClientImpl::createContextMenuProxy(WebPageProxy& pa
- }
- #endif
-
--RefPtr<WebColorPicker> PageClientImpl::createColorPicker(WebPageProxy&, const WebCore::Color& intialColor, const WebCore::IntRect&, ColorControlSupportsAlpha supportsAlpha, Vector<WebCore::Color>&&, std::optional<WebCore::FrameIdentifier>)
-+RefPtr<WebColorPicker> PageClientImpl::createColorPicker(WebPageProxy& page, const WebCore::Color& intialColor, const WebCore::IntRect& rect, ColorControlSupportsAlpha supportsAlpha, Vector<WebCore::Color>&&, std::optional<WebCore::FrameIdentifier> frameID)
- {
-- return nullptr;
-+ return WebColorPickerWPE::create(page, intialColor, rect, frameID);
- }
-
--RefPtr<WebDataListSuggestionsDropdown> PageClientImpl::createDataListSuggestionsDropdown(WebPageProxy&)
-+RefPtr<WebKit::WebDataListSuggestionsDropdown> PageClientImpl::createDataListSuggestionsDropdown(WebKit::WebPageProxy& page)
- {
-- return nullptr;
-+ return WebDataListSuggestionsDropdownWPE::create(page);
- }
-
- RefPtr<WebDateTimePicker> PageClientImpl::createDateTimePicker(WebPageProxy& page)
-@@ -592,11 +601,11 @@ void PageClientImpl::callAfterNextPresentationUpdate(CompletionHandler<void()>&&
+@@ -607,11 +613,11 @@ void PageClientImpl::callAfterNextPresentationUpdate(CompletionHandler<void()>&&
m_view.callAfterNextPresentationUpdate(WTF::move(callback));
}
@@ -9220,40 +9640,24 @@ index 0f14ad703cc8fe790cd3a13f25caf25aaf10db82..a191cd0c5dd1b05b9bc6bda9c0ca971e
// FIXME Forward the Expected in https://webkit.org/b/300271
if (snapshot)
return WTF::move(snapshot.value());
-@@ -607,4 +616,11 @@ RefPtr<ViewSnapshot> PageClientImpl::takeViewSnapshot(std::optional<WebCore::Int
- return nullptr;
- }
-
-+#if ENABLE(DATE_AND_TIME_INPUT_TYPES)
-+RefPtr<WebDateTimePicker> PageClientImpl::createDateTimePicker(WebPageProxy& page)
-+{
-+ return WebDateTimePickerWPE::create(page);
-+}
-+#endif
-+
- } // namespace WebKit
diff --git a/Source/WebKit/UIProcess/API/wpe/PageClientImpl.h b/Source/WebKit/UIProcess/API/wpe/PageClientImpl.h
-index 8a02b69c2a1f49bcf12bc7e1684e5b643c6a6417..84780a2f44362a204af8289644d0c287006c82bb 100644
+index 5c8040f89edabd59f15caeca4e5dd0dc95898474..ab6a14bb6917ec2fedf9f8f1f808812c6c889340 100644
--- a/Source/WebKit/UIProcess/API/wpe/PageClientImpl.h
+++ b/Source/WebKit/UIProcess/API/wpe/PageClientImpl.h
-@@ -196,7 +196,11 @@ private:
+@@ -197,7 +197,7 @@ private:
WebKitWebResourceLoadManager* webResourceLoadManager() override;
- RefPtr<ViewSnapshot> takeViewSnapshot(std::optional<WebCore::IntRect>&&) override;
+ RefPtr<ViewSnapshot> takeViewSnapshot(std::optional<WebCore::IntRect>&&, bool nominalResolution) override;
-+
-+#if ENABLE(DATE_AND_TIME_INPUT_TYPES)
-+ RefPtr<WebDateTimePicker> createDateTimePicker(WebPageProxy&) override;
-+#endif
WKWPE::View& m_view;
DefaultUndoController m_undoController;
diff --git a/Source/WebKit/UIProcess/API/wpe/WPEWebViewPlatform.cpp b/Source/WebKit/UIProcess/API/wpe/WPEWebViewPlatform.cpp
-index b6a956287581840046b69366178254976f41d175..1bc1efbffe212f7f2ab7fcf71c9b164d6a787198 100644
+index dff7c5a47202fd66f3d92e46dc0d572e115d0a35..5b9ff1df39750b8469f4b55915a8e079ac8e6265 100644
--- a/Source/WebKit/UIProcess/API/wpe/WPEWebViewPlatform.cpp
+++ b/Source/WebKit/UIProcess/API/wpe/WPEWebViewPlatform.cpp
-@@ -651,9 +651,9 @@ void ViewPlatform::callAfterNextPresentationUpdate(CompletionHandler<void()>&& c
+@@ -692,9 +692,9 @@ void ViewPlatform::callAfterNextPresentationUpdate(CompletionHandler<void()>&& c
}
}
@@ -9370,82 +9774,11 @@ index 0000000000000000000000000000000000000000..22baa003f1220a87d5c1012cd485a6fe
+G_END_DECLS
+
+#endif
-diff --git a/Source/WebKit/UIProcess/API/wpe/WebKitWebViewBackend.cpp b/Source/WebKit/UIProcess/API/wpe/WebKitWebViewBackend.cpp
-index 96170b6fd5f7dfc9ae97019f1dae74ee686f3a89..731d1aa724878543872a604c55da6b0affca45b6 100644
---- a/Source/WebKit/UIProcess/API/wpe/WebKitWebViewBackend.cpp
-+++ b/Source/WebKit/UIProcess/API/wpe/WebKitWebViewBackend.cpp
-@@ -56,6 +56,7 @@ struct _WebKitWebViewBackend {
- struct wpe_view_backend* backend;
- GDestroyNotify notifyCallback;
- gpointer notifyCallbackData;
-+ take_screenshot_callback screenshotCallback;
- int referenceCount { 1 };
- };
-
-@@ -118,6 +119,19 @@ struct wpe_view_backend* webkit_web_view_backend_get_wpe_backend(WebKitWebViewBa
- return viewBackend->backend;
- }
-
-+void webkit_web_view_backend_set_screenshot_callback(WebKitWebViewBackend *view_backend, take_screenshot_callback callback)
-+{
-+ view_backend->screenshotCallback = callback;
-+}
-+
-+PlatformImage webkitWebViewBackendTakeScreenshot(WebKitWebViewBackend* view_backend)
-+{
-+ if (!view_backend->screenshotCallback)
-+ return nullptr;
-+
-+ return view_backend->screenshotCallback(view_backend->notifyCallbackData);
-+}
-+
- namespace WTF {
- WTF_DEFINE_GREF_TRAITS(WebKitWebViewBackend, webkitWebViewBackendRef, webkitWebViewBackendUnref)
- }
-diff --git a/Source/WebKit/UIProcess/API/wpe/WebKitWebViewBackend.h b/Source/WebKit/UIProcess/API/wpe/WebKitWebViewBackend.h
-index 16dcc1f69c38cd8ad630bc49d6d69feaa3aa811e..98677028c19c12c3b6d513bb5e45375a1528fe8a 100644
---- a/Source/WebKit/UIProcess/API/wpe/WebKitWebViewBackend.h
-+++ b/Source/WebKit/UIProcess/API/wpe/WebKitWebViewBackend.h
-@@ -28,6 +28,11 @@
- #include <wpe/WebKitDefines.h>
- #include <wpe/wpe.h>
-
-+#if defined(USE_SKIA) && USE_SKIA
-+#include <skia/core/SkImage.h>
-+using PlatformImage = SkImage*;
-+#endif
-+
- G_BEGIN_DECLS
-
- #define WEBKIT_TYPE_WEB_VIEW_BACKEND (webkit_web_view_backend_get_type())
-@@ -44,6 +49,12 @@ webkit_web_view_backend_new (struct wpe_view_backend *backend,
- WEBKIT_API struct wpe_view_backend *
- webkit_web_view_backend_get_wpe_backend (WebKitWebViewBackend *view_backend);
-
-+typedef PlatformImage (*take_screenshot_callback)(gpointer user_data);
-+
-+WEBKIT_API void
-+webkit_web_view_backend_set_screenshot_callback (WebKitWebViewBackend *view_backend,
-+ take_screenshot_callback callback);
-+
- G_END_DECLS
-
- #endif /* WebKitWebViewBackend_h */
-diff --git a/Source/WebKit/UIProcess/API/wpe/WebKitWebViewBackendPrivate.h b/Source/WebKit/UIProcess/API/wpe/WebKitWebViewBackendPrivate.h
-index 21131a4d26ba115f3249b227d3e1dabd42398c80..7b1a6e98f3c1fb5ef5d54f416c49ba3e6188dcf4 100644
---- a/Source/WebKit/UIProcess/API/wpe/WebKitWebViewBackendPrivate.h
-+++ b/Source/WebKit/UIProcess/API/wpe/WebKitWebViewBackendPrivate.h
-@@ -32,3 +32,5 @@ WTF_DECLARE_GREF_TRAITS(WebKitWebViewBackend)
- void webkitWebViewBackendUnref(WebKitWebViewBackend*);
-
- #endif // USE(LIBWPE)
-+
-+PlatformImage webkitWebViewBackendTakeScreenshot(WebKitWebViewBackend*);
diff --git a/Source/WebKit/UIProcess/Automation/WebAutomationSession.h b/Source/WebKit/UIProcess/Automation/WebAutomationSession.h
-index b7596a4c384d5cc0c21cc1bef1bc695c2c5275af..4fdb0cdb0c761aa48373e1eae0d132c0b40aa1b7 100644
+index c55202e54c6a51d663afe184f950fe56d767c605..a8d55f5d3441fbf26e5f2e188e200e32d178e1f8 100644
--- a/Source/WebKit/UIProcess/Automation/WebAutomationSession.h
+++ b/Source/WebKit/UIProcess/Automation/WebAutomationSession.h
-@@ -333,6 +333,8 @@ public:
+@@ -336,6 +336,8 @@ public:
void didDestroyFrame(WebCore::FrameIdentifier);
@@ -9454,7 +9787,7 @@ index b7596a4c384d5cc0c21cc1bef1bc695c2c5275af..4fdb0cdb0c761aa48373e1eae0d132c0
RefPtr<WebPageProxy> webPageProxyForHandle(const String&);
String effectiveHandleForWebFrameProxy(const WebFrameProxy&);
String handleForWebFrameID(std::optional<WebCore::FrameIdentifier>);
-@@ -400,7 +402,6 @@ private:
+@@ -403,7 +405,6 @@ private:
// Get base64-encoded PNG data from a bitmap.
static std::optional<String> platformGetBase64EncodedPNGData(WebCore::ShareableBitmap::Handle&&);
@@ -9463,7 +9796,7 @@ index b7596a4c384d5cc0c21cc1bef1bc695c2c5275af..4fdb0cdb0c761aa48373e1eae0d132c0
// Save base64-encoded file contents to a local file path and return the path.
// This reuses the basename of the remote file path so that the filename exposed to DOM API remains the same.
diff --git a/Source/WebKit/UIProcess/AuxiliaryProcessProxy.cpp b/Source/WebKit/UIProcess/AuxiliaryProcessProxy.cpp
-index 4128fa8680361ffa99db7984cfa306f9fb8ffdd3..48a0f29f82a76a3785e7b6a8889ae461ff925187 100644
+index bdcf6c24e4bef75fdab6b41d3c09e8fc557deebf..5a4444b7f83325440a2b1c0d494560b367933bcf 100644
--- a/Source/WebKit/UIProcess/AuxiliaryProcessProxy.cpp
+++ b/Source/WebKit/UIProcess/AuxiliaryProcessProxy.cpp
@@ -200,7 +200,11 @@ void AuxiliaryProcessProxy::getLaunchOptions(ProcessLauncher::LaunchOptions& lau
@@ -9479,10 +9812,10 @@ index 4128fa8680361ffa99db7984cfa306f9fb8ffdd3..48a0f29f82a76a3785e7b6a8889ae461
platformGetLaunchOptions(launchOptions);
}
diff --git a/Source/WebKit/UIProcess/AuxiliaryProcessProxy.h b/Source/WebKit/UIProcess/AuxiliaryProcessProxy.h
-index e09764985ea23e5e1f26a3cf1718fb39353b08ce..faacac0f785bb4adf9b1ced275489c63bef0633b 100644
+index fb53778f50cbd4ca1ed6b0f138013422ff580802..0333b36d95e164db6960244dce6461d2a376b159 100644
--- a/Source/WebKit/UIProcess/AuxiliaryProcessProxy.h
+++ b/Source/WebKit/UIProcess/AuxiliaryProcessProxy.h
-@@ -305,13 +305,16 @@ protected:
+@@ -337,13 +337,16 @@ protected:
InitializationActivityAndGrant initializationActivityAndGrant();
@@ -9700,7 +10033,7 @@ index 4bbca9a3e6b05ea9282808bd0da0d31a9b1356a3..208535f6e28966176d393f502e5a918c
{
RefPtr uiDelegate = m_uiDelegate.get();
diff --git a/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm b/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm
-index 95cc92bda5a98c782b0f2fd237ad04fc24a6eb2a..ba72ab1745bf641d9f50e38692e1ff1fb2424aff 100644
+index c4b70744eeac51b8b9f0da691e4bedb26bdf8fc2..e514c2191dd3289381403213a99e1310b5ba9744 100644
--- a/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm
+++ b/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm
@@ -45,7 +45,9 @@
@@ -9713,7 +10046,7 @@ index 95cc92bda5a98c782b0f2fd237ad04fc24a6eb2a..ba72ab1745bf641d9f50e38692e1ff1f
#import "PlatformXRSystem.h"
#import "PlaybackSessionManagerProxy.h"
#import "RemoteLayerTreeCommitBundle.h"
-@@ -498,11 +500,85 @@ bool WebPageProxy::scrollingUpdatesDisabledForTesting()
+@@ -485,11 +487,85 @@ bool WebPageProxy::scrollingUpdatesDisabledForTesting()
void WebPageProxy::startDrag(const DragItem& dragItem, ShareableBitmap::Handle&& dragImageHandle, const std::optional<NodeIdentifier>& nodeID, const std::optional<FrameIdentifier>& frameID)
{
@@ -9825,7 +10158,7 @@ index c76b60616bf92b9bf89522d29addd9b4c32d733f..7df4cb16b6b7a4449d1a8f1b6aef26c9
m_activationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:NSApplicationDidBecomeActiveNotification object:NSAppSingleton() queue:[NSOperationQueue currentQueue] usingBlock:^(NSNotification *notification) {
diff --git a/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp b/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp
-index be40fa0e3e3e8698c29f70a2b8dac324225aba97..6f8d77d390d41b40b1099baf53e3a3c1131de679 100644
+index 931f7dc80030d61bafdeae53363c6d30cea2df84..8ddc2db6172fa949dd6606ce70f524389119c64a 100644
--- a/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp
+++ b/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp
@@ -33,6 +33,7 @@
@@ -9898,7 +10231,7 @@ index be40fa0e3e3e8698c29f70a2b8dac324225aba97..6f8d77d390d41b40b1099baf53e3a3c1
bool DrawingAreaProxyCoordinatedGraphics::alwaysUseCompositing() const
{
if (!page())
-@@ -301,6 +343,12 @@ void DrawingAreaProxyCoordinatedGraphics::didUpdateGeometry()
+@@ -306,6 +348,12 @@ void DrawingAreaProxyCoordinatedGraphics::didUpdateGeometry()
// we need to resend the new size here.
if (m_lastSentSize != size())
sendUpdateGeometry();
@@ -10365,10 +10698,10 @@ index 0000000000000000000000000000000000000000..6a89043bb0b8f6a22ee9af2b271de349
+WTF_ALLOW_UNSAFE_BUFFER_USAGE_END
diff --git a/Source/WebKit/UIProcess/Inspector/Agents/InspectorScreencastAgent.h b/Source/WebKit/UIProcess/Inspector/Agents/InspectorScreencastAgent.h
new file mode 100644
-index 0000000000000000000000000000000000000000..afadd2371dffab9d4b92e4245f5622828c8fded1
+index 0000000000000000000000000000000000000000..1d7a002623a273ef98e9f0d2cd6996f7685649ea
--- /dev/null
+++ b/Source/WebKit/UIProcess/Inspector/Agents/InspectorScreencastAgent.h
-@@ -0,0 +1,100 @@
+@@ -0,0 +1,102 @@
+/*
+ * Copyright (C) 2020 Microsoft Corporation.
+ *
@@ -10442,6 +10775,8 @@ index 0000000000000000000000000000000000000000..afadd2371dffab9d4b92e4245f562282
+ void didPaint(sk_sp<SkImage>&& surface);
+#endif
+
++ bool isActive() const { return m_screencast; }
++
+ Inspector::Protocol::ErrorStringOr<int /* generation */> startScreencast(int width, int height, int toolbarHeight, int quality) override;
+ Inspector::Protocol::ErrorStringOr<void> screencastFrameAck(int generation) override;
+ Inspector::Protocol::ErrorStringOr<void> stopScreencast() override;
@@ -10470,10 +10805,10 @@ index 0000000000000000000000000000000000000000..afadd2371dffab9d4b92e4245f562282
+
+} // namespace WebKit
diff --git a/Source/WebKit/UIProcess/Inspector/Agents/ProxyingNetworkAgent.cpp b/Source/WebKit/UIProcess/Inspector/Agents/ProxyingNetworkAgent.cpp
-index 10e9e5e244c8c215efcc378aea79efc31a75337e..8b1e9b6a0907e7c41d518cd389edb4ee4ea09e77 100644
+index e2973d233255eeff7637bdc130dfafc84c232ad8..6512986b61b2ed78528a5be7f2a798b79f369b10 100644
--- a/Source/WebKit/UIProcess/Inspector/Agents/ProxyingNetworkAgent.cpp
+++ b/Source/WebKit/UIProcess/Inspector/Agents/ProxyingNetworkAgent.cpp
-@@ -441,6 +441,12 @@ CommandResult<void> ProxyingNetworkAgent::interceptRequestWithError(const Protoc
+@@ -524,6 +524,12 @@ CommandResult<void> ProxyingNetworkAgent::interceptRequestWithError(const Protoc
return { };
}
@@ -10487,10 +10822,10 @@ index 10e9e5e244c8c215efcc378aea79efc31a75337e..8b1e9b6a0907e7c41d518cd389edb4ee
CommandResult<void> ProxyingNetworkAgent::setEmulatedConditions(std::optional<int>&& bytesPerSecondLimit)
diff --git a/Source/WebKit/UIProcess/Inspector/Agents/ProxyingNetworkAgent.h b/Source/WebKit/UIProcess/Inspector/Agents/ProxyingNetworkAgent.h
-index bbc609f7bc0b137174094728a1118b2ecec7c9e7..176e24ce76cbe0ebaa0532bf1bee0a1951ab8ee5 100644
+index 6339daf6a7cee5b2dda844730bf5d2c17bdef3cd..0587b597eeccd0a99c4261d770133604d611c858 100644
--- a/Source/WebKit/UIProcess/Inspector/Agents/ProxyingNetworkAgent.h
+++ b/Source/WebKit/UIProcess/Inspector/Agents/ProxyingNetworkAgent.h
-@@ -93,6 +93,7 @@ public:
+@@ -91,6 +91,7 @@ public:
CommandResult<void> interceptWithResponse(const Protocol::Network::RequestId&, const String& content, bool base64Encoded, const String& mimeType, std::optional<int>&& status, const String& statusText, RefPtr<JSON::Object>&& headers) final;
CommandResult<void> interceptRequestWithResponse(const Protocol::Network::RequestId&, const String& content, bool base64Encoded, const String& mimeType, int status, const String& statusText, Ref<JSON::Object>&& headers) final;
CommandResult<void> interceptRequestWithError(const Protocol::Network::RequestId&, Protocol::Network::ResourceErrorType) final;
@@ -10499,7 +10834,7 @@ index bbc609f7bc0b137174094728a1118b2ecec7c9e7..176e24ce76cbe0ebaa0532bf1bee0a19
CommandResult<void> setEmulatedConditions(std::optional<int>&& bytesPerSecondLimit) final;
#endif
diff --git a/Source/WebKit/UIProcess/Inspector/Agents/ProxyingPageAgent.cpp b/Source/WebKit/UIProcess/Inspector/Agents/ProxyingPageAgent.cpp
-index 6273e8d7ad6e5e1c0f9add34821f3c3d36449982..98da2baf085451cff18a9871258c2cff559b7084 100644
+index 038aab825e3ea8d787a9bac02af7c5389a38d65c..d95d23e03b44f75e87d9258c7e48992f9eeaea36 100644
--- a/Source/WebKit/UIProcess/Inspector/Agents/ProxyingPageAgent.cpp
+++ b/Source/WebKit/UIProcess/Inspector/Agents/ProxyingPageAgent.cpp
@@ -128,12 +128,14 @@ void ProxyingPageAgent::frameNavigated(FrameIdentifier frameID, const URL& url,
@@ -10519,7 +10854,7 @@ index 6273e8d7ad6e5e1c0f9add34821f3c3d36449982..98da2baf085451cff18a9871258c2cff
}
void ProxyingPageAgent::frameDetached(FrameIdentifier)
-@@ -634,17 +636,82 @@ CommandResult<void> ProxyingPageAgent::setShowPaintRects(bool)
+@@ -696,17 +698,82 @@ CommandResult<void> ProxyingPageAgent::setShowPaintRects(bool show)
return { };
}
@@ -10603,7 +10938,7 @@ index 6273e8d7ad6e5e1c0f9add34821f3c3d36449982..98da2baf085451cff18a9871258c2cff
{
return makeUnexpected("Not yet implemented under Site Isolation"_s);
}
-@@ -656,11 +723,9 @@ CommandResult<String> ProxyingPageAgent::archive()
+@@ -718,11 +785,9 @@ CommandResult<String> ProxyingPageAgent::archive()
}
#endif
@@ -10616,10 +10951,10 @@ index 6273e8d7ad6e5e1c0f9add34821f3c3d36449982..98da2baf085451cff18a9871258c2cff
} // namespace Inspector
diff --git a/Source/WebKit/UIProcess/Inspector/Agents/ProxyingPageAgent.h b/Source/WebKit/UIProcess/Inspector/Agents/ProxyingPageAgent.h
-index 38e4309adedda3ff6533d36a1ea56aa8f597d802..ebbbacb068f9e936d61f494fd736f384c3093d85 100644
+index b6245ae311306d4080b74232cd45324066a7d638..64c882ed05c1fb879985331995d49f991779051b 100644
--- a/Source/WebKit/UIProcess/Inspector/Agents/ProxyingPageAgent.h
+++ b/Source/WebKit/UIProcess/Inspector/Agents/ProxyingPageAgent.h
-@@ -93,15 +93,26 @@ public:
+@@ -92,15 +92,26 @@ public:
CommandResult<void> setShowRulers(bool) final;
#endif
CommandResult<void> setShowPaintRects(bool) final;
@@ -10712,7 +11047,7 @@ index 88fe6b2104c5e26cee4a975a552e8a2c78f44129..6e185a255c83f8e311911bee4a673f33
WeakPtr<ProvisionalPageProxy> m_provisionalPage;
};
diff --git a/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.cpp b/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.cpp
-index d7279a951aba2b48fcc37be72952eddc7124747f..01cecbce3e15e325450abb0ff15c9e9fd00b6654 100644
+index 384e49ec836db1b82af8cf44db0d3ef27b8a58a6..29179aa9b1054148302b05cb4958cc8e78e14b2b 100644
--- a/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.cpp
+++ b/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.cpp
@@ -26,10 +26,14 @@
@@ -10887,7 +11222,7 @@ index d7279a951aba2b48fcc37be72952eddc7124747f..01cecbce3e15e325450abb0ff15c9e9f
Ref inspectedPage = m_inspectedPage.get();
inspectedPage->didChangeInspectorFrontendCount(m_frontendRouter->frontendCount());
-@@ -200,6 +306,66 @@ void WebPageInspectorController::setIndicating(bool indicating)
+@@ -200,6 +306,71 @@ void WebPageInspectorController::setIndicating(bool indicating)
}
#endif
@@ -10901,6 +11236,11 @@ index d7279a951aba2b48fcc37be72952eddc7124747f..01cecbce3e15e325450abb0ff15c9e9f
+}
+#endif
+
++bool WebPageInspectorController::screencastActive() const
++{
++ return m_screecastAgent && m_screecastAgent->isActive();
++}
++
+
+void WebPageInspectorController::navigate(WebCore::ResourceRequest&& request, WebFrameProxy* frame, NavigationHandler&& completionHandler)
+{
@@ -10954,7 +11294,7 @@ index d7279a951aba2b48fcc37be72952eddc7124747f..01cecbce3e15e325450abb0ff15c9e9f
void WebPageInspectorController::sendMessageToInspectorFrontend(const String& targetId, const String& message)
{
if (!m_targets.contains(targetId)) {
-@@ -214,6 +380,52 @@ void WebPageInspectorController::sendMessageToInspectorFrontend(const String& ta
+@@ -214,6 +385,52 @@ void WebPageInspectorController::sendMessageToInspectorFrontend(const String& ta
protect(m_targetAgent)->sendMessageFromTargetToFrontend(targetId, message);
}
@@ -11007,7 +11347,7 @@ index d7279a951aba2b48fcc37be72952eddc7124747f..01cecbce3e15e325450abb0ff15c9e9f
bool WebPageInspectorController::shouldPauseLoadingForPage(const ProvisionalPageProxy& provisionalPage) const
{
if (!m_frontendRouter->hasFrontends())
-@@ -268,7 +480,7 @@ void WebPageInspectorController::setContinueLoadingCallbackForFrame(const Provis
+@@ -268,7 +485,7 @@ void WebPageInspectorController::setContinueLoadingCallbackForFrame(const Provis
void WebPageInspectorController::didCreateProvisionalPage(ProvisionalPageProxy& provisionalPage, WebCore::FrameIdentifier mainFrameID, WebProcessProxy& mainFrameProcess)
{
@@ -11017,7 +11357,7 @@ index d7279a951aba2b48fcc37be72952eddc7124747f..01cecbce3e15e325450abb0ff15c9e9f
if (shouldManageFrameTargets()) {
constexpr bool isProvisional = true;
diff --git a/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.h b/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.h
-index 00580efa59c6c92b4a2afb2bab93f8df6364e494..e2bf34f44dc82f64cb9b4370ff61c53c004c27dd 100644
+index b7713e8492e46e2248817e72441c41df0cfcf3db..cef64e181985f1e65d3533d3f086be0f17e778f5 100644
--- a/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.h
+++ b/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.h
@@ -28,9 +28,11 @@
@@ -11109,13 +11449,14 @@ index 00580efa59c6c92b4a2afb2bab93f8df6364e494..e2bf34f44dc82f64cb9b4370ff61c53c
bool hasLocalFrontend() const;
-@@ -74,9 +124,25 @@ public:
+@@ -74,9 +124,26 @@ public:
#if ENABLE(REMOTE_INSPECTOR)
void setIndicating(bool);
#endif
+#if USE(SKIA)
+ void didPaint(sk_sp<SkImage>&&);
+#endif
++ bool screencastActive() const;
+ using NavigationHandler = Function<void(const String&, Markable<WebCore::NavigationIdentifier>)>;
+ void navigate(WebCore::ResourceRequest&&, WebFrameProxy*, NavigationHandler&&);
+ void didReceivePolicyDecision(WebCore::PolicyAction action, std::optional<WebCore::NavigationIdentifier> navigationID);
@@ -11135,7 +11476,7 @@ index 00580efa59c6c92b4a2afb2bab93f8df6364e494..e2bf34f44dc82f64cb9b4370ff61c53c
bool shouldPauseLoadingForPage(const ProvisionalPageProxy&) const;
void setContinueLoadingCallbackForPage(const ProvisionalPageProxy&, WTF::Function<void()>&&);
bool shouldPauseLoadingForFrame(const ProvisionalFrameProxy&) const;
-@@ -118,11 +184,18 @@ private:
+@@ -120,11 +187,18 @@ private:
CheckedPtr<Inspector::InspectorTargetAgent> m_targetAgent;
HashMap<String, std::unique_ptr<InspectorTargetProxy>> m_targets;
@@ -11156,10 +11497,10 @@ index 00580efa59c6c92b4a2afb2bab93f8df6364e494..e2bf34f44dc82f64cb9b4370ff61c53c
} // namespace WebKit
diff --git a/Source/WebKit/UIProcess/InspectorDialogAgent.cpp b/Source/WebKit/UIProcess/InspectorDialogAgent.cpp
new file mode 100644
-index 0000000000000000000000000000000000000000..53bf0625a4e6af2f4387b9a516604d5e6219cfef
+index 0000000000000000000000000000000000000000..6e5159ff2b6fd88ead0ef48fde6fe6217de8136b
--- /dev/null
+++ b/Source/WebKit/UIProcess/InspectorDialogAgent.cpp
-@@ -0,0 +1,90 @@
+@@ -0,0 +1,94 @@
+/*
+ * Copyright (C) 2019 Microsoft Corporation.
+ *
@@ -11249,13 +11590,17 @@ index 0000000000000000000000000000000000000000..53bf0625a4e6af2f4387b9a516604d5e
+ m_frontendDispatcher->javascriptDialogOpening(type, message, defaultValue);
+}
+
++void InspectorDialogAgent::javascriptDialogClosed() {
++ m_frontendDispatcher->javascriptDialogClosed();
++}
++
+} // namespace WebKit
diff --git a/Source/WebKit/UIProcess/InspectorDialogAgent.h b/Source/WebKit/UIProcess/InspectorDialogAgent.h
new file mode 100644
-index 0000000000000000000000000000000000000000..26775d9cfe30d220b14c1b2355a9baf9e6eca815
+index 0000000000000000000000000000000000000000..08116b924a8fc123cfe7f903e36c00f58b6ec1c7
--- /dev/null
+++ b/Source/WebKit/UIProcess/InspectorDialogAgent.h
-@@ -0,0 +1,70 @@
+@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2019 Microsoft Corporation.
+ *
@@ -11317,6 +11662,7 @@ index 0000000000000000000000000000000000000000..26775d9cfe30d220b14c1b2355a9baf9
+ Inspector::Protocol::ErrorStringOr<void> handleJavaScriptDialog(bool accept, const String& promptText) override;
+
+ void javascriptDialogOpening(const String& type, const String& message, const String& defaultValue = String());
++ void javascriptDialogClosed();
+
+private:
+ void platformHandleJavaScriptDialog(bool accept, const String* promptText);
@@ -12621,10 +12967,10 @@ index 0000000000000000000000000000000000000000..af71e4077eb0c6f95396de7bfef89a3e
+
+#endif // ENABLE(REMOTE_INSPECTOR)
diff --git a/Source/WebKit/UIProcess/Launcher/glib/ProcessLauncherGLib.cpp b/Source/WebKit/UIProcess/Launcher/glib/ProcessLauncherGLib.cpp
-index 4b51695cfad05edf88ec3d50ed49bcdd55411195..e568c845e9801153b1d37a88e4631d0917abba65 100644
+index 63a1abdff4b0f59863259b89ecb5a1a8061b5641..fdf2e0623fb8bd9895650f0dad9123c7a6172860 100644
--- a/Source/WebKit/UIProcess/Launcher/glib/ProcessLauncherGLib.cpp
+++ b/Source/WebKit/UIProcess/Launcher/glib/ProcessLauncherGLib.cpp
-@@ -160,6 +160,13 @@ void ProcessLauncher::launchProcess()
+@@ -201,6 +201,13 @@ void ProcessLauncher::launchProcess()
nargs++;
}
#endif
@@ -12638,7 +12984,7 @@ index 4b51695cfad05edf88ec3d50ed49bcdd55411195..e568c845e9801153b1d37a88e4631d09
Vector<char*> argv(nargs);
unsigned i = 0;
-@@ -175,6 +182,10 @@ void ProcessLauncher::launchProcess()
+@@ -216,6 +223,10 @@ void ProcessLauncher::launchProcess()
if (configureJSCForTesting)
argv[i++] = const_cast<char*>("--configure-jsc-for-testing");
#endif
@@ -12677,7 +13023,7 @@ index 6723ee0d9943be07bc8ad09d2b678838aca968df..0d7fb3c7b1a4c877a2ff2f2189d12c7d
BOOL result = ::CreateProcess(0, commandLine.mutableSpan().data(), 0, 0, true, 0, 0, 0, &startupInfo, &processInformation);
diff --git a/Source/WebKit/UIProcess/Media/RemoteMediaSessionManagerProxy.cpp b/Source/WebKit/UIProcess/Media/RemoteMediaSessionManagerProxy.cpp
-index 4aaaaf20111ba60e4d10bb148db80bc0108bdd16..8a679c00c818bcab3338a9cbe4c8e785106aba11 100644
+index d4d3ac19df4340aa756a9f9ccc0adb613b86f313..f2b11a8ca2c74d86a0c153df7efe4c3b584aab97 100644
--- a/Source/WebKit/UIProcess/Media/RemoteMediaSessionManagerProxy.cpp
+++ b/Source/WebKit/UIProcess/Media/RemoteMediaSessionManagerProxy.cpp
@@ -30,6 +30,7 @@
@@ -12689,10 +13035,10 @@ index 4aaaaf20111ba60e4d10bb148db80bc0108bdd16..8a679c00c818bcab3338a9cbe4c8e785
#include "RemoteMediaSessionProxy.h"
#include "RemoteMediaSessionState.h"
diff --git a/Source/WebKit/UIProcess/PageClient.h b/Source/WebKit/UIProcess/PageClient.h
-index 82120c2989f467abc747f72f955bd69c170dbb31..6358a3ba3b20b32fbfa0f2f6b4e1707eebf2f8ec 100644
+index 28282d105382134e509500940fdeba1cea1274af..0761c75f458eeeaca3a0f33b89847c4023679224 100644
--- a/Source/WebKit/UIProcess/PageClient.h
+++ b/Source/WebKit/UIProcess/PageClient.h
-@@ -78,6 +78,11 @@
+@@ -79,6 +79,11 @@
#include <WebCore/PlatformTextAlternatives.h>
#endif
@@ -12704,7 +13050,7 @@ index 82120c2989f467abc747f72f955bd69c170dbb31..6358a3ba3b20b32fbfa0f2f6b4e1707e
OBJC_CLASS AVPlayerViewController;
OBJC_CLASS CALayer;
OBJC_CLASS NSFileWrapper;
-@@ -406,7 +411,15 @@ public:
+@@ -411,7 +416,15 @@ public:
virtual void selectionDidChange() = 0;
#endif
@@ -12852,7 +13198,7 @@ index 0000000000000000000000000000000000000000..e729f8cbd1dd87a489f226611d9657ad
+
+#endif // ENABLE(FULLSCREEN_API)
diff --git a/Source/WebKit/UIProcess/ProvisionalFrameProxy.cpp b/Source/WebKit/UIProcess/ProvisionalFrameProxy.cpp
-index 0e8f21982c6499e6886f5db6c193afc43663f29c..43ed4c8837479744a98ef76ceb2911c0e49d3f2b 100644
+index 68d91b9c4b14aebb4f08a13383b46526cc1f9d49..18dea5ab1e445c0f785f002dcea2edb493804b62 100644
--- a/Source/WebKit/UIProcess/ProvisionalFrameProxy.cpp
+++ b/Source/WebKit/UIProcess/ProvisionalFrameProxy.cpp
@@ -25,6 +25,7 @@
@@ -12864,7 +13210,7 @@ index 0e8f21982c6499e6886f5db6c193afc43663f29c..43ed4c8837479744a98ef76ceb2911c0
#include "FrameProcess.h"
#include "ProvisionalFrameCreationParameters.h"
diff --git a/Source/WebKit/UIProcess/ProvisionalPageProxy.h b/Source/WebKit/UIProcess/ProvisionalPageProxy.h
-index a4f5aa34b3e128a428dcae16796e316f8a08ef92..95940123f11637263a82597d20718e594e5cca17 100644
+index 6f6cd599dc2234a184f13158c7e8d6a55f8cfa15..0745a8c7b684163c0463cf5235a3269cd566d088 100644
--- a/Source/WebKit/UIProcess/ProvisionalPageProxy.h
+++ b/Source/WebKit/UIProcess/ProvisionalPageProxy.h
@@ -32,8 +32,10 @@
@@ -12878,7 +13224,7 @@ index a4f5aa34b3e128a428dcae16796e316f8a08ef92..95940123f11637263a82597d20718e59
#include <WebCore/FrameIdentifier.h>
#include <WebCore/FrameLoaderClient.h>
#include <WebCore/NavigationIdentifier.h>
-@@ -77,7 +79,6 @@ class WebBackForwardListItem;
+@@ -78,7 +80,6 @@ class WebBackForwardListItem;
class WebFrameProxy;
class WebPageProxy;
class WebProcessProxy;
@@ -13234,7 +13580,7 @@ index 3f6cd845733e2e8f5e25c318e7ab54f77032d4cf..e4399bfd734a28ef5df5ec855b7c78b4
class RemotePagePlaybackSessionManagerProxy : public IPC::MessageReceiver, public RefCounted<RemotePagePlaybackSessionManagerProxy> {
diff --git a/Source/WebKit/UIProcess/RemotePageProxy.cpp b/Source/WebKit/UIProcess/RemotePageProxy.cpp
-index 5ddeafec1d5c22b33874527b94f009cdbfb79ba5..96b738507e648dcd1d16d07968109c88287ebdd8 100644
+index 5e31842cb922abafe154b6f909497a9af9f6b390..7f31042eb9d9b47c24a606d74dce62944b2e3a8f 100644
--- a/Source/WebKit/UIProcess/RemotePageProxy.cpp
+++ b/Source/WebKit/UIProcess/RemotePageProxy.cpp
@@ -38,6 +38,7 @@
@@ -13254,7 +13600,7 @@ index 5ddeafec1d5c22b33874527b94f009cdbfb79ba5..96b738507e648dcd1d16d07968109c88
#include "WebFullScreenManagerProxy.h"
#endif
diff --git a/Source/WebKit/UIProcess/UserMediaPermissionRequestManagerProxy.cpp b/Source/WebKit/UIProcess/UserMediaPermissionRequestManagerProxy.cpp
-index c9c17f1ea054d727887cb1f6159a7bb86e2cfa3c..ea5125e44a22aba9009c1377aa9ca75e5dfa5163 100644
+index a21993beb5b20098b7c64fd35091e10df869fe86..86c20644947d390bd1bd4190cb21821238ecc38c 100644
--- a/Source/WebKit/UIProcess/UserMediaPermissionRequestManagerProxy.cpp
+++ b/Source/WebKit/UIProcess/UserMediaPermissionRequestManagerProxy.cpp
@@ -737,6 +737,17 @@ void UserMediaPermissionRequestManagerProxy::processUserMediaPermissionValidRequ
@@ -13275,18 +13621,6 @@ index c9c17f1ea054d727887cb1f6159a7bb86e2cfa3c..ea5125e44a22aba9009c1377aa9ca75e
auto action = getRequestAction(*currentUserMediaRequest);
ALWAYS_LOG(LOGIDENTIFIER, currentUserMediaRequest->userMediaID() ? currentUserMediaRequest->userMediaID()->toUInt64() : 0, ", action: ", action);
-diff --git a/Source/WebKit/UIProcess/WebContextMenuProxy.h b/Source/WebKit/UIProcess/WebContextMenuProxy.h
-index ff828014f7da9ef7a9f482f11550510fcba2a343..6fbe942c3a24b2cc9110e344ee4cebe12e1cc855 100644
---- a/Source/WebKit/UIProcess/WebContextMenuProxy.h
-+++ b/Source/WebKit/UIProcess/WebContextMenuProxy.h
-@@ -51,6 +51,7 @@ public:
- void deref() const final { RefCounted::deref(); }
-
- virtual void show();
-+ virtual void hide() {}
-
- WebPageProxy* page() const { return m_page.get(); }
- const FrameInfoData& frameInfo() const LIFETIME_BOUND { return m_frameInfo; }
diff --git a/Source/WebKit/UIProcess/WebPageInspectorEmulationAgent.cpp b/Source/WebKit/UIProcess/WebPageInspectorEmulationAgent.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..eebc878fbf78ce1fe22d274541dfce8c177d731d
@@ -14057,7 +14391,7 @@ index 0000000000000000000000000000000000000000..d57c86a11d49efb8105a871a4b420e2b
+
+} // namespace WebKit
diff --git a/Source/WebKit/UIProcess/WebPageProxy.cpp b/Source/WebKit/UIProcess/WebPageProxy.cpp
-index d4381103cc6ab004242e01cfe024fc8a9358503f..2e7ded80837501f890fc041af4ae1c802ebb4ac0 100644
+index 732d3ddbd9800ee07b791629741897333eef7e9c..8feb7668fa9f505a497293a0948433e3a7f929af 100644
--- a/Source/WebKit/UIProcess/WebPageProxy.cpp
+++ b/Source/WebKit/UIProcess/WebPageProxy.cpp
@@ -222,6 +222,7 @@
@@ -14068,7 +14402,7 @@ index d4381103cc6ab004242e01cfe024fc8a9358503f..2e7ded80837501f890fc041af4ae1c80
#include <WebCore/CompositionHighlight.h>
#include <WebCore/CrossSiteNavigationDataTransfer.h>
#include <WebCore/CryptoKey.h>
-@@ -235,6 +236,7 @@
+@@ -236,6 +237,7 @@
#include <WebCore/DigitalCredentialsProtocols.h>
#include <WebCore/DigitalCredentialsRequestData.h>
#include <WebCore/DigitalCredentialsResponseData.h>
@@ -14076,7 +14410,7 @@ index d4381103cc6ab004242e01cfe024fc8a9358503f..2e7ded80837501f890fc041af4ae1c80
#include <WebCore/DocumentSyncData.h>
#include <WebCore/DragController.h>
#include <WebCore/DragData.h>
-@@ -268,6 +270,7 @@
+@@ -269,6 +271,7 @@
#include <WebCore/NotImplemented.h>
#include <WebCore/OrganizationStorageAccessPromptQuirk.h>
#include <WebCore/OriginAgentClusterPolicy.h>
@@ -14084,7 +14418,7 @@ index d4381103cc6ab004242e01cfe024fc8a9358503f..2e7ded80837501f890fc041af4ae1c80
#include <WebCore/PerformanceLoggingClient.h>
#include <WebCore/PermissionDescriptor.h>
#include <WebCore/PermissionState.h>
-@@ -278,11 +281,13 @@
+@@ -279,11 +282,13 @@
#include <WebCore/Quirks.h>
#include <WebCore/RealtimeMediaSourceCenter.h>
#include <WebCore/ReferrerPolicy.h>
@@ -14098,7 +14432,7 @@ index d4381103cc6ab004242e01cfe024fc8a9358503f..2e7ded80837501f890fc041af4ae1c80
#include <WebCore/SecurityOrigin.h>
#include <WebCore/SecurityOriginData.h>
#include <WebCore/SerializedCryptoKeyWrap.h>
-@@ -524,6 +529,17 @@ static bool shouldUseEnhancedSecurityHeuristics(const Ref<WebPreferences>& prefe
+@@ -540,6 +545,17 @@ static bool shouldUseEnhancedSecurityHeuristics(const Ref<WebPreferences>& prefe
static constexpr Seconds audibleActivityClearDelay = 10_s;
#endif
@@ -14116,7 +14450,7 @@ index d4381103cc6ab004242e01cfe024fc8a9358503f..2e7ded80837501f890fc041af4ae1c80
#if PLATFORM(COCOA)
static WorkQueue& sharedFileQueueSingleton()
{
-@@ -1120,6 +1136,10 @@ WebPageProxy::~WebPageProxy()
+@@ -1138,6 +1154,10 @@ WebPageProxy::~WebPageProxy()
ASSERT(webPageProxyMap().get(m_identifier) == this);
webPageProxyMap().remove(m_identifier);
@@ -14127,7 +14461,7 @@ index d4381103cc6ab004242e01cfe024fc8a9358503f..2e7ded80837501f890fc041af4ae1c80
}
void WebPageProxy::addAllMessageReceivers()
-@@ -1697,7 +1717,7 @@ void WebPageProxy::didAttachToRunningProcess()
+@@ -1720,7 +1740,7 @@ void WebPageProxy::didAttachToRunningProcess()
#if ENABLE(FULLSCREEN_API)
ASSERT(!m_fullScreenManager);
if (RefPtr pageClient = this->pageClient())
@@ -14136,7 +14470,7 @@ index d4381103cc6ab004242e01cfe024fc8a9358503f..2e7ded80837501f890fc041af4ae1c80
#endif
#if ENABLE(VIDEO_PRESENTATION_MODE)
ASSERT(!m_playbackSessionManager);
-@@ -1729,7 +1749,7 @@ void WebPageProxy::didAttachToRunningProcess()
+@@ -1752,7 +1772,7 @@ void WebPageProxy::didAttachToRunningProcess()
#endif
#if !PLATFORM(IOS_FAMILY)
@@ -14145,7 +14479,7 @@ index d4381103cc6ab004242e01cfe024fc8a9358503f..2e7ded80837501f890fc041af4ae1c80
#else
auto currentOrientation = toScreenOrientationType(m_deviceOrientation);
#endif
-@@ -1871,6 +1891,7 @@ void WebPageProxy::initializeWebPage(const Site& site, WebCore::SandboxFlags eff
+@@ -1901,6 +1921,7 @@ void WebPageProxy::initializeWebPage(const Site& site, WebCore::SandboxFlags eff
if (preferences->siteIsolationEnabled())
browsingContextGroup->addPage(*this);
process->send(Messages::WebProcess::CreateWebPage(m_webPageID, creationParameters(process, *protect(drawingArea()), m_mainFrame->frameID(), std::nullopt)), 0);
@@ -14153,7 +14487,7 @@ index d4381103cc6ab004242e01cfe024fc8a9358503f..2e7ded80837501f890fc041af4ae1c80
process->addVisitedLinkStoreUser(m_visitedLinkStore, identifier());
-@@ -2198,6 +2219,21 @@ WebProcessProxy& WebPageProxy::ensureRunningProcess()
+@@ -2232,6 +2253,21 @@ WebProcessProxy& WebPageProxy::ensureRunningProcess()
return m_legacyMainFrameProcess;
}
@@ -14175,10 +14509,10 @@ index d4381103cc6ab004242e01cfe024fc8a9358503f..2e7ded80837501f890fc041af4ae1c80
RefPtr<API::Navigation> WebPageProxy::loadRequest(WebCore::ResourceRequest&& request, ShouldOpenExternalURLsPolicy shouldOpenExternalURLsPolicy, NavigationUpgradeToHTTPSBehavior navigationUpgradeToHTTPSBehavior, std::unique_ptr<NavigationActionData>&& lastNavigationAction, API::Object* userData, bool isRequestFromClientOrUserInput)
{
if (m_isClosed)
-@@ -2330,11 +2366,29 @@ void WebPageProxy::loadRequestWithNavigationShared(Ref<WebProcessProxy>&& proces
+@@ -2364,11 +2400,29 @@ void WebPageProxy::loadRequestWithNavigationShared(Ref<WebProcessProxy>&& proces
+ protectedThis->preconnectTo(ResourceRequest { loadParameters.request });
navigation->setIsLoadedWithNavigationShared(true);
- protectedProcess->markProcessAsRecentlyUsed();
- if (!protectedProcess->isLaunching() || !url.protocolIsFile())
- protectedProcess->send(Messages::WebPage::LoadRequest(WTF::move(loadParameters)), webPageID);
+
@@ -14209,7 +14543,7 @@ index d4381103cc6ab004242e01cfe024fc8a9358503f..2e7ded80837501f890fc041af4ae1c80
});
}
-@@ -3157,6 +3211,52 @@ RefPtr<WebAutomationSession> WebPageProxy::activeAutomationSession() const
+@@ -3197,6 +3251,52 @@ RefPtr<WebAutomationSession> WebPageProxy::activeAutomationSession() const
return m_configuration->processPool().automationSession();
}
@@ -14262,7 +14596,7 @@ index d4381103cc6ab004242e01cfe024fc8a9358503f..2e7ded80837501f890fc041af4ae1c80
void WebPageProxy::sendMessageToInspectorFrontend(const String& targetId, const String& message)
{
m_inspectorController->sendMessageToInspectorFrontend(targetId, message);
-@@ -3462,6 +3562,24 @@ void WebPageProxy::updateActivityState(OptionSet<ActivityState> flagsToUpdate)
+@@ -3502,6 +3602,24 @@ void WebPageProxy::updateActivityState(OptionSet<ActivityState> flagsToUpdate)
if (!pageClient)
return;
internals().activityState.remove(flagsToUpdate);
@@ -14287,7 +14621,7 @@ index d4381103cc6ab004242e01cfe024fc8a9358503f..2e7ded80837501f890fc041af4ae1c80
if (flagsToUpdate & ActivityState::IsFocused && pageClient->isViewFocused())
internals().activityState.add(ActivityState::IsFocused);
if (flagsToUpdate & ActivityState::WindowIsActive && pageClient->isViewWindowActive())
-@@ -4349,6 +4467,8 @@ void WebPageProxy::performDragControllerAction(DragControllerAction action, Drag
+@@ -4396,6 +4514,8 @@ void WebPageProxy::performDragControllerAction(DragControllerAction action, Drag
if (!hasRunningProcess())
return;
@@ -14296,7 +14630,7 @@ index d4381103cc6ab004242e01cfe024fc8a9358503f..2e7ded80837501f890fc041af4ae1c80
auto completionHandler = [this, protectedThis = Ref { *this }, action, dragData] (std::optional<WebCore::DragOperation> dragOperation, WebCore::DragHandlingMethod dragHandlingMethod, bool mouseIsOverFileInput, unsigned numberOfItemsToBeAccepted, const IntRect& insertionRect, const IntRect& editableElementRect, std::optional<WebCore::RemoteUserInputEventData> remoteUserInputEventData) mutable {
if (!m_pageClient)
return;
-@@ -4395,17 +4515,36 @@ void WebPageProxy::didPerformDragControllerAction(std::optional<WebCore::DragOpe
+@@ -4442,17 +4562,36 @@ void WebPageProxy::didPerformDragControllerAction(std::optional<WebCore::DragOpe
setDragCaretRect(insertionRect);
if (RefPtr pageClient = this->pageClient())
pageClient->didPerformDragControllerAction();
@@ -14336,7 +14670,7 @@ index d4381103cc6ab004242e01cfe024fc8a9358503f..2e7ded80837501f890fc041af4ae1c80
didStartDrag();
}
#endif
-@@ -4426,6 +4565,29 @@ void WebPageProxy::dragEnded(const IntPoint& clientPosition, const IntPoint& glo
+@@ -4473,6 +4612,29 @@ void WebPageProxy::dragEnded(const IntPoint& clientPosition, const IntPoint& glo
setDragCaretRect({ });
}
@@ -14366,7 +14700,7 @@ index d4381103cc6ab004242e01cfe024fc8a9358503f..2e7ded80837501f890fc041af4ae1c80
void WebPageProxy::didStartDrag(const std::optional<FrameIdentifier>& targetFrameID)
{
if (!hasRunningProcess())
-@@ -4434,6 +4596,25 @@ void WebPageProxy::didStartDrag(const std::optional<FrameIdentifier>& targetFram
+@@ -4481,6 +4643,25 @@ void WebPageProxy::didStartDrag(const std::optional<FrameIdentifier>& targetFram
discardQueuedMouseEvents();
sendToProcessContainingFrame(targetFrameID, Messages::WebPage::DidStartDrag(targetFrameID));
@@ -14392,7 +14726,7 @@ index d4381103cc6ab004242e01cfe024fc8a9358503f..2e7ded80837501f890fc041af4ae1c80
}
void WebPageProxy::dragCancelled()
-@@ -4632,26 +4813,47 @@ void WebPageProxy::processNextQueuedMouseEvent()
+@@ -4685,26 +4866,47 @@ void WebPageProxy::processNextQueuedMouseEvent()
auto eventType = event->type();
startResponsivenessTimerForMouseEvent(*targetFrame, eventType);
@@ -14452,7 +14786,7 @@ index d4381103cc6ab004242e01cfe024fc8a9358503f..2e7ded80837501f890fc041af4ae1c80
}
#if ENABLE(MAC_GESTURE_EVENTS)
-@@ -4973,6 +5175,8 @@ void WebPageProxy::wheelEventHandlingCompleted(bool wasHandled)
+@@ -5026,6 +5228,8 @@ void WebPageProxy::wheelEventHandlingCompleted(bool wasHandled)
#if ENABLE(TOUCH_EVENTS) && !ENABLE(IOS_TOUCH_EVENTS)
didFinishProcessingAllPendingWheelEvents();
#endif
@@ -14461,7 +14795,7 @@ index d4381103cc6ab004242e01cfe024fc8a9358503f..2e7ded80837501f890fc041af4ae1c80
}
void WebPageProxy::cacheWheelEventScrollingAccelerationCurve(const NativeWebWheelEvent& nativeWheelEvent)
-@@ -5126,7 +5330,7 @@ static TrackingType mergeTrackingTypes(TrackingType a, TrackingType b)
+@@ -5179,7 +5383,7 @@ static TrackingType mergeTrackingTypes(TrackingType a, TrackingType b)
void WebPageProxy::updateTouchEventTracking(const WebTouchEvent& touchStartEvent)
{
@@ -14470,7 +14804,7 @@ index d4381103cc6ab004242e01cfe024fc8a9358503f..2e7ded80837501f890fc041af4ae1c80
for (auto& touchPoint : touchStartEvent.touchPoints()) {
auto location = touchPoint.locationInRootView();
auto update = [this, location](TrackingType& trackingType, EventTrackingRegions::EventType eventType) {
-@@ -6014,6 +6218,7 @@ Ref<WebPageProxy> WebPageProxy::navigationOriginatingPage(const FrameInfoData& f
+@@ -6146,6 +6350,7 @@ Ref<WebPageProxy> WebPageProxy::navigationOriginatingPage(const FrameInfoData& f
void WebPageProxy::receivedPolicyDecision(PolicyAction action, API::Navigation* navigation, std::optional<std::pair<Ref<API::WebsitePolicies>, Ref<WebProcessProxy>>>&& websitePoliciesAndProcess, Ref<API::NavigationAction>&& navigationAction, WillContinueLoadInNewProcess willContinueLoadInNewProcess, std::optional<SandboxExtension::Handle> sandboxExtensionHandle, std::optional<PolicyDecisionConsoleMessage>&& consoleMessage, CompletionHandler<void(PolicyDecision&&)>&& completionHandler)
{
@@ -14478,7 +14812,7 @@ index d4381103cc6ab004242e01cfe024fc8a9358503f..2e7ded80837501f890fc041af4ae1c80
if (!hasRunningProcess())
return completionHandler(PolicyDecision { });
-@@ -8093,6 +8298,7 @@ void WebPageProxy::didDestroyNavigationShared(Ref<WebProcessProxy>&& process, We
+@@ -8259,6 +8464,7 @@ void WebPageProxy::didDestroyNavigationShared(Ref<WebProcessProxy>&& process, We
RefPtr protectedPageClient { pageClient() };
m_navigationState->didDestroyNavigation(process->coreProcessIdentifier(), navigationID);
@@ -14486,16 +14820,16 @@ index d4381103cc6ab004242e01cfe024fc8a9358503f..2e7ded80837501f890fc041af4ae1c80
}
void WebPageProxy::didStartProvisionalLoadForFrame(IPC::Connection& connection, FrameIdentifier frameID, FrameInfoData&& frameInfo, ResourceRequest&& request, std::optional<WebCore::NavigationIdentifier> navigationID, URL&& url, URL&& unreachableURL, const UserData& userData, WallTime timestamp)
-@@ -8490,6 +8696,8 @@ void WebPageProxy::didFailProvisionalLoadForFrameShared(Ref<WebProcessProxy>&& p
- m_failingProvisionalLoadURL = { };
- m_allowsLoadingAlternateHTMLForFailingProvisionalLoadURL = true;
+@@ -8656,6 +8862,8 @@ void WebPageProxy::didFailProvisionalLoadForFrameShared(Ref<WebProcessProxy>&& p
+ if (willContinueLoading == WillContinueLoading::Yes)
+ return;
+ m_inspectorController->didFailProvisionalLoadForFrame(*navigationID, error);
+
// If the provisional page's load fails then we destroy the provisional page.
- if (m_provisionalPage && m_provisionalPage->mainFrame() == &frame && (willContinueLoading == WillContinueLoading::No))
+ if (m_provisionalPage && m_provisionalPage->mainFrame() == &frame)
m_provisionalPage = nullptr;
-@@ -10615,6 +10823,8 @@ void WebPageProxy::createNewPage(IPC::Connection& connection, WindowFeatures&& w
+@@ -10871,6 +11079,8 @@ void WebPageProxy::createNewPage(IPC::Connection& connection, WindowFeatures&& w
if (RefPtr page = originatingFrameInfo->page())
openerAppInitiatedState = page->lastNavigationWasAppInitiated();
@@ -14504,7 +14838,7 @@ index d4381103cc6ab004242e01cfe024fc8a9358503f..2e7ded80837501f890fc041af4ae1c80
auto completionHandler = [
this,
protectedThis = Ref { *this },
-@@ -10708,6 +10918,7 @@ void WebPageProxy::createNewPage(IPC::Connection& connection, WindowFeatures&& w
+@@ -10964,6 +11174,7 @@ void WebPageProxy::createNewPage(IPC::Connection& connection, WindowFeatures&& w
configuration->setInitialReferrerPolicy(effectiveReferrerPolicy);
configuration->setWindowFeatures(WTF::move(windowFeatures));
configuration->setOpenedMainFrameName(openedMainFrameName);
@@ -14512,7 +14846,7 @@ index d4381103cc6ab004242e01cfe024fc8a9358503f..2e7ded80837501f890fc041af4ae1c80
if (RefPtr openerFrame = originatingFrame; navigationActionData.hasOpener && openerFrame) {
configuration->setRelatedPage(*this);
-@@ -10743,6 +10954,7 @@ void WebPageProxy::createNewPage(IPC::Connection& connection, WindowFeatures&& w
+@@ -10999,6 +11210,7 @@ void WebPageProxy::createNewPage(IPC::Connection& connection, WindowFeatures&& w
void WebPageProxy::showPage()
{
m_uiClient->showPage(this);
@@ -14520,45 +14854,69 @@ index d4381103cc6ab004242e01cfe024fc8a9358503f..2e7ded80837501f890fc041af4ae1c80
}
bool WebPageProxy::hasOpenedPage() const
-@@ -10886,6 +11098,10 @@ void WebPageProxy::closePage()
+@@ -11142,6 +11354,10 @@ void WebPageProxy::closePage()
if (isClosed())
return;
+#if ENABLE(CONTEXT_MENUS)
-+ if (m_activeContextMenu)
-+ m_activeContextMenu->hide();
++ if (RefPtr activeContextMenu = m_activeContextMenu)
++ activeContextMenu->cancelTracking();
+#endif
WEBPAGEPROXY_RELEASE_LOG(Process, "closePage:");
if (RefPtr pageClient = this->pageClient())
pageClient->clearAllEditCommands();
-@@ -10927,6 +11143,8 @@ void WebPageProxy::runJavaScriptAlert(IPC::Connection& connection, FrameIdentifi
-
- auto showModal = [protectedThis = Ref { *this }](RefPtr<WebFrameProxy>&& frame, FrameInfoData&& frameInfo, String&& message, CompletionHandler<void()>&& reply) mutable {
- protectedThis->runModalJavaScriptDialog(WTF::move(frame), WTF::move(frameInfo), WTF::move(message), [reply = WTF::move(reply)](WebPageProxy& page, WebFrameProxy* frame, FrameInfoData&& frameInfo, String&& message, CompletionHandler<void()>&& completion) mutable {
-+ if (page.m_inspectorDialogAgent)
-+ page.m_inspectorDialogAgent->javascriptDialogOpening("alert"_s, message);
- page.m_uiClient->runJavaScriptAlert(page, WTF::move(message), frame, WTF::move(frameInfo), [reply = WTF::move(reply), completion = WTF::move(completion)]() mutable {
- reply();
- completion();
-@@ -10962,6 +11180,8 @@ void WebPageProxy::runJavaScriptConfirm(IPC::Connection& connection, FrameIdenti
+@@ -11216,7 +11432,11 @@ void WebPageProxy::runJavaScriptAlert(IPC::Connection& connection, FrameIdentifi
+ reply();
+ return completion();
+ }
+- page.m_uiClient->runJavaScriptAlert(page, WTF::move(message), frame, WTF::move(frameInfo), [reply = WTF::move(reply), completion = WTF::move(completion)]() mutable {
++ if (page.m_inspectorDialogAgent)
++ page.m_inspectorDialogAgent->javascriptDialogOpening("alert"_s, message);
++ page.m_uiClient->runJavaScriptAlert(page, WTF::move(message), frame, WTF::move(frameInfo), [weakPage = WeakPtr { page }, reply = WTF::move(reply), completion = WTF::move(completion)]() mutable {
++ if (RefPtr page = weakPage.get(); page && page->m_inspectorDialogAgent)
++ page->m_inspectorDialogAgent->javascriptDialogClosed();
+ reply();
+ completion();
+ });
+@@ -11240,13 +11460,17 @@ void WebPageProxy::runJavaScriptConfirm(IPC::Connection& connection, FrameIdenti
if (RefPtr automationSession = configuration().processPool().automationSession())
automationSession->willShowJavaScriptDialog(*this, message, std::nullopt);
}
+ if (m_inspectorDialogAgent)
+ m_inspectorDialogAgent->javascriptDialogOpening("confirm"_s, message);
- auto showModal = [protectedThis = Ref { *this }](RefPtr<WebFrameProxy>&& frame, FrameInfoData&& frameInfo, String&& message, CompletionHandler<void(bool)>&& reply) mutable {
- protectedThis->runModalJavaScriptDialog(WTF::move(frame), WTF::move(frameInfo), WTF::move(message), [reply = WTF::move(reply)](WebPageProxy& page, WebFrameProxy* frame, FrameInfoData&& frameInfo, String&& message, CompletionHandler<void()>&& completion) mutable {
-@@ -11000,6 +11220,8 @@ void WebPageProxy::runJavaScriptPrompt(IPC::Connection& connection, FrameIdentif
+ runModalJavaScriptDialog(WTF::move(frame), WTF::move(frameInfo), WTF::move(message), [reply = WTF::move(reply)](WebPageProxy& page, WebFrameProxy* frame, FrameInfoData&& frameInfo, String&& message, CompletionHandler<void()>&& completion, DialogDisposition disposition) mutable {
+ if (disposition == DialogDisposition::Cancel) {
+ reply(false);
+ return completion();
+ }
+- page.m_uiClient->runJavaScriptConfirm(page, WTF::move(message), frame, WTF::move(frameInfo), [reply = WTF::move(reply), completion = WTF::move(completion)](bool result) mutable {
++ page.m_uiClient->runJavaScriptConfirm(page, WTF::move(message), frame, WTF::move(frameInfo), [weakPage = WeakPtr { page }, reply = WTF::move(reply), completion = WTF::move(completion)](bool result) mutable {
++ if (RefPtr page = weakPage.get(); page && page->m_inspectorDialogAgent)
++ page->m_inspectorDialogAgent->javascriptDialogClosed();
+ reply(result);
+ completion();
+ });
+@@ -11270,13 +11494,17 @@ void WebPageProxy::runJavaScriptPrompt(IPC::Connection& connection, FrameIdentif
if (RefPtr automationSession = configuration().processPool().automationSession())
automationSession->willShowJavaScriptDialog(*this, message, defaultValue);
}
+ if (m_inspectorDialogAgent)
+ m_inspectorDialogAgent->javascriptDialogOpening("prompt"_s, message, defaultValue);
- auto showModal = [protectedThis = Ref { *this }](RefPtr<WebFrameProxy>&& frame, FrameInfoData&& frameInfo, String&& message, String&& defaultValue, CompletionHandler<void(const String&)>&& reply) mutable {
- protectedThis->runModalJavaScriptDialog(WTF::move(frame), WTF::move(frameInfo), WTF::move(message), [reply = WTF::move(reply), defaultValue = WTF::move(defaultValue)](WebPageProxy& page, WebFrameProxy* frame, FrameInfoData&& frameInfo, String&& message, CompletionHandler<void()>&& completion) mutable {
-@@ -11227,6 +11449,8 @@ void WebPageProxy::runBeforeUnloadConfirmPanel(IPC::Connection& connection, Fram
+ runModalJavaScriptDialog(WTF::move(frame), WTF::move(frameInfo), WTF::move(message), [reply = WTF::move(reply), defaultValue = WTF::move(defaultValue)](WebPageProxy& page, WebFrameProxy* frame, FrameInfoData&& frameInfo, String&& message, CompletionHandler<void()>&& completion, DialogDisposition disposition) mutable {
+ if (disposition == DialogDisposition::Cancel) {
+ reply({ });
+ return completion();
+ }
+- page.m_uiClient->runJavaScriptPrompt(page, WTF::move(message), WTF::move(defaultValue), frame, WTF::move(frameInfo), [reply = WTF::move(reply), completion = WTF::move(completion)](auto& result) mutable {
++ page.m_uiClient->runJavaScriptPrompt(page, WTF::move(message), WTF::move(defaultValue), frame, WTF::move(frameInfo), [weakPage = WeakPtr { page }, reply = WTF::move(reply), completion = WTF::move(completion)](auto& result) mutable {
++ if (RefPtr page = weakPage.get(); page && page->m_inspectorDialogAgent)
++ page->m_inspectorDialogAgent->javascriptDialogClosed();
+ reply(result);
+ completion();
+ });
+@@ -11489,6 +11717,8 @@ void WebPageProxy::runBeforeUnloadConfirmPanel(IPC::Connection& connection, Fram
return;
}
}
@@ -14567,7 +14925,16 @@ index d4381103cc6ab004242e01cfe024fc8a9358503f..2e7ded80837501f890fc041af4ae1c80
// Since runBeforeUnloadConfirmPanel() can spin a nested run loop we need to turn off the responsiveness timer and the tryClose timer.
webProcess->stopResponsivenessTimer();
-@@ -12057,6 +12281,11 @@ void WebPageProxy::resourceLoadDidCompleteWithError(ResourceLoadInfo&& loadInfo,
+@@ -11497,6 +11727,8 @@ void WebPageProxy::runBeforeUnloadConfirmPanel(IPC::Connection& connection, Fram
+ m_uiClient->runBeforeUnloadConfirmPanel(*this, WTF::move(message), frame.get(), WTF::move(frameInfo),
+ [weakThis = WeakPtr { *this }, completionHandler = WTF::move(reply), shouldResumeTimerAfterPrompt](bool shouldClose) mutable {
+ RefPtr protectedThis = weakThis.get();
++ if (protectedThis && protectedThis->m_inspectorDialogAgent)
++ protectedThis->m_inspectorDialogAgent->javascriptDialogClosed();
+ if (protectedThis && shouldResumeTimerAfterPrompt)
+ protectedThis->internals().tryCloseTimeoutTimer.startOneShot(tryCloseTimeoutDelay);
+ completionHandler(shouldClose);
+@@ -12376,6 +12608,11 @@ void WebPageProxy::resourceLoadDidCompleteWithError(ResourceLoadInfo&& loadInfo,
}
#if ENABLE(FULLSCREEN_API)
@@ -14579,7 +14946,7 @@ index d4381103cc6ab004242e01cfe024fc8a9358503f..2e7ded80837501f890fc041af4ae1c80
WebFullScreenManagerProxy* WebPageProxy::fullScreenManager()
{
return m_fullScreenManager.get();
-@@ -12173,6 +12402,17 @@ void WebPageProxy::requestDOMPasteAccess(IPC::Connection& connection, DOMPasteAc
+@@ -12492,6 +12729,17 @@ void WebPageProxy::requestDOMPasteAccess(IPC::Connection& connection, DOMPasteAc
}
}
@@ -14597,7 +14964,7 @@ index d4381103cc6ab004242e01cfe024fc8a9358503f..2e7ded80837501f890fc041af4ae1c80
auto rootFrameID = frame->rootFrame()->frameID();
convertRectToMainFrameCoordinates(elementRect, rootFrameID, [weakThis = WeakPtr { *this }, pasteAccessCategory, requiresInteraction, frameID, originIdentifier, completionHandler = WTF::move(completionHandler)](std::optional<FloatRect> convertedRect) mutable {
RefPtr protectedThis = weakThis.get();
-@@ -12557,6 +12797,15 @@ void WebPageProxy::showContextMenu(FrameInfoData&& frameInfo, ContextMenuContext
+@@ -12872,6 +13120,15 @@ void WebPageProxy::showContextMenu(FrameInfoData&& frameInfo, ContextMenuContext
return;
}
@@ -14613,7 +14980,7 @@ index d4381103cc6ab004242e01cfe024fc8a9358503f..2e7ded80837501f890fc041af4ae1c80
#if ENABLE(CONTEXT_MENUS)
m_waitingForContextMenuToShow = true;
#endif
-@@ -13189,6 +13438,8 @@ void WebPageProxy::mouseEventHandlingCompleted(bool handled, std::optional<Remot
+@@ -13504,6 +13761,8 @@ void WebPageProxy::mouseEventHandlingCompleted(bool handled, std::optional<Remot
if (RefPtr automationSession = configuration().processPool().automationSession())
automationSession->mouseEventsFlushedForPage(*this);
didFinishProcessingAllPendingMouseEvents();
@@ -14622,7 +14989,7 @@ index d4381103cc6ab004242e01cfe024fc8a9358503f..2e7ded80837501f890fc041af4ae1c80
}
}
-@@ -13243,6 +13494,7 @@ void WebPageProxy::keyEventHandlingCompleted(bool handled)
+@@ -13558,6 +13817,7 @@ void WebPageProxy::keyEventHandlingCompleted(bool handled)
if (RefPtr automationSession = configuration().processPool().automationSession())
automationSession->keyboardEventsFlushedForPage(*this);
didFinishProcessingAllPendingKeyEvents();
@@ -14630,7 +14997,7 @@ index d4381103cc6ab004242e01cfe024fc8a9358503f..2e7ded80837501f890fc041af4ae1c80
}
}
-@@ -13603,7 +13855,10 @@ void WebPageProxy::dispatchProcessDidTerminate(WebProcessProxy& process, Process
+@@ -13931,7 +14191,10 @@ void WebPageProxy::dispatchProcessDidTerminate(WebProcessProxy& process, Process
protect(browsingContextGroup())->processDidTerminate(*this, process);
}
@@ -14642,7 +15009,7 @@ index d4381103cc6ab004242e01cfe024fc8a9358503f..2e7ded80837501f890fc041af4ae1c80
if (m_loaderClient)
handledByClient = reason != ProcessTerminationReason::RequestedByClient && m_loaderClient->processDidCrash(*this);
else
-@@ -14287,6 +14542,9 @@ WebPageCreationParameters WebPageProxy::creationParameters(WebProcessProxy& proc
+@@ -14616,6 +14879,9 @@ WebPageCreationParameters WebPageProxy::creationParameters(WebProcessProxy& proc
parameters.allowPostingLegacySynchronousMessages = m_configuration->allowPostingLegacySynchronousMessages();
parameters.backgroundTextExtractionEnabled = m_configuration->backgroundTextExtractionEnabled();
@@ -14652,7 +15019,7 @@ index d4381103cc6ab004242e01cfe024fc8a9358503f..2e7ded80837501f890fc041af4ae1c80
#if ENABLE(APP_HIGHLIGHTS)
parameters.appHighlightsVisible = appHighlightsVisibility() ? HighlightVisibility::Visible : HighlightVisibility::Hidden;
#endif
-@@ -14497,8 +14755,59 @@ void WebPageProxy::allowGamepadAccess()
+@@ -14828,8 +15094,59 @@ void WebPageProxy::allowGamepadAccess()
#endif // ENABLE(GAMEPAD)
@@ -14712,7 +15079,7 @@ index d4381103cc6ab004242e01cfe024fc8a9358503f..2e7ded80837501f890fc041af4ae1c80
if (negotiatedLegacyTLS == NegotiatedLegacyTLS::Yes) {
m_navigationClient->shouldAllowLegacyTLS(*this, authenticationChallenge.get(), [this, protectedThis = Ref { *this }, authenticationChallenge] (bool shouldAllowLegacyTLS) {
if (shouldAllowLegacyTLS)
-@@ -14609,6 +14918,12 @@ void WebPageProxy::requestGeolocationPermissionForFrame(IPC::Connection& connect
+@@ -14940,6 +15257,12 @@ void WebPageProxy::requestGeolocationPermissionForFrame(IPC::Connection& connect
request->deny();
};
@@ -14725,7 +15092,7 @@ index d4381103cc6ab004242e01cfe024fc8a9358503f..2e7ded80837501f890fc041af4ae1c80
// FIXME: Once iOS migrates to the new WKUIDelegate SPI, clean this up
// and make it one UIClient call that calls the completionHandler with false
// if there is no delegate instead of returning the completionHandler
-@@ -14717,6 +15032,12 @@ void WebPageProxy::queryPermission(const ClientOrigin& clientOrigin, const Permi
+@@ -15048,6 +15371,12 @@ void WebPageProxy::queryPermission(const ClientOrigin& clientOrigin, const Permi
shouldChangeDeniedToPrompt = false;
if (sessionID().isEphemeral()) {
@@ -14738,7 +15105,7 @@ index d4381103cc6ab004242e01cfe024fc8a9358503f..2e7ded80837501f890fc041af4ae1c80
completionHandler(shouldChangeDeniedToPrompt ? PermissionState::Prompt : PermissionState::Denied);
return;
}
-@@ -14731,6 +15052,12 @@ void WebPageProxy::queryPermission(const ClientOrigin& clientOrigin, const Permi
+@@ -15062,6 +15391,12 @@ void WebPageProxy::queryPermission(const ClientOrigin& clientOrigin, const Permi
return;
}
@@ -14752,7 +15119,7 @@ index d4381103cc6ab004242e01cfe024fc8a9358503f..2e7ded80837501f890fc041af4ae1c80
completionHandler(shouldChangeDeniedToPrompt ? PermissionState::Prompt : PermissionState::Denied);
return;
diff --git a/Source/WebKit/UIProcess/WebPageProxy.h b/Source/WebKit/UIProcess/WebPageProxy.h
-index b600786b6ca3b60021d6b184d1f08709482101c0..ecd4da408df578cd6c693d524cbecf73cd472320 100644
+index 524f935cd7df378e1193c03b8837120fcc56d3ce..a82ef858e3bbdc1685481d4934da7eaf28634e16 100644
--- a/Source/WebKit/UIProcess/WebPageProxy.h
+++ b/Source/WebKit/UIProcess/WebPageProxy.h
@@ -28,6 +28,7 @@
@@ -14762,8 +15129,8 @@ index b600786b6ca3b60021d6b184d1f08709482101c0..ecd4da408df578cd6c693d524cbecf73
+#include "APIWebsitePolicies.h"
#include "MessageReceiver.h"
#include "TextExtractionAssertionScope.h"
- #include <WebCore/UserGestureTokenIdentifier.h>
-@@ -43,6 +44,20 @@
+ #include <WebCore/ProcessIdentifier.h>
+@@ -44,6 +45,20 @@
#include <wtf/SwiftBridging.h>
#include <wtf/UniqueRef.h>
#include <wtf/WeakHashSet.h>
@@ -14784,7 +15151,7 @@ index b600786b6ca3b60021d6b184d1f08709482101c0..ecd4da408df578cd6c693d524cbecf73
#if USE(COORDINATED_GRAPHICS) && HAVE(DISPLAY_LINK)
#include "DisplayLinkObserverID.h"
-@@ -134,6 +149,7 @@ class DragData;
+@@ -148,6 +163,7 @@ class DragData;
class Exception;
class FloatPoint;
class FloatQuad;
@@ -14792,7 +15159,7 @@ index b600786b6ca3b60021d6b184d1f08709482101c0..ecd4da408df578cd6c693d524cbecf73
class FloatRect;
class FloatSize;
class FontAttributeChanges;
-@@ -853,6 +869,8 @@ public:
+@@ -863,6 +879,8 @@ public:
RefPtr<WebAutomationSession> activeAutomationSession() const;
@@ -14801,7 +15168,7 @@ index b600786b6ca3b60021d6b184d1f08709482101c0..ecd4da408df578cd6c693d524cbecf73
WebPageInspectorController& inspectorController() LIFETIME_BOUND { return m_inspectorController.get(); }
#if PLATFORM(IOS_FAMILY)
-@@ -887,6 +905,7 @@ public:
+@@ -897,6 +915,7 @@ public:
bool NODELETE hasSleepDisabler() const;
#if ENABLE(FULLSCREEN_API)
@@ -14809,7 +15176,7 @@ index b600786b6ca3b60021d6b184d1f08709482101c0..ecd4da408df578cd6c693d524cbecf73
WebFullScreenManagerProxy* NODELETE fullScreenManager();
void setFullScreenClientForTesting(std::unique_ptr<WebKit::WebFullScreenManagerProxyClient>&&);
-@@ -950,6 +969,13 @@ public:
+@@ -960,6 +979,13 @@ public:
void setPageLoadStateObserver(RefPtr<PageLoadStateObserverBase>&&);
@@ -14823,7 +15190,7 @@ index b600786b6ca3b60021d6b184d1f08709482101c0..ecd4da408df578cd6c693d524cbecf73
void initializeWebPage(const WebCore::Site&, WebCore::SandboxFlags, WebCore::ReferrerPolicy);
void setDrawingArea(RefPtr<DrawingAreaProxy>&&);
-@@ -981,6 +1007,8 @@ public:
+@@ -991,6 +1017,8 @@ public:
RefPtr<API::Navigation> loadRequest(WebCore::ResourceRequest&&, WebCore::ShouldOpenExternalURLsPolicy, WebCore::NavigationUpgradeToHTTPSBehavior);
RefPtr<API::Navigation> loadRequest(WebCore::ResourceRequest&&, WebCore::ShouldOpenExternalURLsPolicy, WebCore::NavigationUpgradeToHTTPSBehavior, std::unique_ptr<NavigationActionData>&&, API::Object* userData = nullptr, bool isRequestFromClientOrUserInput = true);
@@ -14832,7 +15199,7 @@ index b600786b6ca3b60021d6b184d1f08709482101c0..ecd4da408df578cd6c693d524cbecf73
RefPtr<API::Navigation> loadFile(const String& fileURL, const String& resourceDirectoryURL, bool isAppInitiated = true, API::Object* userData = nullptr);
RefPtr<API::Navigation> loadData(Ref<WebCore::SharedBuffer>&&, const String& MIMEType, const String& encoding, const String& baseURL, API::Object* userData = nullptr);
RefPtr<API::Navigation> loadData(Ref<WebCore::SharedBuffer>&&, const String& MIMEType, const String& encoding, const String& baseURL, API::Object* userData, WebCore::ShouldOpenExternalURLsPolicy);
-@@ -1095,6 +1123,7 @@ public:
+@@ -1105,6 +1133,7 @@ public:
void restoreSelectionInFocusedEditableElement();
PageClient* NODELETE pageClient() const;
@@ -14840,7 +15207,7 @@ index b600786b6ca3b60021d6b184d1f08709482101c0..ecd4da408df578cd6c693d524cbecf73
void setViewNeedsDisplay(const WebCore::Region&);
void requestScroll(const WebCore::FloatPoint& scrollPosition, const WebCore::IntPoint& scrollOrigin, WebCore::ScrollIsAnimated, WebCore::InterruptScrollAnimation);
-@@ -1786,6 +1815,9 @@ public:
+@@ -1796,6 +1825,9 @@ public:
void backForwardRemovedItem(WebCore::BackForwardFrameItemIdentifier);
@@ -14850,7 +15217,7 @@ index b600786b6ca3b60021d6b184d1f08709482101c0..ecd4da408df578cd6c693d524cbecf73
#if ENABLE(DRAG_SUPPORT)
// Drag and drop support.
void dragEntered(WebCore::DragData&, const String& dragStorageName = String());
-@@ -1798,11 +1830,14 @@ public:
+@@ -1808,11 +1840,14 @@ public:
void didStartDrag(const std::optional<WebCore::FrameIdentifier>& = std::nullopt);
void dragCancelled();
void setDragCaretRect(const WebCore::IntRect&);
@@ -14865,7 +15232,7 @@ index b600786b6ca3b60021d6b184d1f08709482101c0..ecd4da408df578cd6c693d524cbecf73
#endif
#if PLATFORM(GTK) || PLATFORM(WPE)
void startDrag(WebCore::SelectionData&&, OptionSet<WebCore::DragOperation>, std::optional<WebCore::ShareableBitmapHandle>&& dragImage, WebCore::IntPoint&& dragImageHotspot);
-@@ -1810,6 +1845,9 @@ public:
+@@ -1820,6 +1855,9 @@ public:
#if ENABLE(MODEL_PROCESS)
void modelDragEnded(const WebCore::NodeIdentifier);
#endif
@@ -14875,7 +15242,7 @@ index b600786b6ca3b60021d6b184d1f08709482101c0..ecd4da408df578cd6c693d524cbecf73
#endif
void processDidBecomeUnresponsive(WebProcessProxy&);
-@@ -2073,6 +2111,7 @@ public:
+@@ -2089,6 +2127,7 @@ public:
void setViewportSizeForCSSViewportUnits(const WebCore::FloatSize&);
WebCore::FloatSize NODELETE viewportSizeForCSSViewportUnits() const;
@@ -14883,7 +15250,7 @@ index b600786b6ca3b60021d6b184d1f08709482101c0..ecd4da408df578cd6c693d524cbecf73
void didReceiveAuthenticationChallengeProxy(Ref<AuthenticationChallengeProxy>&&, NegotiatedLegacyTLS);
void negotiatedLegacyTLS();
void didNegotiateModernTLS(const URL&);
-@@ -2106,6 +2145,8 @@ public:
+@@ -2122,6 +2161,8 @@ public:
// TODO Replace RefPtr with Expected for error reporting https://webkit.org/b/300271
RefPtr<ViewSnapshot> takeViewSnapshot(std::optional<WebCore::IntRect>&&);
RefPtr<ViewSnapshot> takeViewSnapshot(std::optional<WebCore::IntRect>&&, ForceSoftwareCapturingViewportSnapshot);
@@ -14892,7 +15259,7 @@ index b600786b6ca3b60021d6b184d1f08709482101c0..ecd4da408df578cd6c693d524cbecf73
#endif
void serializeAndWrapCryptoKey(IPC::Connection&, WebCore::CryptoKeyData&&, CompletionHandler<void(std::optional<Vector<uint8_t>>&&)>&&);
-@@ -3834,11 +3875,13 @@ private:
+@@ -3874,11 +3915,13 @@ private:
String m_openedMainFrameName;
RefPtr<WebInspectorUIProxy> m_inspector;
@@ -14906,7 +15273,7 @@ index b600786b6ca3b60021d6b184d1f08709482101c0..ecd4da408df578cd6c693d524cbecf73
RefPtr<WebFullScreenManagerProxy> m_fullScreenManager;
std::unique_ptr<API::FullscreenClient> m_fullscreenClient;
#endif
-@@ -4053,12 +4096,31 @@ private:
+@@ -4094,12 +4137,31 @@ private:
bool m_mainFrameHasCustomContentProvider { false };
@@ -14938,7 +15305,7 @@ index b600786b6ca3b60021d6b184d1f08709482101c0..ecd4da408df578cd6c693d524cbecf73
#endif
bool m_mainFrameHasHorizontalScrollbar { false };
-@@ -4226,6 +4288,10 @@ private:
+@@ -4267,6 +4329,10 @@ private:
RefPtr<API::Object> messageBody;
};
Vector<InjectedBundleMessage> m_pendingInjectedBundleMessages;
@@ -14950,7 +15317,7 @@ index b600786b6ca3b60021d6b184d1f08709482101c0..ecd4da408df578cd6c693d524cbecf73
#if PLATFORM(IOS_FAMILY) && ENABLE(DEVICE_ORIENTATION)
RefPtr<WebDeviceOrientationUpdateProviderProxy> m_webDeviceOrientationUpdateProviderProxy;
diff --git a/Source/WebKit/UIProcess/WebPageProxy.messages.in b/Source/WebKit/UIProcess/WebPageProxy.messages.in
-index ca384b5fa1733bf2fa53cf0c5bf2c966ad6a1ccf..65f90ba82dc6aa18a4230053afbb6ac0cfbc3977 100644
+index a92f1300cb2d0c20b842eb3149208ae5a20e94a6..ff0328381de3a4f7c21b93ac4eff44a7e9e42076 100644
--- a/Source/WebKit/UIProcess/WebPageProxy.messages.in
+++ b/Source/WebKit/UIProcess/WebPageProxy.messages.in
@@ -35,6 +35,7 @@ messages -> WebPageProxy {
@@ -14961,7 +15328,7 @@ index ca384b5fa1733bf2fa53cf0c5bf2c966ad6a1ccf..65f90ba82dc6aa18a4230053afbb6ac0
SetCursor(WebCore::Cursor cursor)
SetCursorHiddenUntilMouseMoves(bool hiddenUntilMouseMoves)
-@@ -363,6 +364,10 @@ messages -> WebPageProxy {
+@@ -361,6 +362,10 @@ messages -> WebPageProxy {
StartDrag(WebCore::SelectionData selectionData, OptionSet<WebCore::DragOperation> dragOperationMask, std::optional<WebCore::ShareableBitmapHandle> dragImage, WebCore::IntPoint dragImageHotspot)
#endif
@@ -14973,10 +15340,10 @@ index ca384b5fa1733bf2fa53cf0c5bf2c966ad6a1ccf..65f90ba82dc6aa18a4230053afbb6ac0
WillReceiveEditDragSnapshot()
DidReceiveEditDragSnapshot(RefPtr<WebCore::TextIndicator> textIndicator)
diff --git a/Source/WebKit/UIProcess/WebProcessCache.cpp b/Source/WebKit/UIProcess/WebProcessCache.cpp
-index 81a690dd2023557c4b2f26a367c0dd8c86a795bd..c18c6cba370f510a44a2bee0876188f7480b1b47 100644
+index 76b196e42a28e53e10f1eb2d4a3ec5cb083388cd..f85ba39e28fb56be0cdb1ce561e76c96fe3db0f0 100644
--- a/Source/WebKit/UIProcess/WebProcessCache.cpp
+++ b/Source/WebKit/UIProcess/WebProcessCache.cpp
-@@ -125,6 +125,10 @@ bool WebProcessCache::canCacheProcess(WebProcessProxy& process) const
+@@ -130,6 +130,10 @@ bool WebProcessCache::canCacheProcess(WebProcessProxy& process) const
return false;
}
@@ -14988,23 +15355,22 @@ index 81a690dd2023557c4b2f26a367c0dd8c86a795bd..c18c6cba370f510a44a2bee0876188f7
}
diff --git a/Source/WebKit/UIProcess/WebProcessPool.cpp b/Source/WebKit/UIProcess/WebProcessPool.cpp
-index 6fae21fdb83d05bd3555e37a5705ed87b4bfa157..4929a99ce4e0d5768c5eea9653c30056d6bf33bd 100644
+index 42fea8ce38718316315c544ddcc304df65542a5d..8ed1c0ee96577f5a15e6f349dc6c89d77ebb3a7e 100644
--- a/Source/WebKit/UIProcess/WebProcessPool.cpp
+++ b/Source/WebKit/UIProcess/WebProcessPool.cpp
-@@ -427,10 +427,10 @@ void WebProcessPool::setAutomationClient(std::unique_ptr<API::AutomationClient>&
-
+@@ -430,9 +430,9 @@ void WebProcessPool::setAutomationClient(std::unique_ptr<API::AutomationClient>&
void WebProcessPool::setOverrideLanguages(Vector<String>&& languages)
{
+ LOG_WITH_STREAM(Language, stream << "WebProcessPool is setting OverrideLanguages: " << languages);
- WebKit::setOverrideLanguages(WTF::move(languages));
+ m_configuration->setOverrideLanguages(WTF::move(languages));
- LOG_WITH_STREAM(Language, stream << "WebProcessPool is setting OverrideLanguages: " << languages);
- sendToAllProcesses(Messages::WebProcess::UserPreferredLanguagesChanged(overrideLanguages()));
+ sendToAllProcesses(Messages::WebProcess::UserPreferredLanguagesChanged(m_configuration->overrideLanguages()));
#if ENABLE(GPU_PROCESS)
if (RefPtr gpuProcess = GPUProcessProxy::singletonIfCreated())
-@@ -438,9 +438,10 @@ void WebProcessPool::setOverrideLanguages(Vector<String>&& languages)
+@@ -440,9 +440,10 @@ void WebProcessPool::setOverrideLanguages(Vector<String>&& languages)
#endif
#if USE(SOUP)
for (Ref networkProcess : NetworkProcessProxy::allNetworkProcesses())
@@ -15016,7 +15382,7 @@ index 6fae21fdb83d05bd3555e37a5705ed87b4bfa157..4929a99ce4e0d5768c5eea9653c30056
void WebProcessPool::fullKeyboardAccessModeChanged(bool fullKeyboardAccessEnabled)
{
-@@ -996,7 +997,7 @@ void WebProcessPool::initializeNewWebProcess(WebProcessProxy& process, WebsiteDa
+@@ -998,7 +999,7 @@ void WebProcessPool::initializeNewWebProcess(WebProcessProxy& process, WebsiteDa
#endif
parameters.cacheModel = LegacyGlobalSettings::singleton().cacheModel();
@@ -15025,7 +15391,7 @@ index 6fae21fdb83d05bd3555e37a5705ed87b4bfa157..4929a99ce4e0d5768c5eea9653c30056
LOG_WITH_STREAM(Language, stream << "WebProcessPool is initializing a new web process with overrideLanguages: " << parameters.overrideLanguages);
parameters.urlSchemesRegisteredAsSecure = copyToVector(LegacyGlobalSettings::singleton().schemesToRegisterAsSecure());
-@@ -1079,7 +1080,7 @@ void WebProcessPool::initializeNewWebProcess(WebProcessProxy& process, WebsiteDa
+@@ -1081,7 +1082,7 @@ void WebProcessPool::initializeNewWebProcess(WebProcessProxy& process, WebsiteDa
if (!injectedBundleInitializationUserData)
injectedBundleInitializationUserData = m_injectedBundleInitializationUserData;
parameters.initializationUserData = UserData(process.transformObjectsToHandles(injectedBundleInitializationUserData.get()));
@@ -15034,7 +15400,7 @@ index 6fae21fdb83d05bd3555e37a5705ed87b4bfa157..4929a99ce4e0d5768c5eea9653c30056
if (websiteDataStore)
parameters.websiteDataStoreParameters = webProcessDataStoreParameters(process, *websiteDataStore);
-@@ -1173,14 +1174,14 @@ void WebProcessPool::processDidFinishLaunching(WebProcessProxy& process)
+@@ -1175,14 +1176,14 @@ void WebProcessPool::processDidFinishLaunching(WebProcessProxy& process)
// Sometimes the memorySampler gets initialized after process initialization has happened but before the process has finished launching
// so check if it needs to be started here
if (m_memorySamplerEnabled) {
@@ -15051,7 +15417,7 @@ index 6fae21fdb83d05bd3555e37a5705ed87b4bfa157..4929a99ce4e0d5768c5eea9653c30056
process.send(Messages::WebProcess::StartMemorySampler(WTF::move(sampleLogSandboxHandle), sampleLogFilePath, m_memorySamplerInterval), 0);
}
-@@ -1352,6 +1353,12 @@ Ref<WebPageProxy> WebProcessPool::createWebPage(PageClient& pageClient, Ref<API:
+@@ -1359,6 +1360,12 @@ Ref<WebPageProxy> WebProcessPool::createWebPage(PageClient& pageClient, Ref<API:
auto enhancedSecurity = (protect(pageConfiguration->preferences())->forceEnhancedSecurity() || pageConfiguration->isEnhancedSecurityEnabled() || useEnhancedSecurityFallback) ? EnhancedSecurity::EnabledPolicy : EnhancedSecurity::Disabled;
RefPtr relatedPage = pageConfiguration->relatedPage();
@@ -15064,7 +15430,7 @@ index 6fae21fdb83d05bd3555e37a5705ed87b4bfa157..4929a99ce4e0d5768c5eea9653c30056
bool siteIsolationEnabled = protect(pageConfiguration->preferences())->siteIsolationEnabled();
if (siteIsolationEnabled) {
Ref<WebPreferences> preferences = pageConfiguration->preferences();
-@@ -1389,9 +1396,9 @@ Ref<WebPageProxy> WebProcessPool::createWebPage(PageClient& pageClient, Ref<API:
+@@ -1396,9 +1403,9 @@ Ref<WebPageProxy> WebProcessPool::createWebPage(PageClient& pageClient, Ref<API:
}
Ref userContentController = pageConfiguration->userContentController();
@@ -15076,7 +15442,7 @@ index 6fae21fdb83d05bd3555e37a5705ed87b4bfa157..4929a99ce4e0d5768c5eea9653c30056
process->setAllowTestOnlyIPC(pageConfiguration->allowTestOnlyIPC());
auto page = process->createWebPage(pageClient, WTF::move(pageConfiguration));
-@@ -1772,18 +1779,18 @@ void WebProcessPool::setEnhancedAccessibility(bool flag)
+@@ -1784,18 +1791,18 @@ void WebProcessPool::setEnhancedAccessibility(bool flag)
{
sendToAllProcesses(Messages::WebProcess::SetEnhancedAccessibility(flag));
}
@@ -15099,7 +15465,7 @@ index 6fae21fdb83d05bd3555e37a5705ed87b4bfa157..4929a99ce4e0d5768c5eea9653c30056
for (auto& process : m_processes) {
if (!process->canSendMessage())
continue;
-@@ -1802,10 +1809,10 @@ void WebProcessPool::startMemorySampler(const double interval)
+@@ -1814,10 +1821,10 @@ void WebProcessPool::startMemorySampler(const double interval)
}
void WebProcessPool::stopMemorySampler()
@@ -15112,7 +15478,7 @@ index 6fae21fdb83d05bd3555e37a5705ed87b4bfa157..4929a99ce4e0d5768c5eea9653c30056
// For UIProcess
#if ENABLE(MEMORY_SAMPLER)
WebMemorySampler::singleton()->stop();
-@@ -1857,7 +1864,7 @@ void WebProcessPool::setAutomationSession(RefPtr<WebAutomationSession>&& automat
+@@ -1869,7 +1876,7 @@ void WebProcessPool::setAutomationSession(RefPtr<WebAutomationSession>&& automat
{
if (RefPtr previousSession = m_automationSession)
previousSession->setProcessPool(nullptr);
@@ -15121,7 +15487,7 @@ index 6fae21fdb83d05bd3555e37a5705ed87b4bfa157..4929a99ce4e0d5768c5eea9653c30056
m_automationSession = WTF::move(automationSession);
#if ENABLE(REMOTE_INSPECTOR)
-@@ -2458,7 +2465,7 @@ std::tuple<Ref<WebProcessProxy>, RefPtr<SuspendedPageProxy>, ASCIILiteral> WebPr
+@@ -2476,7 +2483,7 @@ std::tuple<Ref<WebProcessProxy>, RefPtr<SuspendedPageProxy>, ASCIILiteral> WebPr
}
auto reason = "Navigation is cross-site"_s;
@@ -15130,7 +15496,7 @@ index 6fae21fdb83d05bd3555e37a5705ed87b4bfa157..4929a99ce4e0d5768c5eea9653c30056
if (m_configuration->alwaysKeepAndReuseSwappedProcesses()) {
LOG(ProcessSwapping, "(ProcessSwapping) Considering re-use of a previously cached process for domain %s", targetSite.domain().string().utf8().data());
-@@ -2563,7 +2570,7 @@ void WebProcessPool::setDomainsWithUserInteraction(HashSet<WebCore::RegistrableD
+@@ -2581,7 +2588,7 @@ void WebProcessPool::setDomainsWithUserInteraction(HashSet<WebCore::RegistrableD
}
void WebProcessPool::setDomainsWithCrossPageStorageAccess(HashMap<TopFrameDomain, Vector<SubResourceDomain>>&& domains, CompletionHandler<void()>&& completionHandler)
@@ -15140,10 +15506,10 @@ index 6fae21fdb83d05bd3555e37a5705ed87b4bfa157..4929a99ce4e0d5768c5eea9653c30056
for (Ref process : borrow(this->processes()).get())
diff --git a/Source/WebKit/UIProcess/WebProcessProxy.cpp b/Source/WebKit/UIProcess/WebProcessProxy.cpp
-index 89f2dd04761e114c918a8b09325c1535d8176008..8330f97a31acc5f3c397a0bee20067fdeb8a80f1 100644
+index f4552a7353177299bf82059839bcd24fefbf7076..62129f7d169fbd9cd31a1152319bdf0e41af9a31 100644
--- a/Source/WebKit/UIProcess/WebProcessProxy.cpp
+++ b/Source/WebKit/UIProcess/WebProcessProxy.cpp
-@@ -224,6 +224,11 @@ Vector<Ref<WebProcessProxy>> WebProcessProxy::allProcesses()
+@@ -264,6 +264,11 @@ Vector<Ref<WebProcessProxy>> WebProcessProxy::allProcesses()
});
}
@@ -15155,7 +15521,7 @@ index 89f2dd04761e114c918a8b09325c1535d8176008..8330f97a31acc5f3c397a0bee20067fd
RefPtr<WebProcessProxy> WebProcessProxy::processForIdentifier(ProcessIdentifier identifier)
{
return allProcessMap().get(identifier);
-@@ -603,6 +608,26 @@ void WebProcessProxy::getLaunchOptions(ProcessLauncher::LaunchOptions& launchOpt
+@@ -694,6 +699,26 @@ void WebProcessProxy::getLaunchOptions(ProcessLauncher::LaunchOptions& launchOpt
if (WebKit::isInspectorProcessPool(processPool()))
launchOptions.extraInitializationData.add<HashTranslatorASCIILiteral>("inspector-process"_s, "1"_s);
@@ -15183,7 +15549,7 @@ index 89f2dd04761e114c918a8b09325c1535d8176008..8330f97a31acc5f3c397a0bee20067fd
if (isPrewarmed())
diff --git a/Source/WebKit/UIProcess/WebProcessProxy.h b/Source/WebKit/UIProcess/WebProcessProxy.h
-index 6f18fdbd312a5664b69d4c074732402ef5d5c20e..12a00ca9644249d5aa567eeacdcd4d37801b9ca2 100644
+index ab09bb2459a7e1d35870cbff7abe767b0ecc347b..cac26e83ffda1dc54b6fed7439bce0603029fcd6 100644
--- a/Source/WebKit/UIProcess/WebProcessProxy.h
+++ b/Source/WebKit/UIProcess/WebProcessProxy.h
@@ -213,6 +213,8 @@ public:
@@ -15196,10 +15562,10 @@ index 6f18fdbd312a5664b69d4c074732402ef5d5c20e..12a00ca9644249d5aa567eeacdcd4d37
unsigned suspendedPageCount() const;
diff --git a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp
-index 1263f3a601eb3624c186039bc614da5354f87391..16fbc50bb2c03f18112c7fc613223257e4e88836 100644
+index 0e0c058df37ac93f57f44d9bef754a3b5caa828e..a7ccd70b60c13631fa4cba9a215060d5fbbfc3de 100644
--- a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp
+++ b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp
-@@ -316,15 +316,10 @@ SOAuthorizationCoordinator& WebsiteDataStore::soAuthorizationCoordinator(const W
+@@ -317,15 +317,10 @@ SOAuthorizationCoordinator& WebsiteDataStore::soAuthorizationCoordinator(const W
static Ref<NetworkProcessProxy> networkProcessForSession(PAL::SessionID sessionID)
{
@@ -15218,7 +15584,7 @@ index 1263f3a601eb3624c186039bc614da5354f87391..16fbc50bb2c03f18112c7fc613223257
#else
UNUSED_PARAM(sessionID);
return NetworkProcessProxy::ensureDefaultNetworkProcess();
-@@ -2123,6 +2118,15 @@ void WebsiteDataStore::setCacheModelSynchronouslyForTesting(CacheModel cacheMode
+@@ -2200,6 +2195,15 @@ void WebsiteDataStore::setCacheModelSynchronouslyForTesting(CacheModel cacheMode
processPool->setCacheModelSynchronouslyForTesting(cacheModel);
}
@@ -15234,7 +15600,7 @@ index 1263f3a601eb3624c186039bc614da5354f87391..16fbc50bb2c03f18112c7fc613223257
Vector<WebsiteDataStoreParameters> WebsiteDataStore::parametersFromEachWebsiteDataStore()
{
return WTF::map(allDataStores(), [](auto& entry) {
-@@ -2553,6 +2557,12 @@ void WebsiteDataStore::lastPageLoadNetworkActivityCompletionCodeForTesting(WebCo
+@@ -2636,6 +2640,12 @@ void WebsiteDataStore::lastPageLoadNetworkActivityCompletionCodeForTesting(WebCo
protect(networkProcess())->lastPageLoadNetworkActivityCompletionCodeForTesting(m_sessionID, pageID, WTF::move(completionHandler));
}
@@ -15248,10 +15614,10 @@ index 1263f3a601eb3624c186039bc614da5354f87391..16fbc50bb2c03f18112c7fc613223257
void WebsiteDataStore::hasAppBoundSession(CompletionHandler<void(bool)>&& completionHandler) const
{
diff --git a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h
-index bd81bd628ec7c6b91229c32d69ab568ac6f63ab2..47f98a84830e3649c4cff14e869b6f9f881b6347 100644
+index efa0a5754d52a370a9b8dcef5df3cd58b32aefda..17294c4ac3872e0d88608b10e1d3e8477bd92a23 100644
--- a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h
+++ b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h
-@@ -103,6 +103,7 @@ class DeviceIdHashSaltStorage;
+@@ -112,6 +112,7 @@ class DeviceIdHashSaltStorage;
class DownloadProxy;
class NetworkProcessProxy;
class SOAuthorizationCoordinator;
@@ -15259,7 +15625,7 @@ index bd81bd628ec7c6b91229c32d69ab568ac6f63ab2..47f98a84830e3649c4cff14e869b6f9f
class VirtualAuthenticatorManager;
class WebPageProxy;
class WebProcessPool;
-@@ -119,6 +120,7 @@ enum class UnifiedOriginStorageLevel : uint8_t;
+@@ -128,6 +129,7 @@ enum class UnifiedOriginStorageLevel : uint8_t;
enum class WebsiteDataFetchOption : uint8_t;
enum class WebsiteDataType : uint32_t;
@@ -15267,7 +15633,7 @@ index bd81bd628ec7c6b91229c32d69ab568ac6f63ab2..47f98a84830e3649c4cff14e869b6f9f
struct ITPThirdPartyData;
struct NetworkProcessConnectionInfo;
struct WebPushMessage;
-@@ -128,6 +130,14 @@ struct WebsiteDataStoreParameters;
+@@ -137,6 +139,14 @@ struct WebsiteDataStoreParameters;
enum RemoveDataTaskCounterType { };
using RemoveDataTaskCounter = RefCounter<RemoveDataTaskCounterType>;
@@ -15282,7 +15648,7 @@ index bd81bd628ec7c6b91229c32d69ab568ac6f63ab2..47f98a84830e3649c4cff14e869b6f9f
class WebsiteDataStore : public API::ObjectImpl<API::Object::Type::WebsiteDataStore>, public CanMakeWeakPtr<WebsiteDataStore> {
public:
static WebsiteDataStore& defaultDataStore();
-@@ -334,8 +344,10 @@ public:
+@@ -342,8 +352,10 @@ public:
#if USE(SOUP)
void setPersistentCredentialStorageEnabled(bool);
bool persistentCredentialStorageEnabled() const { return m_persistentCredentialStorageEnabled && isPersistent(); }
@@ -15293,7 +15659,7 @@ index bd81bd628ec7c6b91229c32d69ab568ac6f63ab2..47f98a84830e3649c4cff14e869b6f9f
void setNetworkProxySettings(WebCore::SoupNetworkProxySettings&&);
const WebCore::SoupNetworkProxySettings& networkProxySettings() const LIFETIME_BOUND { return m_networkProxySettings; }
void setCookiePersistentStorage(const String&, SoupCookiePersistentStorageType);
-@@ -426,6 +438,12 @@ public:
+@@ -435,6 +447,12 @@ public:
static const String& defaultBaseDataDirectory();
#endif
@@ -15306,7 +15672,7 @@ index bd81bd628ec7c6b91229c32d69ab568ac6f63ab2..47f98a84830e3649c4cff14e869b6f9f
void resetQuota(CompletionHandler<void()>&&);
void resetStoragePersistedState(CompletionHandler<void()>&&);
#if PLATFORM(IOS_FAMILY)
-@@ -644,7 +662,9 @@ private:
+@@ -654,7 +672,9 @@ private:
#if USE(SOUP)
bool m_persistentCredentialStorageEnabled { true };
@@ -15317,7 +15683,7 @@ index bd81bd628ec7c6b91229c32d69ab568ac6f63ab2..47f98a84830e3649c4cff14e869b6f9f
WebCore::SoupNetworkProxySettings m_networkProxySettings;
String m_cookiePersistentStoragePath;
SoupCookiePersistentStorageType m_cookiePersistentStorageType { SoupCookiePersistentStorageType::SQLite };
-@@ -671,6 +691,10 @@ private:
+@@ -681,6 +701,10 @@ private:
const RefPtr<API::HTTPCookieStore> m_cookieStore;
RefPtr<NetworkProcessProxy> m_networkProcess;
@@ -16179,7 +16545,7 @@ index 0000000000000000000000000000000000000000..40355b2c69d7a94e924451b5fe1c0b96
+
+} // namespace WebKit
diff --git a/Source/WebKit/UIProcess/gtk/WebPasteboardProxyGtk.cpp b/Source/WebKit/UIProcess/gtk/WebPasteboardProxyGtk.cpp
-index baeb21c5cee36343d37fdf552cc36b26b2d5213e..d9efcdf56227966efafe53ba82c98673a47a9959 100644
+index 327ace18cf9ac599f2a9af994a43b606c21f9445..39e6a2e0e0523028ee6624378c28ca561e57a75e 100644
--- a/Source/WebKit/UIProcess/gtk/WebPasteboardProxyGtk.cpp
+++ b/Source/WebKit/UIProcess/gtk/WebPasteboardProxyGtk.cpp
@@ -85,8 +85,10 @@ void WebPasteboardProxy::setPrimarySelectionOwner(WebFrameProxy* frame)
@@ -16422,7 +16788,7 @@ index 0000000000000000000000000000000000000000..8adbd51bfecad2a273117588bf50f8f7
+
+#endif
diff --git a/Source/WebKit/UIProcess/mac/PageClientImplMac.h b/Source/WebKit/UIProcess/mac/PageClientImplMac.h
-index aad13ea61f394de88a82af1fedebe19ae573b5a5..cf92e824116eebc5d92a53a868648265296ba2fd 100644
+index a3b0ccb8afcb57b9f43807553bdb77c7ce1d84f2..47967f78141f98cf1d101ea39b37062ac70102de 100644
--- a/Source/WebKit/UIProcess/mac/PageClientImplMac.h
+++ b/Source/WebKit/UIProcess/mac/PageClientImplMac.h
@@ -31,9 +31,11 @@
@@ -16456,7 +16822,7 @@ index aad13ea61f394de88a82af1fedebe19ae573b5a5..cf92e824116eebc5d92a53a868648265
RefPtr<ViewSnapshot> takeViewSnapshot(std::optional<WebCore::IntRect>&&) override;
RefPtr<ViewSnapshot> takeViewSnapshot(std::optional<WebCore::IntRect>&&, ForceSoftwareCapturingViewportSnapshot) override;
void wheelEventWasNotHandledByWebCore(const NativeWebWheelEvent&) override;
-@@ -234,6 +241,10 @@ private:
+@@ -237,6 +244,10 @@ private:
WebCore::IntRect convertMainFrameCoordinatesInFullscreenPlaceholderViewToScreen(WebPageProxy&, WebCore::IntRect) const override;
#endif
@@ -16468,7 +16834,7 @@ index aad13ea61f394de88a82af1fedebe19ae573b5a5..cf92e824116eebc5d92a53a868648265
void navigationGestureWillEnd(bool willNavigate, WebBackForwardListItem&) override;
void navigationGestureDidEnd(bool willNavigate, WebBackForwardListItem&) override;
diff --git a/Source/WebKit/UIProcess/mac/PageClientImplMac.mm b/Source/WebKit/UIProcess/mac/PageClientImplMac.mm
-index ff04e3aeea13318efffc575992447a6330ab37aa..0fd99f3bf907393489c2109dd7993aa4aac83c8d 100644
+index 33b5d68f40c8d9cba856c7eed4e57018ffeaecf8..738a641968fd39e005e150fa97d46b4701d0ea25 100644
--- a/Source/WebKit/UIProcess/mac/PageClientImplMac.mm
+++ b/Source/WebKit/UIProcess/mac/PageClientImplMac.mm
@@ -79,6 +79,7 @@
@@ -16534,7 +16900,7 @@ index ff04e3aeea13318efffc575992447a6330ab37aa..0fd99f3bf907393489c2109dd7993aa4
}
void PageClientImpl::toolTipChanged(const String& oldToolTip, const String& newToolTip)
-@@ -548,6 +567,8 @@ IntRect PageClientImpl::rootViewToAccessibilityScreen(const IntRect& rect)
+@@ -557,6 +576,8 @@ IntRect PageClientImpl::rootViewToAccessibilityScreen(const IntRect& rect)
void PageClientImpl::doneWithKeyEvent(const NativeWebKeyboardEvent& event, bool eventWasHandled)
{
@@ -16543,7 +16909,7 @@ index ff04e3aeea13318efffc575992447a6330ab37aa..0fd99f3bf907393489c2109dd7993aa4
protect(m_impl)->doneWithKeyEvent(RetainPtr { event.nativeEvent() }.get(), eventWasHandled);
}
-@@ -567,6 +588,8 @@ void PageClientImpl::computeHasVisualSearchResults(const URL& imageURL, Shareabl
+@@ -576,6 +597,8 @@ void PageClientImpl::computeHasVisualSearchResults(const URL& imageURL, Shareabl
RefPtr<WebPopupMenuProxy> PageClientImpl::createPopupMenuProxy(WebPageProxy& page)
{
@@ -16552,7 +16918,7 @@ index ff04e3aeea13318efffc575992447a6330ab37aa..0fd99f3bf907393489c2109dd7993aa4
return WebPopupMenuProxyMac::create(m_view.get().get(), protect(page.popupMenuClient()));
}
-@@ -692,6 +715,12 @@ CALayer *PageClientImpl::footerBannerLayer() const
+@@ -701,6 +724,12 @@ CALayer *PageClientImpl::footerBannerLayer() const
return m_impl->footerBannerLayer();
}
@@ -16565,7 +16931,7 @@ index ff04e3aeea13318efffc575992447a6330ab37aa..0fd99f3bf907393489c2109dd7993aa4
RefPtr<ViewSnapshot> PageClientImpl::takeViewSnapshot(std::optional<WebCore::IntRect>&&)
{
return protect(m_impl)->takeViewSnapshot();
-@@ -922,6 +951,13 @@ WebCore::IntRect PageClientImpl::convertMainFrameCoordinatesInFullscreenPlacehol
+@@ -931,6 +960,13 @@ WebCore::IntRect PageClientImpl::convertMainFrameCoordinatesInFullscreenPlacehol
#endif // ENABLE(FULLSCREEN_API)
@@ -16579,7 +16945,7 @@ index ff04e3aeea13318efffc575992447a6330ab37aa..0fd99f3bf907393489c2109dd7993aa4
void PageClientImpl::navigationGestureDidBegin()
{
protect(m_impl)->dismissContentRelativeChildWindowsWithAnimation(true);
-@@ -1109,6 +1145,9 @@ void PageClientImpl::requestScrollToRect(const WebCore::FloatRect& targetRect, c
+@@ -1118,6 +1154,9 @@ void PageClientImpl::requestScrollToRect(const WebCore::FloatRect& targetRect, c
bool PageClientImpl::windowIsFrontWindowUnderMouse(const NativeWebMouseEvent& event)
{
@@ -16672,35 +17038,6 @@ index 6cfc616d5492bd12f7516ff2d6a67e77705f42b0..fd2e2a98b1db2c469a7f18fb2b7cbfbd
#import <pal/cocoa/WritingToolsUISoftLink.h>
@interface WKTextAnimationTypeEffectData : NSObject
-diff --git a/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.h b/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.h
-index ab8819cf32865706378b1436982f500b4f9d8c36..36534f655d281de18ce2ddf9d95d7e61995e4a21 100644
---- a/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.h
-+++ b/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.h
-@@ -87,6 +87,7 @@ private:
- void show() override;
- void showContextMenuWithItems(Vector<Ref<WebContextMenuItem>>&&) override;
- void useContextMenuItems(Vector<Ref<WebContextMenuItem>>&&) override;
-+ void hide() override;
-
- bool showAfterPostProcessingContextData();
-
-diff --git a/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm b/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm
-index a32612f0dc8a0025b4b916840ca9cee3b1ee1553..909739fba159745be448642405256ea27b526772 100644
---- a/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm
-+++ b/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm
-@@ -544,6 +544,12 @@ RetainPtr<NSMenuItem> WebContextMenuProxyMac::createShareMenuItem(ShareMenuItemT
- }
- #endif
-
-+void WebContextMenuProxyMac::hide()
-+{
-+ if (m_menu)
-+ [m_menu cancelTracking];
-+}
-+
- void WebContextMenuProxyMac::show()
- {
- #if ENABLE(SERVICE_CONTROLS)
diff --git a/Source/WebKit/UIProcess/mac/WebPageInspectorEmulationAgentMac.mm b/Source/WebKit/UIProcess/mac/WebPageInspectorEmulationAgentMac.mm
new file mode 100644
index 0000000000000000000000000000000000000000..6113f4cd60a5d72b8ead61176cb43200803478ed
@@ -16902,7 +17239,7 @@ index 0000000000000000000000000000000000000000..c0dbaec1d6a595896498239c0cdd7dcb
+
+} // namespace WebKit
diff --git a/Source/WebKit/UIProcess/mac/WebViewImpl.h b/Source/WebKit/UIProcess/mac/WebViewImpl.h
-index 510b41441c1c4fba70c461e5ce8662b97b250f38..53b932b1872910082dcdfd683612908791e8bd95 100644
+index 85ed9426e2c0e144fb32207dfe169aa89ed0e516..dd397c3aa795a8cadcc665f82e030fc0861fce10 100644
--- a/Source/WebKit/UIProcess/mac/WebViewImpl.h
+++ b/Source/WebKit/UIProcess/mac/WebViewImpl.h
@@ -41,6 +41,7 @@
@@ -16913,7 +17250,7 @@ index 510b41441c1c4fba70c461e5ce8662b97b250f38..53b932b1872910082dcdfd6836129087
#include <WebCore/DigitalCredentialsRequestData.h>
#include <WebCore/FocusDirection.h>
#include <WebCore/HTMLMediaElementIdentifier.h>
-@@ -634,6 +635,9 @@ public:
+@@ -647,6 +648,9 @@ public:
void provideDataForPasteboard(NSPasteboard *, NSString *type);
NSArray *namesOfPromisedFilesDroppedAtDestination(NSURL *dropDestination);
@@ -16924,10 +17261,10 @@ index 510b41441c1c4fba70c461e5ce8662b97b250f38..53b932b1872910082dcdfd6836129087
RefPtr<ViewSnapshot> takeViewSnapshot(ForceSoftwareCapturingViewportSnapshot);
void saveBackForwardSnapshotForCurrentItem();
diff --git a/Source/WebKit/UIProcess/mac/WebViewImpl.mm b/Source/WebKit/UIProcess/mac/WebViewImpl.mm
-index 1da595e5d3869d55fc1cfc8c5045b01cf4516da2..4e225fbda040c04113d06f0e610494592d9acd85 100644
+index 4a94767c4036e751e12dc0195a2d0b1de497a886..fa457a71aec6221c1be523c2446760940393999b 100644
--- a/Source/WebKit/UIProcess/mac/WebViewImpl.mm
+++ b/Source/WebKit/UIProcess/mac/WebViewImpl.mm
-@@ -2708,6 +2708,11 @@ WebCore::DestinationColorSpace WebViewImpl::colorSpace()
+@@ -2848,6 +2848,11 @@ WebCore::DestinationColorSpace WebViewImpl::colorSpace()
if (!m_colorSpace)
m_colorSpace = [NSColorSpace sRGBColorSpace];
}
@@ -16939,7 +17276,7 @@ index 1da595e5d3869d55fc1cfc8c5045b01cf4516da2..4e225fbda040c04113d06f0e61049459
ASSERT(m_colorSpace);
return WebCore::DestinationColorSpace { [m_colorSpace CGColorSpace] };
-@@ -5300,6 +5305,17 @@ static RetainPtr<CGImageRef> takeWindowSnapshot(CGSWindowID windowID, bool captu
+@@ -5465,6 +5470,17 @@ static RetainPtr<CGImageRef> takeWindowSnapshot(CGSWindowID windowID, bool captu
return WebCore::cgWindowListCreateImage(CGRectNull, kCGWindowListOptionIncludingWindow, windowID, imageOptions);
}
@@ -17247,34 +17584,6 @@ index 0000000000000000000000000000000000000000..6469d95bbe7abe4c2dd77848e1746246
+}
+
+} // namespace WebKit
-diff --git a/Source/WebKit/UIProcess/win/WebContextMenuProxyWin.cpp b/Source/WebKit/UIProcess/win/WebContextMenuProxyWin.cpp
-index 8017b507ce2f0d67922035b1d41b9898f5dddb8c..7e40f52a0e878aeaa0aa38199b432377a6dc4cfd 100644
---- a/Source/WebKit/UIProcess/win/WebContextMenuProxyWin.cpp
-+++ b/Source/WebKit/UIProcess/win/WebContextMenuProxyWin.cpp
-@@ -114,5 +114,11 @@ WebContextMenuProxyWin::~WebContextMenuProxyWin()
- ::DestroyMenu(m_menu);
- }
-
-+void WebContextMenuProxyWin::hide()
-+{
-+ if (m_menu)
-+ ::EndMenu();
-+}
-+
- } // namespace WebKit
- #endif // ENABLE(CONTEXT_MENUS)
-diff --git a/Source/WebKit/UIProcess/win/WebContextMenuProxyWin.h b/Source/WebKit/UIProcess/win/WebContextMenuProxyWin.h
-index ad633673cb4f1c5979aee23c0c3fd32f1b7421a2..2204867f7d2d6c756f17c968c1767ee667aca8c7 100644
---- a/Source/WebKit/UIProcess/win/WebContextMenuProxyWin.h
-+++ b/Source/WebKit/UIProcess/win/WebContextMenuProxyWin.h
-@@ -47,6 +47,7 @@ public:
- private:
- WebContextMenuProxyWin(WebPageProxy&, FrameInfoData&&, ContextMenuContextData&&, const UserData&);
- void showContextMenuWithItems(Vector<Ref<WebContextMenuItem>>&&) override;
-+ void hide() override;
-
- HMENU m_menu;
- };
diff --git a/Source/WebKit/UIProcess/win/WebPageInspectorEmulationAgentWin.cpp b/Source/WebKit/UIProcess/win/WebPageInspectorEmulationAgentWin.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..df55ee613ec085cb85ed12b45deff3a1b046861c
@@ -17414,25 +17723,44 @@ index f3beb2f8390b050913bcb8111c50ced57194c98f..7011eae4d384e0d459bef82bf92099bc
if (m_page && m_page->drawingArea()) {
// FIXME specify correctly layerPosition.
diff --git a/Source/WebKit/UIProcess/wpe/AcceleratedBackingStore.cpp b/Source/WebKit/UIProcess/wpe/AcceleratedBackingStore.cpp
-index 22c44ab7d823a4ae8458ff5265fc935361e25e1f..1ffc82a4597eb151b100f91b12e1bdc2913b41c0 100644
+index 22c44ab7d823a4ae8458ff5265fc935361e25e1f..615b95248b5d65836dcc3122ac348c02bfa59893 100644
--- a/Source/WebKit/UIProcess/wpe/AcceleratedBackingStore.cpp
+++ b/Source/WebKit/UIProcess/wpe/AcceleratedBackingStore.cpp
-@@ -229,7 +229,7 @@ static Expected<SkImageInfo, String> getImageInfoFromBuffer(const GRefPtr<WPEBu
+@@ -44,7 +44,10 @@
+ #endif
+
+ WTF_IGNORE_WARNINGS_IN_THIRD_PARTY_CODE_BEGIN
++#include <skia/core/SkBitmap.h>
++#include <skia/core/SkCanvas.h>
+ #include <skia/core/SkColorSpace.h>
++#include <skia/core/SkImage.h>
+ #include <skia/core/SkPixmap.h>
+ #include <skia/core/SkStream.h>
+ #include <skia/encode/SkPngEncoder.h>
+@@ -229,7 +232,7 @@ static Expected<SkImageInfo, String> getImageInfoFromBuffer(const GRefPtr<WPEBu
return makeUnexpected("Failed to extract snapshot pixel information"_s);
}
-static Expected<Ref<ViewSnapshot>, String> saveBufferSnapshot(const GRefPtr<WPEBuffer>& buffer, std::optional<WebCore::IntRect>&& clipRect)
-+static Expected<Ref<ViewSnapshot>, String> saveBufferSnapshot(const GRefPtr<WPEBuffer>& buffer, std::optional<WebCore::IntRect>&& clipRect, bool nominalResolution)
++static Expected<Ref<ViewSnapshot>, String> saveBufferSnapshot(const GRefPtr<WPEBuffer>& buffer, std::optional<WebCore::IntRect>&& clipRect, bool nominalResolution, WebPageProxy& page)
{
GUniqueOutPtr<GError> error;
GBytes* pixels = wpe_buffer_import_to_pixels(buffer.get(), &error.outPtr());
-@@ -247,33 +247,39 @@ static Expected<Ref<ViewSnapshot>, String> saveBufferSnapshot(const GRefPtr<WPEB
- if (!info)
- return makeUnexpected(info.error());
+@@ -239,6 +242,9 @@ static Expected<Ref<ViewSnapshot>, String> saveBufferSnapshot(const GRefPtr<WPEB
+ return makeUnexpected("Failed to read current WPEBuffer for snapshot"_s);
+ }
-- SkPixmap pixmap(info.value(), g_bytes_get_data(bytes.get(), nullptr), info->minRowBytes());
-+ sk_sp<SkImage> fullScreenshot = SkImage::MakeRasterDirect(info, pixelsData, info->minRowBytes());
++ // wpe_buffer_import_to_pixels() returns memory owned by the WPEBuffer (transfer none), which
++ // may be recycled once a newer frame is committed. Copy it into a GBytes owned by the SkImage
++ // so snapshots (including per-frame screencast captures) can safely outlive the buffer.
+ gsize pixelsDataSize;
+ const auto* pixelsData = g_bytes_get_data(pixels, &pixelsDataSize);
+ GRefPtr<GBytes> bytes = adoptGRef(g_bytes_new(pixelsData, pixelsDataSize));
+@@ -248,32 +254,47 @@ static Expected<Ref<ViewSnapshot>, String> saveBufferSnapshot(const GRefPtr<WPEB
+ return makeUnexpected(info.error());
+ SkPixmap pixmap(info.value(), g_bytes_get_data(bytes.get(), nullptr), info->minRowBytes());
+-
- if (clipRect) {
- SkIRect clippedRect = SkIRect::MakeXYWH(clipRect->x(), clipRect->y(), clipRect->width(), clipRect->height());
- SkImageInfo clippedInfo = info->makeWH(clipRect->width(), clipRect->height());
@@ -17443,22 +17771,26 @@ index 22c44ab7d823a4ae8458ff5265fc935361e25e1f..1ffc82a4597eb151b100f91b12e1bdc2
- }
-
- auto image = SkImages::RasterFromPixmap(pixmap, [](const void*, void* context) {
-- g_bytes_unref(static_cast<GBytes*>(context));
-- }, bytes.leakRef());
-+ float deviceScale = m_view.page().deviceScaleFactor();
++ sk_sp<SkImage> fullScreenshot = SkImages::RasterFromPixmap(pixmap, [](const void*, void* context) {
+ g_bytes_unref(static_cast<GBytes*>(context));
+ }, bytes.leakRef());
+-
+- if (!image)
++ if (!fullScreenshot)
+ return makeUnexpected("Failed to create snapshot image"_s);
+
+- return { ViewSnapshot::create(WTF::move(image)) };
++ float deviceScale = page.deviceScaleFactor();
+ if (!clipRect && (!nominalResolution || deviceScale == 1))
+ return { ViewSnapshot::create(WTF::move(fullScreenshot)) };
-
-- if (!image)
-- return makeUnexpected("Failed to create snapshot image"_s);
-+ WebCore::IntSize size = clipRect ? clipRect->size() : m_view.page().viewSize();
++
++ WebCore::IntSize size = clipRect ? clipRect->size() : page.viewSize();
+ if (!nominalResolution) {
+ size.scale(deviceScale);
+ if (clipRect)
+ clipRect->scale(deviceScale);
+ }
-
-- return { ViewSnapshot::create(WTF::move(image)) };
++
+ SkBitmap bitmap;
+ bitmap.allocPixels(SkImageInfo::Make(size.width(), size.height(), kN32_SkColorType, kPremul_SkAlphaType));
+ SkCanvas canvas(bitmap);
@@ -17470,7 +17802,7 @@ index 22c44ab7d823a4ae8458ff5265fc935361e25e1f..1ffc82a4597eb151b100f91b12e1bdc2
+ if (nominalResolution)
+ canvas.scale(1/deviceScale, 1/deviceScale);
+ canvas.drawImage(fullScreenshot, 0, 0);
-+ return { ViewSnapshot::create(WTF::move(bitmap.asImage())) };
++ return { ViewSnapshot::create(bitmap.asImage()) };
}
-Expected<Ref<ViewSnapshot>, String> AcceleratedBackingStore::takeSnapshot(std::optional<WebCore::IntRect>&& clipRect)
@@ -17480,7 +17812,11 @@ index 22c44ab7d823a4ae8458ff5265fc935361e25e1f..1ffc82a4597eb151b100f91b12e1bdc2
return makeUnexpected("No buffer to create snapshot from"_s);
- return saveBufferSnapshot(m_committedBuffer ? m_committedBuffer : m_pendingBuffer, WTF::move(clipRect));
-+ return saveBufferSnapshot(m_committedBuffer ? m_committedBuffer : m_pendingBuffer, WTF::move(clipRect), nominalResolution);
++ RefPtr page = m_webPage.get();
++ if (!page)
++ return makeUnexpected("No page to create snapshot from"_s);
++
++ return saveBufferSnapshot(m_committedBuffer ? m_committedBuffer : m_pendingBuffer, WTF::move(clipRect), nominalResolution, *page);
}
void AcceleratedBackingStore::renderPendingBuffer()
@@ -17499,10 +17835,10 @@ index dcb02699a62caf8b79e21259287419b76bb71b77..905c613a2550fe4442666b35b393e757
diff --git a/Source/WebKit/UIProcess/wpe/PageInspectorTargetProxyWPE.cpp b/Source/WebKit/UIProcess/wpe/PageInspectorTargetProxyWPE.cpp
new file mode 100644
-index 0000000000000000000000000000000000000000..912e1919a1e2a29ad221114ff312ef118d323093
+index 0000000000000000000000000000000000000000..e67882feb56417c5d44bdb953c35bfb5cd1a2175
--- /dev/null
+++ b/Source/WebKit/UIProcess/wpe/PageInspectorTargetProxyWPE.cpp
-@@ -0,0 +1,40 @@
+@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2019 Microsoft Corporation.
+ *
@@ -17532,382 +17868,31 @@ index 0000000000000000000000000000000000000000..912e1919a1e2a29ad221114ff312ef11
+#include "PageInspectorTargetProxy.h"
+
+#include "WebPageProxy.h"
-+#include <wpe/wpe.h>
+
-+namespace WebKit {
-+
-+void PageInspectorTargetProxy::platformActivate(String& error) const
-+{
-+ struct wpe_view_backend* backend = m_page->viewBackend();
-+ wpe_view_backend_add_activity_state(backend, wpe_view_activity_state_visible | wpe_view_activity_state_focused | wpe_view_activity_state_in_window);
-+}
-+
-+} // namespace WebKit
-diff --git a/Source/WebKit/UIProcess/wpe/WebColorPickerWPE.cpp b/Source/WebKit/UIProcess/wpe/WebColorPickerWPE.cpp
-new file mode 100644
-index 0000000000000000000000000000000000000000..b3c6d0a59daca4667ca8c709dad7816492389b47
---- /dev/null
-+++ b/Source/WebKit/UIProcess/wpe/WebColorPickerWPE.cpp
-@@ -0,0 +1,57 @@
-+/*
-+ * Copyright (C) 2015 Igalia S.L.
-+ *
-+ * Redistribution and use in source and binary forms, with or without
-+ * modification, are permitted provided that the following conditions
-+ * are met:
-+ * 1. Redistributions of source code must retain the above copyright
-+ * notice, this list of conditions and the following disclaimer.
-+ * 2. Redistributions in binary form must reproduce the above copyright
-+ * notice, this list of conditions and the following disclaimer in the
-+ * documentation and/or other materials provided with the distribution.
-+ *
-+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS AS IS''
-+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
-+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
-+ * THE POSSIBILITY OF SUCH DAMAGE.
-+ */
-+
-+#include "config.h"
-+#include "WebColorPickerWPE.h"
-+
-+#include "WebPageProxy.h"
-+
-+namespace WebKit {
-+using namespace WebCore;
-+
-+Ref<WebColorPickerWPE> WebColorPickerWPE::create(WebPageProxy& page, const Color& initialColor, const IntRect& rect, std::optional<WebCore::FrameIdentifier> frameID)
-+{
-+ return adoptRef(*new WebColorPickerWPE(page, initialColor, rect, frameID));
-+}
-+
-+WebColorPickerWPE::WebColorPickerWPE(WebPageProxy& page, const Color& initialColor, const IntRect&, std::optional<WebCore::FrameIdentifier> frameID)
-+ : WebColorPicker(&page.colorPickerClient(), frameID)
-+{
-+}
-+
-+WebColorPickerWPE::~WebColorPickerWPE()
-+{
-+ endPicker();
-+}
-+
-+void WebColorPickerWPE::endPicker()
-+{
-+}
-+
-+void WebColorPickerWPE::showColorPicker(const Color& color, const IntRect&)
-+{
-+}
-+
-+} // namespace WebKit
-diff --git a/Source/WebKit/UIProcess/wpe/WebColorPickerWPE.h b/Source/WebKit/UIProcess/wpe/WebColorPickerWPE.h
-new file mode 100644
-index 0000000000000000000000000000000000000000..7f588248e107a19f5b700fb8e0fe51d1c5cf5aac
---- /dev/null
-+++ b/Source/WebKit/UIProcess/wpe/WebColorPickerWPE.h
-@@ -0,0 +1,54 @@
-+/*
-+ * Copyright (C) 2015 Igalia S.L.
-+ *
-+ * Redistribution and use in source and binary forms, with or without
-+ * modification, are permitted provided that the following conditions
-+ * are met:
-+ * 1. Redistributions of source code must retain the above copyright
-+ * notice, this list of conditions and the following disclaimer.
-+ * 2. Redistributions in binary form must reproduce the above copyright
-+ * notice, this list of conditions and the following disclaimer in the
-+ * documentation and/or other materials provided with the distribution.
-+ *
-+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS AS IS''
-+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
-+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
-+ * THE POSSIBILITY OF SUCH DAMAGE.
-+ */
-+
-+#ifndef WebColorPickerWPE_h
-+#define WebColorPickerWPE_h
-+
-+#include "WebColorPicker.h"
-+
-+typedef struct _GtkColorChooser GtkColorChooser;
-+
-+namespace WebCore {
-+class Color;
-+class IntRect;
-+}
-+
-+namespace WebKit {
-+
-+class WebColorPickerWPE : public WebColorPicker {
-+public:
-+ static Ref<WebColorPickerWPE> create(WebPageProxy&, const WebCore::Color&, const WebCore::IntRect&, std::optional<WebCore::FrameIdentifier> = std::nullopt);
-+ virtual ~WebColorPickerWPE();
-+
-+ void endPicker() override;
-+ void showColorPicker(const WebCore::Color&, const WebCore::IntRect&) override;
-+
-+protected:
-+ WebColorPickerWPE(WebPageProxy&, const WebCore::Color&, const WebCore::IntRect&, std::optional<WebCore::FrameIdentifier> = std::nullopt);
-+};
-+
-+} // namespace WebKit
-+
-+#endif // WebColorPickerWPE_h
-diff --git a/Source/WebKit/UIProcess/wpe/WebDataListSuggestionsDropdownWPE.cpp b/Source/WebKit/UIProcess/wpe/WebDataListSuggestionsDropdownWPE.cpp
-new file mode 100644
-index 0000000000000000000000000000000000000000..c3ac81529d4dfb7070a9e1c30d4634eb10382713
---- /dev/null
-+++ b/Source/WebKit/UIProcess/wpe/WebDataListSuggestionsDropdownWPE.cpp
-@@ -0,0 +1,55 @@
-+/*
-+ * Copyright (C) 2019 Igalia S.L.
-+ *
-+ * Redistribution and use in source and binary forms, with or without
-+ * modification, are permitted provided that the following conditions
-+ * are met:
-+ * 1. Redistributions of source code must retain the above copyright
-+ * notice, this list of conditions and the following disclaimer.
-+ * 2. Redistributions in binary form must reproduce the above copyright
-+ * notice, this list of conditions and the following disclaimer in the
-+ * documentation and/or other materials provided with the distribution.
-+ *
-+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS AS IS''
-+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
-+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
-+ * THE POSSIBILITY OF SUCH DAMAGE.
-+ */
-+
-+#include "config.h"
-+#include "WebDataListSuggestionsDropdownWPE.h"
-+
-+#include "WebPageProxy.h"
-+#include <WebCore/DataListSuggestionInformation.h>
-+
-+namespace WebKit {
-+
-+WebDataListSuggestionsDropdownWPE::WebDataListSuggestionsDropdownWPE(WebPageProxy& page)
-+ : WebDataListSuggestionsDropdown(page)
-+{
-+}
-+
-+WebDataListSuggestionsDropdownWPE::~WebDataListSuggestionsDropdownWPE()
-+{
-+}
-+
-+void WebDataListSuggestionsDropdownWPE::platformShow(WebCore::DataListSuggestionInformation&& information)
-+{
-+}
-+
-+void WebDataListSuggestionsDropdownWPE::handleKeydownWithIdentifier(const String& key)
-+{
-+}
-+
-+void WebDataListSuggestionsDropdownWPE::close()
-+{
-+}
-+
-+} // namespace WebKit
-diff --git a/Source/WebKit/UIProcess/wpe/WebDataListSuggestionsDropdownWPE.h b/Source/WebKit/UIProcess/wpe/WebDataListSuggestionsDropdownWPE.h
-new file mode 100644
-index 0000000000000000000000000000000000000000..07a7cd3ab025616a41dc809e843a7f393b8e8e2f
---- /dev/null
-+++ b/Source/WebKit/UIProcess/wpe/WebDataListSuggestionsDropdownWPE.h
-@@ -0,0 +1,51 @@
-+/*
-+ * Copyright (C) 2019 Igalia S.L.
-+ *
-+ * Redistribution and use in source and binary forms, with or without
-+ * modification, are permitted provided that the following conditions
-+ * are met:
-+ * 1. Redistributions of source code must retain the above copyright
-+ * notice, this list of conditions and the following disclaimer.
-+ * 2. Redistributions in binary form must reproduce the above copyright
-+ * notice, this list of conditions and the following disclaimer in the
-+ * documentation and/or other materials provided with the distribution.
-+ *
-+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS AS IS''
-+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
-+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
-+ * THE POSSIBILITY OF SUCH DAMAGE.
-+ */
-+
-+#pragma once
-+
-+#include "WebDataListSuggestionsDropdown.h"
-+
-+namespace WebKit {
-+
-+class WebPageProxy;
-+
-+class WebDataListSuggestionsDropdownWPE final : public WebDataListSuggestionsDropdown {
-+public:
-+ static Ref<WebDataListSuggestionsDropdown> create(WebPageProxy& page)
-+ {
-+ return adoptRef(*new WebDataListSuggestionsDropdownWPE(page));
-+ }
-+
-+ ~WebDataListSuggestionsDropdownWPE();
-+
-+private:
-+ WebDataListSuggestionsDropdownWPE(WebPageProxy&);
-+
-+ void platformShow(WebCore::DataListSuggestionInformation&&) final;
-+ void handleKeydownWithIdentifier(const String&) final;
-+ void close() final;
-+};
-+
-+} // namespace WebKit
-diff --git a/Source/WebKit/UIProcess/wpe/WebDateTimePickerWPE.cpp b/Source/WebKit/UIProcess/wpe/WebDateTimePickerWPE.cpp
-new file mode 100644
-index 0000000000000000000000000000000000000000..a44463faf011fbab08f87bb7007a5e71c2a73758
---- /dev/null
-+++ b/Source/WebKit/UIProcess/wpe/WebDateTimePickerWPE.cpp
-@@ -0,0 +1,56 @@
-+/*
-+ * Copyright (C) 2020 Apple Inc. All rights reserved.
-+ * Copyright (C) 2021 Igalia S.L.
-+ *
-+ * Redistribution and use in source and binary forms, with or without
-+ * modification, are permitted provided that the following conditions
-+ * are met:
-+ * 1. Redistributions of source code must retain the above copyright
-+ * notice, this list of conditions and the following disclaimer.
-+ * 2. Redistributions in binary form must reproduce the above copyright
-+ * notice, this list of conditions and the following disclaimer in the
-+ * documentation and/or other materials provided with the distribution.
-+ *
-+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
-+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
-+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
-+ * THE POSSIBILITY OF SUCH DAMAGE.
-+ */
-+
-+#include "config.h"
-+#include "WebDateTimePickerWPE.h"
-+
-+#if ENABLE(DATE_AND_TIME_INPUT_TYPES)
-+
-+using namespace WebCore;
++#if ENABLE(WPE_PLATFORM)
++#include <wpe/wpe-platform.h>
++#endif
+
+namespace WebKit {
+
-+Ref<WebDateTimePickerWPE> WebDateTimePickerWPE::create(WebPageProxy& page)
-+{
-+ return adoptRef(*new WebDateTimePickerWPE(page));
-+}
-+
-+WebDateTimePickerWPE::~WebDateTimePickerWPE()
-+{
-+}
-+
-+WebDateTimePickerWPE::WebDateTimePickerWPE(WebPageProxy& page)
-+ : WebDateTimePicker(page)
-+{
-+}
-+
-+void WebDateTimePickerWPE::showDateTimePicker(WebCore::DateTimeChooserParameters&& params)
++void PageInspectorTargetProxy::platformActivate(String& error) const
+{
++ UNUSED_PARAM(error);
++#if ENABLE(WPE_PLATFORM)
++ // Focusing the WPEView marks it as focused; visible/in-window activity states are derived
++ // from its toplevel.
++ if (auto* wpeView = m_page->wpeView())
++ wpe_view_focus_in(wpeView);
++#endif
+}
+
+} // namespace WebKit
-+
-+#endif // ENABLE(DATE_AND_TIME_INPUT_TYPES)
-diff --git a/Source/WebKit/UIProcess/wpe/WebDateTimePickerWPE.h b/Source/WebKit/UIProcess/wpe/WebDateTimePickerWPE.h
-new file mode 100644
-index 0000000000000000000000000000000000000000..0c0e3fce33b06ee72c4c29d2a4abe9644f4cc895
---- /dev/null
-+++ b/Source/WebKit/UIProcess/wpe/WebDateTimePickerWPE.h
-@@ -0,0 +1,50 @@
-+/*
-+ * Copyright (C) 2020 Apple Inc. All rights reserved.
-+ * Copyright (C) 2021 Igalia S.L.
-+ *
-+ * Redistribution and use in source and binary forms, with or without
-+ * modification, are permitted provided that the following conditions
-+ * are met:
-+ * 1. Redistributions of source code must retain the above copyright
-+ * notice, this list of conditions and the following disclaimer.
-+ * 2. Redistributions in binary form must reproduce the above copyright
-+ * notice, this list of conditions and the following disclaimer in the
-+ * documentation and/or other materials provided with the distribution.
-+ *
-+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
-+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
-+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
-+ * THE POSSIBILITY OF SUCH DAMAGE.
-+ */
-+
-+#pragma once
-+
-+#if ENABLE(DATE_AND_TIME_INPUT_TYPES)
-+
-+#include "WebDateTimePicker.h"
-+#include <WebCore/DateComponents.h>
-+#include <WebCore/DateTimeChooserParameters.h>
-+
-+namespace WebKit {
-+
-+class WebDateTimePickerWPE final : public WebDateTimePicker {
-+public:
-+ static Ref<WebDateTimePickerWPE> create(WebPageProxy&);
-+ ~WebDateTimePickerWPE();
-+
-+private:
-+ WebDateTimePickerWPE(WebPageProxy&);
-+
-+ void showDateTimePicker(WebCore::DateTimeChooserParameters&&) final;
-+};
-+
-+} // namespace WebKit
-+
-+#endif // ENABLE(DATE_AND_TIME_INPUT_TYPES)
diff --git a/Source/WebKit/UIProcess/wpe/WebPageInspectorEmulationAgentWPE.cpp b/Source/WebKit/UIProcess/wpe/WebPageInspectorEmulationAgentWPE.cpp
new file mode 100644
-index 0000000000000000000000000000000000000000..493c44f0051a748d6570070f8b169e0e781370f4
+index 0000000000000000000000000000000000000000..e10040e04d8b88deebeb8cb7f4ff322a204c0378
--- /dev/null
+++ b/Source/WebKit/UIProcess/wpe/WebPageInspectorEmulationAgentWPE.cpp
-@@ -0,0 +1,53 @@
+@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2019 Microsoft Corporation.
+ *
@@ -17938,7 +17923,10 @@ index 0000000000000000000000000000000000000000..493c44f0051a748d6570070f8b169e0e
+
+#include "DrawingAreaProxyCoordinatedGraphics.h"
+#include "WebPageProxy.h"
-+#include <wpe/wpe.h>
++
++#if ENABLE(WPE_PLATFORM)
++#include <wpe/wpe-platform.h>
++#endif
+
+namespace WebKit {
+
@@ -17950,23 +17938,37 @@ index 0000000000000000000000000000000000000000..493c44f0051a748d6570070f8b169e0e
+ return;
+ }
+
-+ struct wpe_view_backend* backend = m_page.viewBackend();
-+ wpe_view_backend_dispatch_set_size(backend, viewSize.width(), viewSize.height());
-+ if (auto* drawingArea = static_cast<DrawingAreaProxyCoordinatedGraphics*>(m_page.drawingArea())) {
-+ drawingArea->waitForSizeUpdate([callback = WTF::move(callback)](const DrawingAreaProxyCoordinatedGraphics&) mutable {
++ auto waitForSizeUpdate = [this, callback = WTF::move(callback)]() mutable {
++ if (auto* drawingArea = static_cast<DrawingAreaProxyCoordinatedGraphics*>(m_page.drawingArea())) {
++ drawingArea->waitForSizeUpdate([callback = WTF::move(callback)](const DrawingAreaProxyCoordinatedGraphics&) mutable {
++ callback(String());
++ });
++ } else
+ callback(String());
-+ });
-+ } else
-+ callback(String());
++ };
++
++#if ENABLE(WPE_PLATFORM)
++ // WPEPlatform path: there is no libwpe view backend, so resize the WPEView's toplevel, which
++ // propagates the new size to the web process via WKWPE::ViewPlatform's "resized" signal. Note
++ // this only works reliably on displays where the client controls the toplevel size (e.g. the
++ // headless display); on Wayland the compositor's configure event may override the request.
++ if (auto* wpeView = m_page.wpeView()) {
++ if (auto* toplevel = wpe_view_get_toplevel(wpeView))
++ wpe_toplevel_resize(toplevel, viewSize.width(), viewSize.height());
++ waitForSizeUpdate();
++ return;
++ }
++#endif
++ waitForSizeUpdate();
+}
+
+} // namespace WebKit
diff --git a/Source/WebKit/UIProcess/wpe/WebPageInspectorInputAgentWPE.cpp b/Source/WebKit/UIProcess/wpe/WebPageInspectorInputAgentWPE.cpp
new file mode 100644
-index 0000000000000000000000000000000000000000..c6af56767484e2889208c96d454a0924f290ba9c
+index 0000000000000000000000000000000000000000..bd681a075d465dab2f612e2b1e6ad183d3111123
--- /dev/null
+++ b/Source/WebKit/UIProcess/wpe/WebPageInspectorInputAgentWPE.cpp
-@@ -0,0 +1,55 @@
+@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2019 Microsoft Corporation.
+ *
@@ -17998,7 +18000,6 @@ index 0000000000000000000000000000000000000000..c6af56767484e2889208c96d454a0924
+#include "NativeWebKeyboardEvent.h"
+#include "WebPageProxy.h"
+#include <WebCore/PlatformKeyboardEvent.h>
-+#include <wpe/wpe.h>
+
+namespace WebKit {
+
@@ -18038,10 +18039,10 @@ index 9b688ad328317fea4fd96ce66e9714bad8f0f937..402a36a9c565e13ec298aa7f014f0d92
} // namespace WebKit
diff --git a/Source/WebKit/WebKit.xcodeproj/project.pbxproj b/Source/WebKit/WebKit.xcodeproj/project.pbxproj
-index 096c342935ff2c88254cc80d5e5f3ff3e8c3cc59..b1d264ecd70d2640e5689c5a9b415dc16f82a3a3 100644
+index 9b3728970c1364ed0cb5b85e9e99b032ae420afc..20e870addf3bca2421ecc3ad1271ffbcf319d76f 100644
--- a/Source/WebKit/WebKit.xcodeproj/project.pbxproj
+++ b/Source/WebKit/WebKit.xcodeproj/project.pbxproj
-@@ -1581,6 +1581,7 @@
+@@ -1596,6 +1596,7 @@
5CABDC8722C40FED001EDE8E /* APIMessageListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CABDC8322C40FA7001EDE8E /* APIMessageListener.h */; };
5CADDE05215046BD0067D309 /* WKWebProcess.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C74300E21500492004BFA17 /* WKWebProcess.h */; settings = {ATTRIBUTES = (Private, ); }; };
5CAECB6627465AE400AB78D0 /* UnifiedSource115.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5CAECB5E27465AE300AB78D0 /* UnifiedSource115.cpp */; };
@@ -18049,7 +18050,7 @@ index 096c342935ff2c88254cc80d5e5f3ff3e8c3cc59..b1d264ecd70d2640e5689c5a9b415dc1
5CAF7AA726F93AB00003F19E /* adattributiond.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5CAF7AA526F93A950003F19E /* adattributiond.cpp */; };
5CAFDE452130846300B1F7E1 /* _WKInspector.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CAFDE422130843500B1F7E1 /* _WKInspector.h */; settings = {ATTRIBUTES = (Private, ); }; };
5CAFDE472130846A00B1F7E1 /* _WKInspectorInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CAFDE442130843600B1F7E1 /* _WKInspectorInternal.h */; };
-@@ -2426,6 +2427,18 @@
+@@ -2443,6 +2444,18 @@
DF0C5F28252ECB8E00D921DB /* WKDownload.h in Headers */ = {isa = PBXBuildFile; fileRef = DF0C5F24252ECB8D00D921DB /* WKDownload.h */; settings = {ATTRIBUTES = (Public, ); }; };
DF0C5F2A252ECB8E00D921DB /* WKDownloadDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = DF0C5F26252ECB8E00D921DB /* WKDownloadDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
DF0C5F2B252ED44000D921DB /* WKDownloadInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = DF0C5F25252ECB8E00D921DB /* WKDownloadInternal.h */; };
@@ -18068,7 +18069,7 @@ index 096c342935ff2c88254cc80d5e5f3ff3e8c3cc59..b1d264ecd70d2640e5689c5a9b415dc1
DF462E0F23F22F5500EFF35F /* WKHTTPCookieStorePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = DF462E0E23F22F5300EFF35F /* WKHTTPCookieStorePrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
DF462E1223F338BE00EFF35F /* WKContentWorldPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = DF462E1123F338AD00EFF35F /* WKContentWorldPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
DF7A231C291B088D00B98DF3 /* WKSnapshotConfigurationPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = DF7A231B291B088D00B98DF3 /* WKSnapshotConfigurationPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
-@@ -2532,6 +2545,8 @@
+@@ -2549,6 +2562,8 @@
E5BEF6822130C48000F31111 /* WebDataListSuggestionsDropdownIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = E5BEF6802130C47F00F31111 /* WebDataListSuggestionsDropdownIOS.h */; };
E5CB07DC20E1678F0022C183 /* WKFormColorControl.h in Headers */ = {isa = PBXBuildFile; fileRef = E5CB07DA20E1678F0022C183 /* WKFormColorControl.h */; };
E5CBA76427A318E100DF7858 /* UnifiedSource120.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E5CBA75F27A3187800DF7858 /* UnifiedSource120.cpp */; };
@@ -18077,7 +18078,7 @@ index 096c342935ff2c88254cc80d5e5f3ff3e8c3cc59..b1d264ecd70d2640e5689c5a9b415dc1
E5CBA76527A318E100DF7858 /* UnifiedSource118.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E5CBA76127A3187900DF7858 /* UnifiedSource118.cpp */; };
E5CBA76627A318E100DF7858 /* UnifiedSource116.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E5CBA76327A3187B00DF7858 /* UnifiedSource116.cpp */; };
E5CBA76727A318E100DF7858 /* UnifiedSource119.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E5CBA76027A3187900DF7858 /* UnifiedSource119.cpp */; };
-@@ -2577,6 +2592,8 @@
+@@ -2594,6 +2609,8 @@
F3EEEE592DB318270038CC1D /* BidiBrowserAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = F3EEEE572DB318270038CC1D /* BidiBrowserAgent.h */; };
F3EEEE5A2DB318270038CC1D /* BidiBrowserAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F3EEEE582DB318270038CC1D /* BidiBrowserAgent.cpp */; };
F404455C2D5CFB56000E587E /* AppKitSoftLink.h in Headers */ = {isa = PBXBuildFile; fileRef = F404455A2D5CFB56000E587E /* AppKitSoftLink.h */; };
@@ -18086,7 +18087,7 @@ index 096c342935ff2c88254cc80d5e5f3ff3e8c3cc59..b1d264ecd70d2640e5689c5a9b415dc1
F409BA181E6E64BC009DA28E /* WKDragDestinationAction.h in Headers */ = {isa = PBXBuildFile; fileRef = F409BA171E6E64B3009DA28E /* WKDragDestinationAction.h */; settings = {ATTRIBUTES = (Private, ); }; };
F40C3B712AB401C5007A3567 /* WKDatePickerPopoverController.h in Headers */ = {isa = PBXBuildFile; fileRef = F40C3B6F2AB40167007A3567 /* WKDatePickerPopoverController.h */; };
F41145682CD939E0004CDBD1 /* _WKTouchEventGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = F41145652CD939E0004CDBD1 /* _WKTouchEventGenerator.h */; settings = {ATTRIBUTES = (Private, ); }; };
-@@ -6762,6 +6779,7 @@
+@@ -6797,6 +6814,7 @@
5CABDC8522C40FCC001EDE8E /* WKMessageListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKMessageListener.h; sourceTree = "<group>"; };
5CABE07A28F60E8A00D83FD9 /* WebPushMessage.serialization.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebPushMessage.serialization.in; sourceTree = "<group>"; };
5CADDE0D2151AA010067D309 /* AuthenticationChallengeDisposition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AuthenticationChallengeDisposition.h; sourceTree = "<group>"; };
@@ -18094,7 +18095,7 @@ index 096c342935ff2c88254cc80d5e5f3ff3e8c3cc59..b1d264ecd70d2640e5689c5a9b415dc1
5CAECB5E27465AE300AB78D0 /* UnifiedSource115.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = UnifiedSource115.cpp; sourceTree = "<group>"; };
5CAF7AA426F93A750003F19E /* adattributiond */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = adattributiond; sourceTree = BUILT_PRODUCTS_DIR; };
5CAF7AA526F93A950003F19E /* adattributiond.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = adattributiond.cpp; sourceTree = "<group>"; };
-@@ -8628,6 +8646,19 @@
+@@ -8673,6 +8691,19 @@
DF0C5F24252ECB8D00D921DB /* WKDownload.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKDownload.h; sourceTree = "<group>"; };
DF0C5F25252ECB8E00D921DB /* WKDownloadInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKDownloadInternal.h; sourceTree = "<group>"; };
DF0C5F26252ECB8E00D921DB /* WKDownloadDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKDownloadDelegate.h; sourceTree = "<group>"; };
@@ -18114,7 +18115,7 @@ index 096c342935ff2c88254cc80d5e5f3ff3e8c3cc59..b1d264ecd70d2640e5689c5a9b415dc1
DF462E0E23F22F5300EFF35F /* WKHTTPCookieStorePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKHTTPCookieStorePrivate.h; sourceTree = "<group>"; };
DF462E1123F338AD00EFF35F /* WKContentWorldPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKContentWorldPrivate.h; sourceTree = "<group>"; };
DF58C6311371AC5800F9A37C /* NativeWebWheelEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeWebWheelEvent.h; sourceTree = "<group>"; };
-@@ -8831,6 +8862,8 @@
+@@ -8876,6 +8907,8 @@
E5CBA76127A3187900DF7858 /* UnifiedSource118.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = UnifiedSource118.cpp; sourceTree = "<group>"; };
E5CBA76227A3187900DF7858 /* UnifiedSource117.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = UnifiedSource117.cpp; sourceTree = "<group>"; };
E5CBA76327A3187B00DF7858 /* UnifiedSource116.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = UnifiedSource116.cpp; sourceTree = "<group>"; };
@@ -18123,7 +18124,7 @@ index 096c342935ff2c88254cc80d5e5f3ff3e8c3cc59..b1d264ecd70d2640e5689c5a9b415dc1
E5DEFA6726F8F42600AB68DB /* PhotosUISPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PhotosUISPI.h; sourceTree = "<group>"; };
E838FCAF2DE90BF800703353 /* ISO18013MobileDocumentRequest+Extras.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ISO18013MobileDocumentRequest+Extras.swift"; sourceTree = "<group>"; };
E88885662DC914C400C572B8 /* WKISO18013Request.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WKISO18013Request.h; sourceTree = "<group>"; };
-@@ -8896,6 +8929,9 @@
+@@ -8941,6 +8974,9 @@
F404455A2D5CFB56000E587E /* AppKitSoftLink.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppKitSoftLink.h; sourceTree = "<group>"; };
F404455B2D5CFB56000E587E /* AppKitSoftLink.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = AppKitSoftLink.mm; sourceTree = "<group>"; };
F4063DDE2D71481E00F3FE6E /* LLVMProfiling.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LLVMProfiling.h; sourceTree = "<group>"; };
@@ -18133,7 +18134,7 @@ index 096c342935ff2c88254cc80d5e5f3ff3e8c3cc59..b1d264ecd70d2640e5689c5a9b415dc1
F409BA171E6E64B3009DA28E /* WKDragDestinationAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKDragDestinationAction.h; sourceTree = "<group>"; };
F40C3B6F2AB40167007A3567 /* WKDatePickerPopoverController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WKDatePickerPopoverController.h; sourceTree = "<group>"; };
F40C3B702AB40167007A3567 /* WKDatePickerPopoverController.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = WKDatePickerPopoverController.mm; sourceTree = "<group>"; };
-@@ -9433,6 +9469,7 @@
+@@ -9476,6 +9512,7 @@
3766F9EE189A1241003CF19B /* JavaScriptCore.framework in Frameworks */,
3766F9F1189A1254003CF19B /* libicucore.dylib in Frameworks */,
7B9FC5BB28A5233B007570E7 /* libWebKitPlatform.a in Frameworks */,
@@ -18141,7 +18142,7 @@ index 096c342935ff2c88254cc80d5e5f3ff3e8c3cc59..b1d264ecd70d2640e5689c5a9b415dc1
3766F9EF189A1244003CF19B /* QuartzCore.framework in Frameworks */,
37694525184FC6B600CDE21F /* Security.framework in Frameworks */,
37BEC4DD1948FC6A008B4286 /* WebCore.framework in Frameworks */,
-@@ -12795,6 +12832,7 @@
+@@ -12887,6 +12924,7 @@
990D28AF1C65203900986977 /* _WKAutomationSessionInternal.h */,
BC35BB81026B48A6A3BDAA80 /* _WKAutomationSessionPrivateForTesting.h */,
A197A4B2903C423281A84E16 /* _WKAutomationSessionTesting.mm */,
@@ -18149,7 +18150,7 @@ index 096c342935ff2c88254cc80d5e5f3ff3e8c3cc59..b1d264ecd70d2640e5689c5a9b415dc1
5C4609E222430E4C009943C2 /* _WKContentRuleListAction.h */,
5C4609E322430E4D009943C2 /* _WKContentRuleListAction.mm */,
5C4609E422430E4D009943C2 /* _WKContentRuleListActionInternal.h */,
-@@ -14632,6 +14670,7 @@
+@@ -14726,6 +14764,7 @@
E34B110C27C46BC6006D2F2E /* libWebCoreTestShim.dylib */,
E34B110F27C46D09006D2F2E /* libWebCoreTestSupport.dylib */,
DDE992F4278D06D900F60D26 /* libWebKitAdditions.a */,
@@ -18157,16 +18158,16 @@ index 096c342935ff2c88254cc80d5e5f3ff3e8c3cc59..b1d264ecd70d2640e5689c5a9b415dc1
57A9FF15252C6AEF006A2040 /* libWTF.a */,
5750F32A2032D4E500389347 /* LocalAuthentication.framework */,
570DAAB0230273D200E8FC04 /* NearField.framework */,
-@@ -15237,6 +15276,8 @@
- AA10570002 /* InspectorStorageAgent.h */,
+@@ -15330,6 +15369,8 @@
+ children = (
9197940423DBC4BB00257892 /* InspectorBrowserAgent.cpp */,
9197940323DBC4BB00257892 /* InspectorBrowserAgent.h */,
+ F3867F0324607D2B008F0F31 /* InspectorScreencastAgent.cpp */,
+ F3867F0424607D2B008F0F31 /* InspectorScreencastAgent.h */,
+ AA1057000000000000000001 /* InspectorStorageAgent.cpp */,
+ AA1057000000000000000002 /* InspectorStorageAgent.h */,
D2CB01DAB4428B76CDA8AECC /* ProxyingNetworkAgent.cpp */,
- EB43329193327F9D842EE004 /* ProxyingNetworkAgent.h */,
- 35541583DC2A3C24CD8C2D87 /* ProxyingNetworkAgent.messages.in */,
-@@ -16066,6 +16107,7 @@
+@@ -16163,6 +16204,7 @@
E1513C65166EABB200149FCB /* AuxiliaryProcessProxy.h */,
46A2B6061E5675A200C3DEDA /* BackgroundProcessResponsivenessTimer.cpp */,
46A2B6071E5675A200C3DEDA /* BackgroundProcessResponsivenessTimer.h */,
@@ -18174,7 +18175,7 @@ index 096c342935ff2c88254cc80d5e5f3ff3e8c3cc59..b1d264ecd70d2640e5689c5a9b415dc1
5C6D69352AC3935D0099BDAF /* BrowsingContextGroup.cpp */,
5C6D69362AC3935D0099BDAF /* BrowsingContextGroup.h */,
5CA98549210BEB5A0057EB6B /* BrowsingWarning.h */,
-@@ -16096,6 +16138,8 @@
+@@ -16193,6 +16235,8 @@
BC06F43912DBCCFB002D78DE /* GeolocationPermissionRequestProxy.cpp */,
BC06F43812DBCCFB002D78DE /* GeolocationPermissionRequestProxy.h */,
2DD5A72A1EBF09A7009BA597 /* HiddenPageThrottlingAutoIncreasesCounter.h */,
@@ -18183,7 +18184,7 @@ index 096c342935ff2c88254cc80d5e5f3ff3e8c3cc59..b1d264ecd70d2640e5689c5a9b415dc1
5CEABA2B2333251400797797 /* LegacyGlobalSettings.cpp */,
5CEABA2A2333247700797797 /* LegacyGlobalSettings.h */,
31607F3819627002009B87DA /* LegacySessionStateCoding.h */,
-@@ -16126,6 +16170,7 @@
+@@ -16223,6 +16267,7 @@
4683569B21E81CC7006E27A3 /* ProvisionalPageProxy.cpp */,
4683569A21E81CC7006E27A3 /* ProvisionalPageProxy.h */,
411B89CB27B2B89600F9EBD3 /* QueryPermissionResultCallback.h */,
@@ -18191,7 +18192,7 @@ index 096c342935ff2c88254cc80d5e5f3ff3e8c3cc59..b1d264ecd70d2640e5689c5a9b415dc1
5CCB54DC2A4FEA6A0005FAA8 /* RemotePageDrawingAreaProxy.cpp */,
5CCB54DB2A4FEA6A0005FAA8 /* RemotePageDrawingAreaProxy.h */,
FABBBC802D35AC6800820017 /* RemotePageFullscreenManagerProxy.cpp */,
-@@ -16253,6 +16298,8 @@
+@@ -16352,6 +16397,8 @@
BC7B6204129A0A6700D174A4 /* WebPageGroup.h */,
2D9EA3101A96D9EB002D2807 /* WebPageInjectedBundleClient.cpp */,
2D9EA30E1A96CBFF002D2807 /* WebPageInjectedBundleClient.h */,
@@ -18200,7 +18201,7 @@ index 096c342935ff2c88254cc80d5e5f3ff3e8c3cc59..b1d264ecd70d2640e5689c5a9b415dc1
9B7F8A502C785725000057F3 /* WebPageLoadTiming.h */,
BC111B0B112F5E4F00337BAB /* WebPageProxy.cpp */,
BC032DCB10F4389F0058C15A /* WebPageProxy.h */,
-@@ -16445,6 +16492,7 @@
+@@ -16544,6 +16591,7 @@
BC646C1911DD399F006455B0 /* WKBackForwardListItemRef.h */,
BC646C1611DD399F006455B0 /* WKBackForwardListRef.cpp */,
BC646C1711DD399F006455B0 /* WKBackForwardListRef.h */,
@@ -18208,7 +18209,7 @@ index 096c342935ff2c88254cc80d5e5f3ff3e8c3cc59..b1d264ecd70d2640e5689c5a9b415dc1
BCB9E24A1120E15C00A137E0 /* WKContext.cpp */,
BCB9E2491120E15C00A137E0 /* WKContext.h */,
1AE52F9319201F6B00A1FA37 /* WKContextConfigurationRef.cpp */,
-@@ -17026,8 +17074,11 @@
+@@ -17126,8 +17174,11 @@
B878B613133428DC006888E9 /* CorrectionPanel.h */,
B878B614133428DC006888E9 /* CorrectionPanel.mm */,
7AFA6F682A9F57C50055322A /* DisplayLinkMac.cpp */,
@@ -18220,7 +18221,7 @@ index 096c342935ff2c88254cc80d5e5f3ff3e8c3cc59..b1d264ecd70d2640e5689c5a9b415dc1
33F1A0112FEFB66B00BD5D70 /* PositionInformationManager.cpp */,
33F1A0102FEFB66B00BD5D70 /* PositionInformationManager.h */,
E18E6909169B563F009B6670 /* SecItemShimProxy.cpp */,
-@@ -17049,6 +17100,8 @@
+@@ -17150,6 +17201,8 @@
E568B92120A3AC6A00E3C856 /* WebDataListSuggestionsDropdownMac.mm */,
E55CD20124D09F1F0042DB9C /* WebDateTimePickerMac.h */,
E55CD20224D09F1F0042DB9C /* WebDateTimePickerMac.mm */,
@@ -18229,7 +18230,7 @@ index 096c342935ff2c88254cc80d5e5f3ff3e8c3cc59..b1d264ecd70d2640e5689c5a9b415dc1
BC857E8512B71EBB00EDEB2E /* WebPageProxyMac.mm */,
BC5750951268F3C6006F0F12 /* WebPopupMenuProxyMac.h */,
BC5750961268F3C6006F0F12 /* WebPopupMenuProxyMac.mm */,
-@@ -17891,6 +17944,7 @@
+@@ -17977,6 +18030,7 @@
990D28AC1C6420CF00986977 /* _WKAutomationSessionDelegate.h in Headers */,
990D28B11C65208D00986977 /* _WKAutomationSessionInternal.h in Headers */,
C4450D54570C4383A25745E6 /* _WKAutomationSessionPrivateForTesting.h in Headers */,
@@ -18237,7 +18238,7 @@ index 096c342935ff2c88254cc80d5e5f3ff3e8c3cc59..b1d264ecd70d2640e5689c5a9b415dc1
CD89ACBD2EA696A300C76423 /* _WKCaptionStyleMenuController.h in Headers */,
97C476282ECD33A6004D1492 /* _WKCaptionStyleMenuControllerInternal.h in Headers */,
5C4609E7224317B4009943C2 /* _WKContentRuleListAction.h in Headers */,
-@@ -18207,6 +18261,7 @@
+@@ -18294,6 +18348,7 @@
E164A2F2191AF14E0010737D /* BlobDataFileReferenceWithSandboxExtension.h in Headers */,
E170876C16D6CA6900F99226 /* BlobRegistryProxy.h in Headers */,
1A5705111BE410E600874AF1 /* BlockSPI.h in Headers */,
@@ -18245,20 +18246,20 @@ index 096c342935ff2c88254cc80d5e5f3ff3e8c3cc59..b1d264ecd70d2640e5689c5a9b415dc1
5CA9854A210BEB640057EB6B /* BrowsingWarning.h in Headers */,
A7E69BCC2B2117A100D43D3F /* BufferAndBackendInfo.h in Headers */,
BC3065FA1259344E00E71278 /* CacheModel.h in Headers */,
-@@ -18415,8 +18470,12 @@
- BC14DF77120B5B7900826C0C /* InjectedBundleScriptWorld.h in Headers */,
+@@ -18503,8 +18558,12 @@
CE550E152283752200D28791 /* InsertTextOptions.h in Headers */,
9197940523DBC4BB00257892 /* InspectorBrowserAgent.h in Headers */,
+ AA1057000000000000000006 /* InspectorCookieStoreHelpers.h in Headers */,
+ D76D6888238DBD81008D314B /* InspectorDialogAgent.h in Headers */,
996B2B9D25E257FF00719379 /* InspectorExtensionDelegate.h in Headers */,
01840EDDFCFA4B829AA44670 /* InspectorPassthroughChannel.h in Headers */,
+ D71A94342370E07A002C4D9E /* InspectorPlaywrightAgentClient.h in Headers */,
+ D71A94322370E025002C4D9E /* InspectorPlaywrightAgentClientMac.h in Headers */,
+ F3867F0A24607D4E008F0F31 /* InspectorScreencastAgent.h in Headers */,
+ AA1057000000000000000005 /* InspectorStorageAgent.h in Headers */,
A5E391FD2183C1F800C8FB31 /* InspectorTargetProxy.h in Headers */,
07AE8FBD2F3BC4F300A4C0CA /* InteractionInformationAtPosition.h in Headers */,
- 07AE8FC22F3BC58200A4C0CA /* InteractionInformationRequest.h in Headers */,
-@@ -18706,6 +18765,7 @@
+@@ -18798,6 +18857,7 @@
07E065142F19E01000ECDA2E /* RemoteGPU.h in Headers */,
0F6E7C532C4C386800F1DB85 /* RemoteGraphicsContextMessages.h in Headers */,
F451C0FE2703B263002BA03B /* RemoteGraphicsContextProxy.h in Headers */,
@@ -18266,7 +18267,7 @@ index 096c342935ff2c88254cc80d5e5f3ff3e8c3cc59..b1d264ecd70d2640e5689c5a9b415dc1
2D47B56D1810714E003A3AEE /* RemoteLayerBackingStore.h in Headers */,
2DDF731518E95060004F5A66 /* RemoteLayerBackingStoreCollection.h in Headers */,
5F4D67D682584880B7E5A569 /* RemoteLayerTreeCommitBundle.h in Headers */,
-@@ -19155,6 +19215,8 @@
+@@ -19250,6 +19310,8 @@
939EF87029D112EE00F23AEE /* WebPageInlines.h in Headers */,
9197940823DBC4CB00257892 /* WebPageInspectorAgentBase.h in Headers */,
A513F5402154A5D700662841 /* WebPageInspectorController.h in Headers */,
@@ -18275,7 +18276,7 @@ index 096c342935ff2c88254cc80d5e5f3ff3e8c3cc59..b1d264ecd70d2640e5689c5a9b415dc1
C0CE72A11247E71D00BC0EC4 /* WebPageMessages.h in Headers */,
2D5C9D0619C81D8F00B3C5C1 /* WebPageOverlay.h in Headers */,
939EF86F29D0C17300F23AEE /* WebPageProxy.h in Headers */,
-@@ -22134,6 +22196,7 @@
+@@ -22232,6 +22294,7 @@
2749F6442146561B008380BF /* InjectedBundleNodeHandle.cpp in Sources */,
2749F6452146561E008380BF /* InjectedBundleRangeHandle.cpp in Sources */,
48E4FD912C91486DA934D031 /* InspectorPassthroughChannel.cpp in Sources */,
@@ -18283,7 +18284,7 @@ index 096c342935ff2c88254cc80d5e5f3ff3e8c3cc59..b1d264ecd70d2640e5689c5a9b415dc1
074D6A652F385435006089F6 /* IntRectCG.swift in Sources */,
5CF250AF2EE06491006A7172 /* IPCTesterReceiver.swift in Sources */,
5C448C662EE06E11008931C7 /* IPCTesterReceiverMessageReceiver.swift in Sources */,
-@@ -22153,6 +22216,7 @@
+@@ -22251,6 +22314,7 @@
41E242E026E0C908009A8C64 /* NetworkRTCUtilitiesCocoa.mm in Sources */,
FA5AAE9C2E6A217A00FE693D /* NetworkSoftLink.mm in Sources */,
DD4BDE7B2CA38213001A3339 /* ObjectiveCBlockConversions.swift in Sources */,
@@ -18291,8 +18292,8 @@ index 096c342935ff2c88254cc80d5e5f3ff3e8c3cc59..b1d264ecd70d2640e5689c5a9b415dc1
1CB9138F2E8C6D500002BCB7 /* PlatformUnifiedSource1-ARC.mm in Sources */,
1CB913932E8C71920002BCB7 /* PlatformUnifiedSource2-ARC.mm in Sources */,
A1B849382F3D9F02004256A1 /* PlaybackSessionInterfaceAVKit.mm in Sources */,
-@@ -22497,6 +22561,8 @@
- 078B04A02CF18EAB00B453A6 /* WebPage+NavigationPreferences.swift in Sources */,
+@@ -22598,6 +22662,8 @@
+ 0732D6EB301D645100C2BFE7 /* WebPage+SPI.swift in Sources */,
071467782DFE84E500F77867 /* WebPage+Transferable.swift in Sources */,
07CB79962CE9435700199C49 /* WebPage.swift in Sources */,
+ D79902B1236E9404005D6F7E /* WebPageInspectorEmulationAgentMac.mm in Sources */,
@@ -18332,10 +18333,10 @@ index cc107b48bb95ab2321a32ff37b2e62781113418a..715f3b89f6b7ca255f35093b44afb6bd
WeakRef<WebFrame> m_frame;
std::unique_ptr<UIProcessForwardingFrontendChannel> m_channel;
diff --git a/Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp b/Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp
-index 006dfb944fd18c0b6632cf52589b9c15c9df2ac7..35c69d9d9d562750942f1eaa7ef5218420663b7d 100644
+index f4f72945c2733401a6d656cdae61c7a0e1c020ae..7968931f4947f53af86ddd8017579ff21ae8b080 100644
--- a/Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp
+++ b/Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp
-@@ -274,6 +274,11 @@ void WebLoaderStrategy::scheduleLoad(ResourceLoader& resourceLoader, CachedResou
+@@ -276,6 +276,11 @@ void WebLoaderStrategy::scheduleLoad(ResourceLoader& resourceLoader, CachedResou
}
#endif
@@ -18347,7 +18348,7 @@ index 006dfb944fd18c0b6632cf52589b9c15c9df2ac7..35c69d9d9d562750942f1eaa7ef52184
#if ENABLE(PDFJS)
if (tryLoadingUsingPDFJSHandler(resourceLoader, trackingParameters))
return;
-@@ -295,12 +300,16 @@ void WebLoaderStrategy::scheduleLoad(ResourceLoader& resourceLoader, CachedResou
+@@ -297,12 +302,16 @@ void WebLoaderStrategy::scheduleLoad(ResourceLoader& resourceLoader, CachedResou
}
if (InspectorInstrumentationWebKit::shouldInterceptRequest(resourceLoader)) {
@@ -18370,7 +18371,7 @@ index 006dfb944fd18c0b6632cf52589b9c15c9df2ac7..35c69d9d9d562750942f1eaa7ef52184
}
WEBLOADERSTRATEGY_RELEASE_LOG_FORWARDABLE(WebLoaderStrategyScheduleLoad);
-@@ -380,6 +389,8 @@ static void addParametersShared(const LocalFrame* frame, NetworkResourceLoadPara
+@@ -382,6 +391,8 @@ static void addParametersShared(const LocalFrame* frame, NetworkResourceLoadPara
parameters.crossOriginAccessControlCheckEnabled = CrossOriginAccessControlCheckDisabler::singleton().crossOriginAccessControlCheckEnabled();
parameters.hadMainFrameMainResourcePrivateRelayed = WebProcess::singleton().hadMainFrameMainResourcePrivateRelayed();
@@ -18379,7 +18380,7 @@ index 006dfb944fd18c0b6632cf52589b9c15c9df2ac7..35c69d9d9d562750942f1eaa7ef52184
if (!frame)
return;
-@@ -439,7 +450,7 @@ static void addParametersShared(const LocalFrame* frame, NetworkResourceLoadPara
+@@ -441,7 +452,7 @@ static void addParametersShared(const LocalFrame* frame, NetworkResourceLoadPara
parameters.linkPreconnectEarlyHintsEnabled = mainFrame->settings().linkPreconnectEarlyHintsEnabled();
}
@@ -18388,7 +18389,7 @@ index 006dfb944fd18c0b6632cf52589b9c15c9df2ac7..35c69d9d9d562750942f1eaa7ef52184
{
auto identifier = *resourceLoader.identifier();
-@@ -451,10 +462,10 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceL
+@@ -453,10 +464,10 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceL
&& resourceLoader.frameLoader()->notifier().isInitialRequestIdentifier(identifier)
? MainFrameMainResource::Yes : MainFrameMainResource::No;
if (!page->allowsLoadFromURL(request.url(), mainFrameMainResource)) {
@@ -18401,7 +18402,7 @@ index 006dfb944fd18c0b6632cf52589b9c15c9df2ac7..35c69d9d9d562750942f1eaa7ef52184
}
}
-@@ -464,14 +475,6 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceL
+@@ -466,14 +477,6 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceL
LOG(NetworkScheduling, "(WebProcess) WebLoaderStrategy::scheduleLoad, url '%s' will be scheduled with the NetworkProcess with priority %d, storedCredentialsPolicy %i", resourceLoader.url().string().latin1().data(), static_cast<int>(resourceLoader.request().priority()), (int)storedCredentialsPolicy);
@@ -18416,7 +18417,7 @@ index 006dfb944fd18c0b6632cf52589b9c15c9df2ac7..35c69d9d9d562750942f1eaa7ef52184
loadParameters.identifier = identifier;
loadParameters.parentPID = legacyPresentingApplicationPID();
loadParameters.contentSniffingPolicy = contentSniffingPolicy;
-@@ -566,11 +569,8 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceL
+@@ -568,11 +571,8 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceL
if (loadParameters.options.mode != FetchOptions::Mode::Navigate) {
ASSERT(loadParameters.sourceOrigin);
@@ -18430,7 +18431,7 @@ index 006dfb944fd18c0b6632cf52589b9c15c9df2ac7..35c69d9d9d562750942f1eaa7ef52184
}
loadParameters.isMainFrameNavigation = isMainFrameNavigation;
-@@ -644,10 +644,29 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceL
+@@ -649,10 +649,29 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceL
if (RefPtr handle = resourceLoader.cachedResource())
loadParameters.isInitiatorPrefetch = handle->type() == CachedResource::Type::LinkPrefetch;
@@ -18461,16 +18462,16 @@ index 006dfb944fd18c0b6632cf52589b9c15c9df2ac7..35c69d9d9d562750942f1eaa7ef52184
loadParameters.shouldConsiderEnhancedSecurityForInsecureResponse = webFrame->page() ? webFrame->page()->takeShouldConsiderEnhancedSecurityForInsecureResponseForCurrentNavigation() : false;
}
WEBLOADERSTRATEGY_RELEASE_LOG_FORWARDABLE(WebLoaderStrategyScheduleLoadResourceScheduledWithNetworkProcess, static_cast<int>(resourceLoader.request().priority()), existingNetworkResourceLoadIdentifierToResume ? existingNetworkResourceLoadIdentifierToResume->toUInt64() : 0);
-@@ -662,7 +681,7 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceL
- }
-
- auto loader = WebResourceLoader::create(resourceLoader, trackingParameters);
+@@ -670,7 +689,7 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceL
+ if (RefPtr body = resourceLoader.request().httpBody())
+ state = body->pendingStreamState();
+ auto loader = WebResourceLoader::create(resourceLoader, trackingParameters, WTF::move(state));
- m_webResourceLoaders.set(identifier, WTF::move(loader));
+ m_webResourceLoaders.set(*resourceLoader.identifier(), WTF::move(loader));
}
void WebLoaderStrategy::scheduleInternallyFailedLoad(WebCore::ResourceLoader& resourceLoader)
-@@ -1086,7 +1105,7 @@ void WebLoaderStrategy::didFinishPreconnection(WebCore::ResourceLoaderIdentifier
+@@ -1094,7 +1113,7 @@ void WebLoaderStrategy::didFinishPreconnection(WebCore::ResourceLoaderIdentifier
bool WebLoaderStrategy::isOnLine() const
{
@@ -18479,7 +18480,7 @@ index 006dfb944fd18c0b6632cf52589b9c15c9df2ac7..35c69d9d9d562750942f1eaa7ef52184
}
void WebLoaderStrategy::addOnlineStateChangeListener(Function<void(bool)>&& listener)
-@@ -1112,6 +1131,11 @@ void WebLoaderStrategy::isResourceLoadFinished(CachedResource& resource, Complet
+@@ -1120,6 +1139,11 @@ void WebLoaderStrategy::isResourceLoadFinished(CachedResource& resource, Complet
void WebLoaderStrategy::setOnLineState(bool isOnLine)
{
@@ -18491,7 +18492,7 @@ index 006dfb944fd18c0b6632cf52589b9c15c9df2ac7..35c69d9d9d562750942f1eaa7ef52184
if (m_isOnLine == isOnLine)
return;
-@@ -1120,6 +1144,12 @@ void WebLoaderStrategy::setOnLineState(bool isOnLine)
+@@ -1128,6 +1152,12 @@ void WebLoaderStrategy::setOnLineState(bool isOnLine)
listener(isOnLine);
}
@@ -18505,7 +18506,7 @@ index 006dfb944fd18c0b6632cf52589b9c15c9df2ac7..35c69d9d9d562750942f1eaa7ef52184
{
WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::SetCaptureExtraNetworkLoadMetricsEnabled(enabled), 0);
diff --git a/Source/WebKit/WebProcess/Network/WebLoaderStrategy.h b/Source/WebKit/WebProcess/Network/WebLoaderStrategy.h
-index a317b77e961391faba0a3745e560d2285941a20b..1a198ba07e77e19434a0fcfb0b81f94e1b1e1f49 100644
+index 31b1f2f99da0aba3b594727fe80f1bce7eaa35c5..92e41b57e72a98a72cf0d5531aaecdcb215d10c3 100644
--- a/Source/WebKit/WebProcess/Network/WebLoaderStrategy.h
+++ b/Source/WebKit/WebProcess/Network/WebLoaderStrategy.h
@@ -26,6 +26,7 @@
@@ -18535,10 +18536,10 @@ index a317b77e961391faba0a3745e560d2285941a20b..1a198ba07e77e19434a0fcfb0b81f94e
} // namespace WebKit
diff --git a/Source/WebKit/WebProcess/Network/WebResourceLoader.cpp b/Source/WebKit/WebProcess/Network/WebResourceLoader.cpp
-index 92c407cd8349da4fa94d46a31c39b3935240af61..86e7de852319d854cb3f63b26e90fbcbc984ee0f 100644
+index 019896845f00832c129c23029dd394af0bc711c0..25589b47cd12ed01878da0956a1d94243da471a4 100644
--- a/Source/WebKit/WebProcess/Network/WebResourceLoader.cpp
+++ b/Source/WebKit/WebProcess/Network/WebResourceLoader.cpp
-@@ -237,9 +237,6 @@ void WebResourceLoader::didReceiveResponse(ResourceResponse&& response, PrivateR
+@@ -296,9 +296,6 @@ void WebResourceLoader::didReceiveResponse(ResourceResponse&& response, PrivateR
coreLoader->didReceiveResponse(ResourceResponse { inspectorResponse }, [this, protectedThis = Ref { *this }, interceptedRequestIdentifier, policyDecisionCompletionHandler = WTF::move(policyDecisionCompletionHandler), overrideData = WTF::move(overrideData)]() mutable {
RefPtr coreLoader = m_coreLoader;
@@ -18548,7 +18549,7 @@ index 92c407cd8349da4fa94d46a31c39b3935240af61..86e7de852319d854cb3f63b26e90fbcb
if (!m_coreLoader || !coreLoader->identifier()) {
m_interceptController.continueResponse(interceptedRequestIdentifier);
return;
-@@ -256,6 +253,8 @@ void WebResourceLoader::didReceiveResponse(ResourceResponse&& response, PrivateR
+@@ -315,6 +312,8 @@ void WebResourceLoader::didReceiveResponse(ResourceResponse&& response, PrivateR
}
});
});
@@ -18558,7 +18559,7 @@ index 92c407cd8349da4fa94d46a31c39b3935240af61..86e7de852319d854cb3f63b26e90fbcb
}
diff --git a/Source/WebKit/WebProcess/Network/WebSocketChannel.cpp b/Source/WebKit/WebProcess/Network/WebSocketChannel.cpp
-index d4372e7ad2b4a92660799d2168bda178217cbc6d..ee8fd95b8ab175a3cc68f77f397d8c39a782282f 100644
+index 0812c1abaa5fccce8c02ba0a1bd15a0b64a1af9c..9ac0a84a9aaf5e89c1435a03e8a17a32c3a79364 100644
--- a/Source/WebKit/WebProcess/Network/WebSocketChannel.cpp
+++ b/Source/WebKit/WebProcess/Network/WebSocketChannel.cpp
@@ -166,6 +166,7 @@ WebSocketChannel::ConnectStatus WebSocketChannel::connect(const URL& url, const
@@ -18570,10 +18571,10 @@ index d4372e7ad2b4a92660799d2168bda178217cbc6d..ee8fd95b8ab175a3cc68f77f397d8c39
Ref policySourceFrame = [&] -> Ref<Frame> {
diff --git a/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp b/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp
-index d160f422bd7b97480305149e41348006908f273b..fc0bb66eded4eee92c2a6997409d2340f7212095 100644
+index 3f83de82fe8751649ac8af15522c61ff217ad3f5..ed7ff53186af82b12f28c6cb4f1bbc2b52abfe39 100644
--- a/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp
+++ b/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp
-@@ -506,6 +506,9 @@ void WebChromeClient::addMessageToConsole(MessageSource source, MessageLevel lev
+@@ -511,6 +511,9 @@ void WebChromeClient::addMessageToConsole(MessageSource source, MessageLevel lev
if (!page)
return;
@@ -18699,7 +18700,7 @@ index 5ac78eb5880335f49a9a6f2690626e46fbcac7f4..aa12d9c96279054e01cc9e82e78547a7
#include "WebPage.h"
#include "WebPageCreationParameters.h"
diff --git a/Source/WebKit/WebProcess/WebPage/WebCookieJar.cpp b/Source/WebKit/WebProcess/WebPage/WebCookieJar.cpp
-index d2a69a979ac3f6f3507ef71b9f23c105d110ec52..7702064e4428a32ab5c613b8bc6aff2d064fc69b 100644
+index 7768b414032ef521f6435ca4c61b5a2f3fc27305..312908ef6d6f1b226af9b2ab3cf8413a3af31aa3 100644
--- a/Source/WebKit/WebProcess/WebPage/WebCookieJar.cpp
+++ b/Source/WebKit/WebProcess/WebPage/WebCookieJar.cpp
@@ -43,6 +43,7 @@
@@ -18710,7 +18711,7 @@ index d2a69a979ac3f6f3507ef71b9f23c105d110ec52..7702064e4428a32ab5c613b8bc6aff2d
#include <WebCore/ScriptTrackingPrivacyCategory.h>
#include <WebCore/Settings.h>
#include <WebCore/StorageSessionProvider.h>
-@@ -446,6 +447,12 @@ void WebCookieJar::setOptInCookiePartitioningEnabled(bool enabled)
+@@ -446,4 +447,10 @@ void WebCookieJar::setOptInCookiePartitioningEnabled(bool enabled)
}
#endif
@@ -18720,14 +18721,12 @@ index d2a69a979ac3f6f3507ef71b9f23c105d110ec52..7702064e4428a32ab5c613b8bc6aff2d
+ WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::SetCookieFromResponse(request.firstPartyForCookies(), SameSiteInfo::create(request), request.url(), setCookieValue), 0);
+}
+
- #if !PLATFORM(COCOA)
-
- String WebCookieJar::cookiesInPartitionedCookieStorage(const WebCore::Document&, const URL&, const WebCore::SameSiteInfo&) const
+ } // namespace WebKit
diff --git a/Source/WebKit/WebProcess/WebPage/WebCookieJar.h b/Source/WebKit/WebProcess/WebPage/WebCookieJar.h
-index a7ad18fc1201e5de2cc1528539a765599ecfc41e..ebea233bc54ab6e56fb7093ff63e2368e8670ccd 100644
+index bbe99b97b3563cc8dc31c0b8d4488f7235de95c7..39fd2c2229d735f708c549b1f1ea10167f13198a 100644
--- a/Source/WebKit/WebProcess/WebPage/WebCookieJar.h
+++ b/Source/WebKit/WebProcess/WebPage/WebCookieJar.h
-@@ -81,6 +81,8 @@ public:
+@@ -78,6 +78,8 @@ public:
void setOptInCookiePartitioningEnabled(bool);
#endif
@@ -18737,10 +18736,10 @@ index a7ad18fc1201e5de2cc1528539a765599ecfc41e..ebea233bc54ab6e56fb7093ff63e2368
WebCookieJar();
diff --git a/Source/WebKit/WebProcess/WebPage/WebFrame.cpp b/Source/WebKit/WebProcess/WebPage/WebFrame.cpp
-index 6359126c554e0a49f0a8ea23bdbf2759fc5d57e8..9a0cbc22ceb96d60b32ec04ab4bf8fe3898c2b45 100644
+index 243582e36c8e679fddbca7044557d7c4f18ff11a..f955cf2e4ce7531bcde991a08ed1fcd90c20455b 100644
--- a/Source/WebKit/WebProcess/WebPage/WebFrame.cpp
+++ b/Source/WebKit/WebProcess/WebPage/WebFrame.cpp
-@@ -184,6 +184,9 @@ Ref<WebFrame> WebFrame::createSubframe(WebPage& page, WebFrame& parent, const At
+@@ -194,6 +194,9 @@ Ref<WebFrame> WebFrame::createSubframe(WebPage& page, WebFrame& parent, const At
if (RefPtr backend = Ref { page }->inspector(WebPage::LazyCreationPolicy::UseExistingOnly))
backend->ensureInstrumentationForFrame(coreFrame.get());
@@ -18751,18 +18750,18 @@ index 6359126c554e0a49f0a8ea23bdbf2759fc5d57e8..9a0cbc22ceb96d60b32ec04ab4bf8fe3
}
diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.cpp b/Source/WebKit/WebProcess/WebPage/WebPage.cpp
-index c0256ed7d8ee83b928b9d92e0b1e3cb436af758e..170167f2caf76b494fd94b5f38c8af2f0b95dca1 100644
+index 11e3c6306159f4d5b2f6e91409354ec8871f9e53..393a61449d4ae0ec37a7a329ffd0f7f56fe0ab1e 100644
--- a/Source/WebKit/WebProcess/WebPage/WebPage.cpp
+++ b/Source/WebKit/WebProcess/WebPage/WebPage.cpp
-@@ -267,6 +267,7 @@
- #include <WebCore/ImageAnalysisQueue.h>
+@@ -272,6 +272,7 @@
+ #include <WebCore/ImageBuffer.h>
#include <WebCore/ImageOverlay.h>
#include <WebCore/ImageUtilities.h>
+#include <WebCore/InspectorInstrumentationWebKit.h>
#include <WebCore/JSDOMExceptionHandling.h>
#include <WebCore/JSNode.h>
#include <WebCore/KeyboardEvent.h>
-@@ -1275,6 +1276,14 @@ WebPage::WebPage(PageIdentifier pageID, WebPageCreationParameters&& parameters)
+@@ -1297,6 +1298,14 @@ WebPage::WebPage(PageIdentifier pageID, WebPageCreationParameters&& parameters)
setLinkDecorationFilteringData(WTF::move(parameters.linkDecorationFilteringData));
setAllowedQueryParametersForAdvancedPrivacyProtections(WTF::move(parameters.allowedQueryParametersForAdvancedPrivacyProtections));
#endif
@@ -18777,7 +18776,7 @@ index c0256ed7d8ee83b928b9d92e0b1e3cb436af758e..170167f2caf76b494fd94b5f38c8af2f
if (parameters.windowFeatures) {
page->applyWindowFeatures(*parameters.windowFeatures);
page->chrome().show();
-@@ -2420,6 +2429,22 @@ void WebPage::loadDidCommitInAnotherProcess(WebCore::FrameIdentifier frameID, We
+@@ -2562,6 +2571,22 @@ void WebPage::loadDidCommitInAnotherProcess(WebCore::FrameIdentifier frameID, We
}
}
@@ -18800,7 +18799,7 @@ index c0256ed7d8ee83b928b9d92e0b1e3cb436af758e..170167f2caf76b494fd94b5f38c8af2f
void WebPage::loadRequest(LoadParameters&& loadParameters)
{
WEBPAGE_RELEASE_LOG_FORWARDABLE(Loading, WebPageLoadRequest, loadParameters.navigationID ? loadParameters.navigationID->toUInt64() : 0, static_cast<unsigned>(loadParameters.shouldTreatAsContinuingLoad), loadParameters.request.isAppInitiated(), loadParameters.existingNetworkResourceLoadIdentifierToResume ? loadParameters.existingNetworkResourceLoadIdentifierToResume->toUInt64() : 0);
-@@ -2616,7 +2641,9 @@ void WebPage::stopLoading()
+@@ -2761,7 +2786,9 @@ void WebPage::stopLoading()
void WebPage::stopLoadingDueToProcessSwap()
{
SetForScope isStoppingLoadingDueToProcessSwap(m_isStoppingLoadingDueToProcessSwap, true);
@@ -18810,7 +18809,7 @@ index c0256ed7d8ee83b928b9d92e0b1e3cb436af758e..170167f2caf76b494fd94b5f38c8af2f
}
void WebPage::keepBlobURLAliveForNewWindowNavigation(URL&& blobURL, std::optional<SecurityOriginData>&& topOrigin)
-@@ -3217,7 +3244,7 @@ void WebPage::viewportPropertiesDidChange(const ViewportArguments& viewportArgum
+@@ -3362,7 +3389,7 @@ void WebPage::viewportPropertiesDidChange(const ViewportArguments& viewportArgum
#if PLATFORM(IOS_FAMILY)
if (m_viewportConfiguration.setViewportArguments(viewportArguments))
viewportConfigurationChanged();
@@ -18819,7 +18818,7 @@ index c0256ed7d8ee83b928b9d92e0b1e3cb436af758e..170167f2caf76b494fd94b5f38c8af2f
// Adjust view dimensions when using fixed layout.
RefPtr localMainFrame = this->localMainFrame();
RefPtr view = localMainFrame ? localMainFrame->view() : nullptr;
-@@ -4075,6 +4102,13 @@ void WebPage::flushDeferredIntersectionObservations()
+@@ -4260,6 +4287,13 @@ void WebPage::flushDeferredIntersectionObservations()
protect(corePage())->flushDeferredIntersectionObservations();
}
@@ -18833,7 +18832,7 @@ index c0256ed7d8ee83b928b9d92e0b1e3cb436af758e..170167f2caf76b494fd94b5f38c8af2f
void WebPage::flushDeferredDidReceiveMouseEvent()
{
if (auto info = std::exchange(m_deferredDidReceiveMouseEvent, std::nullopt))
-@@ -4358,6 +4392,100 @@ void WebPage::touchEvent(const WebTouchEvent& touchEvent, CompletionHandler<void
+@@ -4543,6 +4577,100 @@ void WebPage::touchEvent(const WebTouchEvent& touchEvent, CompletionHandler<void
completionHandler(touchEvent.type(), handled);
}
@@ -18933,8 +18932,8 @@ index c0256ed7d8ee83b928b9d92e0b1e3cb436af758e..170167f2caf76b494fd94b5f38c8af2f
+}
#endif
- void WebPage::cancelPointer(WebCore::PointerID pointerId, const WebCore::IntPoint& documentPoint)
-@@ -4458,6 +4586,16 @@ void WebPage::sendMessageToTargetBackend(const String& message)
+ #if ENABLE(COORDINATED_TOUCH_EVENTS)
+@@ -4654,6 +4782,16 @@ void WebPage::sendMessageToTargetBackend(const String& message)
ensureInspectorTarget()->sendMessageToTargetBackend(message);
}
@@ -18951,7 +18950,7 @@ index c0256ed7d8ee83b928b9d92e0b1e3cb436af758e..170167f2caf76b494fd94b5f38c8af2f
void WebPage::insertNewlineInQuotedContent()
{
RefPtr frame = corePage()->focusController().focusedOrMainFrame();
-@@ -4700,6 +4838,7 @@ void WebPage::setMainFrameDocumentVisualUpdatesAllowed(bool allowed)
+@@ -4896,6 +5034,7 @@ void WebPage::setMainFrameDocumentVisualUpdatesAllowed(bool allowed)
void WebPage::show()
{
send(Messages::WebPageProxy::ShowPage());
@@ -18959,7 +18958,7 @@ index c0256ed7d8ee83b928b9d92e0b1e3cb436af758e..170167f2caf76b494fd94b5f38c8af2f
}
void WebPage::setIsTakingSnapshotsForApplicationSuspension(bool isTakingSnapshotsForApplicationSuspension)
-@@ -6524,7 +6663,10 @@ void WebPage::failedToShowPopupMenu()
+@@ -6719,7 +6858,10 @@ void WebPage::failedToShowPopupMenu()
auto activePopupMenu = std::exchange(m_activePopupMenu, nullptr);
if (auto* popupClient = activePopupMenu->client()) {
#if PLATFORM(WPE)
@@ -18971,7 +18970,7 @@ index c0256ed7d8ee83b928b9d92e0b1e3cb436af758e..170167f2caf76b494fd94b5f38c8af2f
#else
popupClient->popupDidHide();
#endif
-@@ -8292,6 +8434,10 @@ void WebPage::didCommitLoad(WebFrame* frame)
+@@ -8487,6 +8629,10 @@ void WebPage::didCommitLoad(WebFrame* frame)
if (frame && frame->isMainFrame())
m_networkResourceRequestIdentifiersForPageLoadTiming.clear();
@@ -18982,7 +18981,7 @@ index c0256ed7d8ee83b928b9d92e0b1e3cb436af758e..170167f2caf76b494fd94b5f38c8af2f
}
void WebPage::didFinishDocumentLoad(WebFrame& frame)
-@@ -8587,6 +8733,9 @@ Ref<DocumentLoader> WebPage::createDocumentLoader(LocalFrame& frame, ResourceReq
+@@ -8782,6 +8928,9 @@ Ref<DocumentLoader> WebPage::createDocumentLoader(LocalFrame& frame, ResourceReq
m_allowsContentJavaScriptFromMostRecentNavigation = m_internals->pendingWebsitePolicies->allowsContentJavaScript;
WebsitePoliciesData::applyToDocumentLoader(*std::exchange(m_internals->pendingWebsitePolicies, std::nullopt), documentLoader);
}
@@ -18993,7 +18992,7 @@ index c0256ed7d8ee83b928b9d92e0b1e3cb436af758e..170167f2caf76b494fd94b5f38c8af2f
return documentLoader;
diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.h b/Source/WebKit/WebProcess/WebPage/WebPage.h
-index 40b2ec39ca38624e1ab6364e132cfbec8f69d3a2..318c67107b5c48fecfcc8e8a626b38b7409501dc 100644
+index 3615f2947a8cd4951a129a6a3b9766a6e43f1d71..9789ad5e3762b2efbc224f501aeb4e1f1d306e5f 100644
--- a/Source/WebKit/WebProcess/WebPage/WebPage.h
+++ b/Source/WebKit/WebProcess/WebPage/WebPage.h
@@ -49,6 +49,7 @@
@@ -19004,7 +19003,7 @@ index 40b2ec39ca38624e1ab6364e132cfbec8f69d3a2..318c67107b5c48fecfcc8e8a626b38b7
#include <WebCore/PageIdentifier.h>
#include <WebCore/PageOverlay.h>
#include <WebCore/PlatformLayerIdentifier.h>
-@@ -1449,6 +1450,9 @@ public:
+@@ -1465,6 +1466,9 @@ public:
#if ENABLE(MODEL_PROCESS)
void modelDragEnded(WebCore::NodeIdentifier);
#endif
@@ -19014,7 +19013,7 @@ index 40b2ec39ca38624e1ab6364e132cfbec8f69d3a2..318c67107b5c48fecfcc8e8a626b38b7
#endif
#if ENABLE(MODEL_PROCESS)
-@@ -1551,8 +1555,11 @@ public:
+@@ -1567,8 +1571,11 @@ public:
void gestureEvent(WebCore::FrameIdentifier, const WebGestureEvent&, CompletionHandler<void(std::optional<WebEventType>, bool, std::optional<WebCore::RemoteUserInputEventData>)>&&);
#endif
@@ -19027,7 +19026,7 @@ index 40b2ec39ca38624e1ab6364e132cfbec8f69d3a2..318c67107b5c48fecfcc8e8a626b38b7
void dynamicViewportSizeUpdate(const DynamicViewportSizeUpdate&);
bool scaleWasSetByUIProcess() const { return m_scaleWasSetByUIProcess; }
void willStartUserTriggeredZooming();
-@@ -1714,6 +1721,8 @@ public:
+@@ -1732,6 +1739,8 @@ public:
void connectInspector(Inspector::FrontendChannel::ConnectionType);
void disconnectInspector();
void sendMessageToTargetBackend(const String& message);
@@ -19036,7 +19035,7 @@ index 40b2ec39ca38624e1ab6364e132cfbec8f69d3a2..318c67107b5c48fecfcc8e8a626b38b7
void insertNewlineInQuotedContent();
-@@ -2158,6 +2167,7 @@ public:
+@@ -2182,6 +2191,7 @@ public:
void showContextMenuFromFrame(const FrameInfoData&, const ContextMenuContextData&, const UserData&);
#endif
void loadRequest(LoadParameters&&);
@@ -19044,7 +19043,7 @@ index 40b2ec39ca38624e1ab6364e132cfbec8f69d3a2..318c67107b5c48fecfcc8e8a626b38b7
void setObscuredContentInsets(const WebCore::FloatBoxExtent&);
-@@ -2386,6 +2396,7 @@ private:
+@@ -2411,6 +2421,7 @@ private:
void updatePotentialTapSecurityOrigin(const WebTouchEvent&, bool wasHandled);
#elif ENABLE(TOUCH_EVENTS)
void touchEvent(const WebTouchEvent&, CompletionHandler<void(std::optional<WebEventType>, bool)>&&);
@@ -19052,7 +19051,7 @@ index 40b2ec39ca38624e1ab6364e132cfbec8f69d3a2..318c67107b5c48fecfcc8e8a626b38b7
#endif
void cancelPointer(WebCore::PointerID, const WebCore::IntPoint&);
-@@ -3245,6 +3256,7 @@ private:
+@@ -3278,6 +3289,7 @@ private:
bool m_isAppNapEnabled { true };
Markable<WebCore::NavigationIdentifier> m_pendingNavigationID;
@@ -19061,7 +19060,7 @@ index 40b2ec39ca38624e1ab6364e132cfbec8f69d3a2..318c67107b5c48fecfcc8e8a626b38b7
bool m_shouldConsiderEnhancedSecurityForInsecureResponseForCurrentNavigation { false };
bool m_mainFrameProgressCompleted { false };
diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.messages.in b/Source/WebKit/WebProcess/WebPage/WebPage.messages.in
-index bffa81d317e549152e9afa7fd7c3a1b99df24f81..fa927fd8a1be3075e1bb0ad92df667df43be2ca0 100644
+index 59c138454fc4dad2662259b3bbd76c93befac35f..80693af9b86e0e6ae7309fe31fc144acb01d2efe 100644
--- a/Source/WebKit/WebProcess/WebPage/WebPage.messages.in
+++ b/Source/WebKit/WebProcess/WebPage/WebPage.messages.in
@@ -85,10 +85,13 @@ messages -> WebPage WantsAsyncDispatchMessage {
@@ -19103,7 +19102,7 @@ index bffa81d317e549152e9afa7fd7c3a1b99df24f81..fa927fd8a1be3075e1bb0ad92df667df
LoadRequestWaitingForProcessLaunch(struct WebKit::LoadParameters loadParameters, URL resourceDirectoryURL, WebKit::WebPageProxyIdentifier pageID, bool checkAssumedReadAccessToResourceURL)
LoadData(struct WebKit::LoadParameters loadParameters)
LoadSimulatedRequestAndResponse(struct WebKit::LoadParameters loadParameters, WebCore::ResourceResponse simulatedResponse)
-@@ -418,6 +424,10 @@ messages -> WebPage WantsAsyncDispatchMessage {
+@@ -419,6 +425,10 @@ messages -> WebPage WantsAsyncDispatchMessage {
ModelDragEnded(WebCore::NodeIdentifier nodeID)
#endif
@@ -19153,7 +19152,7 @@ index 56f754ce23543fd1b2c5d2d72b33d07124bf43d0..c344e47680376018dcf43c497629fa30
const auto& availableInputs = WebProcess::singleton().availableInputDevices();
if (availableInputs.contains(AvailableInputDevices::Mouse))
diff --git a/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm b/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm
-index 2b10d8d5684099f5eca94b32d1fc74c164365a05..2b91a71f06c4d0b95de7f76984b839da950cce2f 100644
+index 9dbd15c9f8e0749b2e4b8d78c77fd55ae194b863..fda41ee5cad6ded2cb4cbf59e2b88ad2d4f7e234 100644
--- a/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm
+++ b/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm
@@ -761,21 +761,37 @@ String WebPage::platformUserAgent(const URL&) const
@@ -19245,7 +19244,7 @@ index 506ae38c6c54a2866ce44271575d8731ba1fea2c..52791bcd240e5eeb68c739de361fb62b
}
diff --git a/Source/WebKit/WebProcess/WebProcess.cpp b/Source/WebKit/WebProcess/WebProcess.cpp
-index b2d75d3df51f17a5d8bcb8c873bf1a1b6cbb1875..71ac2d6230507cf1d17886b84a970de240914aec 100644
+index a8c38f28bddad7f83add61b82f6f8f95828e3343..5a710b83bd86f012437e2ed4030278871bdb9199 100644
--- a/Source/WebKit/WebProcess/WebProcess.cpp
+++ b/Source/WebKit/WebProcess/WebProcess.cpp
@@ -96,6 +96,7 @@
@@ -19256,7 +19255,7 @@ index b2d75d3df51f17a5d8bcb8c873bf1a1b6cbb1875..71ac2d6230507cf1d17886b84a970de2
#include <JavaScriptCore/JSLock.h>
#include <JavaScriptCore/MemoryStatistics.h>
#include <JavaScriptCore/WasmFaultSignalHandler.h>
-@@ -429,6 +430,14 @@ void WebProcess::initializeProcess(const AuxiliaryProcessInitializationParameter
+@@ -425,6 +426,14 @@ void WebProcess::initializeProcess(const AuxiliaryProcessInitializationParameter
{
JSC::Options::AllowUnfinalizedAccessScope scope;
JSC::Options::allowNonSPTagging() = false;
@@ -19271,7 +19270,7 @@ index b2d75d3df51f17a5d8bcb8c873bf1a1b6cbb1875..71ac2d6230507cf1d17886b84a970de2
JSC::Options::notifyOptionsChanged();
}
-@@ -436,6 +445,8 @@ void WebProcess::initializeProcess(const AuxiliaryProcessInitializationParameter
+@@ -432,6 +441,8 @@ void WebProcess::initializeProcess(const AuxiliaryProcessInitializationParameter
platformInitializeProcess(parameters);
updateCPULimit();
@@ -19280,7 +19279,7 @@ index b2d75d3df51f17a5d8bcb8c873bf1a1b6cbb1875..71ac2d6230507cf1d17886b84a970de2
}
void WebProcess::initializeConnection(IPC::Connection* connection)
-@@ -621,7 +632,8 @@ void WebProcess::initializeWebProcess(WebProcessCreationParameters&& parameters,
+@@ -617,7 +628,8 @@ void WebProcess::initializeWebProcess(WebProcessCreationParameters&& parameters,
if (!parameters.overrideLanguages.isEmpty()) {
LOG_WITH_STREAM(Language, stream << "Web Process initialization is setting overrideLanguages: " << parameters.overrideLanguages);
@@ -19290,7 +19289,7 @@ index b2d75d3df51f17a5d8bcb8c873bf1a1b6cbb1875..71ac2d6230507cf1d17886b84a970de2
} else
LOG(Language, "Web process initialization is not setting overrideLanguages");
-@@ -999,10 +1011,18 @@ void WebProcess::setDisableFontSubpixelAntialiasingForTesting(bool disable)
+@@ -995,10 +1007,18 @@ void WebProcess::setDisableFontSubpixelAntialiasingForTesting(bool disable)
WebCore::FontCascade::setDisableFontSubpixelAntialiasingForTesting(disable);
}
@@ -19311,7 +19310,7 @@ index b2d75d3df51f17a5d8bcb8c873bf1a1b6cbb1875..71ac2d6230507cf1d17886b84a970de2
}
void WebProcess::fullKeyboardAccessModeChanged(bool fullKeyboardAccessEnabled)
-@@ -1084,6 +1104,7 @@ void WebProcess::createWebPage(PageIdentifier pageID, WebPageCreationParameters&
+@@ -1080,6 +1100,7 @@ void WebProcess::createWebPage(PageIdentifier pageID, WebPageCreationParameters&
m_hasPendingAccessibilityUnsuspension = false;
accessibilityRelayProcessSuspended(false);
}
@@ -19320,7 +19319,7 @@ index b2d75d3df51f17a5d8bcb8c873bf1a1b6cbb1875..71ac2d6230507cf1d17886b84a970de2
Awaitable<unsigned> WebProcess::countWebPagesForTesting()
diff --git a/Source/WebKit/WebProcess/WebProcess.h b/Source/WebKit/WebProcess/WebProcess.h
-index b496b181d2a6132bafcef9bbb516e8e95c1f90c4..4ebede8bf209c9bcd4e7e1c5435329e84bac47b8 100644
+index 2a4d6d35450b69c25f4ab6f77f88144f964617a5..9f3ee91a2a8527622c3737cbe8239b48e4e3fb3e 100644
--- a/Source/WebKit/WebProcess/WebProcess.h
+++ b/Source/WebKit/WebProcess/WebProcess.h
@@ -106,6 +106,7 @@ namespace WebCore {
@@ -19331,7 +19330,7 @@ index b496b181d2a6132bafcef9bbb516e8e95c1f90c4..4ebede8bf209c9bcd4e7e1c5435329e8
class SecurityOriginData;
class Site;
class UserGestureToken;
-@@ -259,6 +260,8 @@ public:
+@@ -253,6 +254,8 @@ public:
bool fullKeyboardAccessEnabled() const { return m_fullKeyboardAccessEnabled; }
@@ -19340,7 +19339,7 @@ index b496b181d2a6132bafcef9bbb516e8e95c1f90c4..4ebede8bf209c9bcd4e7e1c5435329e8
void contentWorldDestroyed(ContentWorldIdentifier);
#if HAVE(MOUSE_DEVICE_OBSERVATION)
-@@ -610,7 +613,7 @@ private:
+@@ -598,7 +601,7 @@ private:
void clearResourceLoadStatistics();
void flushResourceLoadStatistics();
void seedResourceLoadStatisticsForTesting(const WebCore::RegistrableDomain& firstPartyDomain, const WebCore::RegistrableDomain& thirdPartyDomain, bool shouldScheduleNotification, CompletionHandler<void()>&&);
@@ -19349,7 +19348,7 @@ index b496b181d2a6132bafcef9bbb516e8e95c1f90c4..4ebede8bf209c9bcd4e7e1c5435329e8
void NODELETE fullKeyboardAccessModeChanged(bool fullKeyboardAccessEnabled);
#if ENABLE(OPT_IN_PARTITIONED_COOKIES)
void setOptInCookiePartitioningEnabled(bool);
-@@ -801,6 +804,7 @@ private:
+@@ -793,6 +796,7 @@ private:
CacheModel m_cacheModel { CacheModel::DocumentViewer };
bool m_fullKeyboardAccessEnabled { false };
@@ -19371,7 +19370,7 @@ index 497c5b01ff2e98fb722878dadfe8c5c0924f3982..bbc544cddeaa061c2e87d9860ff8613b
- (void)touch:(WebEvent *)event
{
diff --git a/Source/WebKitLegacy/mac/WebView/WebView.mm b/Source/WebKitLegacy/mac/WebView/WebView.mm
-index 436f7c1ea55f5446fc20f5e2c4c03e89b64301ed..21a2ad87518910b4a264a5a57e611151c6342d7d 100644
+index 035570341d5c88c6e7089fc22020a11f65c0fe7c..ebe30a987449247ebb42cb48fef1c9d0efb6208d 100644
--- a/Source/WebKitLegacy/mac/WebView/WebView.mm
+++ b/Source/WebKitLegacy/mac/WebView/WebView.mm
@@ -3981,7 +3981,7 @@ + (void)_doNotStartObservingNetworkReachability
@@ -19393,10 +19392,10 @@ index 436f7c1ea55f5446fc20f5e2c4c03e89b64301ed..21a2ad87518910b4a264a5a57e611151
// For backwards compatibility with the WebBackForwardList API, we honor both
// a per-WebView and a per-preferences setting for whether to use the back/forward cache.
diff --git a/Source/cmake/OptionsGTK.cmake b/Source/cmake/OptionsGTK.cmake
-index 1db95887eeda425cf0b402f50f16f00ace4acb1f..e3e1a07d3fe15d46862e66c1d2a90d27063adea2 100644
+index d582d23f5f35d9f3614161e3a77d6cf566874fff..5961b55e88aa715b7a5cdf4c1b871aadb697dd08 100644
--- a/Source/cmake/OptionsGTK.cmake
+++ b/Source/cmake/OptionsGTK.cmake
-@@ -12,6 +12,10 @@ list(APPEND WEBKIT_UNSAFE_BUFFER_WARNING_FLAGS -Wno-unsafe-buffer-usage-in-forma
+@@ -14,6 +14,10 @@ set(ENABLE_THREAD_SAFETY_WARNING ON)
# Update Source/WTF/wtf/Platform.h to match required GLib versions.
find_package(GLib 2.70.0 REQUIRED COMPONENTS GioUnix Thread Module)
@@ -19407,7 +19406,7 @@ index 1db95887eeda425cf0b402f50f16f00ace4acb1f..e3e1a07d3fe15d46862e66c1d2a90d27
find_package(Cairo 1.16.0 REQUIRED)
find_package(LibGcrypt 1.7.0 REQUIRED)
find_package(Soup3 3.0.0 REQUIRED)
-@@ -76,6 +80,10 @@ WEBKIT_OPTION_DEFINE(USE_SYSTEM_UNIFDEF "Whether to use a system-provided unifde
+@@ -74,6 +78,10 @@ WEBKIT_OPTION_DEFINE(USE_SYSTEM_UNIFDEF "Whether to use a system-provided unifde
WEBKIT_OPTION_DEPEND(USE_SYSTEM_SYSPROF_CAPTURE USE_SYSPROF_CAPTURE)
@@ -19418,7 +19417,7 @@ index 1db95887eeda425cf0b402f50f16f00ace4acb1f..e3e1a07d3fe15d46862e66c1d2a90d27
SET_AND_EXPOSE_TO_BUILD(ENABLE_DEVELOPER_MODE ${DEVELOPER_MODE})
if (DEVELOPER_MODE)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_API_TESTS PRIVATE ON)
-@@ -153,6 +161,21 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(USE_SKIA PRIVATE ON)
+@@ -151,6 +159,21 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(USE_SKIA PRIVATE ON)
WEBKIT_OPTION_DEPEND(ENABLE_GPU_PROCESS USE_GBM)
@@ -19441,10 +19440,10 @@ index 1db95887eeda425cf0b402f50f16f00ace4acb1f..e3e1a07d3fe15d46862e66c1d2a90d27
WEBKIT_OPTION_DEPEND(ENABLE_WEBXR ENABLE_GAMEPAD)
diff --git a/Source/cmake/OptionsWPE.cmake b/Source/cmake/OptionsWPE.cmake
-index 122452a958dc58ba42e2e9931b3d6e37fd935333..e4f71ce45b4850d080e65702c54ce0745092cddf 100644
+index b90eccefc642edc70f72cb5dd405d850aff1f8b6..a5266b81de08660be223ed4b86b28fdcd69388f4 100644
--- a/Source/cmake/OptionsWPE.cmake
+++ b/Source/cmake/OptionsWPE.cmake
-@@ -40,6 +40,9 @@ else ()
+@@ -41,6 +41,9 @@ else ()
set(ENABLE_MEDIA_SESSION_DEFAULT ON)
endif ()
@@ -19454,7 +19453,7 @@ index 122452a958dc58ba42e2e9931b3d6e37fd935333..e4f71ce45b4850d080e65702c54ce074
WEBKIT_OPTION_BEGIN()
SET_AND_EXPOSE_TO_BUILD(ENABLE_DEVELOPER_MODE ${DEVELOPER_MODE})
-@@ -97,6 +100,22 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEBXR PRIVATE ${ENABLE_EXPERIMENTAL_FEAT
+@@ -99,6 +102,22 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEBXR PRIVATE ${ENABLE_EXPERIMENTAL_FEAT
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEBXR_HIT_TEST PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES})
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEBXR_LAYERS PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES})
@@ -19477,7 +19476,7 @@ index 122452a958dc58ba42e2e9931b3d6e37fd935333..e4f71ce45b4850d080e65702c54ce074
# Public options specific to the WPE port. Do not add any options here unless
# there is a strong reason we should support changing the value of the option,
# and the option is not relevant to other WebKit ports.
-@@ -135,6 +154,11 @@ WEBKIT_OPTION_DEPEND(ENABLE_DOCUMENTATION ENABLE_INTROSPECTION)
+@@ -138,6 +157,11 @@ WEBKIT_OPTION_DEPEND(ENABLE_DOCUMENTATION ENABLE_INTROSPECTION)
WEBKIT_OPTION_DEPEND(ENABLE_WPE_QT_API ENABLE_WPE_PLATFORM)
WEBKIT_OPTION_DEPEND(USE_SYSTEM_SYSPROF_CAPTURE USE_SYSPROF_CAPTURE)
@@ -19490,10 +19489,10 @@ index 122452a958dc58ba42e2e9931b3d6e37fd935333..e4f71ce45b4850d080e65702c54ce074
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_BUBBLEWRAP_SANDBOX PUBLIC ON)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MEMORY_SAMPLER PRIVATE ON)
diff --git a/Source/cmake/OptionsWin.cmake b/Source/cmake/OptionsWin.cmake
-index 24ee1217f1b015dfe7a22815585748e974c05cc2..299f38f6bda7c6421b89b1804796e8b9a24ad2fd 100644
+index dadb66c11c754162683c9f7839959647fa2913cc..e6696975cf6bb14da40aec2375b745f925abeb27 100644
--- a/Source/cmake/OptionsWin.cmake
+++ b/Source/cmake/OptionsWin.cmake
-@@ -114,6 +114,14 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEBDRIVER PRIVATE ON)
+@@ -120,6 +120,14 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_SWIFT_DEMO_URI_SCHEME PRIVATE OFF)
SET_AND_EXPOSE_TO_BUILD(ENABLE_WEBDRIVER_KEYBOARD_INTERACTIONS ON)
SET_AND_EXPOSE_TO_BUILD(ENABLE_WEBDRIVER_MOUSE_INTERACTIONS ON)
@@ -19509,12 +19508,12 @@ index 24ee1217f1b015dfe7a22815585748e974c05cc2..299f38f6bda7c6421b89b1804796e8b9
set(USE_ANGLE_EGL ON)
diff --git a/Source/cmake/WebKitCompilerFlags.cmake b/Source/cmake/WebKitCompilerFlags.cmake
-index 0793c78950bab49578abb6cac4e5823c7cd322c2..69d307f2f9a4a3183e0c69de1ea5747dfd53619c 100644
+index 2aeab0eaa2084b6e5b0b622c4ccf9573b5354259..46de3f6ca165f8242f3db91f7fb66224d228427b 100644
--- a/Source/cmake/WebKitCompilerFlags.cmake
+++ b/Source/cmake/WebKitCompilerFlags.cmake
-@@ -161,7 +161,7 @@ set(WEBKIT_UNSAFE_BUFFER_WARNING_FLAGS
- )
- option(ENABLE_UNSAFE_BUFFER_USAGE_WARNING "Build with -Wunsafe-buffer-usage" OFF)
+@@ -163,7 +163,7 @@ option(ENABLE_UNSAFE_BUFFER_USAGE_WARNING "Build with -Wunsafe-buffer-usage" OFF
+
+ option(ENABLE_THREAD_SAFETY_WARNING "Build with -Wthread-safety" OFF)
-option(DEVELOPER_MODE_FATAL_WARNINGS "Build with warnings as errors if DEVELOPER_MODE is also enabled" ON)
+option(DEVELOPER_MODE_FATAL_WARNINGS "Build with warnings as errors if DEVELOPER_MODE is also enabled" OFF)
@@ -19710,7 +19709,7 @@ index 1fd07efb828b85b6d8def6c6cd92a0c11debfe1b..da9fac7975d477857ead2adb1d67108d
typedef struct _BrowserWindow BrowserWindow;
diff --git a/Tools/MiniBrowser/gtk/main.c b/Tools/MiniBrowser/gtk/main.c
-index 8722194f5a3007d7eeb90e5517c129afcfbef45e..068d50bdd954578b9cd7dc091059976dd1f9f216 100644
+index 4a15b00a55815f5582059023ed3b0645fd6bebd4..d4fdce5b69f95957d14fa88dfa370918f6bfd024 100644
--- a/Tools/MiniBrowser/gtk/main.c
+++ b/Tools/MiniBrowser/gtk/main.c
@@ -68,9 +68,15 @@ static char* timeZone;
@@ -19741,7 +19740,7 @@ index 8722194f5a3007d7eeb90e5517c129afcfbef45e..068d50bdd954578b9cd7dc091059976d
{ G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &uriArguments, 0, "[URL…]" },
{ 0, 0, 0, 0, 0, 0, 0 }
};
-@@ -734,6 +745,64 @@ static void filterSavedCallback(WebKitUserContentFilterStore *store, GAsyncResul
+@@ -735,6 +746,64 @@ static void filterSavedCallback(WebKitUserContentFilterStore *store, GAsyncResul
g_main_loop_quit(data->mainLoop);
}
@@ -19806,7 +19805,7 @@ index 8722194f5a3007d7eeb90e5517c129afcfbef45e..068d50bdd954578b9cd7dc091059976d
static void startup(GApplication *application)
{
const char *actionAccels[] = {
-@@ -805,22 +874,39 @@ static void addUserScript(WebKitUserContentManager *userContentManager, const gc
+@@ -806,22 +875,39 @@ static void addUserScript(WebKitUserContentManager *userContentManager, const gc
static void activate(GApplication *application, WebKitSettings *webkitSettings)
{
@@ -19850,7 +19849,7 @@ index 8722194f5a3007d7eeb90e5517c129afcfbef45e..068d50bdd954578b9cd7dc091059976d
webkit_network_session_set_itp_enabled(networkSession, enableITP);
if (!automationMode) {
-@@ -855,9 +941,12 @@ static void activate(GApplication *application, WebKitSettings *webkitSettings)
+@@ -856,9 +942,12 @@ static void activate(GApplication *application, WebKitSettings *webkitSettings)
}
#else
WebKitWebsiteDataManager *manager;
@@ -19865,7 +19864,7 @@ index 8722194f5a3007d7eeb90e5517c129afcfbef45e..068d50bdd954578b9cd7dc091059976d
g_autofree char *dataDirectory = profileDirectory ? g_build_filename(profileDirectory, "data", NULL) : g_build_filename(g_get_user_data_dir(), "webkitgtk-" WEBKITGTK_API_VERSION, "MiniBrowser", NULL);
g_autofree char *cacheDirectory = profileDirectory ? g_build_filename(profileDirectory, "cache", NULL) : g_build_filename(g_get_user_cache_dir(), "webkitgtk-" WEBKITGTK_API_VERSION, "MiniBrowser", NULL);
manager = webkit_website_data_manager_new("base-data-directory", dataDirectory, "base-cache-directory", cacheDirectory, NULL);
-@@ -905,6 +994,7 @@ static void activate(GApplication *application, WebKitSettings *webkitSettings)
+@@ -906,6 +995,7 @@ static void activate(GApplication *application, WebKitSettings *webkitSettings)
// Enable the favicon database.
webkit_web_context_set_favicon_database_directory(webContext, NULL);
#endif
@@ -19873,7 +19872,7 @@ index 8722194f5a3007d7eeb90e5517c129afcfbef45e..068d50bdd954578b9cd7dc091059976d
webkit_web_context_register_uri_scheme(webContext, BROWSER_ABOUT_SCHEME, (WebKitURISchemeRequestCallback)aboutURISchemeRequestCallback, NULL, NULL);
-@@ -978,9 +1068,7 @@ static void activate(GApplication *application, WebKitSettings *webkitSettings)
+@@ -979,9 +1069,7 @@ static void activate(GApplication *application, WebKitSettings *webkitSettings)
if (exitAfterLoad)
exitAfterWebViewLoadFinishes(webView, application);
}
@@ -19884,7 +19883,7 @@ index 8722194f5a3007d7eeb90e5517c129afcfbef45e..068d50bdd954578b9cd7dc091059976d
}
} else {
WebKitWebView *webView = createBrowserTab(mainWindow, webkitSettings, userContentManager, defaultWebsitePolicies);
-@@ -1030,7 +1118,7 @@ int main(int argc, char *argv[])
+@@ -1031,7 +1119,7 @@ int main(int argc, char *argv[])
g_option_context_add_group(context, gst_init_get_option_group());
#endif
@@ -19893,7 +19892,7 @@ index 8722194f5a3007d7eeb90e5517c129afcfbef45e..068d50bdd954578b9cd7dc091059976d
webkit_settings_set_enable_developer_extras(webkitSettings, TRUE);
webkit_settings_set_enable_webgl(webkitSettings, TRUE);
webkit_settings_set_enable_media_stream(webkitSettings, TRUE);
-@@ -1082,9 +1170,11 @@ int main(int argc, char *argv[])
+@@ -1083,9 +1171,11 @@ int main(int argc, char *argv[])
}
GtkApplication *application = gtk_application_new("org.webkitgtk.MiniBrowser", G_APPLICATION_NON_UNIQUE);
@@ -19906,7 +19905,7 @@ index 8722194f5a3007d7eeb90e5517c129afcfbef45e..068d50bdd954578b9cd7dc091059976d
g_clear_object(&interfaceSettings);
diff --git a/Tools/MiniBrowser/wpe/main.cpp b/Tools/MiniBrowser/wpe/main.cpp
-index 4446005792f94b8bc8d3cff6bf7d243e1970baf8..549fc8424b7030a927c54b3f4d7fdd2592b1f089 100644
+index 180639f059aa2e06556a2d246fd8be0f724f99a2..9754eb3779d40ab14970fc8ae4d463eb0702ea53 100644
--- a/Tools/MiniBrowser/wpe/main.cpp
+++ b/Tools/MiniBrowser/wpe/main.cpp
@@ -57,6 +57,10 @@ static gboolean privateMode;
@@ -19918,9 +19917,19 @@ index 4446005792f94b8bc8d3cff6bf7d243e1970baf8..549fc8424b7030a927c54b3f4d7fdd25
+static gboolean noStartupWindow;
+static const char* userDataDir;
static const char* contentFilter;
- static const char* cookiesFile;
- static const char* cookiesPolicy;
-@@ -142,6 +146,10 @@ static const GOptionEntry commandLineOptions[] =
+ static const char** userScriptsAtDocumentStart;
+ static const char** userScriptsAtDocumentEnd;
+@@ -83,6 +87,9 @@ static const char* configFile;
+ static gboolean useLegacyAPI;
+ #endif
+ static const char* defaultWindowTitle = "WPEWebKit MiniBrowser";
++// Playwright begin
++static WPEDisplay* browserDisplay;
++// Playwright end
+ #endif
+
+ static gboolean parseWindowSize(const char*, const char* value, gpointer, GError** error)
+@@ -146,6 +153,10 @@ static const GOptionEntry commandLineOptions[] =
{ "config-file", 0, 0, G_OPTION_ARG_FILENAME, &configFile, "Config file to load for settings", "FILE" },
{ "size", 's', 0, G_OPTION_ARG_CALLBACK, reinterpret_cast<gpointer>(parseWindowSize), "Specify the window size to use, e.g. --size=\"800x600\"", nullptr },
{ "version", 'v', 0, G_OPTION_ARG_NONE, &printVersion, "Print the WPE version", nullptr },
@@ -19931,7 +19940,7 @@ index 4446005792f94b8bc8d3cff6bf7d243e1970baf8..549fc8424b7030a927c54b3f4d7fdd25
{ G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &uriArguments, nullptr, "[URL]" },
{ nullptr, 0, 0, G_OPTION_ARG_NONE, nullptr, nullptr, nullptr }
};
-@@ -332,15 +340,38 @@ static void filterSavedCallback(WebKitUserContentFilterStore *store, GAsyncResul
+@@ -336,15 +347,38 @@ static void filterSavedCallback(WebKitUserContentFilterStore *store, GAsyncResul
g_main_loop_quit(data->mainLoop);
}
@@ -19972,19 +19981,11 @@ index 4446005792f94b8bc8d3cff6bf7d243e1970baf8..549fc8424b7030a927c54b3f4d7fdd25
{
#if defined(USE_LIBWPE) && USE_LIBWPE
auto backend = createViewBackend(defaultWindowWidthLegacyAPI, defaultWindowHeightLegacyAPI);
-@@ -357,14 +388,31 @@ static WebKitWebView* createWebView(WebKitWebView* webView, WebKitNavigationActi
+@@ -361,14 +395,27 @@ static WebKitWebView* createWebView(WebKitWebView* webView, WebKitNavigationActi
}
#endif
- auto* newWebView = WEBKIT_WEB_VIEW(g_object_new(WEBKIT_TYPE_WEB_VIEW,
-+// Playwright begin
-+ if (headlessMode) {
-+ webkit_web_view_backend_set_screenshot_callback(viewBackend,
-+ [](gpointer data) {
-+ return static_cast<WPEToolingBackends::HeadlessViewBackend*>(data)->snapshot();
-+ });
-+ }
-+// Playwright end
+ WebKitWebView* newWebView;
+ if (webView) {
+ newWebView = WEBKIT_WEB_VIEW(g_object_new(WEBKIT_TYPE_WEB_VIEW,
@@ -20003,6 +20004,10 @@ index 4446005792f94b8bc8d3cff6bf7d243e1970baf8..549fc8424b7030a927c54b3f4d7fdd25
+#if defined(USE_LIBWPE) && USE_LIBWPE
+ "backend", viewBackend,
+#endif
++#if ENABLE_WPE_PLATFORM
++ // Playwright: never fall back to the default native display.
++ "display", browserDisplay,
++#endif
+ "web-context", webContext,
+ "is-controlled-by-automation", TRUE,
+ nullptr));
@@ -20010,7 +20015,7 @@ index 4446005792f94b8bc8d3cff6bf7d243e1970baf8..549fc8424b7030a927c54b3f4d7fdd25
#if ENABLE_WPE_PLATFORM
if (auto* wpeView = webkit_web_view_get_wpe_view(newWebView)) {
-@@ -376,9 +424,13 @@ static WebKitWebView* createWebView(WebKitWebView* webView, WebKitNavigationActi
+@@ -380,9 +427,13 @@ static WebKitWebView* createWebView(WebKitWebView* webView, WebKitNavigationActi
g_signal_connect(newWebView, "create", G_CALLBACK(createWebView), user_data);
g_signal_connect(newWebView, "close", G_CALLBACK(webViewClose), user_data);
@@ -20026,10 +20031,10 @@ index 4446005792f94b8bc8d3cff6bf7d243e1970baf8..549fc8424b7030a927c54b3f4d7fdd25
return newWebView;
}
-@@ -469,24 +521,120 @@ static void loadConfigFile(WebKitSettings* webkitSettings
+@@ -485,6 +536,103 @@ static void loadConfigFile(WebKitSettings* webkitSettings
+ #endif
}
- #if defined(USE_LIBWPE) && USE_LIBWPE
+static WebKitWebView* createWebView(WebKitWebView* webView, WebKitNavigationAction*, gpointer user_data)
+{
+ return createWebViewImpl(webView, nullptr, user_data);
@@ -20076,8 +20081,14 @@ index 4446005792f94b8bc8d3cff6bf7d243e1970baf8..549fc8424b7030a927c54b3f4d7fdd25
+ return FALSE;
+
+ guint modifiers = webkit_navigation_action_get_modifiers(navigationAction);
++ // The modifier values depend on the API in use, see toPlatformModifiers() in WebKitPrivate.cpp.
++#if ENABLE_WPE_PLATFORM
++ const guint ctrlShiftMask = WPE_MODIFIER_KEYBOARD_CONTROL | WPE_MODIFIER_KEYBOARD_SHIFT;
++#else
++ const guint ctrlShiftMask = wpe_input_keyboard_modifier_control | wpe_input_keyboard_modifier_shift;
++#endif
+ if (webkit_navigation_action_get_mouse_button(navigationAction) != 2 /* GDK_BUTTON_MIDDLE */ &&
-+ (webkit_navigation_action_get_mouse_button(navigationAction) != 1 /* GDK_BUTTON_PRIMARY */ || (modifiers & (wpe_input_keyboard_modifier_control | wpe_input_keyboard_modifier_shift)) == 0))
++ (webkit_navigation_action_get_mouse_button(navigationAction) != 1 /* GDK_BUTTON_PRIMARY */ || (modifiers & ctrlShiftMask) == 0))
+ return FALSE;
+
+ /* Open a new tab if link clicked with the middle button, shift+click or ctrl+click. */
@@ -20121,9 +20132,10 @@ index 4446005792f94b8bc8d3cff6bf7d243e1970baf8..549fc8424b7030a927c54b3f4d7fdd25
+ webkit_browser_inspector_initialize_web_socket(remoteDebuggingPort, proxy, ignoreHosts);
+}
+
+ #if defined(USE_LIBWPE) && USE_LIBWPE
static void activate(GApplication* application, WPEToolingBackends::ViewBackend* backend)
#else
- static void activate(GApplication* application, gpointer)
+@@ -492,18 +640,23 @@ static void activate(GApplication* application, gpointer)
#endif
{
g_application_hold(application);
@@ -20151,7 +20163,7 @@ index 4446005792f94b8bc8d3cff6bf7d243e1970baf8..549fc8424b7030a927c54b3f4d7fdd25
webkit_network_session_set_itp_enabled(networkSession, enableITP);
if (proxy) {
-@@ -513,19 +661,22 @@ static void activate(GApplication* application, gpointer)
+@@ -530,19 +683,22 @@ static void activate(GApplication* application, gpointer)
webkit_cookie_manager_set_persistent_storage(cookieManager, cookiesFile, storageType);
}
}
@@ -20181,7 +20193,7 @@ index 4446005792f94b8bc8d3cff6bf7d243e1970baf8..549fc8424b7030a927c54b3f4d7fdd25
webkit_website_data_manager_set_itp_enabled(manager, enableITP);
if (proxy) {
-@@ -556,6 +707,7 @@ static void activate(GApplication* application, gpointer)
+@@ -573,6 +729,7 @@ static void activate(GApplication* application, gpointer)
}
#endif
@@ -20189,23 +20201,31 @@ index 4446005792f94b8bc8d3cff6bf7d243e1970baf8..549fc8424b7030a927c54b3f4d7fdd25
g_autoptr(WebKitUserContentManager) userContentManager = nullptr;
if (contentFilter) {
g_autoptr(GFile) contentFilterFile = g_file_new_for_commandline_arg(contentFilter);
-@@ -638,6 +790,15 @@ static void activate(GApplication* application, gpointer)
- "autoplay", WEBKIT_AUTOPLAY_ALLOW,
- nullptr);
+@@ -655,12 +812,7 @@ static void activate(GApplication* application, gpointer)
+ #endif
+
+ #if ENABLE_WPE_PLATFORM_HEADLESS
+-#if defined(USE_LIBWPE) && USE_LIBWPE
+- const bool useHeadlessMode = headlessMode && !useLegacyAPI;
+-#else
+- const bool useHeadlessMode = headlessMode;
+-#endif
+- WPEDisplay* wpeDisplay = useHeadlessMode ? wpe_display_headless_new() : nullptr;
++ WPEDisplay* wpeDisplay = browserDisplay;
+ #endif
+
+ webkit_web_context_set_automation_allowed(webContext, automationMode);
+@@ -687,9 +839,6 @@ static void activate(GApplication* application, gpointer)
+ nullptr));
+ g_object_unref(settings);
+ g_object_unref(defaultWebsitePolicies);
+-#if ENABLE_WPE_PLATFORM_HEADLESS
+- g_clear_object(&wpeDisplay);
+-#endif
-+// Playwright begin
-+ if (headlessMode) {
-+ webkit_web_view_backend_set_screenshot_callback(viewBackend,
-+ [](gpointer data) {
-+ return static_cast<WPEToolingBackends::HeadlessViewBackend*>(data)->snapshot();
-+ });
-+ }
-+// Playwright end
-+
- auto* webView = WEBKIT_WEB_VIEW(g_object_new(WEBKIT_TYPE_WEB_VIEW,
#if defined(USE_LIBWPE) && USE_LIBWPE
- "backend", viewBackend,
-@@ -700,12 +861,16 @@ static void activate(GApplication* application, gpointer)
+ if (backend) {
+@@ -731,12 +880,16 @@ static void activate(GApplication* application, gpointer)
#endif
}
@@ -20224,7 +20244,7 @@ index 4446005792f94b8bc8d3cff6bf7d243e1970baf8..549fc8424b7030a927c54b3f4d7fdd25
g_hash_table_add(openViews, webView);
WebKitColor color;
-@@ -713,16 +878,11 @@ static void activate(GApplication* application, gpointer)
+@@ -744,16 +897,11 @@ static void activate(GApplication* application, gpointer)
webkit_web_view_set_background_color(webView, &color);
if (uriArguments) {
@@ -20246,16 +20266,52 @@ index 4446005792f94b8bc8d3cff6bf7d243e1970baf8..549fc8424b7030a927c54b3f4d7fdd25
webkit_web_view_load_uri(webView, "https://wpewebkit.org");
g_object_unref(webContext);
-@@ -817,6 +977,8 @@ int main(int argc, char *argv[])
+@@ -786,6 +934,16 @@ int main(int argc, char *argv[])
+ }
+ g_option_context_free(context);
+
++// Playwright begin
++ if (headlessMode) {
++ // Render in software, as with libwpe: wpe_display_get_drm_device() returns NULL under this
++ // env var, keeping web processes on shared-memory buffers instead of the desktop GPU.
++ g_setenv("LIBGL_ALWAYS_SOFTWARE", "true", FALSE);
++ // The Skia DMABuf atlas crashes the web process on the software rendering path.
++ g_setenv("WEBKIT_DISABLE_DMABUF_ATLAS", "1", FALSE);
++ }
++// Playwright end
++
+ if (printVersion) {
+ g_print("WPE WebKit %u.%u.%u",
+ webkit_get_major_version(),
+@@ -848,6 +1006,27 @@ int main(int argc, char *argv[])
}
#endif
++#if ENABLE_WPE_PLATFORM_HEADLESS
++// Playwright begin
++#if defined(USE_LIBWPE) && USE_LIBWPE
++ const bool useHeadlessMode = headlessMode && !useLegacyAPI;
++#else
++ const bool useHeadlessMode = headlessMode;
++#endif
++ if (useHeadlessMode) {
++ // Shared headless display passed explicitly to every view; a view without a display would
++ // fall back to wpe_display_get_default() and open a real window on the native display.
++ browserDisplay = wpe_display_headless_new();
++ // Declare mouse + keyboard (headless has none by default) so CSS media features report
++ // hover and a fine pointer, like a desktop browser.
++ wpe_display_set_available_input_devices(browserDisplay,
++ static_cast<WPEAvailableInputDevices>(WPE_AVAILABLE_INPUT_DEVICE_MOUSE | WPE_AVAILABLE_INPUT_DEVICE_KEYBOARD));
++ }
++// Playwright end
++#endif
++
+ openViews = g_hash_table_new_full(nullptr, nullptr, g_object_unref, nullptr);
+
GApplication* application = g_application_new("org.wpewebkit.MiniBrowser", G_APPLICATION_NON_UNIQUE);
#if defined(USE_LIBWPE) && USE_LIBWPE
g_signal_connect(application, "activate", G_CALLBACK(activate), backend.release());
-@@ -829,6 +991,12 @@ int main(int argc, char *argv[])
+@@ -860,6 +1039,12 @@ int main(int argc, char *argv[])
};
g_unix_signal_add(SIGINT, quitOnSignal, application);
g_unix_signal_add(SIGTERM, quitOnSignal, application);
@@ -20281,10 +20337,10 @@ index 1067b31bc989748dfcc5502209d36d001b9b239e..7629263fb8bc93dca6dfc01c75eed8d2
+ add_subdirectory(Playwright/win)
+endif ()
diff --git a/Tools/WebKitTestRunner/CMakeLists.txt b/Tools/WebKitTestRunner/CMakeLists.txt
-index 25d5ca51d94ce47cacfa2485d9d971dd35a6ac4f..6af69810ca2c022a2128bc9a96c42d409b8a87e7 100644
+index 994baf3414612c2630580f576effa34fa3c8f509..e635e32a8e132e9e478aa867dea1ab5e7e6bbb74 100644
--- a/Tools/WebKitTestRunner/CMakeLists.txt
+++ b/Tools/WebKitTestRunner/CMakeLists.txt
-@@ -102,6 +102,10 @@ set(TestRunnerInjectedBundle_PRIVATE_LIBRARIES
+@@ -104,6 +104,10 @@ set(TestRunnerInjectedBundle_PRIVATE_LIBRARIES
)
set(TestRunnerInjectedBundle_FRAMEWORKS ${WebKitTestRunner_FRAMEWORKS})
@@ -20296,10 +20352,10 @@ index 25d5ca51d94ce47cacfa2485d9d971dd35a6ac4f..6af69810ca2c022a2128bc9a96c42d40
"${WebKitTestRunner_DIR}/InjectedBundle/Bindings/AccessibilityController.idl"
"${WebKitTestRunner_DIR}/InjectedBundle/Bindings/AccessibilityTextMarker.idl"
diff --git a/Tools/WebKitTestRunner/TestController.cpp b/Tools/WebKitTestRunner/TestController.cpp
-index c5ac77c675da81f6aa2686aedae39f8cf0c779e6..2037f08c6c2f068b46f09232ea810ae564294084 100644
+index ff270f9bce9d02f86fefe0febc51d8af7fa82d82..b95baf4e50ddda05fe998dfb152cd4494fec120d 100644
--- a/Tools/WebKitTestRunner/TestController.cpp
+++ b/Tools/WebKitTestRunner/TestController.cpp
-@@ -837,6 +837,7 @@ PlatformWebView* TestController::createOtherPlatformWebView(PlatformWebView* par
+@@ -848,6 +848,7 @@ PlatformWebView* TestController::createOtherPlatformWebView(PlatformWebView* par
nullptr, // requestStorageAccessConfirm
nullptr, // shouldAllowDeviceOrientationAndMotionAccess
nullptr, // runWebAuthenticationPanel
@@ -20307,7 +20363,7 @@ index c5ac77c675da81f6aa2686aedae39f8cf0c779e6..2037f08c6c2f068b46f09232ea810ae5
nullptr, // decidePolicyForSpeechRecognitionPermissionRequest
nullptr, // decidePolicyForMediaKeySystemPermissionRequest
nullptr, // queryPermission
-@@ -1325,6 +1326,7 @@ void TestController::createWebViewWithOptions(const TestOptions& options)
+@@ -1343,6 +1344,7 @@ void TestController::createWebViewWithOptions(const TestOptions& options)
nullptr, // requestStorageAccessConfirm
shouldAllowDeviceOrientationAndMotionAccess,
runWebAuthenticationPanel,
@@ -20379,66 +20435,6 @@ index 13a94ad7d71f65b38408e0cf52558fbc4610a649..7cebd2e49f7214d61ea541d124f4b46f
+
+
} // namespace WTR
-diff --git a/Tools/jhbuild/jhbuild-minimal.modules b/Tools/jhbuild/jhbuild-minimal.modules
-index 394952b034ef7ac376396499c5c42635d7dfa8a3..519fdf07d9c55ed4c2b940e392d1f559cc5c01b2 100644
---- a/Tools/jhbuild/jhbuild-minimal.modules
-+++ b/Tools/jhbuild/jhbuild-minimal.modules
-@@ -188,7 +188,6 @@
- </meson>
-
- <meson id="libsoup" mesonargs="-Dgssapi=disabled -Dvapi=disabled -Dntlm=disabled -Dsysprof=disabled -Dautobahn=disabled -Dpkcs11_tests=disabled">
-- <pkg-config>libsoup-3.0.pc</pkg-config>
- <dependencies>
- <dep package="glib"/>
- <dep package="glib-networking"/>
-diff --git a/Tools/wpe/backends/fdo/HeadlessViewBackendFdo.cpp b/Tools/wpe/backends/fdo/HeadlessViewBackendFdo.cpp
-index 6186d81869dbbb346ec5a62f2bbba88e2320d5e7..25b5615339b74cd56042b89f723993023cbb58ca 100644
---- a/Tools/wpe/backends/fdo/HeadlessViewBackendFdo.cpp
-+++ b/Tools/wpe/backends/fdo/HeadlessViewBackendFdo.cpp
-@@ -175,28 +175,27 @@ void HeadlessViewBackend::updateSnapshot(PlatformBuffer exportedBuffer)
- return;
- }
-
-- auto info = SkImageInfo::MakeN32Premul(m_width, m_height, SkColorSpace::MakeSRGB());
-+ uint32_t width = std::max(0, wl_shm_buffer_get_width(shmBuffer));
-+ uint32_t height = std::max(0, wl_shm_buffer_get_height(shmBuffer));
-+ if (!width || !height) {
-+ fprintf(stderr, "HeadlessViewBackend::updateSnapshot shmBuffer is empty: %ux%u\n", width, height);
-+ return;
-+ }
-+
-+ auto info = SkImageInfo::MakeN32Premul(width, height, SkColorSpace::MakeSRGB());
- uint32_t bufferStride = info.minRowBytes();
-- uint8_t* buffer = new uint8_t[bufferStride * m_height];
-- memset(buffer, 0, bufferStride * m_height);
-+ uint32_t stride = std::max(0, wl_shm_buffer_get_stride(shmBuffer));
-+ if (bufferStride != stride) {
-+ fprintf(stderr, "bufferStride != stride: %u != %u\n", bufferStride, stride);
-+ return;
-+ }
-
-+ uint8_t* buffer = new uint8_t[bufferStride * height];
- {
-- uint32_t width = std::min<uint32_t>(m_width, std::max(0, wl_shm_buffer_get_width(shmBuffer)));
-- uint32_t height = std::min<uint32_t>(m_height, std::max(0, wl_shm_buffer_get_height(shmBuffer)));
-- uint32_t stride = std::max(0, wl_shm_buffer_get_stride(shmBuffer));
--
- wl_shm_buffer_begin_access(shmBuffer);
- auto* data = static_cast<uint8_t*>(wl_shm_buffer_get_data(shmBuffer));
-
-- for (uint32_t y = 0; y < height; ++y) {
-- for (uint32_t x = 0; x < width; ++x) {
-- buffer[bufferStride * y + 4 * x + 0] = data[stride * y + 4 * x + 0];
-- buffer[bufferStride * y + 4 * x + 1] = data[stride * y + 4 * x + 1];
-- buffer[bufferStride * y + 4 * x + 2] = data[stride * y + 4 * x + 2];
-- buffer[bufferStride * y + 4 * x + 3] = data[stride * y + 4 * x + 3];
-- }
-- }
--
-+ memcpy(buffer, data, bufferStride * height);
- wl_shm_buffer_end_access(shmBuffer);
- }
-
diff --git a/WebKit.xcworkspace/contents.xcworkspacedata b/WebKit.xcworkspace/contents.xcworkspacedata
index 5d6492124eb520ce2b25f5c62775438103050ed3..1c0ea8a3258b5676b81fb00360e2c0589cc93e18 100644
--- a/WebKit.xcworkspace/contents.xcworkspacedata