Skip to content

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

browser(webkit): roll to 09/21 (#3945)

Yury Semikhatsky2fbe76714247
diff --git a/browser_patches/webkit/BUILD_NUMBER b/browser_patches/webkit/BUILD_NUMBER
index c7140c52e3..a4f4c031eb 100644
--- a/browser_patches/webkit/BUILD_NUMBER
+++ b/browser_patches/webkit/BUILD_NUMBER
@@ -1,2 +1,2 @@
-1344
-Changed: [email protected] Fri Sep 11 13:34:58 PDT 2020
+1345
+Changed: [email protected] Mon Sep 21 15:52:04 PDT 2020
diff --git a/browser_patches/webkit/UPSTREAM_CONFIG.sh b/browser_patches/webkit/UPSTREAM_CONFIG.sh
index e5fe25be6b..8e141c33ad 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"
BASE_BRANCH="master"
-BASE_REVISION="7f0791ac477f778a31f58b1d206112299a7ba596"
+BASE_REVISION="8cddd8461a7930c57566b0ca339f0f5a6ccbcbc2"
diff --git a/browser_patches/webkit/patches/bootstrap.diff b/browser_patches/webkit/patches/bootstrap.diff
index 3b1c9ab554..e0f26ebedb 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 a86288b2e7770e8817a0e8db2b48d7263778dc15..3cafc2843f97344961f2d1f8cdf338cfba2e31a7 100644
+index 93159afb8584d8940ed5d5b3f27a3443e8f08d32..7848baf5fb6422fec66091cdbef063d34c62c508 100644
--- a/Source/JavaScriptCore/CMakeLists.txt
+++ b/Source/JavaScriptCore/CMakeLists.txt
-@@ -1168,22 +1168,27 @@ set(JavaScriptCore_INSPECTOR_DOMAINS
+@@ -1170,22 +1170,27 @@ set(JavaScriptCore_INSPECTOR_DOMAINS
${JAVASCRIPTCORE_DIR}/inspector/protocol/CSS.json
${JAVASCRIPTCORE_DIR}/inspector/protocol/Canvas.json
${JAVASCRIPTCORE_DIR}/inspector/protocol/Console.json
@@ -31,10 +31,10 @@ index a86288b2e7770e8817a0e8db2b48d7263778dc15..3cafc2843f97344961f2d1f8cdf338cf
${JAVASCRIPTCORE_DIR}/inspector/protocol/ServiceWorker.json
${JAVASCRIPTCORE_DIR}/inspector/protocol/Target.json
diff --git a/Source/JavaScriptCore/DerivedSources.make b/Source/JavaScriptCore/DerivedSources.make
-index d5d6f2bbd013307c84a81037c01b521cbd2aa4f0..11593beafdd85d457da988481e96c8440008bc96 100644
+index 9a9eae93f69c7faaadf2b25c7d26aa99a6d588bf..5732b5f68f1d1db5dcd27b2bd65727114973a320 100644
--- a/Source/JavaScriptCore/DerivedSources.make
+++ b/Source/JavaScriptCore/DerivedSources.make
-@@ -261,22 +261,27 @@ INSPECTOR_DOMAINS := \
+@@ -265,22 +265,27 @@ INSPECTOR_DOMAINS := \
$(JavaScriptCore)/inspector/protocol/CSS.json \
$(JavaScriptCore)/inspector/protocol/Canvas.json \
$(JavaScriptCore)/inspector/protocol/Console.json \
@@ -63,7 +63,7 @@ index d5d6f2bbd013307c84a81037c01b521cbd2aa4f0..11593beafdd85d457da988481e96c844
$(JavaScriptCore)/inspector/protocol/ServiceWorker.json \
$(JavaScriptCore)/inspector/protocol/Target.json \
diff --git a/Source/JavaScriptCore/bindings/ScriptValue.cpp b/Source/JavaScriptCore/bindings/ScriptValue.cpp
-index 6b853c931f1dce9253bbac06a95e6aac527cf25a..bb50bfb871ace62ef84be62c7564f2e3f27dc2bd 100644
+index 7968b90a73b282df5982256a6edcb2d6e574396e..6cc034017ae9b2f35c9c526633052586db920ee4 100644
--- a/Source/JavaScriptCore/bindings/ScriptValue.cpp
+++ b/Source/JavaScriptCore/bindings/ScriptValue.cpp
@@ -79,7 +79,10 @@ static RefPtr<JSON::Value> jsToInspectorValue(JSGlobalObject* globalObject, JSVa
@@ -77,7 +77,7 @@ index 6b853c931f1dce9253bbac06a95e6aac527cf25a..bb50bfb871ace62ef84be62c7564f2e3
+ auto inspectorValue = jsToInspectorValue(globalObject, childValue, maxDepth);
if (!inspectorValue)
return nullptr;
- inspectorObject->setValue(name.string(), WTFMove(inspectorValue));
+ inspectorObject->setValue(name.string(), inspectorValue.releaseNonNull());
diff --git a/Source/JavaScriptCore/inspector/IdentifiersFactory.cpp b/Source/JavaScriptCore/inspector/IdentifiersFactory.cpp
index 95cd87b01b15cb8667e57bc5bb51a71f06bc3760..0481fa93227f297be9d9cf000c5a72235956a390 100644
--- a/Source/JavaScriptCore/inspector/IdentifiersFactory.cpp
@@ -118,10 +118,10 @@ index eb25aedee4cd9ebe007e06c2515b37ee095b06f4..badf6559595c8377db1089ca3c25008e
static String requestId(unsigned long identifier);
};
diff --git a/Source/JavaScriptCore/inspector/InjectedScript.cpp b/Source/JavaScriptCore/inspector/InjectedScript.cpp
-index cc849f051fa40518a9d1a03429bc2b4dbcfb3102..11b05346f6098fa23f51ba9abc1af0e0e60a626c 100644
+index 6909a339ea2e3de600f55fd6fe4683646171e0a7..0a502d6e6c7efa3195c8aaaaec434a08e7465554 100644
--- a/Source/JavaScriptCore/inspector/InjectedScript.cpp
+++ b/Source/JavaScriptCore/inspector/InjectedScript.cpp
-@@ -287,9 +287,13 @@ RefPtr<Protocol::Runtime::RemoteObject> InjectedScript::wrapObject(JSC::JSValue
+@@ -289,6 +289,10 @@ RefPtr<Protocol::Runtime::RemoteObject> InjectedScript::wrapObject(JSC::JSValue
auto callResult = callFunctionWithEvalEnabled(wrapFunction);
if (!callResult)
return nullptr;
@@ -130,12 +130,8 @@ index cc849f051fa40518a9d1a03429bc2b4dbcfb3102..11b05346f6098fa23f51ba9abc1af0e0
+ if (!callResultValue)
+ return nullptr;
- RefPtr<JSON::Object> resultObject;
-- bool castSucceeded = toInspectorValue(globalObject(), callResult.value())->asObject(resultObject);
-+ bool castSucceeded = toInspectorValue(globalObject(), callResultValue)->asObject(resultObject);
- ASSERT_UNUSED(castSucceeded, castSucceeded);
-
- return BindingTraits<Protocol::Runtime::RemoteObject>::runtimeCast(resultObject);
+ auto resultValue = toInspectorValue(globalObject(), callResult.value());
+ if (!resultValue)
diff --git a/Source/JavaScriptCore/inspector/InjectedScriptSource.js b/Source/JavaScriptCore/inspector/InjectedScriptSource.js
index cd593a24af4fe24ba59577b73b26947765edcc32..1f7a04d72065dbd60761c1a72f3254f953d3b9a9 100644
--- a/Source/JavaScriptCore/inspector/InjectedScriptSource.js
@@ -150,7 +146,7 @@ index cd593a24af4fe24ba59577b73b26947765edcc32..1f7a04d72065dbd60761c1a72f3254f9
return;
}
diff --git a/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.cpp b/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.cpp
-index 693e8b25c73778340e8394046786d9318a8a0924..4be62e0aca82895a96449175adb1af10e7b9daec 100644
+index 033a1b4713352777ee0de5ed53e64f8391f9d74f..fc356dec4b1518547a4217def6a7b5f1d97330fb 100644
--- a/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.cpp
+++ b/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.cpp
@@ -101,7 +101,7 @@ void BackendDispatcher::registerDispatcherForDomain(const String& domain, Supple
@@ -162,8 +158,8 @@ index 693e8b25c73778340e8394046786d9318a8a0924..4be62e0aca82895a96449175adb1af10
{
Ref<BackendDispatcher> protect(*this);
-@@ -142,6 +142,9 @@ void BackendDispatcher::dispatch(const String& message)
- }
+@@ -146,6 +146,9 @@ void BackendDispatcher::dispatch(const String& message)
+ requestId = *requestIdInt;
}
+ if (interceptor && interceptor(messageObject) == InterceptionResult::Intercepted)
@@ -173,10 +169,10 @@ index 693e8b25c73778340e8394046786d9318a8a0924..4be62e0aca82895a96449175adb1af10
// We could be called re-entrantly from a nested run loop, so restore the previous id.
SetForScope<Optional<long>> scopedRequestId(m_currentRequestId, requestId);
diff --git a/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.h b/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.h
-index 95d9d81188e735e8f1b70cc0deee2682cb6714f0..fbab25a07bf35c49faf026a3dfaccd50f50d1ab8 100644
+index 8a5efb316e9d09337ada2323dc6f926056a9c2f9..f3dcc8fcc087f474abc88cea837d11ff3e5faeff 100644
--- a/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.h
+++ b/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.h
-@@ -82,7 +82,10 @@ public:
+@@ -84,7 +84,10 @@ public:
};
void registerDispatcherForDomain(const String& domain, SupplementalBackendDispatcher*);
@@ -240,39 +236,45 @@ index 4b95964db4d902b4b7f4b0b4c40afea51654ff2f..966a5927702b65edb343369decafda7f
bool m_isPaused { false };
};
diff --git a/Source/JavaScriptCore/inspector/agents/InspectorTargetAgent.cpp b/Source/JavaScriptCore/inspector/agents/InspectorTargetAgent.cpp
-index 8fcb5a1e55750d325a84824d86c49cfe6fb04268..ed2525df326bfe649793701a112eefa30952e375 100644
+index 508eb02ec95c52408384a1e2b77648afd426dd9d..05f483dced4b62ffdd60b0a0447504802e1f5711 100644
--- a/Source/JavaScriptCore/inspector/agents/InspectorTargetAgent.cpp
+++ b/Source/JavaScriptCore/inspector/agents/InspectorTargetAgent.cpp
-@@ -87,6 +87,28 @@ void InspectorTargetAgent::sendMessageToTarget(ErrorString& errorString, const S
- target->sendMessageToTargetBackend(message);
+@@ -87,6 +87,34 @@ Protocol::ErrorStringOr<void> InspectorTargetAgent::sendMessageToTarget(const St
+ return { };
}
-+void InspectorTargetAgent::activate(ErrorString& errorString, const String& targetId)
++Protocol::ErrorStringOr<void> InspectorTargetAgent::activate(const String& targetId)
+{
+ InspectorTarget* target = m_targets.get(targetId);
-+ if (!target) {
-+ errorString = "Missing target for given targetId"_s;
-+ return;
-+ }
++ if (!target)
++ return makeUnexpected("Missing target for given targetId"_s);
+
++ String errorString;
+ target->activate(errorString);
++ if (!errorString.isEmpty())
++ return makeUnexpected(errorString);
++
++ return { };
+}
+
-+void InspectorTargetAgent::close(ErrorString& errorString, const String& targetId, const bool* runBeforeUnload)
++Protocol::ErrorStringOr<void> InspectorTargetAgent::close(const String& targetId, Optional<bool>&& runBeforeUnload)
+{
+ InspectorTarget* target = m_targets.get(targetId);
-+ if (!target) {
-+ errorString = "Missing target for given targetId"_s;
-+ return;
-+ }
++ if (!target)
++ return makeUnexpected("Missing target for given targetId"_s);
+
++ String errorString;
+ target->close(errorString, runBeforeUnload && *runBeforeUnload);
++ if (!errorString.isEmpty())
++ return makeUnexpected(errorString);
++
++ return { };
+}
+
void InspectorTargetAgent::sendMessageFromTargetToFrontend(const String& targetId, const String& message)
{
ASSERT_WITH_MESSAGE(m_targets.get(targetId), "Sending a message from an untracked target to the frontend.");
-@@ -144,7 +166,17 @@ void InspectorTargetAgent::targetDestroyed(InspectorTarget& target)
+@@ -144,7 +172,17 @@ void InspectorTargetAgent::targetDestroyed(InspectorTarget& target)
if (!m_isConnected)
return;
@@ -291,7 +293,7 @@ index 8fcb5a1e55750d325a84824d86c49cfe6fb04268..ed2525df326bfe649793701a112eefa3
}
void InspectorTargetAgent::didCommitProvisionalTarget(const String& oldTargetID, const String& committedTargetID)
-@@ -159,6 +191,18 @@ void InspectorTargetAgent::didCommitProvisionalTarget(const String& oldTargetID,
+@@ -159,6 +197,18 @@ void InspectorTargetAgent::didCommitProvisionalTarget(const String& oldTargetID,
m_frontendDispatcher->didCommitProvisionalTarget(oldTargetID, committedTargetID);
}
@@ -311,15 +313,15 @@ index 8fcb5a1e55750d325a84824d86c49cfe6fb04268..ed2525df326bfe649793701a112eefa3
{
return m_router.hasLocalFrontend() ? Inspector::FrontendChannel::ConnectionType::Local : Inspector::FrontendChannel::ConnectionType::Remote;
diff --git a/Source/JavaScriptCore/inspector/agents/InspectorTargetAgent.h b/Source/JavaScriptCore/inspector/agents/InspectorTargetAgent.h
-index b929ddffe29c3fb088ab6714087c99302c275214..2670ff3ba9b15afd2bb99993c3240c49b24907f5 100644
+index edcd489b76e080827e0741f14bab09f9ea9303d4..cbb18bbff3c6277fdcc6455160d692d03d56c338 100644
--- a/Source/JavaScriptCore/inspector/agents/InspectorTargetAgent.h
+++ b/Source/JavaScriptCore/inspector/agents/InspectorTargetAgent.h
-@@ -52,15 +52,21 @@ public:
- void setPauseOnStart(ErrorString&, bool pauseOnStart) final;
- void resume(ErrorString&, const String& targetId) final;
- void sendMessageToTarget(ErrorString&, const String& targetId, const String& message) final;
-+ void activate(ErrorString&, const String& targetId) override;
-+ void close(ErrorString&, const String& targetId, const bool* runBeforeUnload) override;
+@@ -50,15 +50,21 @@ public:
+ Protocol::ErrorStringOr<void> setPauseOnStart(bool);
+ Protocol::ErrorStringOr<void> resume(const String& targetId);
+ Protocol::ErrorStringOr<void> sendMessageToTarget(const String& targetId, const String& message);
++ Protocol::ErrorStringOr<void> activate(const String& targetId) override;
++ Protocol::ErrorStringOr<void> close(const String& targetId, Optional<bool>&& runBeforeUnload) override;
// Target lifecycle.
void targetCreated(InspectorTarget&);
@@ -337,7 +339,7 @@ index b929ddffe29c3fb088ab6714087c99302c275214..2670ff3ba9b15afd2bb99993c3240c49
// FrontendChannel
FrontendChannel::ConnectionType connectionType() const;
diff --git a/Source/JavaScriptCore/inspector/protocol/DOM.json b/Source/JavaScriptCore/inspector/protocol/DOM.json
-index f3a7753702995ebc54312ead0b0c028a58bb19b9..869e06b61f31356dd10c38fc5cae519fa40c2b9e 100644
+index 998bc4afe68ec70502a009b7bf5ed1de9758ab31..e50d833cee34a9d0a8349b193ced87dc10d93381 100644
--- a/Source/JavaScriptCore/inspector/protocol/DOM.json
+++ b/Source/JavaScriptCore/inspector/protocol/DOM.json
@@ -79,6 +79,16 @@
@@ -374,7 +376,7 @@ index f3a7753702995ebc54312ead0b0c028a58bb19b9..869e06b61f31356dd10c38fc5cae519f
}
],
"commands": [
-@@ -508,7 +528,9 @@
+@@ -509,7 +529,9 @@
"description": "Resolves JavaScript node object for given node id.",
"targetTypes": ["page"],
"parameters": [
@@ -385,7 +387,7 @@ index f3a7753702995ebc54312ead0b0c028a58bb19b9..869e06b61f31356dd10c38fc5cae519f
{ "name": "objectGroup", "type": "string", "optional": true, "description": "Symbolic group name that can be used to release multiple objects." }
],
"returns": [
-@@ -575,6 +597,45 @@
+@@ -576,6 +598,45 @@
"parameters": [
{ "name": "allow", "type": "boolean" }
]
@@ -720,7 +722,7 @@ index 65ab2092b0ffd0ead3da1ddccd398d4f4179f51a..2d9ef40a20df819193c9a5867fbf6f8f
],
"events": [
diff --git a/Source/JavaScriptCore/inspector/protocol/Page.json b/Source/JavaScriptCore/inspector/protocol/Page.json
-index 3b8fa18bd7e8d95d7e8f95b442afc63e550ce63a..a72174146a85d0db01b11fda3a120712cb6a9e37 100644
+index fde4f6964d40e8a565116be2bc692a451c2da106..a1ccbc2c6df9d938d30614e15239bb5000a874ff 100644
--- a/Source/JavaScriptCore/inspector/protocol/Page.json
+++ b/Source/JavaScriptCore/inspector/protocol/Page.json
@@ -27,7 +27,7 @@
@@ -790,7 +792,7 @@ index 3b8fa18bd7e8d95d7e8f95b442afc63e550ce63a..a72174146a85d0db01b11fda3a120712
"name": "navigate",
"description": "Navigates current page to the given URL.",
@@ -270,6 +313,20 @@
- { "name": "appearance", "$ref": "Appearance", "description": "Appearance name to force. Empty string disables the override." }
+ { "name": "appearance", "$ref": "Appearance", "optional": true }
]
},
+ {
@@ -1360,18 +1362,18 @@ index 955756ba405f400970610f9a68c7ed42a67cb015..1520c0a1475a90de2795e4ccd8919c1b
builder.append(timeZoneName);
builder.append(')');
diff --git a/Source/JavaScriptCore/runtime/IntlDateTimeFormat.cpp b/Source/JavaScriptCore/runtime/IntlDateTimeFormat.cpp
-index 10c6ffd4d6c7e237c171dfd3a47baaafbacf537d..13f490ca506dd7d16f45048d6e7576c9b70a6a26 100644
+index f51cb02ee88d86c997a2332c5cc0d01b4641be1c..342ad6b5402afaa7883e3656d15641667ff45edd 100644
--- a/Source/JavaScriptCore/runtime/IntlDateTimeFormat.cpp
+++ b/Source/JavaScriptCore/runtime/IntlDateTimeFormat.cpp
@@ -34,6 +34,7 @@
+ #include "ObjectConstructor.h"
#include <unicode/ucal.h>
- #include <unicode/udatpg.h>
#include <unicode/uenum.h>
+#include <wtf/DateMath.h>
#include <wtf/text/StringBuilder.h>
#include <wtf/unicode/icu/ICUHelpers.h>
-@@ -98,6 +99,10 @@ static ALWAYS_INLINE bool isUTCEquivalent(StringView timeZone)
+@@ -93,6 +94,10 @@ static ALWAYS_INLINE bool isUTCEquivalent(StringView timeZone)
// https://tc39.es/ecma402/#sec-defaulttimezone
static String defaultTimeZone()
{
@@ -1409,16 +1411,13 @@ index 70ccc9bd0e1d8d57cbfdc5fea72fe9aae5203864..90027ec135a7f42068f501138d5cf15f
Source/third_party/opus/src/celt
Source/third_party/opus/src/include
diff --git a/Source/ThirdParty/libwebrtc/Configurations/libwebrtc.mac.exp b/Source/ThirdParty/libwebrtc/Configurations/libwebrtc.mac.exp
-index 558f4b2c182171efc415c7577f1d396018032ab1..1e89d8b88db54d4f134d4983a8f81cb0029f21c9 100644
+index b9d6259708e90889de1fb63ada0f4e0b73c5a7d1..9b1ca5ca1c41368ee103ea5fe8d1595ef8e1f806 100644
--- a/Source/ThirdParty/libwebrtc/Configurations/libwebrtc.mac.exp
+++ b/Source/ThirdParty/libwebrtc/Configurations/libwebrtc.mac.exp
-@@ -322,4 +322,24 @@ __ZN4webm10WebmParserC2Ev
- __ZN4webm10WebmParserD1Ev
- __ZN4webm10WebmParserD2Ev
- __ZN4webm4swapERNS_10WebmParserES1_
--__ZN10vp9_parser15Vp9HeaderParser23ParseUncompressedHeaderEPKhm
-\ No newline at end of file
-+__ZN10vp9_parser15Vp9HeaderParser23ParseUncompressedHeaderEPKhm
+@@ -326,3 +326,23 @@ __ZN10vp9_parser15Vp9HeaderParser23ParseUncompressedHeaderEPKhm
+ __ZN6webrtc14ParseCandidateERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPN7cricket9CandidateEPNS_13SdpParseErrorEb
+ __ZN7cricket27ICE_CANDIDATE_COMPONENT_RTPE
+ __ZNK3rtc13SocketAddress5IsNilEv
+__ZN8mkvmuxer11SegmentInfo15set_writing_appEPKc
+__ZN8mkvmuxer11SegmentInfo4InitEv
+__ZN8mkvmuxer7Segment10OutputCuesEb
@@ -1669,10 +1668,10 @@ index 246ba67c764b629042a7927d24fe89b049d82a0b..68d536878d1f0ba832d1c1d3e36e10b8
WTF_EXPORT_PRIVATE LocalTimeOffset calculateLocalTimeOffset(double utcInMilliseconds, TimeType = UTCTime);
diff --git a/Source/WTF/wtf/PlatformEnable.h b/Source/WTF/wtf/PlatformEnable.h
-index 700f90adc6c39a76baa27d7c8b31fe4de629598b..b38a27f15587b7780a39c52c853e4e6e8153c061 100644
+index e52c88dae63bcb39a4b3325e8a10ec9c160dea21..14c7330ab88e8505524366a0be4fb6ceb48eee35 100644
--- a/Source/WTF/wtf/PlatformEnable.h
+++ b/Source/WTF/wtf/PlatformEnable.h
-@@ -402,7 +402,7 @@
+@@ -398,7 +398,7 @@
#endif
#if !defined(ENABLE_ORIENTATION_EVENTS)
@@ -1681,7 +1680,7 @@ index 700f90adc6c39a76baa27d7c8b31fe4de629598b..b38a27f15587b7780a39c52c853e4e6e
#endif
#if OS(WINDOWS)
-@@ -475,7 +475,7 @@
+@@ -471,7 +471,7 @@
#endif
#if !defined(ENABLE_TOUCH_EVENTS)
@@ -1691,10 +1690,10 @@ index 700f90adc6c39a76baa27d7c8b31fe4de629598b..b38a27f15587b7780a39c52c853e4e6e
#if !defined(ENABLE_TOUCH_ACTION_REGIONS)
diff --git a/Source/WTF/wtf/PlatformHave.h b/Source/WTF/wtf/PlatformHave.h
-index cb8c6d01850deb7389dc7e09d6ac9c40246b2736..055f3000b426aa88dc2c21031da2e72fa8da6e49 100644
+index 600e58c5e22e1227033f5fc1a27ad0b6bcdd209a..53fad9899157093b97580e1683d55cf01f9d1fa0 100644
--- a/Source/WTF/wtf/PlatformHave.h
+++ b/Source/WTF/wtf/PlatformHave.h
-@@ -332,7 +332,7 @@
+@@ -335,7 +335,7 @@
#define HAVE_NSHTTPCOOKIESTORAGE__INITWITHIDENTIFIER_WITH_INACCURATE_NULLABILITY 1
#endif
@@ -1719,10 +1718,10 @@ index 6d5be9a591a272cd67d6e9d097b30505bdf8ae5e..8f67ba28c380e844c8e4191ee7044665
}
diff --git a/Source/WebCore/SourcesCocoa.txt b/Source/WebCore/SourcesCocoa.txt
-index b17114cbc21fe2939102a31d6ff02b9c312c988f..c0664ce1ada202f2211b477661ce098913ada1e8 100644
+index beeab6c9927d548bd5bf8e0558b576f691940004..aa0a07ad6ea6f2e9828936debafd9d9dff5b9263 100644
--- a/Source/WebCore/SourcesCocoa.txt
+++ b/Source/WebCore/SourcesCocoa.txt
-@@ -603,3 +603,9 @@ platform/graphics/angle/TemporaryANGLESetting.cpp @no-unify
+@@ -604,3 +604,9 @@ platform/graphics/angle/TemporaryANGLESetting.cpp @no-unify
// Derived Sources
WHLSLStandardLibraryFunctionMap.cpp
@@ -1745,10 +1744,10 @@ index d643d5bbfbed5b4e3bb1358e36096dcaf66d5d8a..5a0a8ffa1ab74ccf0858e69e35127d49
__ZN7WebCore14DocumentLoaderD2Ev
__ZN7WebCore14DocumentLoader17clearMainResourceEv
diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj
-index 03979379925f7d192d2628029d19a7c74986f965..814159f29243fe307371604e55950ebc8128811e 100644
+index 3dcc5e71b8b1339002621ac7b6cab740adfce21b..8e1bf4b94238f7a1bf7fb6e4c2e00c686fb7388d 100644
--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj
-@@ -5104,6 +5104,14 @@
+@@ -5119,6 +5119,14 @@
EDE3A5000C7A430600956A37 /* ColorMac.h in Headers */ = {isa = PBXBuildFile; fileRef = EDE3A4FF0C7A430600956A37 /* ColorMac.h */; settings = {ATTRIBUTES = (Private, ); }; };
EDEC98030AED7E170059137F /* WebCorePrefix.h in Headers */ = {isa = PBXBuildFile; fileRef = EDEC98020AED7E170059137F /* WebCorePrefix.h */; };
EFCC6C8F20FE914400A2321B /* CanvasActivityRecord.h in Headers */ = {isa = PBXBuildFile; fileRef = EFCC6C8D20FE914000A2321B /* CanvasActivityRecord.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -1763,7 +1762,7 @@ index 03979379925f7d192d2628029d19a7c74986f965..814159f29243fe307371604e55950ebc
F12171F616A8CF0B000053CA /* WebVTTElement.h in Headers */ = {isa = PBXBuildFile; fileRef = F12171F416A8BC63000053CA /* WebVTTElement.h */; };
F32BDCD92363AACA0073B6AE /* UserGestureEmulationScope.h in Headers */ = {isa = PBXBuildFile; fileRef = F32BDCD72363AACA0073B6AE /* UserGestureEmulationScope.h */; };
F344C7141125B82C00F26EEE /* InspectorFrontendClient.h in Headers */ = {isa = PBXBuildFile; fileRef = F344C7121125B82C00F26EEE /* InspectorFrontendClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
-@@ -15983,6 +15991,14 @@
+@@ -16088,6 +16096,14 @@
EDEC98020AED7E170059137F /* WebCorePrefix.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebCorePrefix.h; sourceTree = "<group>"; tabWidth = 4; usesTabs = 0; };
EFB7287B2124C73D005C2558 /* CanvasActivityRecord.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CanvasActivityRecord.cpp; sourceTree = "<group>"; };
EFCC6C8D20FE914000A2321B /* CanvasActivityRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CanvasActivityRecord.h; sourceTree = "<group>"; };
@@ -1778,8 +1777,8 @@ index 03979379925f7d192d2628029d19a7c74986f965..814159f29243fe307371604e55950ebc
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>"; };
F32BDCD52363AAC90073B6AE /* UserGestureEmulationScope.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UserGestureEmulationScope.cpp; sourceTree = "<group>"; };
-@@ -21345,7 +21361,12 @@
- 2D2E34A921A4E191004598B5 /* EditableImageReference.h */,
+@@ -21481,7 +21497,12 @@
+ 81F65FF513788FAA00FF6F2D /* DragState.h */,
1AF326770D78B9440068F0C4 /* EditorClient.h */,
93C09A800B064F00005ABD4D /* EventHandler.cpp */,
+ F050E16F23AD669E0011CE47 /* TouchEvent.cpp */,
@@ -1791,7 +1790,7 @@ index 03979379925f7d192d2628029d19a7c74986f965..814159f29243fe307371604e55950ebc
E0FEF371B27C53EAC1C1FBEE /* EventSource.cpp */,
E0FEF371B17C53EAC1C1FBEE /* EventSource.h */,
E0FEF371B07C53EAC1C1FBEE /* EventSource.idl */,
-@@ -26665,7 +26686,9 @@
+@@ -26842,7 +26863,9 @@
B2C3D9EC0D006C1D00EF6F26 /* text */,
E1EE8B6B2412B2A700E794D6 /* xr */,
DFDB912CF8E88A6DA1AD264F /* AbortableTaskQueue.h */,
@@ -1801,15 +1800,15 @@ index 03979379925f7d192d2628029d19a7c74986f965..814159f29243fe307371604e55950ebc
49AE2D95134EE5F90072920A /* CalculationValue.h */,
C330A22113EC196B0000B45B /* ColorChooser.h */,
C37CDEBC149EF2030042090D /* ColorChooserClient.h */,
-@@ -29067,6 +29090,7 @@
- BCCFBAE70B5152ED0001F1D7 /* DocumentParser.h */,
+@@ -29256,6 +29279,7 @@
+ 7C3A8ABA2509A199008C477F /* DocumentSelection.idl */,
AD6E71AA1668899D00320C13 /* DocumentSharedObjectPool.cpp */,
AD6E71AB1668899D00320C13 /* DocumentSharedObjectPool.h */,
+ F050E17323AD6A800011CE47 /* DocumentTouch.cpp */,
6BDB5DC1227BD3B800919770 /* DocumentStorageAccess.cpp */,
6BDB5DC0227BD3B800919770 /* DocumentStorageAccess.h */,
6BDB5DC5227CA0EB00919770 /* DocumentStorageAccess.idl */,
-@@ -30048,6 +30072,7 @@
+@@ -30265,6 +30289,7 @@
93C4F6EB1108F9A50099D0DB /* AccessibilityScrollbar.h in Headers */,
29489FC712C00F0300D83F0F /* AccessibilityScrollView.h in Headers */,
0709FC4E1025DEE30059CDBA /* AccessibilitySlider.h in Headers */,
@@ -1817,7 +1816,7 @@ index 03979379925f7d192d2628029d19a7c74986f965..814159f29243fe307371604e55950ebc
29D7BCFA1444AF7D0070619C /* AccessibilitySpinButton.h in Headers */,
69A6CBAD1C6BE42C00B836E9 /* AccessibilitySVGElement.h in Headers */,
AAC08CF315F941FD00F1E188 /* AccessibilitySVGRoot.h in Headers */,
-@@ -31967,6 +31992,7 @@
+@@ -32197,6 +32222,7 @@
6E4ABCD5138EA0B70071D291 /* JSHTMLUnknownElement.h in Headers */,
E44614170CD6826900FADA75 /* JSHTMLVideoElement.h in Headers */,
81BE20D311F4BC3200915DFA /* JSIDBCursor.h in Headers */,
@@ -1825,10 +1824,10 @@ index 03979379925f7d192d2628029d19a7c74986f965..814159f29243fe307371604e55950ebc
7C3D8EF01E0B21430023B084 /* JSIDBCursorDirection.h in Headers */,
C585A68311D4FB08004C3E4B /* JSIDBDatabase.h in Headers */,
C585A69711D4FB13004C3E4B /* JSIDBFactory.h in Headers */,
-@@ -33916,9 +33942,11 @@
- A7DBF8DE1276919C006B6008 /* TextCheckingHelper.h in Headers */,
+@@ -34145,9 +34171,11 @@
B2C3DA3A0D006C1D00EF6F26 /* TextCodec.h in Headers */,
26E98A10130A9FCA008EB7B2 /* TextCodecASCIIFastPath.h in Headers */,
+ DF95B14A24FDAFD300B1F4D7 /* TextCodecCJK.h in Headers */,
+ F050E16823AC9C080011CE47 /* PlatformTouchEvent.h in Headers */,
B2C3DA3C0D006C1D00EF6F26 /* TextCodecICU.h in Headers */,
B2C3DA3E0D006C1D00EF6F26 /* TextCodecLatin1.h in Headers */,
@@ -1837,7 +1836,7 @@ index 03979379925f7d192d2628029d19a7c74986f965..814159f29243fe307371604e55950ebc
B2C3DA400D006C1D00EF6F26 /* TextCodecUserDefined.h in Headers */,
B2C3DA420D006C1D00EF6F26 /* TextCodecUTF16.h in Headers */,
9343CB8212F25E510033C5EE /* TextCodecUTF8.h in Headers */,
-@@ -34896,6 +34924,7 @@
+@@ -35127,6 +35155,7 @@
51058ADF1D67C229009A538C /* MockGamepad.cpp in Sources */,
51058AE11D67C229009A538C /* MockGamepadProvider.cpp in Sources */,
CDF2B0121820540600F2B424 /* MockMediaPlayerMediaSource.cpp in Sources */,
@@ -1845,7 +1844,7 @@ index 03979379925f7d192d2628029d19a7c74986f965..814159f29243fe307371604e55950ebc
CDF2B0141820540600F2B424 /* MockMediaSourcePrivate.cpp in Sources */,
CDF2B0161820540700F2B424 /* MockSourceBufferPrivate.cpp in Sources */,
2D9BF7421DBFDC27007A7D99 /* NavigatorEME.cpp in Sources */,
-@@ -34927,6 +34956,7 @@
+@@ -35158,6 +35187,7 @@
6E72F54F229DCD1300B3E151 /* TemporaryANGLESetting.cpp in Sources */,
CE88EE262414467B007F29C2 /* TextAlternativeWithRange.mm in Sources */,
51DF6D800B92A18E00C2DC85 /* ThreadCheck.mm in Sources */,
@@ -1853,7 +1852,7 @@ index 03979379925f7d192d2628029d19a7c74986f965..814159f29243fe307371604e55950ebc
538EC8031F96AF81004D22A8 /* UnifiedSource1-mm.mm in Sources */,
538EC8021F96AF81004D22A8 /* UnifiedSource1.cpp in Sources */,
538EC8051F96AF81004D22A8 /* UnifiedSource2-mm.mm in Sources */,
-@@ -34975,6 +35005,7 @@
+@@ -35206,6 +35236,7 @@
538EC8881F993F9C004D22A8 /* UnifiedSource23.cpp in Sources */,
DE5F85801FA1ABF4006DB63A /* UnifiedSource24-mm.mm in Sources */,
538EC8891F993F9D004D22A8 /* UnifiedSource24.cpp in Sources */,
@@ -1861,7 +1860,7 @@ index 03979379925f7d192d2628029d19a7c74986f965..814159f29243fe307371604e55950ebc
DE5F85811FA1ABF4006DB63A /* UnifiedSource25-mm.mm in Sources */,
538EC88A1F993F9D004D22A8 /* UnifiedSource25.cpp in Sources */,
DE5F85821FA1ABF4006DB63A /* UnifiedSource26-mm.mm in Sources */,
-@@ -35507,6 +35538,7 @@
+@@ -35738,6 +35769,7 @@
2D8B92F1203D13E1009C868F /* UnifiedSource516.cpp in Sources */,
2D8B92F2203D13E1009C868F /* UnifiedSource517.cpp in Sources */,
2D8B92F3203D13E1009C868F /* UnifiedSource518.cpp in Sources */,
@@ -1870,7 +1869,7 @@ index 03979379925f7d192d2628029d19a7c74986f965..814159f29243fe307371604e55950ebc
2D8B92F5203D13E1009C868F /* UnifiedSource520.cpp in Sources */,
2D8B92F6203D13E1009C868F /* UnifiedSource521.cpp in Sources */,
diff --git a/Source/WebCore/accessibility/AccessibilityObject.cpp b/Source/WebCore/accessibility/AccessibilityObject.cpp
-index ca5f221306c597afd1fbe1372a9dca643c5884d8..99cb41b617220db2b47114bdf7222a77fa1db43f 100644
+index 585c7670604fd1f3dcfb6f580e0fd35a2aad4015..8d8a31539189978ceff11a79ee80244bf8bc6863 100644
--- a/Source/WebCore/accessibility/AccessibilityObject.cpp
+++ b/Source/WebCore/accessibility/AccessibilityObject.cpp
@@ -58,6 +58,7 @@
@@ -1881,7 +1880,7 @@ index ca5f221306c597afd1fbe1372a9dca643c5884d8..99cb41b617220db2b47114bdf7222a77
#include "LocalizedStrings.h"
#include "MathMLNames.h"
#include "NodeList.h"
-@@ -3254,10 +3255,15 @@ AccessibilityObjectInclusion AccessibilityObject::defaultObjectInclusion() const
+@@ -3241,10 +3242,15 @@ AccessibilityObjectInclusion AccessibilityObject::defaultObjectInclusion() const
if (useParentData ? m_isIgnoredFromParentData.isPresentationalChildOfAriaRole : isPresentationalChildOfAriaRole())
return AccessibilityObjectInclusion::IgnoreObject;
@@ -1949,7 +1948,7 @@ index 76399ab574d94d73c5abc08f8df7901979e58273..8df80e34cda19470e305d5696bf108bd
if (processInteractionStyle == ProcessInteractionStyle::Immediate)
ResourceLoadObserver::shared().logUserInteractionWithReducedTimeResolution(document->topDocument());
diff --git a/Source/WebCore/html/FileInputType.cpp b/Source/WebCore/html/FileInputType.cpp
-index d20b5b4e187fdfa7001db73edd0717fff7bd32f0..569449a90edc0a26ff3152ff6378aa45667fed02 100644
+index de06188e522381e034914f539af45166907767c9..900c152116b75e14e990a2810402afc49eaca78d 100644
--- a/Source/WebCore/html/FileInputType.cpp
+++ b/Source/WebCore/html/FileInputType.cpp
@@ -36,6 +36,7 @@
@@ -1960,7 +1959,7 @@ index d20b5b4e187fdfa7001db73edd0717fff7bd32f0..569449a90edc0a26ff3152ff6378aa45
#include "LocalizedStrings.h"
#include "MIMETypeRegistry.h"
#include "RenderFileUploadControl.h"
-@@ -206,6 +207,11 @@ void FileInputType::handleDOMActivateEvent(Event& event)
+@@ -211,6 +212,11 @@ void FileInputType::handleDOMActivateEvent(Event& event)
if (input.isDisabledFormControl())
return;
@@ -1973,7 +1972,7 @@ index d20b5b4e187fdfa7001db73edd0717fff7bd32f0..569449a90edc0a26ff3152ff6378aa45
return;
diff --git a/Source/WebCore/inspector/InspectorController.cpp b/Source/WebCore/inspector/InspectorController.cpp
-index a595c13494442c6a69c4f24b1347f057b770211b..0db75363bd708b371e1db1ea81c1b025744bc9e1 100644
+index 630df71790c63b6e75873451a1740f86f67e02de..568beed149797df3d208c1a59c049e2d23ab7ffa 100644
--- a/Source/WebCore/inspector/InspectorController.cpp
+++ b/Source/WebCore/inspector/InspectorController.cpp
@@ -371,8 +371,8 @@ void InspectorController::inspect(Node* node)
@@ -1987,7 +1986,7 @@ index a595c13494442c6a69c4f24b1347f057b770211b..0db75363bd708b371e1db1ea81c1b025
ensureDOMAgent().inspect(node);
}
-@@ -515,4 +515,24 @@ void InspectorController::didComposite(Frame& frame)
+@@ -513,4 +513,24 @@ void InspectorController::didComposite(Frame& frame)
InspectorInstrumentation::didComposite(frame);
}
@@ -2013,7 +2012,7 @@ index a595c13494442c6a69c4f24b1347f057b770211b..0db75363bd708b371e1db1ea81c1b025
+
} // namespace WebCore
diff --git a/Source/WebCore/inspector/InspectorController.h b/Source/WebCore/inspector/InspectorController.h
-index bca5ead33d04e3b1f4d67cd335242334e93892ca..bbac092e2c1377d6e1a687e2ea820286b68ec68b 100644
+index b3118080ac5f61b233a5f4998ea9a63dc95cca75..d4240bacd7cf3855b203965eb14eb0611881afc8 100644
--- a/Source/WebCore/inspector/InspectorController.h
+++ b/Source/WebCore/inspector/InspectorController.h
@@ -101,6 +101,10 @@ public:
@@ -2036,7 +2035,7 @@ index bca5ead33d04e3b1f4d67cd335242334e93892ca..bbac092e2c1377d6e1a687e2ea820286
} // namespace WebCore
diff --git a/Source/WebCore/inspector/InspectorInstrumentation.cpp b/Source/WebCore/inspector/InspectorInstrumentation.cpp
-index 191cf8d0e2562c41d03c5830c8ee06b239a8fe89..0417261c688f9e032cba8de38142eafc386725b8 100644
+index 1d65a452759fd02532232fffbfb70376f0afef90..3134459af0bc3c744bd580bf7b283b7420097217 100644
--- a/Source/WebCore/inspector/InspectorInstrumentation.cpp
+++ b/Source/WebCore/inspector/InspectorInstrumentation.cpp
@@ -627,6 +627,12 @@ void InspectorInstrumentation::didFailLoadingImpl(InstrumentingAgents& instrumen
@@ -2076,7 +2075,7 @@ index 191cf8d0e2562c41d03c5830c8ee06b239a8fe89..0417261c688f9e032cba8de38142eafc
}
void InspectorInstrumentation::frameDetachedFromParentImpl(InstrumentingAgents& instrumentingAgents, Frame& frame)
-@@ -750,12 +753,6 @@ void InspectorInstrumentation::frameDocumentUpdatedImpl(InstrumentingAgents& ins
+@@ -753,12 +756,6 @@ void InspectorInstrumentation::frameDocumentUpdatedImpl(InstrumentingAgents& ins
pageDOMDebuggerAgent->frameDocumentUpdated(frame);
}
@@ -2089,7 +2088,7 @@ index 191cf8d0e2562c41d03c5830c8ee06b239a8fe89..0417261c688f9e032cba8de38142eafc
void InspectorInstrumentation::frameStartedLoadingImpl(InstrumentingAgents& instrumentingAgents, Frame& frame)
{
if (frame.isMainFrame()) {
-@@ -792,6 +789,12 @@ void InspectorInstrumentation::frameClearedScheduledNavigationImpl(Instrumenting
+@@ -795,6 +792,12 @@ void InspectorInstrumentation::frameClearedScheduledNavigationImpl(Instrumenting
inspectorPageAgent->frameClearedScheduledNavigation(frame);
}
@@ -2102,7 +2101,7 @@ index 191cf8d0e2562c41d03c5830c8ee06b239a8fe89..0417261c688f9e032cba8de38142eafc
#if ENABLE(DARK_MODE_CSS) || HAVE(OS_DARK_MODE_SUPPORT)
void InspectorInstrumentation::defaultAppearanceDidChangeImpl(InstrumentingAgents& instrumentingAgents, bool useDarkAppearance)
{
-@@ -1315,6 +1318,36 @@ void InspectorInstrumentation::renderLayerDestroyedImpl(InstrumentingAgents& ins
+@@ -1320,6 +1323,36 @@ void InspectorInstrumentation::renderLayerDestroyedImpl(InstrumentingAgents& ins
layerTreeAgent->renderLayerDestroyed(renderLayer);
}
@@ -2139,7 +2138,7 @@ index 191cf8d0e2562c41d03c5830c8ee06b239a8fe89..0417261c688f9e032cba8de38142eafc
InstrumentingAgents& InspectorInstrumentation::instrumentingAgentsForWorkerGlobalScope(WorkerGlobalScope& workerGlobalScope)
{
return workerGlobalScope.inspectorController().m_instrumentingAgents;
-@@ -1326,6 +1359,13 @@ InstrumentingAgents& InspectorInstrumentation::instrumentingAgentsForPage(Page&
+@@ -1331,6 +1364,13 @@ InstrumentingAgents& InspectorInstrumentation::instrumentingAgentsForPage(Page&
return page.inspectorController().m_instrumentingAgents.get();
}
@@ -2154,7 +2153,7 @@ index 191cf8d0e2562c41d03c5830c8ee06b239a8fe89..0417261c688f9e032cba8de38142eafc
{
if (is<Document>(context))
diff --git a/Source/WebCore/inspector/InspectorInstrumentation.h b/Source/WebCore/inspector/InspectorInstrumentation.h
-index 730f33251dd0274404adef8f6f3fb6e09cd6fe29..c193eb96be720f1a055b242948f8b388f32c4d41 100644
+index 5ad79e0d16a9532b81c8b5af80aacace59869d1e..a42a5b0c224b979703366a16e97a3332a3471b55 100644
--- a/Source/WebCore/inspector/InspectorInstrumentation.h
+++ b/Source/WebCore/inspector/InspectorInstrumentation.h
@@ -31,6 +31,7 @@
@@ -2336,7 +2335,7 @@ index 730f33251dd0274404adef8f6f3fb6e09cd6fe29..c193eb96be720f1a055b242948f8b388
{
return context ? instrumentingAgentsForContext(*context) : nullptr;
diff --git a/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp b/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp
-index 34da9580ae4a86f49bc89b5678ea63c1998cf3d6..7364b36045427a3daa7321f9174fd9ce0fe2a8ff 100644
+index f6c83ea43b81e59816130269a28b1a6623b99854..69d4f43dc676e6c1fa08146ca704cf363b19f41f 100644
--- a/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp
+++ b/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp
@@ -61,12 +61,16 @@
@@ -2371,36 +2370,36 @@ index 34da9580ae4a86f49bc89b5678ea63c1998cf3d6..7364b36045427a3daa7321f9174fd9ce
#include "StaticNodeList.h"
#include "StyleProperties.h"
#include "StyleResolver.h"
-@@ -128,7 +135,8 @@ using namespace HTMLNames;
+@@ -129,7 +136,8 @@ using namespace HTMLNames;
static const size_t maxTextSize = 10000;
static const UChar ellipsisUChar[] = { 0x2026, 0 };
--static Color parseColor(const JSON::Object* colorObject)
+-static Color parseColor(RefPtr<JSON::Object>&& colorObject)
+// static
-+Color InspectorDOMAgent::parseColor(const JSON::Object* colorObject)
++Color InspectorDOMAgent::parseColor(RefPtr<JSON::Object>&& colorObject)
{
if (!colorObject)
return Color::transparentBlack;
-@@ -150,7 +158,7 @@ static Color parseConfigColor(const String& fieldName, const JSON::Object* confi
- RefPtr<JSON::Object> colorObject;
- configObject->getObject(fieldName, colorObject);
+@@ -148,7 +156,7 @@ static Color parseColor(RefPtr<JSON::Object>&& colorObject)
-- return parseColor(colorObject.get());
-+ return InspectorDOMAgent::parseColor(colorObject.get());
+ static Color parseConfigColor(const String& fieldName, JSON::Object& configObject)
+ {
+- return parseColor(configObject.getObject(fieldName));
++ return InspectorDOMAgent::parseColor(configObject.getObject(fieldName));
}
- static bool parseQuad(const JSON::Array& quadArray, FloatQuad* quad)
-@@ -431,6 +439,20 @@ Node* InspectorDOMAgent::assertNode(ErrorString& errorString, int nodeId)
+ static bool parseQuad(Ref<JSON::Array>&& quadArray, FloatQuad* quad)
+@@ -431,6 +439,20 @@ Node* InspectorDOMAgent::assertNode(Protocol::ErrorString& errorString, Protocol
return node;
}
-+Node* InspectorDOMAgent::assertNode(ErrorString& errorString, const int* nodeId, const String* objectId)
++Node* InspectorDOMAgent::assertNode(Protocol::ErrorString& errorString, Optional<Protocol::DOM::NodeId>&& nodeId, const String& objectId)
+{
+ Node* node = nullptr;
+ if (nodeId) {
+ node = assertNode(errorString, *nodeId);
-+ } else if (objectId) {
-+ node = nodeForObjectId(*objectId);
++ } else if (!!objectId) {
++ node = nodeForObjectId(objectId);
+ if (!node)
+ errorString = "Missing node for given objectId"_s;
+ } else
@@ -2408,39 +2407,39 @@ index 34da9580ae4a86f49bc89b5678ea63c1998cf3d6..7364b36045427a3daa7321f9174fd9ce
+ return node;
+}
+
- Document* InspectorDOMAgent::assertDocument(ErrorString& errorString, int nodeId)
+ Document* InspectorDOMAgent::assertDocument(Protocol::ErrorString& errorString, Protocol::DOM::NodeId nodeId)
{
Node* node = assertNode(errorString, nodeId);
-@@ -1334,16 +1356,7 @@ void InspectorDOMAgent::highlightSelector(ErrorString& errorString, const JSON::
-
- void InspectorDOMAgent::highlightNode(ErrorString& errorString, const JSON::Object& highlightInspectorObject, const int* nodeId, const String* objectId)
+@@ -1389,16 +1411,7 @@ Protocol::ErrorStringOr<void> InspectorDOMAgent::highlightSelector(Ref<JSON::Obj
+ Protocol::ErrorStringOr<void> InspectorDOMAgent::highlightNode(Ref<JSON::Object>&& highlightInspectorObject, Optional<Protocol::DOM::NodeId>&& nodeId, const Protocol::Runtime::RemoteObjectId& objectId)
{
+ Protocol::ErrorString errorString;
+-
- Node* node = nullptr;
- if (nodeId)
- node = assertNode(errorString, *nodeId);
-- else if (objectId) {
-- node = nodeForObjectId(*objectId);
-- if (!node)
-- errorString = "Missing node for given objectId"_s;
+- else if (!!objectId) {
+- node = nodeForObjectId(objectId);
+- errorString = "Missing node for given objectId"_s;
- } else
- errorString = "Either nodeId or objectId must be specified"_s;
-
-+ Node* node = assertNode(errorString, nodeId, objectId);
++ Node* node = assertNode(errorString, WTFMove(nodeId), objectId);
if (!node)
- return;
+ return makeUnexpected(errorString);
-@@ -1491,18 +1504,147 @@ void InspectorDOMAgent::setInspectedNode(ErrorString& errorString, int nodeId)
- m_suppressEventListenerChangedEvent = false;
+@@ -1560,15 +1573,137 @@ Protocol::ErrorStringOr<void> InspectorDOMAgent::setInspectedNode(Protocol::DOM:
+ return { };
}
--void InspectorDOMAgent::resolveNode(ErrorString& errorString, int nodeId, const String* objectGroup, RefPtr<Inspector::Protocol::Runtime::RemoteObject>& result)
+-Protocol::ErrorStringOr<Ref<Protocol::Runtime::RemoteObject>> InspectorDOMAgent::resolveNode(Protocol::DOM::NodeId nodeId, const String& objectGroup)
+static FloatPoint contentsToRootView(FrameView& containingView, const FloatPoint& point)
{
-- String objectGroupName = objectGroup ? *objectGroup : emptyString();
-- Node* node = assertNode(errorString, nodeId);
+- Protocol::ErrorString errorString;
+ return containingView.convertToRootView(point - toFloatSize(containingView.documentScrollPositionRelativeToViewOrigin()));
+}
-+
+
+- Node* node = assertNode(errorString, nodeId);
+static void frameQuadToViewport(FrameView& containingView, FloatQuad& quad, float pageScaleFactor)
+{
+ // Return css (not dip) coordinates by scaling back.
@@ -2450,7 +2449,7 @@ index 34da9580ae4a86f49bc89b5678ea63c1998cf3d6..7364b36045427a3daa7321f9174fd9ce
+ quad.setP4(contentsToRootView(containingView, quad.p4()).scaled(1 / pageScaleFactor));
+}
+
-+static RefPtr<Inspector::Protocol::DOM::Quad> buildObjectForQuad(const FloatQuad& quad)
++static Ref<Inspector::Protocol::DOM::Quad> buildObjectForQuad(const FloatQuad& quad)
+{
+ auto result = Inspector::Protocol::DOM::Quad::create();
+ result->addItem(quad.p1().x());
@@ -2464,7 +2463,7 @@ index 34da9580ae4a86f49bc89b5678ea63c1998cf3d6..7364b36045427a3daa7321f9174fd9ce
+ return result;
+}
+
-+static RefPtr<JSON::ArrayOf<Inspector::Protocol::DOM::Quad>> buildArrayOfQuads(const Vector<FloatQuad>& quads)
++static Ref<JSON::ArrayOf<Inspector::Protocol::DOM::Quad>> buildArrayOfQuads(const Vector<FloatQuad>& quads)
+{
+ auto result = JSON::ArrayOf<Inspector::Protocol::DOM::Quad>::create();
+ for (const auto& quad : quads)
@@ -2472,127 +2471,115 @@ index 34da9580ae4a86f49bc89b5678ea63c1998cf3d6..7364b36045427a3daa7321f9174fd9ce
+ return result;
+}
+
-+void InspectorDOMAgent::describeNode(ErrorString& errorString, const String& objectId, Optional<String>& contentFrameId, Optional<String>& ownerFrameId)
++Inspector::Protocol::ErrorStringOr<std::tuple<String /* contentFrameId */, String /* ownerFrameId */>> InspectorDOMAgent::describeNode(const String& objectId)
+{
+ Node* node = nodeForObjectId(objectId);
-+ if (!node) {
-+ errorString = "Node not found"_s;
-+ return;
-+ }
++ if (!node)
++ return makeUnexpected("Node not found"_s);
+
+ auto* pageAgent = m_instrumentingAgents.enabledPageAgent();
-+ if (!pageAgent) {
-+ errorString = "Page agent must be enabled"_s;
-+ return;
-+ }
++ if (!pageAgent)
++ return makeUnexpected("Page agent must be enabled"_s);
+
++ String ownerFrameId;
+ String frameId = pageAgent->frameId(node->document().frame());
+ if (!frameId.isEmpty())
+ ownerFrameId = frameId;
+
++ String contentFrameId;
+ if (is<HTMLFrameOwnerElement>(*node)) {
+ const auto& frameOwner = downcast<HTMLFrameOwnerElement>(*node);
+ String frameId = pageAgent->frameId(frameOwner.contentFrame());
+ if (!frameId.isEmpty())
+ contentFrameId = frameId;
+ }
++
++ return { { contentFrameId, ownerFrameId } };
+}
+
-+void InspectorDOMAgent::scrollIntoViewIfNeeded(ErrorString& errorString, const String& objectId, const JSON::Object* rect)
++Protocol::ErrorStringOr<void> InspectorDOMAgent::scrollIntoViewIfNeeded(const String& objectId, RefPtr<JSON::Object>&& rect)
+{
+ Node* node = nodeForObjectId(objectId);
-+ if (!node) {
-+ errorString = "Node not found"_s;
-+ return;
-+ }
++ if (!node)
++ return makeUnexpected("Node not found"_s);
++
+ m_inspectedPage.updateRendering();
-+ if (!node->isConnected()) {
-+ errorString = "Node is detached from document"_s;
-+ return;
-+ }
++ if (!node->isConnected())
++ return makeUnexpected("Node is detached from document"_s);
++
+ RenderObject* renderer = node->renderer();
-+ if (!renderer) {
-+ errorString = "Node does not have a layout object"_s;
-+ return;
-+ }
++ if (!renderer)
++ return makeUnexpected("Node does not have a layout object"_s);
++
+ bool insideFixed;
+ LayoutRect absoluteBounds = renderer->absoluteBoundingBoxRect(true, &insideFixed);
+ if (rect) {
-+ double x = 0.0;
-+ double y = 0.0;
-+ double width = 0.0;
-+ double height = 0.0;
-+ if (!rect->getDouble("x", x) || !rect->getDouble("y", y) || !rect->getDouble("width", width) || !rect->getDouble("height", height)) {
-+ errorString = "Malformed rect"_s;
-+ return;
-+ }
-+ absoluteBounds.setX(absoluteBounds.x() + LayoutUnit(x));
-+ absoluteBounds.setY(absoluteBounds.y() + LayoutUnit(y));
-+ absoluteBounds.setWidth(LayoutUnit(std::max(width, 1.0)));
-+ absoluteBounds.setHeight(LayoutUnit(std::max(height, 1.0)));
++ Optional<double> x = rect->getDouble("x");
++ Optional<double> y = rect->getDouble("y");
++ Optional<double> width = rect->getDouble("width");
++ Optional<double> height = rect->getDouble("height");
++ if (!x || !y || !width || !height)
++ return makeUnexpected("Malformed rect"_s);
++
++ absoluteBounds.setX(absoluteBounds.x() + LayoutUnit(*x));
++ absoluteBounds.setY(absoluteBounds.y() + LayoutUnit(*y));
++ absoluteBounds.setWidth(LayoutUnit(std::max(*width, 1.0)));
++ absoluteBounds.setHeight(LayoutUnit(std::max(*height, 1.0)));
+ }
+ // Note: we should use ScrollAlignment::alignCenterIfNotVisible, but
+ // RenderLayer insists on no horizontal scroll if enough of the rect is visible.
+ ScrollAlignment alignment = ScrollAlignment::alignCenterAlways;
+ renderer->scrollRectToVisible(absoluteBounds, insideFixed, { SelectionRevealMode::Reveal, alignment, alignment, ShouldAllowCrossOriginScrolling::Yes });
++ return { };
+}
+
-+void InspectorDOMAgent::getContentQuads(ErrorString& errorString, const String& objectId, RefPtr<JSON::ArrayOf<Inspector::Protocol::DOM::Quad>>& contentQuads)
++Protocol::ErrorStringOr<Ref<JSON::ArrayOf<Protocol::DOM::Quad>>> InspectorDOMAgent::getContentQuads(const String& objectId)
+{
+ Node* node = nodeForObjectId(objectId);
-+ if (!node) {
-+ errorString = "Node not found"_s;
-+ return;
-+ }
++ if (!node)
++ return makeUnexpected("Node not found"_s);
++
+ RenderObject* renderer = node->renderer();
-+ if (!renderer) {
-+ errorString = "Node doesn't have renderer"_s;
-+ return;
-+ }
++ if (!renderer)
++ return makeUnexpected("Node doesn't have renderer"_s);
+
+ // Ensure quads are up to date.
+ m_inspectedPage.updateRendering();
+
+ Frame* containingFrame = renderer->document().frame();
+ FrameView* containingView = containingFrame ? containingFrame->view() : nullptr;
-+ if (!containingView) {
-+ errorString = "Internal error: no containing view"_s;
-+ return;
-+ }
++ if (!containingView)
++ return makeUnexpected("Internal error: no containing view"_s);
++
+ Vector<FloatQuad> quads;
+ renderer->absoluteQuads(quads);
+ for (auto& quad : quads)
+ frameQuadToViewport(*containingView, quad, m_inspectedPage.pageScaleFactor());
-+ contentQuads = buildArrayOfQuads(quads);
++ return buildArrayOfQuads(quads);
+}
+
-+void InspectorDOMAgent::resolveNode(ErrorString& errorString, const int* nodeId, const String* objectId, const int* contextId, const String* objectGroup, RefPtr<Inspector::Protocol::Runtime::RemoteObject>& result)
++Protocol::ErrorStringOr<Ref<Protocol::Runtime::RemoteObject>> InspectorDOMAgent::resolveNode(Optional<Inspector::Protocol::DOM::NodeId>&& nodeId, const String& objectId, Optional<int>&& contextId, const String& objectGroup)
+{
-+ Node* node = assertNode(errorString, nodeId, objectId);
++ Protocol::ErrorString errorString;
++ Node* node = assertNode(errorString, WTFMove(nodeId), objectId);
if (!node)
- return;
-- RefPtr<Inspector::Protocol::Runtime::RemoteObject> object = resolveNode(node, objectGroupName);
-- if (!object) {
-+ String objectGroupName = objectGroup ? *objectGroup : emptyString();
-+ result = resolveNode(node, objectGroupName, contextId);
-+ if (!result) {
- errorString = "Missing injected script for given nodeId"_s;
- return;
- }
-- result = object;
- }
+ return makeUnexpected(errorString);
+
+- auto object = resolveNode(node, objectGroup);
++ auto object = resolveNode(node, objectGroup, WTFMove(contextId));
+ if (!object)
+ return makeUnexpected("Missing injected script for given nodeId"_s);
- void InspectorDOMAgent::getAttributes(ErrorString& errorString, int nodeId, RefPtr<JSON::ArrayOf<String>>& result)
-@@ -2667,7 +2809,7 @@ void InspectorDOMAgent::pushNodeByPathToFrontend(ErrorString& errorString, const
- errorString = "Missing node for given path"_s;
+@@ -2759,7 +2894,7 @@ Protocol::ErrorStringOr<Protocol::DOM::NodeId> InspectorDOMAgent::pushNodeByPath
+ return makeUnexpected("Missing node for given path"_s);
}
--RefPtr<Inspector::Protocol::Runtime::RemoteObject> InspectorDOMAgent::resolveNode(Node* node, const String& objectGroup)
-+RefPtr<Inspector::Protocol::Runtime::RemoteObject> InspectorDOMAgent::resolveNode(Node* node, const String& objectGroup, const int* contextId)
+-RefPtr<Protocol::Runtime::RemoteObject> InspectorDOMAgent::resolveNode(Node* node, const String& objectGroup)
++RefPtr<Inspector::Protocol::Runtime::RemoteObject> InspectorDOMAgent::resolveNode(Node* node, const String& objectGroup, Optional<int>&& contextId)
{
Document* document = &node->document();
if (auto* templateHost = document->templateDocumentHost())
-@@ -2676,12 +2818,16 @@ RefPtr<Inspector::Protocol::Runtime::RemoteObject> InspectorDOMAgent::resolveNod
+@@ -2768,12 +2903,16 @@ RefPtr<Protocol::Runtime::RemoteObject> InspectorDOMAgent::resolveNode(Node* nod
if (!frame)
return nullptr;
@@ -2612,58 +2599,54 @@ index 34da9580ae4a86f49bc89b5678ea63c1998cf3d6..7364b36045427a3daa7321f9174fd9ce
}
Node* InspectorDOMAgent::scriptValueAsNode(JSC::JSValue value)
-@@ -2702,4 +2848,46 @@ void InspectorDOMAgent::setAllowEditingUserAgentShadowTrees(ErrorString&, bool a
- m_allowEditingUserAgentShadowTrees = allow;
+@@ -2796,4 +2935,42 @@ Protocol::ErrorStringOr<void> InspectorDOMAgent::setAllowEditingUserAgentShadowT
+ return { };
}
-+void InspectorDOMAgent::setInputFiles(ErrorString& errorString, const String& objectId, const JSON::Array& files) {
++Protocol::ErrorStringOr<void> InspectorDOMAgent::setInputFiles(const String& objectId, Ref<JSON::Array>&& files) {
+ InjectedScript injectedScript = m_injectedScriptManager.injectedScriptForObjectId(objectId);
-+ if (injectedScript.hasNoValue()) {
-+ errorString = "Can not find element's context for given id"_s;
-+ return;
-+ }
++ if (injectedScript.hasNoValue())
++ return makeUnexpected("Can not find element's context for given id"_s);
++
+ Node* node = scriptValueAsNode(injectedScript.findObjectById(objectId));
-+ if (!node) {
-+ errorString = "Can not find element for given id"_s;
-+ return;
-+ }
-+ if (node->nodeType() != Node::ELEMENT_NODE || node->nodeName() != "INPUT") {
-+ errorString = "Not an input node"_s;
-+ return;
-+ }
++ if (!node)
++ return makeUnexpected("Can not find element for given id"_s);
++
++ if (node->nodeType() != Node::ELEMENT_NODE || node->nodeName() != "INPUT")
++ return makeUnexpected("Not an input node"_s);
++
+ HTMLInputElement* element = static_cast<HTMLInputElement*>(node);
+ Vector<Ref<File>> fileObjects;
-+ for (unsigned i = 0; i < files.length(); ++i) {
-+ RefPtr<JSON::Value> item = files.get(i);
-+ RefPtr<JSON::Object> obj;
-+ if (!item->asObject(obj)) {
-+ errorString = "Invalid file payload format"_s;
-+ return;
-+ }
++ for (unsigned i = 0; i < files->length(); ++i) {
++ RefPtr<JSON::Value> item = files->get(i);
++ RefPtr<JSON::Object> obj = item->asObject();
++ if (!obj)
++ return makeUnexpected("Invalid file payload format"_s);
++
+ String name;
+ String type;
+ String data;
-+ if (!obj->getString("name", name) || !obj->getString("type", type) || !obj->getString("data", data)) {
-+ errorString = "Invalid file payload format"_s;
-+ return;
-+ }
++ if (!obj->getString("name", name) || !obj->getString("type", type) || !obj->getString("data", data))
++ return makeUnexpected("Invalid file payload format"_s);
++
+ Vector<uint8_t> buffer;
-+ if (!base64Decode(data, buffer)) {
-+ errorString = "Unable to decode given content"_s;
-+ return;
-+ }
-+ fileObjects.append(File::create(Blob::create(SharedBuffer::create(WTFMove(buffer)), type), name));
++ if (!base64Decode(data, buffer))
++ return makeUnexpected("Unable to decode given content"_s);
++
++ ScriptExecutionContext* context = element->scriptExecutionContext();
++ fileObjects.append(File::create(context, Blob::create(context, SharedBuffer::create(WTFMove(buffer)), type), name));
+ }
+ RefPtr<FileList> fileList = FileList::create(WTFMove(fileObjects));
+ element->setFiles(WTFMove(fileList));
++ return { };
+}
+
} // namespace WebCore
diff --git a/Source/WebCore/inspector/agents/InspectorDOMAgent.h b/Source/WebCore/inspector/agents/InspectorDOMAgent.h
-index 7e6d3f68d3d60caf3d3a01acc380a2605f42d6e3..426716243b178543bc96799401a0a1ce6d6db26a 100644
+index 7f2872df49e0d40ab020cd9884ded00308f1a2a6..d29615ad8f2dedcadd4ee2dd422f53ff3858f9e1 100644
--- a/Source/WebCore/inspector/agents/InspectorDOMAgent.h
+++ b/Source/WebCore/inspector/agents/InspectorDOMAgent.h
-@@ -54,6 +54,7 @@ namespace WebCore {
+@@ -55,6 +55,7 @@ namespace WebCore {
class AXCoreObject;
class CharacterData;
@@ -2671,72 +2654,69 @@ index 7e6d3f68d3d60caf3d3a01acc380a2605f42d6e3..426716243b178543bc96799401a0a1ce
class DOMEditor;
class Document;
class Element;
-@@ -88,6 +89,7 @@ public:
+@@ -87,6 +88,7 @@ public:
static String toErrorString(Exception&&);
static String documentURLString(Document*);
-+ static Color parseColor(const JSON::Object*);
++ static Color parseColor(RefPtr<JSON::Object>&&);
// We represent embedded doms as a part of the same hierarchy. Hence we treat children of frame owners differently.
// We also skip whitespace text nodes conditionally. Following methods encapsulate these specifics.
-@@ -131,7 +133,7 @@ public:
- void performSearch(ErrorString&, const String& query, const JSON::Array* nodeIds, const bool* caseSensitive, String* searchId, int* resultCount) override;
- void getSearchResults(ErrorString&, const String& searchId, int fromIndex, int toIndex, RefPtr<JSON::ArrayOf<int>>&) override;
- void discardSearchResults(ErrorString&, const String& searchId) override;
-- void resolveNode(ErrorString&, int nodeId, const String* objectGroup, RefPtr<Inspector::Protocol::Runtime::RemoteObject>& result) override;
-+ void resolveNode(ErrorString&, const int* nodeId, const String* objectId, const int* contextId, const String* objectGroup, RefPtr<Inspector::Protocol::Runtime::RemoteObject>& result) override;
- void getAttributes(ErrorString&, int nodeId, RefPtr<JSON::ArrayOf<String>>& result) override;
+@@ -130,7 +132,7 @@ public:
+ Inspector::Protocol::ErrorStringOr<std::tuple<String /* searchId */, int /* resultCount */>> performSearch(const String& query, RefPtr<JSON::Array>&& nodeIds, Optional<bool>&& caseSensitive);
+ Inspector::Protocol::ErrorStringOr<Ref<JSON::ArrayOf<Inspector::Protocol::DOM::NodeId>>> getSearchResults(const String& searchId, int fromIndex, int toIndex);
+ Inspector::Protocol::ErrorStringOr<void> discardSearchResults(const String& searchId);
+- Inspector::Protocol::ErrorStringOr<Ref<Inspector::Protocol::Runtime::RemoteObject>> resolveNode(Inspector::Protocol::DOM::NodeId, const String& objectGroup);
++ Inspector::Protocol::ErrorStringOr<Ref<Inspector::Protocol::Runtime::RemoteObject>> resolveNode(Optional<Inspector::Protocol::DOM::NodeId>&& nodeId, const String& objectId, Optional<int>&& contextId, const String& objectGroup) override;
+ Inspector::Protocol::ErrorStringOr<Ref<JSON::ArrayOf<String>>> getAttributes(Inspector::Protocol::DOM::NodeId);
#if PLATFORM(IOS_FAMILY)
- void setInspectModeEnabled(ErrorString&, bool enabled, const JSON::Object* highlightConfig) override;
-@@ -154,6 +156,10 @@ public:
- void focus(ErrorString&, int nodeId) override;
- void setInspectedNode(ErrorString&, int nodeId) override;
- void setAllowEditingUserAgentShadowTrees(ErrorString&, bool allow) final;
-+ void describeNode(ErrorString&, const String& objectId, Optional<String>& contentFrameId, Optional<String>& ownerFrameId) override;
-+ void scrollIntoViewIfNeeded(ErrorString&, const String& objectId, const JSON::Object* rect) override;
-+ void getContentQuads(ErrorString&, const String& objectId, RefPtr<JSON::ArrayOf<Inspector::Protocol::DOM::Quad>>&) override;
-+ void setInputFiles(ErrorString&, const String& objectId, const JSON::Array& files) override;
+ Inspector::Protocol::ErrorStringOr<void> setInspectModeEnabled(bool, RefPtr<JSON::Object>&& highlightConfig);
+@@ -153,6 +155,10 @@ public:
+ Inspector::Protocol::ErrorStringOr<void> focus(Inspector::Protocol::DOM::NodeId);
+ Inspector::Protocol::ErrorStringOr<void> setInspectedNode(Inspector::Protocol::DOM::NodeId);
+ Inspector::Protocol::ErrorStringOr<void> setAllowEditingUserAgentShadowTrees(bool);
++ Inspector::Protocol::ErrorStringOr<std::tuple<String /* contentFrameId */, String /* ownerFrameId */>> describeNode(const String& objectId) override;
++ Inspector::Protocol::ErrorStringOr<void> scrollIntoViewIfNeeded(const String& objectId, RefPtr<JSON::Object>&& rect) override;
++ Inspector::Protocol::ErrorStringOr<Ref<JSON::ArrayOf<Inspector::Protocol::DOM::Quad>>> getContentQuads(const String& objectId) override;
++ Inspector::Protocol::ErrorStringOr<void> setInputFiles(const String& objectId, Ref<JSON::Array>&& files) override;
// InspectorInstrumentation
- int identifierForNode(Node&);
-@@ -191,7 +197,7 @@ public:
- Node* nodeForId(int nodeId);
- int boundNodeId(const Node*);
+ Inspector::Protocol::DOM::NodeId identifierForNode(Node&);
+@@ -190,7 +196,7 @@ public:
+ Node* nodeForId(Inspector::Protocol::DOM::NodeId);
+ Inspector::Protocol::DOM::NodeId boundNodeId(const Node*);
- RefPtr<Inspector::Protocol::Runtime::RemoteObject> resolveNode(Node*, const String& objectGroup);
-+ RefPtr<Inspector::Protocol::Runtime::RemoteObject> resolveNode(Node*, const String& objectGroup, const int* contextId);
++ RefPtr<Inspector::Protocol::Runtime::RemoteObject> resolveNode(Node*, const String& objectGroup, Optional<int>&& contextId);
bool handleMousePress();
void mouseDidMoveOverElement(const HitTestResult&, unsigned modifierFlags);
void inspect(Node*);
-@@ -202,12 +208,15 @@ public:
+@@ -201,12 +207,15 @@ public:
void reset();
- Node* assertNode(ErrorString&, int nodeId);
-+ Node* assertNode(ErrorString&, const int* nodeId, const String* objectId);
- Element* assertElement(ErrorString&, int nodeId);
- Document* assertDocument(ErrorString&, int nodeId);
+ Node* assertNode(Inspector::Protocol::ErrorString&, Inspector::Protocol::DOM::NodeId);
++ Node* assertNode(Inspector::Protocol::ErrorString&, Optional<Inspector::Protocol::DOM::NodeId>&& nodeId, const String& objectId);
+ Element* assertElement(Inspector::Protocol::ErrorString&, Inspector::Protocol::DOM::NodeId);
+ Document* assertDocument(Inspector::Protocol::ErrorString&, Inspector::Protocol::DOM::NodeId);
- bool hasBreakpointForEventListener(EventTarget&, const AtomString& eventType, EventListener&, bool capture);
- int idForEventListener(EventTarget&, const AtomString& eventType, EventListener&, bool capture);
+ RefPtr<JSC::Breakpoint> breakpointForEventListener(EventTarget&, const AtomString& eventType, EventListener&, bool capture);
+ Inspector::Protocol::DOM::EventListenerId idForEventListener(EventTarget&, const AtomString& eventType, EventListener&, bool capture);
-+ Node* nodeForObjectId(const String& objectId);
++ Node* nodeForObjectId(const Inspector::Protocol::Runtime::RemoteObjectId&);
+
private:
#if ENABLE(VIDEO)
void mediaMetricsTimerFired();
-@@ -234,9 +243,8 @@ private:
- Ref<Inspector::Protocol::DOM::EventListener> buildObjectForEventListener(const RegisteredEventListener&, int identifier, EventTarget&, const AtomString& eventType, bool disabled, bool hasBreakpoint);
- RefPtr<Inspector::Protocol::DOM::AccessibilityProperties> buildObjectForAccessibilityProperties(Node*);
- void processAccessibilityChildren(AXCoreObject&, JSON::ArrayOf<int>&);
--
-+
+@@ -235,7 +244,6 @@ private:
+ void processAccessibilityChildren(AXCoreObject&, JSON::ArrayOf<Inspector::Protocol::DOM::NodeId>&);
+
Node* nodeForPath(const String& path);
-- Node* nodeForObjectId(const String& objectId);
+- Node* nodeForObjectId(const Inspector::Protocol::Runtime::RemoteObjectId&);
void discardBindings();
diff --git a/Source/WebCore/inspector/agents/InspectorDOMStorageAgent.h b/Source/WebCore/inspector/agents/InspectorDOMStorageAgent.h
-index ddbb5d5347f3beabe3cfab201d6838c896d21e39..25f1798cad5a4ef135a27d3bd5146798d1077a13 100644
+index 3386cb879f1178c1b9635775c9a0e864f5b94c52..d2350182f5f061855e8ca172779ad60ee73b39fb 100644
--- a/Source/WebCore/inspector/agents/InspectorDOMStorageAgent.h
+++ b/Source/WebCore/inspector/agents/InspectorDOMStorageAgent.h
@@ -40,6 +40,7 @@ class DOMStorageFrontendDispatcher;
@@ -2748,7 +2728,7 @@ index ddbb5d5347f3beabe3cfab201d6838c896d21e39..25f1798cad5a4ef135a27d3bd5146798
class Page;
class SecurityOrigin;
diff --git a/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp b/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp
-index 8d0382593dd9d4d48376eb807e80b654fd11d1d4..f6b1618da3436d0811169012dd7449b08954b484 100644
+index 575382e4390dd31dbf404fc72662b2206071c7e8..e8d30e12a11b8d24d39c8201375f09b9b108a65b 100644
--- a/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp
+++ b/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp
@@ -45,6 +45,7 @@
@@ -2767,7 +2747,7 @@ index 8d0382593dd9d4d48376eb807e80b654fd11d1d4..f6b1618da3436d0811169012dd7449b0
#include "Page.h"
#include "PlatformStrategies.h"
#include "ProgressTracker.h"
-@@ -486,8 +488,14 @@ static InspectorPageAgent::ResourceType resourceTypeForLoadType(InspectorInstrum
+@@ -490,8 +492,14 @@ static InspectorPageAgent::ResourceType resourceTypeForLoadType(InspectorInstrum
void InspectorNetworkAgent::willSendRequest(unsigned long identifier, DocumentLoader* loader, ResourceRequest& request, const ResourceResponse& redirectResponse)
{
@@ -2784,29 +2764,27 @@ index 8d0382593dd9d4d48376eb807e80b654fd11d1d4..f6b1618da3436d0811169012dd7449b0
}
void InspectorNetworkAgent::willSendRequestOfType(unsigned long identifier, DocumentLoader* loader, ResourceRequest& request, InspectorInstrumentation::LoadType loadType)
-@@ -1095,8 +1103,7 @@ bool InspectorNetworkAgent::willIntercept(const ResourceRequest& request)
+@@ -1105,8 +1113,7 @@ bool InspectorNetworkAgent::willIntercept(const ResourceRequest& request)
if (!m_interceptionEnabled)
return false;
-- return shouldIntercept(request.url(), NetworkStage::Request)
-- || shouldIntercept(request.url(), NetworkStage::Response);
-+ return shouldIntercept(request.url(), NetworkStage::Response);
+- return shouldIntercept(request.url(), Protocol::Network::NetworkStage::Request)
+- || shouldIntercept(request.url(), Protocol::Network::NetworkStage::Response);
++ return shouldIntercept(request.url(), Protocol::Network::NetworkStage::Response);
}
bool InspectorNetworkAgent::shouldInterceptRequest(const ResourceRequest& request)
-@@ -1180,6 +1187,11 @@ void InspectorNetworkAgent::interceptWithRequest(ErrorString& errorString, const
- }
+@@ -1189,6 +1196,9 @@ Protocol::ErrorStringOr<void> InspectorNetworkAgent::interceptWithRequest(const
+ return makeUnexpected("Missing pending intercept request for given requestId"_s);
auto& loader = *pendingRequest->m_loader;
-+ if (loader.reachedTerminalState()) {
-+ errorString = "Unable to intercept request, it has already been processed"_s;
-+ return;
-+ }
++ if (loader.reachedTerminalState())
++ return makeUnexpected("Unable to intercept request, it has already been processed"_s);
+
ResourceRequest request = loader.request();
- if (url)
- request.setURL(URL({ }, *url));
-@@ -1292,6 +1304,8 @@ void InspectorNetworkAgent::interceptRequestWithResponse(ErrorString& errorStrin
+ if (!!url)
+ request.setURL(URL({ }, url));
+@@ -1292,6 +1302,8 @@ Protocol::ErrorStringOr<void> InspectorNetworkAgent::interceptRequestWithRespons
response.setHTTPHeaderFields(WTFMove(explicitHeaders));
response.setHTTPHeaderField(HTTPHeaderName::ContentType, response.mimeType());
loader->didReceiveResponse(response, [loader, buffer = data.releaseNonNull()]() mutable {
@@ -2815,19 +2793,20 @@ index 8d0382593dd9d4d48376eb807e80b654fd11d1d4..f6b1618da3436d0811169012dd7449b0
if (buffer->size())
loader->didReceiveBuffer(WTFMove(buffer), buffer->size(), DataPayloadWholeResource);
loader->didFinishLoading(NetworkLoadMetrics());
-@@ -1336,6 +1350,11 @@ void InspectorNetworkAgent::interceptRequestWithError(ErrorString& errorString,
- loader.didFail(error);
+@@ -1332,6 +1344,12 @@ Protocol::ErrorStringOr<void> InspectorNetworkAgent::interceptRequestWithError(c
+ return { };
}
-+void InspectorNetworkAgent::setEmulateOfflineState(ErrorString&, bool offline)
++Inspector::Protocol::ErrorStringOr<void> InspectorNetworkAgent::setEmulateOfflineState(bool offline)
+{
+ platformStrategies()->loaderStrategy()->setEmulateOfflineState(offline);
++ return { };
+}
+
bool InspectorNetworkAgent::shouldTreatAsText(const String& mimeType)
{
return startsWithLettersIgnoringASCIICase(mimeType, "text/")
-@@ -1377,6 +1396,12 @@ Optional<String> InspectorNetworkAgent::textContentForCachedResource(CachedResou
+@@ -1373,6 +1391,12 @@ Optional<String> InspectorNetworkAgent::textContentForCachedResource(CachedResou
return WTF::nullopt;
}
@@ -2841,10 +2820,10 @@ index 8d0382593dd9d4d48376eb807e80b654fd11d1d4..f6b1618da3436d0811169012dd7449b0
{
ASSERT(result);
diff --git a/Source/WebCore/inspector/agents/InspectorNetworkAgent.h b/Source/WebCore/inspector/agents/InspectorNetworkAgent.h
-index 3440e71a5ed5ef384620a9f62803751e983db5b1..45e0df5e6d92626ae112d92cffdd745516e4d137 100644
+index 933601761667417ebe5de301586869ccc64fc3da..f63a95c3c45980d5606971b83881e8245df11403 100644
--- a/Source/WebCore/inspector/agents/InspectorNetworkAgent.h
+++ b/Source/WebCore/inspector/agents/InspectorNetworkAgent.h
-@@ -73,6 +73,7 @@ public:
+@@ -71,6 +71,7 @@ public:
static Ref<TextResourceDecoder> createTextDecoder(const String& mimeType, const String& textEncodingName);
static Optional<String> textContentForCachedResource(CachedResource&);
static bool cachedResourceContent(CachedResource&, String* result, bool* base64Encoded);
@@ -2852,16 +2831,16 @@ index 3440e71a5ed5ef384620a9f62803751e983db5b1..45e0df5e6d92626ae112d92cffdd7455
// InspectorAgentBase
void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*) final;
-@@ -126,6 +127,7 @@ public:
- bool shouldInterceptResponse(const ResourceResponse&);
- void interceptResponse(const ResourceResponse&, unsigned long identifier, CompletionHandler<void(const ResourceResponse&, RefPtr<SharedBuffer>)>&&);
- void interceptRequest(ResourceLoader&, Function<void(const ResourceRequest&)>&&);
-+ void setEmulateOfflineState(ErrorString&, bool offline) final;
-
- void searchOtherRequests(const JSC::Yarr::RegularExpression&, RefPtr<JSON::ArrayOf<Inspector::Protocol::Page::SearchResult>>&);
- void searchInRequest(ErrorString&, const String& requestId, const String& query, bool caseSensitive, bool isRegex, RefPtr<JSON::ArrayOf<Inspector::Protocol::GenericTypes::SearchMatch>>&);
+@@ -93,6 +94,7 @@ public:
+ Inspector::Protocol::ErrorStringOr<void> interceptWithResponse(const Inspector::Protocol::Network::RequestId&, const String& content, bool base64Encoded, const String& mimeType, Optional<int>&& status, const String& statusText, RefPtr<JSON::Object>&& headers) final;
+ Inspector::Protocol::ErrorStringOr<void> interceptRequestWithResponse(const Inspector::Protocol::Network::RequestId&, const String& content, bool base64Encoded, const String& mimeType, int status, const String& statusText, Ref<JSON::Object>&& headers) final;
+ Inspector::Protocol::ErrorStringOr<void> interceptRequestWithError(const Inspector::Protocol::Network::RequestId&, Inspector::Protocol::Network::ResourceErrorType) final;
++ Inspector::Protocol::ErrorStringOr<void> setEmulateOfflineState(bool offline) final;
+
+ // InspectorInstrumentation
+ void willRecalculateStyle();
diff --git a/Source/WebCore/inspector/agents/InspectorPageAgent.cpp b/Source/WebCore/inspector/agents/InspectorPageAgent.cpp
-index 539e8105b66e7b2a6a05571a1e1c8cd6bdf27c90..d7d6fd1449e006abb47cd7e279bdc6a9ccf58444 100644
+index ae25fcebc93d504bb0abf17b61bbe1d73efcc1e3..9d0cc967efe17c6fc94e694d8806e1c41f6705be 100644
--- a/Source/WebCore/inspector/agents/InspectorPageAgent.cpp
+++ b/Source/WebCore/inspector/agents/InspectorPageAgent.cpp
@@ -32,19 +32,25 @@
@@ -2936,14 +2915,14 @@ index 539e8105b66e7b2a6a05571a1e1c8cd6bdf27c90..d7d6fd1449e006abb47cd7e279bdc6a9
static bool decodeBuffer(const char* buffer, unsigned size, const String& textEncodingName, String* result)
{
if (buffer) {
-@@ -236,6 +255,8 @@ Inspector::Protocol::Page::ResourceType InspectorPageAgent::resourceTypeJSON(Ins
- return Inspector::Protocol::Page::ResourceType::Beacon;
+@@ -236,6 +255,8 @@ Protocol::Page::ResourceType InspectorPageAgent::resourceTypeJSON(InspectorPageA
+ return Protocol::Page::ResourceType::Beacon;
case WebSocketResource:
- return Inspector::Protocol::Page::ResourceType::WebSocket;
+ return Protocol::Page::ResourceType::WebSocket;
+ case EventSource:
-+ return Inspector::Protocol::Page::ResourceType::EventSource;
++ return Protocol::Page::ResourceType::EventSource;
case OtherResource:
- return Inspector::Protocol::Page::ResourceType::Other;
+ return Protocol::Page::ResourceType::Other;
#if ENABLE(APPLICATION_MANIFEST)
@@ -325,6 +346,7 @@ InspectorPageAgent::InspectorPageAgent(PageAgentContext& context, InspectorClien
, m_frontendDispatcher(makeUnique<Inspector::PageFrontendDispatcher>(context.frontendRouter))
@@ -2953,48 +2932,52 @@ index 539e8105b66e7b2a6a05571a1e1c8cd6bdf27c90..d7d6fd1449e006abb47cd7e279bdc6a9
, m_client(client)
, m_overlay(overlay)
{
-@@ -358,11 +380,20 @@ void InspectorPageAgent::enable(ErrorString& errorString)
- #if ENABLE(DARK_MODE_CSS) || HAVE(OS_DARK_MODE_SUPPORT)
+@@ -356,12 +378,20 @@ Protocol::ErrorStringOr<void> InspectorPageAgent::enable()
defaultAppearanceDidChange(m_inspectedPage.defaultUseDarkAppearance());
#endif
-+
+
+ if (!createdUserWorlds().isEmpty()) {
+ Vector<DOMWrapperWorld*> worlds;
+ for (const auto& world : createdUserWorlds().values())
+ worlds.append(world.ptr());
+ ensureUserWorldsExistInAllFrames(worlds);
+ }
+ return { };
}
- void InspectorPageAgent::disable(ErrorString&)
+ Protocol::ErrorStringOr<void> InspectorPageAgent::disable()
{
m_instrumentingAgents.setEnabledPageAgent(nullptr);
+ m_interceptFileChooserDialog = false;
+ m_bypassCSP = false;
- ErrorString unused;
- setShowPaintRects(unused, false);
-@@ -412,6 +443,18 @@ void InspectorPageAgent::reload(ErrorString&, const bool* optionalReloadFromOrig
- m_inspectedPage.mainFrame().loader().reload(reloadOptions);
+ setShowPaintRects(false);
+ #if !PLATFORM(IOS_FAMILY)
+@@ -410,6 +440,22 @@ Protocol::ErrorStringOr<void> InspectorPageAgent::reload(Optional<bool>&& ignore
+ return { };
}
-+void InspectorPageAgent::goBack(ErrorString& errorString)
++Protocol::ErrorStringOr<void> InspectorPageAgent::goBack()
+{
+ if (!m_inspectedPage.backForward().goBack())
-+ errorString = "Failed to go back"_s;
++ return makeUnexpected("Failed to go back"_s);
++
++ return { };
+}
+
-+void InspectorPageAgent::goForward(ErrorString& errorString)
++Protocol::ErrorStringOr<void> InspectorPageAgent::goForward()
+{
+ if (!m_inspectedPage.backForward().goForward())
-+ errorString = "Failed to go forward"_s;
++ return makeUnexpected("Failed to go forward"_s);
++
++ return { };
+}
+
- void InspectorPageAgent::navigate(ErrorString&, const String& url)
+ Protocol::ErrorStringOr<void> InspectorPageAgent::navigate(const String& url)
{
UserGestureIndicator indicator { ProcessingUserGesture };
-@@ -791,15 +834,16 @@ void InspectorPageAgent::setShowPaintRects(ErrorString&, bool show)
- m_overlay->setShowPaintRects(show);
+@@ -805,15 +851,16 @@ Protocol::ErrorStringOr<void> InspectorPageAgent::setShowPaintRects(bool show)
+ return { };
}
-void InspectorPageAgent::domContentEventFired()
@@ -3015,7 +2998,7 @@ index 539e8105b66e7b2a6a05571a1e1c8cd6bdf27c90..d7d6fd1449e006abb47cd7e279bdc6a9
}
void InspectorPageAgent::frameNavigated(Frame& frame)
-@@ -807,13 +851,23 @@ void InspectorPageAgent::frameNavigated(Frame& frame)
+@@ -821,13 +868,23 @@ void InspectorPageAgent::frameNavigated(Frame& frame)
m_frontendDispatcher->frameNavigated(buildObjectForFrame(&frame));
}
@@ -3041,8 +3024,8 @@ index 539e8105b66e7b2a6a05571a1e1c8cd6bdf27c90..d7d6fd1449e006abb47cd7e279bdc6a9
- m_identifierToFrame.remove(identifier);
}
- Frame* InspectorPageAgent::frameForId(const String& frameId)
-@@ -825,20 +879,18 @@ String InspectorPageAgent::frameId(Frame* frame)
+ Frame* InspectorPageAgent::frameForId(const Protocol::Network::FrameId& frameId)
+@@ -839,20 +896,18 @@ String InspectorPageAgent::frameId(Frame* frame)
{
if (!frame)
return emptyString();
@@ -3068,8 +3051,8 @@ index 539e8105b66e7b2a6a05571a1e1c8cd6bdf27c90..d7d6fd1449e006abb47cd7e279bdc6a9
+ return String::number(loader->loaderIDForInspector());
}
- Frame* InspectorPageAgent::assertFrame(ErrorString& errorString, const String& frameId)
-@@ -849,11 +901,6 @@ Frame* InspectorPageAgent::assertFrame(ErrorString& errorString, const String& f
+ Frame* InspectorPageAgent::assertFrame(Protocol::ErrorString& errorString, const Protocol::Network::FrameId& frameId)
+@@ -863,11 +918,6 @@ Frame* InspectorPageAgent::assertFrame(Protocol::ErrorString& errorString, const
return frame;
}
@@ -3081,7 +3064,7 @@ index 539e8105b66e7b2a6a05571a1e1c8cd6bdf27c90..d7d6fd1449e006abb47cd7e279bdc6a9
void InspectorPageAgent::frameStartedLoading(Frame& frame)
{
m_frontendDispatcher->frameStartedLoading(frameId(&frame));
-@@ -874,6 +921,12 @@ void InspectorPageAgent::frameClearedScheduledNavigation(Frame& frame)
+@@ -888,6 +938,12 @@ void InspectorPageAgent::frameClearedScheduledNavigation(Frame& frame)
m_frontendDispatcher->frameClearedScheduledNavigation(frameId(&frame));
}
@@ -3094,7 +3077,7 @@ index 539e8105b66e7b2a6a05571a1e1c8cd6bdf27c90..d7d6fd1449e006abb47cd7e279bdc6a9
#if ENABLE(DARK_MODE_CSS) || HAVE(OS_DARK_MODE_SUPPORT)
void InspectorPageAgent::defaultAppearanceDidChange(bool useDarkAppearance)
{
-@@ -933,6 +986,48 @@ void InspectorPageAgent::didRecalculateStyle()
+@@ -947,6 +1003,52 @@ void InspectorPageAgent::didRecalculateStyle()
m_overlay->update();
}
@@ -3115,14 +3098,18 @@ index 539e8105b66e7b2a6a05571a1e1c8cd6bdf27c90..d7d6fd1449e006abb47cd7e279bdc6a9
+ if (injectedScript.hasNoValue())
+ return;
+
-+ m_frontendDispatcher->fileChooserOpened(frameId(frame), injectedScript.wrapObject(InspectorDOMAgent::nodeAsScriptValue(state, element), WTF::String()));
++ auto object = injectedScript.wrapObject(InspectorDOMAgent::nodeAsScriptValue(state, element), WTF::String());
++ if (!object)
++ return;
++
++ m_frontendDispatcher->fileChooserOpened(frameId(frame), object.releaseNonNull());
+}
+
+void InspectorPageAgent::frameAttached(Frame& frame)
+{
+ Frame* parent = frame.tree().parent();
+ String parentFrameId = frameId(parent);
-+ m_frontendDispatcher->frameAttached(frameId(&frame), parent ? &parentFrameId : nullptr);
++ m_frontendDispatcher->frameAttached(frameId(&frame), parentFrameId);
+}
+
+bool InspectorPageAgent::shouldBypassCSP()
@@ -3140,48 +3127,47 @@ index 539e8105b66e7b2a6a05571a1e1c8cd6bdf27c90..d7d6fd1449e006abb47cd7e279bdc6a9
+ m_frontendDispatcher->didRequestOpenWindow(allowed);
+}
+
- Ref<Inspector::Protocol::Page::Frame> InspectorPageAgent::buildObjectForFrame(Frame* frame)
+ Ref<Protocol::Page::Frame> InspectorPageAgent::buildObjectForFrame(Frame* frame)
{
ASSERT_ARG(frame, frame);
-@@ -1073,6 +1168,29 @@ void InspectorPageAgent::snapshotRect(ErrorString& errorString, int x, int y, in
- *outDataURL = snapshot->toDataURL("image/png"_s, WTF::nullopt, PreserveResolution::Yes);
+@@ -1098,6 +1200,27 @@ Protocol::ErrorStringOr<String> InspectorPageAgent::snapshotRect(int x, int y, i
+ return snapshot->toDataURL("image/png"_s, WTF::nullopt, PreserveResolution::Yes);
}
-+void InspectorPageAgent::setTimeZone(ErrorString& errorString, const String* timeZone)
++Protocol::ErrorStringOr<void> InspectorPageAgent::setTimeZone(const String& timeZone)
+{
-+ if (!timeZone) {
-+ WTF::setTimeZoneForAutomation(String());
-+ return;
-+ }
-+ bool success = WTF::setTimeZoneForAutomation(*timeZone);
++ bool success = WTF::setTimeZoneForAutomation(timeZone);
+ if (!success)
-+ errorString = "Invalid time zone " + *timeZone;
++ return makeUnexpected("Invalid time zone " + timeZone);
++
++ return { };
+}
+
-+void InspectorPageAgent::setTouchEmulationEnabled(ErrorString& errorString, bool enabled)
++Protocol::ErrorStringOr<void> InspectorPageAgent::setTouchEmulationEnabled(bool enabled)
+{
+#if ENABLE(TOUCH_EVENTS)
+ RuntimeEnabledFeatures::sharedFeatures().setTouchEventsEnabled(enabled);
-+ UNUSED_PARAM(errorString);
++ return { };
+#else
+ UNUSED_PARAM(enabled);
-+ errorString = "Not supported"_s;
++ return makeUnexpected("Not supported"_s);
+#endif
+}
+
+
#if ENABLE(WEB_ARCHIVE) && USE(CF)
- void InspectorPageAgent::archive(ErrorString& errorString, String* data)
+ Protocol::ErrorStringOr<String> InspectorPageAgent::archive()
{
-@@ -1087,4 +1205,543 @@ void InspectorPageAgent::archive(ErrorString& errorString, String* data)
+@@ -1110,4 +1233,541 @@ Protocol::ErrorStringOr<String> InspectorPageAgent::archive()
}
#endif
-+void InspectorPageAgent::insertText(ErrorString&, const String& text)
++Protocol::ErrorStringOr<void> InspectorPageAgent::insertText(const String& text)
+{
+ UserGestureIndicator indicator { ProcessingUserGesture };
+ Document* focusedDocument = m_inspectedPage.focusController().focusedOrMainFrame().document();
+ TypingCommand::insertText(*focusedDocument, text, 0);
++ return { };
+}
+
+static String roleFromObject(RefPtr<AXCoreObject> axObject)
@@ -3497,7 +3483,7 @@ index 539e8105b66e7b2a6a05571a1e1c8cd6bdf27c90..d7d6fd1449e006abb47cd7e279bdc6a9
+ return "Unknown";
+}
+
-+static RefPtr<Inspector::Protocol::Page::AXNode> snapshotForAXObject(RefPtr<AXCoreObject> axObject, Node* nodeToFind)
++static Ref<Inspector::Protocol::Page::AXNode> snapshotForAXObject(RefPtr<AXCoreObject> axObject, Node* nodeToFind)
+{
+ auto axNode = Inspector::Protocol::Page::AXNode::create()
+ .setRole(roleFromObject(axObject))
@@ -3601,80 +3587,76 @@ index 539e8105b66e7b2a6a05571a1e1c8cd6bdf27c90..d7d6fd1449e006abb47cd7e279bdc6a9
+ axNode->setFound(true);
+
+ if (axObject->hasChildren()) {
-+ RefPtr<JSON::ArrayOf<Inspector::Protocol::Page::AXNode>> children = JSON::ArrayOf<Inspector::Protocol::Page::AXNode>::create();
++ Ref<JSON::ArrayOf<Inspector::Protocol::Page::AXNode>> children = JSON::ArrayOf<Inspector::Protocol::Page::AXNode>::create();
+ for (auto& childObject : axObject->children())
+ children->addItem(snapshotForAXObject(childObject, nodeToFind));
-+ axNode->setChildren(children);
++ axNode->setChildren(WTFMove(children));
+ }
+ return axNode;
+}
+
+
-+void InspectorPageAgent::accessibilitySnapshot(ErrorString& errorString, const String* objectId, RefPtr<Inspector::Protocol::Page::AXNode>& out_axNode)
++Protocol::ErrorStringOr<Ref<Protocol::Page::AXNode>> InspectorPageAgent::accessibilitySnapshot(const String& objectId)
+{
+ if (!WebCore::AXObjectCache::accessibilityEnabled())
+ WebCore::AXObjectCache::enableAccessibility();
+ auto document = makeRefPtr(m_inspectedPage.mainFrame().document());
-+ if (!document) {
-+ errorString = "No document for main frame"_s;
-+ return;
-+ }
++ if (!document)
++ return makeUnexpected("No document for main frame"_s);
++
+ AXObjectCache* axObjectCache = document->axObjectCache();
-+ if (!axObjectCache) {
-+ errorString = "No AXObjectCache for main document"_s;
-+ return;
-+ }
++ if (!axObjectCache)
++ return makeUnexpected("No AXObjectCache for main document"_s);
++
+ AXCoreObject* axObject = axObjectCache->rootObject();
-+ if (!axObject) {
-+ errorString = "No AXObject for main document"_s;
-+ return;
-+ }
++ if (!axObject)
++ return makeUnexpected("No AXObject for main document"_s);
+
+ Node* node = nullptr;
-+ if (objectId) {
++ if (!objectId.isEmpty()) {
+ InspectorDOMAgent* domAgent = m_instrumentingAgents.persistentDOMAgent();
+ ASSERT(domAgent);
-+ node = domAgent->nodeForObjectId(*objectId);
-+ if (!node) {
-+ errorString = "No Node for objectId"_s;
-+ return;
-+ }
++ node = domAgent->nodeForObjectId(objectId);
++ if (!node)
++ return makeUnexpected("No Node for objectId"_s);
+ }
+
+ m_doingAccessibilitySnapshot = true;
-+ out_axNode = snapshotForAXObject(makeRefPtr(axObject), node);
++ Ref<Inspector::Protocol::Page::AXNode> axNode = snapshotForAXObject(makeRefPtr(axObject), node);
+ m_doingAccessibilitySnapshot = false;
++ return axNode;
+}
+
-+void InspectorPageAgent::setInterceptFileChooserDialog(ErrorString&, bool enabled)
++Protocol::ErrorStringOr<void> InspectorPageAgent::setInterceptFileChooserDialog(bool enabled)
+{
+ m_interceptFileChooserDialog = enabled;
++ return { };
+}
+
-+void InspectorPageAgent::setDefaultBackgroundColorOverride(ErrorString& errorString, const JSON::Object* color)
++Protocol::ErrorStringOr<void> InspectorPageAgent::setDefaultBackgroundColorOverride(RefPtr<JSON::Object>&& color)
+{
+ FrameView* view = m_inspectedPage.mainFrame().view();
-+ if (!view) {
-+ errorString = "Internal error: No frame view to set color two"_s;
-+ return;
-+ }
++ if (!view)
++ return makeUnexpected("Internal error: No frame view to set color two"_s);
++
+ if (!color) {
+ view->updateBackgroundRecursively(Optional<Color>());
-+ return;
++ return { };
+ }
-+ view->updateBackgroundRecursively(InspectorDOMAgent::parseColor(color));
++
++ view->updateBackgroundRecursively(InspectorDOMAgent::parseColor(WTFMove(color)));
++ return { };
+}
+
-+void InspectorPageAgent::createUserWorld(ErrorString& errorString, const String& name)
++Protocol::ErrorStringOr<void> InspectorPageAgent::createUserWorld(const String& name)
+{
-+ if (createdUserWorlds().contains(name)) {
-+ errorString = "World with the given name already exists"_s;
-+ return;
-+ }
++ if (createdUserWorlds().contains(name))
++ return makeUnexpected("World with the given name already exists"_s);
+
+ Ref<DOMWrapperWorld> world = ScriptController::createWorld(name, ScriptController::WorldType::User);
+ ensureUserWorldsExistInAllFrames({world.ptr()});
+ createdUserWorlds().set(name, WTFMove(world));
++ return { };
+}
+
+void InspectorPageAgent::ensureUserWorldsExistInAllFrames(const Vector<DOMWrapperWorld*>& worlds)
@@ -3685,40 +3667,41 @@ index 539e8105b66e7b2a6a05571a1e1c8cd6bdf27c90..d7d6fd1449e006abb47cd7e279bdc6a9
+ }
+}
+
-+void InspectorPageAgent::setBypassCSP(ErrorString&, bool enabled)
++Protocol::ErrorStringOr<void> InspectorPageAgent::setBypassCSP(bool enabled)
+{
+ m_bypassCSP = enabled;
++ return { };
+}
+
-+void InspectorPageAgent::crash(ErrorString&)
++Protocol::ErrorStringOr<void> InspectorPageAgent::crash()
+{
+ CRASH();
++ return { };
+}
+
-+void InspectorPageAgent::setScreenSizeOverride(ErrorString&, int width, int height)
++Protocol::ErrorStringOr<void> InspectorPageAgent::setScreenSizeOverride(int width, int height)
+{
+ Optional<FloatSize> size;
+ if (width && height)
+ size = FloatSize(width, height);
+ m_inspectedPage.setOverrideScreenSize(size);
++ return { };
+}
+
-+void InspectorPageAgent::setOrientationOverride(Inspector::ErrorString& errorString, const int* angle)
++Protocol::ErrorStringOr<void> InspectorPageAgent::setOrientationOverride(Optional<int>&& angle)
+{
+#if ENABLE(ORIENTATION_EVENTS)
-+ UNUSED_PARAM(errorString);
-+ Optional<int> orientation;
-+ if (angle)
-+ orientation = *angle;
-+ m_inspectedPage.setOverrideOrientation(orientation);
++ m_inspectedPage.setOverrideOrientation(WTFMove(angle));
++ return { };
+#else
-+ errorString = "Orientation events are disabled in this build";
++ UNUSED_PARAM(angle);
++ return makeUnexpected("Orientation events are disabled in this build");
+#endif
+}
+
} // namespace WebCore
diff --git a/Source/WebCore/inspector/agents/InspectorPageAgent.h b/Source/WebCore/inspector/agents/InspectorPageAgent.h
-index 3bcd0487cfc8766baa01c7804173a15747b47b2d..51cbe81bd3488069a98738ff99fe9f443f8d4311 100644
+index d2b065e13651fafe747325f02e7701fbf1e8e45e..9076ff5fa9b746f9f13823146504829593f11bef 100644
--- a/Source/WebCore/inspector/agents/InspectorPageAgent.h
+++ b/Source/WebCore/inspector/agents/InspectorPageAgent.h
@@ -34,17 +34,23 @@
@@ -3745,7 +3728,7 @@ index 3bcd0487cfc8766baa01c7804173a15747b47b2d..51cbe81bd3488069a98738ff99fe9f44
class InspectorClient;
class InspectorOverlay;
class Page;
-@@ -71,12 +77,14 @@ public:
+@@ -69,12 +75,14 @@ public:
PingResource,
BeaconResource,
WebSocketResource,
@@ -3759,37 +3742,37 @@ index 3bcd0487cfc8766baa01c7804173a15747b47b2d..51cbe81bd3488069a98738ff99fe9f44
+ WEBCORE_EXPORT static String makeFrameID(ProcessIdentifier processID, FrameIdentifier frameID);
static bool sharedBufferContent(RefPtr<SharedBuffer>&&, const String& textEncodingName, bool withBase64Encode, String* result);
static Vector<CachedResource*> cachedResourcesForFrame(Frame*);
- static void resourceContent(ErrorString&, Frame*, const URL&, String* result, bool* base64Encoded);
-@@ -97,6 +105,8 @@ public:
- void enable(ErrorString&) override;
- void disable(ErrorString&) override;
- void reload(ErrorString&, const bool* optionalReloadFromOrigin, const bool* optionalRevalidateAllResources) override;
-+ void goBack(ErrorString&) override;
-+ void goForward(ErrorString&) override;
- void navigate(ErrorString&, const String& url) override;
- void overrideUserAgent(ErrorString&, const String* value) override;
- void overrideSetting(ErrorString&, const String& setting, const bool* value) override;
-@@ -116,22 +126,34 @@ public:
+ static void resourceContent(Inspector::Protocol::ErrorString&, Frame*, const URL&, String* result, bool* base64Encoded);
+@@ -95,6 +103,8 @@ public:
+ Inspector::Protocol::ErrorStringOr<void> enable();
+ Inspector::Protocol::ErrorStringOr<void> disable();
+ Inspector::Protocol::ErrorStringOr<void> reload(Optional<bool>&& ignoreCache, Optional<bool>&& revalidateAllResources);
++ Inspector::Protocol::ErrorStringOr<void> goBack() override;
++ Inspector::Protocol::ErrorStringOr<void> goForward() override;
+ Inspector::Protocol::ErrorStringOr<void> navigate(const String& url);
+ Inspector::Protocol::ErrorStringOr<void> overrideUserAgent(const String&);
+ Inspector::Protocol::ErrorStringOr<void> overrideSetting(Inspector::Protocol::Page::Setting, Optional<bool>&& value);
+@@ -114,22 +124,34 @@ public:
#if ENABLE(DARK_MODE_CSS) || HAVE(OS_DARK_MODE_SUPPORT)
- void setForcedAppearance(ErrorString&, const String&) override;
+ Inspector::Protocol::ErrorStringOr<void> setForcedAppearance(Optional<Inspector::Protocol::Page::Appearance>&&);
#endif
-+ void setTimeZone(ErrorString&, const String*) override;
-+ void setTouchEmulationEnabled(ErrorString&, bool) override;
- void snapshotNode(ErrorString&, int nodeId, String* outDataURL) override;
- void snapshotRect(ErrorString&, int x, int y, int width, int height, const String& coordinateSystem, String* outDataURL) override;
++ Inspector::Protocol::ErrorStringOr<void> setTimeZone(const String&) override;
++ Inspector::Protocol::ErrorStringOr<void> setTouchEmulationEnabled(bool) override;
+ Inspector::Protocol::ErrorStringOr<String> snapshotNode(Inspector::Protocol::DOM::NodeId);
+ Inspector::Protocol::ErrorStringOr<String> snapshotRect(int x, int y, int width, int height, Inspector::Protocol::Page::CoordinateSystem);
#if ENABLE(WEB_ARCHIVE) && USE(CF)
- void archive(ErrorString&, String* data) override;
+ Inspector::Protocol::ErrorStringOr<String> archive();
#endif
-+ void insertText(ErrorString&, const String& text) override;
-+ void accessibilitySnapshot(ErrorString&, const String* objectId, RefPtr<Inspector::Protocol::Page::AXNode>& out_axNode) override;
-+ void setInterceptFileChooserDialog(ErrorString&, bool enabled) override;
-+ void setDefaultBackgroundColorOverride(ErrorString&, const JSON::Object*) override;
-+ void createUserWorld(ErrorString&, const String&) override;
-+ void setBypassCSP(ErrorString&, bool) override;
-+ void crash(ErrorString&) override;
-+ void setScreenSizeOverride(ErrorString&, int width, int height) override;
-+ void setOrientationOverride(Inspector::ErrorString&, const int* angle) override;
++ Inspector::Protocol::ErrorStringOr<void> insertText(const String& text) override;
++ Inspector::Protocol::ErrorStringOr<Ref<Inspector::Protocol::Page::AXNode>> accessibilitySnapshot(const String& objectId) override;
++ Inspector::Protocol::ErrorStringOr<void> setInterceptFileChooserDialog(bool enabled) override;
++ Inspector::Protocol::ErrorStringOr<void> setDefaultBackgroundColorOverride(RefPtr<JSON::Object>&&) override;
++ Inspector::Protocol::ErrorStringOr<void> createUserWorld(const String&) override;
++ Inspector::Protocol::ErrorStringOr<void> setBypassCSP(bool) override;
++ Inspector::Protocol::ErrorStringOr<void> crash()override;
++ Inspector::Protocol::ErrorStringOr<void> setScreenSizeOverride(int width, int height) override;
++ Inspector::Protocol::ErrorStringOr<void> setOrientationOverride(Optional<int>&& angle) override;
+
// InspectorInstrumentation
- void domContentEventFired();
@@ -3807,7 +3790,7 @@ index 3bcd0487cfc8766baa01c7804173a15747b47b2d..51cbe81bd3488069a98738ff99fe9f44
#if ENABLE(DARK_MODE_CSS) || HAVE(OS_DARK_MODE_SUPPORT)
void defaultAppearanceDidChange(bool useDarkAppearance);
#endif
-@@ -142,6 +164,12 @@ public:
+@@ -140,6 +162,12 @@ public:
void didLayout();
void didScroll();
void didRecalculateStyle();
@@ -3818,9 +3801,9 @@ index 3bcd0487cfc8766baa01c7804173a15747b47b2d..51cbe81bd3488069a98738ff99fe9f44
+ void didCheckNewWindowPolicy(bool allowed);
+ bool doingAccessibilitySnapshot() const { return m_doingAccessibilitySnapshot; };
- Frame* frameForId(const String& frameId);
+ Frame* frameForId(const Inspector::Protocol::Network::FrameId&);
WEBCORE_EXPORT String frameId(Frame*);
-@@ -150,6 +178,7 @@ public:
+@@ -148,6 +176,7 @@ public:
private:
double timestamp();
@@ -3828,7 +3811,7 @@ index 3bcd0487cfc8766baa01c7804173a15747b47b2d..51cbe81bd3488069a98738ff99fe9f44
static bool mainResourceContent(Frame*, bool withBase64Encode, String* result);
static bool dataContent(const char* data, unsigned size, const String& textEncodingName, bool withBase64Encode, String* result);
-@@ -161,17 +190,19 @@ private:
+@@ -159,17 +188,19 @@ private:
RefPtr<Inspector::PageBackendDispatcher> m_backendDispatcher;
Page& m_inspectedPage;
@@ -3851,10 +3834,10 @@ index 3bcd0487cfc8766baa01c7804173a15747b47b2d..51cbe81bd3488069a98738ff99fe9f44
} // namespace WebCore
diff --git a/Source/WebCore/inspector/agents/InspectorWorkerAgent.cpp b/Source/WebCore/inspector/agents/InspectorWorkerAgent.cpp
-index 909c466f87e9bfa8c4c1728c46ad6e7e5907b46e..b4c53ba9dee0e7bb070fe03150339b2abe5efc2c 100644
+index 33caa0aa2079ad4081cc29605a53537c24d66bef..4b74d397d4de9a7eba3d5530538443d8907726aa 100644
--- a/Source/WebCore/inspector/agents/InspectorWorkerAgent.cpp
+++ b/Source/WebCore/inspector/agents/InspectorWorkerAgent.cpp
-@@ -160,7 +160,11 @@ void InspectorWorkerAgent::connectToWorkerInspectorProxy(WorkerInspectorProxy& p
+@@ -161,7 +161,11 @@ void InspectorWorkerAgent::connectToWorkerInspectorProxy(WorkerInspectorProxy& p
m_connectedProxies.set(proxy.identifier(), &proxy);
@@ -3868,7 +3851,7 @@ index 909c466f87e9bfa8c4c1728c46ad6e7e5907b46e..b4c53ba9dee0e7bb070fe03150339b2a
void InspectorWorkerAgent::disconnectFromWorkerInspectorProxy(WorkerInspectorProxy& proxy)
diff --git a/Source/WebCore/inspector/agents/page/PageDebuggerAgent.cpp b/Source/WebCore/inspector/agents/page/PageDebuggerAgent.cpp
-index 50cc98b3fa30e3da1f6e5edd291c9cc663166e71..74d6f7a9a8374ffa92a38ca9244d3fcdc13a585e 100644
+index 6187268bd275181e98f45ee0fa7e16a7509bc160..4b6457e9f92e07b69f46efbd58ea29d5d904d819 100644
--- a/Source/WebCore/inspector/agents/page/PageDebuggerAgent.cpp
+++ b/Source/WebCore/inspector/agents/page/PageDebuggerAgent.cpp
@@ -38,6 +38,7 @@
@@ -3878,22 +3861,22 @@ index 50cc98b3fa30e3da1f6e5edd291c9cc663166e71..74d6f7a9a8374ffa92a38ca9244d3fcd
+#include "JSDOMWindowBase.h"
#include "Page.h"
#include "PageConsoleClient.h"
- #include "PageScriptDebugServer.h"
-@@ -70,8 +71,11 @@ bool PageDebuggerAgent::enabled() const
+ #include "PageDebugger.h"
+@@ -70,7 +71,11 @@ bool PageDebuggerAgent::enabled() const
- void PageDebuggerAgent::evaluateOnCallFrame(ErrorString& errorString, const String& callFrameId, const String& expression, const String* objectGroup, const bool* includeCommandLineAPI, const bool* doNotPauseOnExceptionsAndMuteConsole, const bool* returnByValue, const bool* generatePreview, const bool* saveResult, const bool* emulateUserGesture, RefPtr<Protocol::Runtime::RemoteObject>& result, Optional<bool>& wasThrown, Optional<int>& savedResultIndex)
+ Protocol::ErrorStringOr<std::tuple<Ref<Protocol::Runtime::RemoteObject>, Optional<bool> /* wasThrown */, Optional<int> /* savedResultIndex */>> PageDebuggerAgent::evaluateOnCallFrame(const Protocol::Debugger::CallFrameId& callFrameId, const String& expression, const String& objectGroup, Optional<bool>&& includeCommandLineAPI, Optional<bool>&& doNotPauseOnExceptionsAndMuteConsole, Optional<bool>&& returnByValue, Optional<bool>&& generatePreview, Optional<bool>&& saveResult, Optional<bool>&& emulateUserGesture)
{
+- UserGestureEmulationScope userGestureScope(m_inspectedPage, emulateUserGesture && *emulateUserGesture);
+ InjectedScript injectedScript = injectedScriptManager().injectedScriptForObjectId(callFrameId);
+ JSC::JSGlobalObject* globalObject = injectedScript.globalObject();
+ Document* document = globalObject ? activeDOMWindow(*globalObject).document() : nullptr;
- auto shouldEmulateUserGesture = emulateUserGesture && *emulateUserGesture;
-- UserGestureEmulationScope userGestureScope(m_inspectedPage, shouldEmulateUserGesture);
++ auto shouldEmulateUserGesture = emulateUserGesture && *emulateUserGesture;
+ UserGestureEmulationScope userGestureScope(m_inspectedPage, shouldEmulateUserGesture, document);
- WebDebuggerAgent::evaluateOnCallFrame(errorString, callFrameId, expression, objectGroup, includeCommandLineAPI, doNotPauseOnExceptionsAndMuteConsole, returnByValue, generatePreview, saveResult, emulateUserGesture, result, wasThrown, savedResultIndex);
+ return WebDebuggerAgent::evaluateOnCallFrame(callFrameId, expression, objectGroup, WTFMove(includeCommandLineAPI), WTFMove(doNotPauseOnExceptionsAndMuteConsole), WTFMove(returnByValue), WTFMove(generatePreview), WTFMove(saveResult), WTFMove(emulateUserGesture));
}
diff --git a/Source/WebCore/inspector/agents/page/PageRuntimeAgent.cpp b/Source/WebCore/inspector/agents/page/PageRuntimeAgent.cpp
-index e8ab5f4c89ade4fc85c042b43433b726563abdd2..ce3b87ef1bdcd29c4fff2cfa735b9d1bc76e1f36 100644
+index 00e69f1aa2e3f8ea2f445e8dd446dd16ea6363df..92d45059ca6d87ddf7b6cc12033267a4c108a73c 100644
--- a/Source/WebCore/inspector/agents/page/PageRuntimeAgent.cpp
+++ b/Source/WebCore/inspector/agents/page/PageRuntimeAgent.cpp
@@ -35,12 +35,14 @@
@@ -3911,7 +3894,7 @@ index e8ab5f4c89ade4fc85c042b43433b726563abdd2..ce3b87ef1bdcd29c4fff2cfa735b9d1b
#include "ScriptState.h"
#include "SecurityOrigin.h"
#include "UserGestureEmulationScope.h"
-@@ -106,6 +108,15 @@ void PageRuntimeAgent::didClearWindowObjectInWorld(Frame& frame, DOMWrapperWorld
+@@ -103,6 +105,15 @@ void PageRuntimeAgent::didClearWindowObjectInWorld(Frame& frame, DOMWrapperWorld
notifyContextCreated(pageAgent->frameId(&frame), frame.script().globalObject(world), world);
}
@@ -3924,46 +3907,48 @@ index e8ab5f4c89ade4fc85c042b43433b726563abdd2..ce3b87ef1bdcd29c4fff2cfa735b9d1b
+ }
+}
+
- InjectedScript PageRuntimeAgent::injectedScriptForEval(ErrorString& errorString, const int* executionContextId)
+ InjectedScript PageRuntimeAgent::injectedScriptForEval(Protocol::ErrorString& errorString, Optional<Protocol::Runtime::ExecutionContextId>&& executionContextId)
{
if (!executionContextId) {
-@@ -194,13 +205,21 @@ void PageRuntimeAgent::notifyContextCreated(const String& frameId, JSC::JSGlobal
+@@ -191,13 +202,23 @@ void PageRuntimeAgent::notifyContextCreated(const Protocol::Network::FrameId& fr
- void PageRuntimeAgent::evaluate(ErrorString& errorString, const String& expression, const String* objectGroup, const bool* includeCommandLineAPI, const bool* doNotPauseOnExceptionsAndMuteConsole, const int* executionContextId, const bool* returnByValue, const bool* generatePreview, const bool* saveResult, const bool* emulateUserGesture, RefPtr<Inspector::Protocol::Runtime::RemoteObject>& result, Optional<bool>& wasThrown, Optional<int>& savedResultIndex)
+ Protocol::ErrorStringOr<std::tuple<Ref<Protocol::Runtime::RemoteObject>, Optional<bool> /* wasThrown */, Optional<int> /* savedResultIndex */>> PageRuntimeAgent::evaluate(const String& expression, const String& objectGroup, Optional<bool>&& includeCommandLineAPI, Optional<bool>&& doNotPauseOnExceptionsAndMuteConsole, Optional<Protocol::Runtime::ExecutionContextId>&& executionContextId, Optional<bool>&& returnByValue, Optional<bool>&& generatePreview, Optional<bool>&& saveResult, Optional<bool>&& emulateUserGesture)
{
-- UserGestureEmulationScope userGestureScope(m_inspectedPage, asBool(emulateUserGesture));
-+ InjectedScript injectedScript = injectedScriptForEval(errorString, executionContextId);
+- UserGestureEmulationScope userGestureScope(m_inspectedPage, emulateUserGesture && *emulateUserGesture);
++ String errorString;
++ InjectedScript injectedScript = injectedScriptForEval(errorString, Optional(executionContextId));
+ if (!errorString.isEmpty())
-+ return;
++ return makeUnexpected(errorString);
++
+ JSC::JSGlobalObject* globalObject = injectedScript.globalObject();
+ Document* document = globalObject ? activeDOMWindow(*globalObject).document() : nullptr;
-+ UserGestureEmulationScope userGestureScope(m_inspectedPage, asBool(emulateUserGesture), document);
- InspectorRuntimeAgent::evaluate(errorString, expression, objectGroup, includeCommandLineAPI, doNotPauseOnExceptionsAndMuteConsole, executionContextId, returnByValue, generatePreview, saveResult, emulateUserGesture, result, wasThrown, savedResultIndex);
++ UserGestureEmulationScope userGestureScope(m_inspectedPage, emulateUserGesture && *emulateUserGesture, document);
+ return InspectorRuntimeAgent::evaluate(expression, objectGroup, WTFMove(includeCommandLineAPI), WTFMove(doNotPauseOnExceptionsAndMuteConsole), WTFMove(executionContextId), WTFMove(returnByValue), WTFMove(generatePreview), WTFMove(saveResult), WTFMove(emulateUserGesture));
}
- void PageRuntimeAgent::callFunctionOn(ErrorString& errorString, const String& objectId, const String& expression, const JSON::Array* optionalArguments, const bool* doNotPauseOnExceptionsAndMuteConsole, const bool* returnByValue, const bool* generatePreview, const bool* emulateUserGesture, RefPtr<Inspector::Protocol::Runtime::RemoteObject>& result, Optional<bool>& wasThrown)
+ Protocol::ErrorStringOr<std::tuple<Ref<Protocol::Runtime::RemoteObject>, Optional<bool> /* wasThrown */>> PageRuntimeAgent::callFunctionOn(const Protocol::Runtime::RemoteObjectId& objectId, const String& expression, RefPtr<JSON::Array>&& optionalArguments, Optional<bool>&& doNotPauseOnExceptionsAndMuteConsole, Optional<bool>&& returnByValue, Optional<bool>&& generatePreview, Optional<bool>&& emulateUserGesture)
{
-- UserGestureEmulationScope userGestureScope(m_inspectedPage, asBool(emulateUserGesture));
+- UserGestureEmulationScope userGestureScope(m_inspectedPage, emulateUserGesture && *emulateUserGesture);
+ InjectedScript injectedScript = injectedScriptManager().injectedScriptForObjectId(objectId);
+ JSC::JSGlobalObject* globalObject = injectedScript.globalObject();
+ Document* document = globalObject ? activeDOMWindow(*globalObject).document() : nullptr;
-+ UserGestureEmulationScope userGestureScope(m_inspectedPage, asBool(emulateUserGesture), document);
- InspectorRuntimeAgent::callFunctionOn(errorString, objectId, expression, optionalArguments, doNotPauseOnExceptionsAndMuteConsole, returnByValue, generatePreview, emulateUserGesture, result, wasThrown);
++ UserGestureEmulationScope userGestureScope(m_inspectedPage, emulateUserGesture && *emulateUserGesture, document);
+ return InspectorRuntimeAgent::callFunctionOn(objectId, expression, WTFMove(optionalArguments), WTFMove(doNotPauseOnExceptionsAndMuteConsole), WTFMove(returnByValue), WTFMove(generatePreview), WTFMove(emulateUserGesture));
}
diff --git a/Source/WebCore/inspector/agents/page/PageRuntimeAgent.h b/Source/WebCore/inspector/agents/page/PageRuntimeAgent.h
-index 2af3739b7fe7c16faa7d8d2797ce6d010215398d..80bfde6120874e16fb173f707fd0bd8a3e5067a0 100644
+index 298465c52b42464c2733659e07f3f760174a95eb..3b7ac5a5e6fba11bfbc3d641e5a312db5f1391a8 100644
--- a/Source/WebCore/inspector/agents/page/PageRuntimeAgent.h
+++ b/Source/WebCore/inspector/agents/page/PageRuntimeAgent.h
-@@ -63,6 +63,7 @@ public:
+@@ -62,6 +62,7 @@ public:
// InspectorInstrumentation
void frameNavigated(Frame&);
void didClearWindowObjectInWorld(Frame&, DOMWrapperWorld&);
+ void didReceiveMainResourceError(Frame&);
private:
- Inspector::InjectedScript injectedScriptForEval(ErrorString&, const int* executionContextId) override;
-@@ -73,7 +74,6 @@ private:
+ Inspector::InjectedScript injectedScriptForEval(Inspector::Protocol::ErrorString&, Optional<Inspector::Protocol::Runtime::ExecutionContextId>&&);
+@@ -72,7 +73,6 @@ private:
std::unique_ptr<Inspector::RuntimeFrontendDispatcher> m_frontendDispatcher;
RefPtr<Inspector::RuntimeBackendDispatcher> m_backendDispatcher;
@@ -4006,10 +3991,10 @@ index b94ed78ad3dbea19543c1fd54653f0481e52fb7c..6341c7ff7ef53577f33c19ecad1b8bfb
private:
diff --git a/Source/WebCore/loader/DocumentLoader.cpp b/Source/WebCore/loader/DocumentLoader.cpp
-index e99413197e0c11bcf9c67ca66f132b7799ddbcc4..0c3ee3f50e5818bbcf97fd4ccb6a1f2a1cfce739 100644
+index 7c99510855700d855de43e52803d14d76bf9d562..9f4a76ec0b45783dc92942f78cdccac5291b0ceb 100644
--- a/Source/WebCore/loader/DocumentLoader.cpp
+++ b/Source/WebCore/loader/DocumentLoader.cpp
-@@ -1322,8 +1322,6 @@ void DocumentLoader::detachFromFrame()
+@@ -1326,8 +1326,6 @@ void DocumentLoader::detachFromFrame()
if (!m_frame)
return;
@@ -4037,10 +4022,10 @@ index c21678201701d3fa8d41c9ef45ee824eddff64bf..f1f23cf11fd4d646d57118df361ab77a
DocumentWriter& writer() const { return m_writer; }
diff --git a/Source/WebCore/loader/FrameLoader.cpp b/Source/WebCore/loader/FrameLoader.cpp
-index cd1d91af28ad95ff1882940002395cf0ef1d6241..7a2da1d8305f07515ceb112329d1b36968685ed9 100644
+index 8d05431177275400ddaaafa7c63c98419c3ce144..6da79687053ba14dd0a883b1c75a61541057324e 100644
--- a/Source/WebCore/loader/FrameLoader.cpp
+++ b/Source/WebCore/loader/FrameLoader.cpp
-@@ -1167,6 +1167,7 @@ void FrameLoader::loadInSameDocument(const URL& url, SerializedScriptValue* stat
+@@ -1172,6 +1172,7 @@ void FrameLoader::loadInSameDocument(const URL& url, SerializedScriptValue* stat
}
m_client->dispatchDidNavigateWithinPage();
@@ -4048,7 +4033,7 @@ index cd1d91af28ad95ff1882940002395cf0ef1d6241..7a2da1d8305f07515ceb112329d1b369
m_frame.document()->statePopped(stateObject ? Ref<SerializedScriptValue> { *stateObject } : SerializedScriptValue::nullValue());
m_client->dispatchDidPopStateWithinPage();
-@@ -1478,6 +1479,7 @@ void FrameLoader::load(FrameLoadRequest&& request)
+@@ -1483,6 +1484,7 @@ void FrameLoader::load(FrameLoadRequest&& request)
void FrameLoader::loadWithNavigationAction(const ResourceRequest& request, NavigationAction&& action, FrameLoadType type, RefPtr<FormState>&& formState, AllowNavigationToInvalidURL allowNavigationToInvalidURL, CompletionHandler<void()>&& completionHandler)
{
@@ -4056,7 +4041,7 @@ index cd1d91af28ad95ff1882940002395cf0ef1d6241..7a2da1d8305f07515ceb112329d1b369
FRAMELOADER_RELEASE_LOG_IF_ALLOWED(ResourceLoading, "loadWithNavigationAction: frame load started");
Ref<DocumentLoader> loader = m_client->createDocumentLoader(request, defaultSubstituteDataForURL(request.url()));
-@@ -1581,6 +1583,8 @@ void FrameLoader::loadWithDocumentLoader(DocumentLoader* loader, FrameLoadType t
+@@ -1586,6 +1588,8 @@ void FrameLoader::loadWithDocumentLoader(DocumentLoader* loader, FrameLoadType t
const String& httpMethod = loader->request().httpMethod();
if (shouldPerformFragmentNavigation(isFormSubmission, httpMethod, policyChecker().loadType(), newURL)) {
@@ -4065,7 +4050,7 @@ index cd1d91af28ad95ff1882940002395cf0ef1d6241..7a2da1d8305f07515ceb112329d1b369
RefPtr<DocumentLoader> oldDocumentLoader = m_documentLoader;
NavigationAction action { *m_frame.document(), loader->request(), InitiatedByMainFrame::Unknown, policyChecker().loadType(), isFormSubmission };
-@@ -3146,6 +3150,8 @@ void FrameLoader::receivedMainResourceError(const ResourceError& error)
+@@ -3151,6 +3155,8 @@ void FrameLoader::receivedMainResourceError(const ResourceError& error)
checkCompleted();
if (m_frame.page())
checkLoadComplete();
@@ -4074,7 +4059,7 @@ index cd1d91af28ad95ff1882940002395cf0ef1d6241..7a2da1d8305f07515ceb112329d1b369
}
void FrameLoader::continueFragmentScrollAfterNavigationPolicy(const ResourceRequest& request, bool shouldContinue)
-@@ -3905,9 +3911,6 @@ String FrameLoader::referrer() const
+@@ -3910,9 +3916,6 @@ String FrameLoader::referrer() const
void FrameLoader::dispatchDidClearWindowObjectsInAllWorlds()
{
@@ -4084,7 +4069,7 @@ index cd1d91af28ad95ff1882940002395cf0ef1d6241..7a2da1d8305f07515ceb112329d1b369
Vector<Ref<DOMWrapperWorld>> worlds;
ScriptController::getAllWorlds(worlds);
for (auto& world : worlds)
-@@ -3916,13 +3919,13 @@ void FrameLoader::dispatchDidClearWindowObjectsInAllWorlds()
+@@ -3921,13 +3924,13 @@ void FrameLoader::dispatchDidClearWindowObjectsInAllWorlds()
void FrameLoader::dispatchDidClearWindowObjectInWorld(DOMWrapperWorld& world)
{
@@ -4105,7 +4090,7 @@ index cd1d91af28ad95ff1882940002395cf0ef1d6241..7a2da1d8305f07515ceb112329d1b369
InspectorInstrumentation::didClearWindowObjectInWorld(m_frame, world);
}
diff --git a/Source/WebCore/loader/LoaderStrategy.h b/Source/WebCore/loader/LoaderStrategy.h
-index 579d9038f317d45d27c84a27e3f21cff0ae8fddf..9dc41a6ff78b85e229927409b309e01adce2f27a 100644
+index 6097d2650766a2c87a60426272ae6aba0358b297..9f6e41db65a1745a0d9bb343a762e1960a4b5586 100644
--- a/Source/WebCore/loader/LoaderStrategy.h
+++ b/Source/WebCore/loader/LoaderStrategy.h
@@ -80,6 +80,7 @@ public:
@@ -4185,10 +4170,10 @@ index e24fded2225f1c1918f454017566717e20484eab..30e4b7a986418c4b4f6c799b858b6082
void ProgressTracker::incrementProgress(unsigned long identifier, const ResourceResponse& response)
diff --git a/Source/WebCore/page/ChromeClient.h b/Source/WebCore/page/ChromeClient.h
-index 0ffece0ec7cf43a0bc1adc5f8caaf5e26c61682c..0988720bee8a70e8531337b1c06094e26fcd523e 100644
+index e92aaa06fd9ce4c4925203d27113e02ad20d2c5e..6e2f55476dd7063a905c3d028786418a7632257c 100644
--- a/Source/WebCore/page/ChromeClient.h
+++ b/Source/WebCore/page/ChromeClient.h
-@@ -277,7 +277,7 @@ public:
+@@ -278,7 +278,7 @@ public:
#endif
#if ENABLE(ORIENTATION_EVENTS)
@@ -4198,10 +4183,10 @@ index 0ffece0ec7cf43a0bc1adc5f8caaf5e26c61682c..0988720bee8a70e8531337b1c06094e2
#if ENABLE(INPUT_TYPE_COLOR)
diff --git a/Source/WebCore/page/EventHandler.cpp b/Source/WebCore/page/EventHandler.cpp
-index ebda8a24023400c8864879ad9ffba67b3e776845..fed97cd76834b3d6341b4c3a1df7ebc8e8d49f5c 100644
+index f98bce1bf46698ca0e5dadabd649c5fd7580fa27..21f88c81ede0bb34c1cc7c7db40959711b8d8911 100644
--- a/Source/WebCore/page/EventHandler.cpp
+++ b/Source/WebCore/page/EventHandler.cpp
-@@ -836,9 +836,7 @@ bool EventHandler::handleMousePressEvent(const MouseEventWithHitTestResults& eve
+@@ -828,9 +828,7 @@ bool EventHandler::handleMousePressEvent(const MouseEventWithHitTestResults& eve
m_mousePressNode = event.targetNode();
m_frame.document()->setFocusNavigationStartingNode(event.targetNode());
@@ -4211,7 +4196,7 @@ index ebda8a24023400c8864879ad9ffba67b3e776845..fed97cd76834b3d6341b4c3a1df7ebc8
m_mousePressed = true;
m_selectionInitiationState = HaveNotStartedSelection;
-@@ -877,8 +875,6 @@ VisiblePosition EventHandler::selectionExtentRespectingEditingBoundary(const Vis
+@@ -869,8 +867,6 @@ VisiblePosition EventHandler::selectionExtentRespectingEditingBoundary(const Vis
return targetNode->renderer()->positionForPoint(LayoutPoint(selectionEndPoint), nullptr);
}
@@ -4220,7 +4205,7 @@ index ebda8a24023400c8864879ad9ffba67b3e776845..fed97cd76834b3d6341b4c3a1df7ebc8
#if !PLATFORM(IOS_FAMILY)
bool EventHandler::supportsSelectionUpdatesOnMouseDrag() const
-@@ -900,8 +896,10 @@ bool EventHandler::handleMouseDraggedEvent(const MouseEventWithHitTestResults& e
+@@ -892,8 +888,10 @@ bool EventHandler::handleMouseDraggedEvent(const MouseEventWithHitTestResults& e
Ref<Frame> protectedFrame(m_frame);
@@ -4231,7 +4216,7 @@ index ebda8a24023400c8864879ad9ffba67b3e776845..fed97cd76834b3d6341b4c3a1df7ebc8
Node* targetNode = event.targetNode();
if (event.event().button() != LeftButton || !targetNode)
-@@ -922,7 +920,9 @@ bool EventHandler::handleMouseDraggedEvent(const MouseEventWithHitTestResults& e
+@@ -914,7 +912,9 @@ bool EventHandler::handleMouseDraggedEvent(const MouseEventWithHitTestResults& e
ASSERT(m_mouseDownMayStartSelect || m_mouseDownMayStartAutoscroll);
#endif
@@ -4241,7 +4226,7 @@ index ebda8a24023400c8864879ad9ffba67b3e776845..fed97cd76834b3d6341b4c3a1df7ebc8
if (m_mouseDownMayStartAutoscroll && !panScrollInProgress()) {
m_autoscrollController->startAutoscrollForSelection(renderer);
-@@ -939,6 +939,8 @@ bool EventHandler::handleMouseDraggedEvent(const MouseEventWithHitTestResults& e
+@@ -931,6 +931,8 @@ bool EventHandler::handleMouseDraggedEvent(const MouseEventWithHitTestResults& e
return true;
}
@@ -4250,7 +4235,7 @@ index ebda8a24023400c8864879ad9ffba67b3e776845..fed97cd76834b3d6341b4c3a1df7ebc8
bool EventHandler::eventMayStartDrag(const PlatformMouseEvent& event) const
{
// This is a pre-flight check of whether the event might lead to a drag being started. Be careful
-@@ -970,6 +972,8 @@ bool EventHandler::eventMayStartDrag(const PlatformMouseEvent& event) const
+@@ -962,6 +964,8 @@ bool EventHandler::eventMayStartDrag(const PlatformMouseEvent& event) const
return targetElement && page->dragController().draggableElement(&m_frame, targetElement, result.roundedPointInInnerNodeFrame(), state);
}
@@ -4259,7 +4244,7 @@ index ebda8a24023400c8864879ad9ffba67b3e776845..fed97cd76834b3d6341b4c3a1df7ebc8
void EventHandler::updateSelectionForMouseDrag()
{
if (!supportsSelectionUpdatesOnMouseDrag())
-@@ -1061,7 +1065,6 @@ void EventHandler::updateSelectionForMouseDrag(const HitTestResult& hitTestResul
+@@ -1053,7 +1057,6 @@ void EventHandler::updateSelectionForMouseDrag(const HitTestResult& hitTestResul
m_frame.selection().setSelectionByMouseIfDifferent(newSelection, m_frame.selection().granularity(),
FrameSelection::EndPointsAdjustmentMode::AdjustAtBidiBoundary);
}
@@ -4267,7 +4252,7 @@ index ebda8a24023400c8864879ad9ffba67b3e776845..fed97cd76834b3d6341b4c3a1df7ebc8
void EventHandler::lostMouseCapture()
{
-@@ -1109,9 +1112,7 @@ bool EventHandler::handleMouseReleaseEvent(const MouseEventWithHitTestResults& e
+@@ -1101,9 +1104,7 @@ bool EventHandler::handleMouseReleaseEvent(const MouseEventWithHitTestResults& e
// on the selection, the selection goes away. However, if we are
// editing, place the caret.
if (m_mouseDownWasSingleClickInSelection && m_selectionInitiationState != ExtendedSelection
@@ -4277,7 +4262,7 @@ index ebda8a24023400c8864879ad9ffba67b3e776845..fed97cd76834b3d6341b4c3a1df7ebc8
&& m_frame.selection().isRange()
&& event.event().button() != RightButton) {
VisibleSelection newSelection;
-@@ -2072,10 +2073,8 @@ bool EventHandler::handleMouseMoveEvent(const PlatformMouseEvent& platformMouseE
+@@ -2064,10 +2065,8 @@ bool EventHandler::handleMouseMoveEvent(const PlatformMouseEvent& platformMouseE
swallowEvent = !dispatchMouseEvent(eventNames().mousemoveEvent, mouseEvent.targetNode(), 0, platformMouseEvent, FireMouseOverOut::Yes);
@@ -4289,7 +4274,7 @@ index ebda8a24023400c8864879ad9ffba67b3e776845..fed97cd76834b3d6341b4c3a1df7ebc8
return swallowEvent;
}
diff --git a/Source/WebCore/page/EventHandler.h b/Source/WebCore/page/EventHandler.h
-index 617905e01b1ddf0d1e0c1d4eeb8348e79eabb2a1..7b5057757591e98f403873b373d1ed2f2a6cedb6 100644
+index 171ae47f77a67b3d132f04ce6bebb85344dc1de6..e3889f211bfaac614bab5613c267e4b50e35a332 100644
--- a/Source/WebCore/page/EventHandler.h
+++ b/Source/WebCore/page/EventHandler.h
@@ -132,9 +132,7 @@ public:
@@ -4336,7 +4321,7 @@ index 617905e01b1ddf0d1e0c1d4eeb8348e79eabb2a1..7b5057757591e98f403873b373d1ed2f
enum class SetOrClearLastScrollbar { Clear, Set };
void updateLastScrollbarUnderMouse(Scrollbar*, SetOrClearLastScrollbar);
-@@ -529,10 +524,7 @@ private:
+@@ -527,10 +522,7 @@ private:
enum SelectionInitiationState { HaveNotStartedSelection, PlacedCaret, ExtendedSelection };
SelectionInitiationState m_selectionInitiationState { HaveNotStartedSelection };
@@ -4368,10 +4353,10 @@ index 757765c3b4872d5a6f92b34e3f2ac67eaaf2dd82..69c4ef67941cee93213ccac1aa04d2cb
request.setHTTPHeaderField(HTTPHeaderName::Accept, "text/event-stream");
request.setHTTPHeaderField(HTTPHeaderName::CacheControl, "no-cache");
diff --git a/Source/WebCore/page/Frame.cpp b/Source/WebCore/page/Frame.cpp
-index 289bea8ea14bfa97eb8746b7e98af21d82196e33..c165327d66e3d60289f4bce74c4c9b91e176cfc3 100644
+index bd3497c1a220015656e002045e4e6177c39398b5..4ca17452a5fb377396e8aefcd073dbf76072b9c2 100644
--- a/Source/WebCore/page/Frame.cpp
+++ b/Source/WebCore/page/Frame.cpp
-@@ -181,6 +181,7 @@ Frame::Frame(Page& page, HTMLFrameOwnerElement* ownerElement, UniqueRef<FrameLoa
+@@ -179,6 +179,7 @@ Frame::Frame(Page& page, HTMLFrameOwnerElement* ownerElement, UniqueRef<FrameLoa
void Frame::init()
{
m_loader->init();
@@ -4379,7 +4364,7 @@ index 289bea8ea14bfa97eb8746b7e98af21d82196e33..c165327d66e3d60289f4bce74c4c9b91
}
Ref<Frame> Frame::create(Page* page, HTMLFrameOwnerElement* ownerElement, UniqueRef<FrameLoaderClient>&& client)
-@@ -340,7 +341,7 @@ void Frame::orientationChanged()
+@@ -338,7 +339,7 @@ void Frame::orientationChanged()
int Frame::orientation() const
{
if (m_page)
@@ -4418,10 +4403,10 @@ index efc6c0ef136a4b6a99a66487e7387f404baf4a3b..81cdfb027f2cc5171756cf9dbe7e9b69
}
diff --git a/Source/WebCore/page/FrameView.cpp b/Source/WebCore/page/FrameView.cpp
-index f9b1a5d715b754729428589ae581e69c5b7de11c..dbde8fc8bbd68f1376cbeafb219728deed507401 100644
+index daacbe1a9a786ca5d09bf2a99bd3121616e7097e..244de66c50b8c871b45e9c86226f893c879bf125 100644
--- a/Source/WebCore/page/FrameView.cpp
+++ b/Source/WebCore/page/FrameView.cpp
-@@ -3001,7 +3001,7 @@ void FrameView::setBaseBackgroundColor(const Color& backgroundColor)
+@@ -3012,7 +3012,7 @@ void FrameView::setBaseBackgroundColor(const Color& backgroundColor)
void FrameView::updateBackgroundRecursively(const Optional<Color>& backgroundColor)
{
@@ -4431,10 +4416,18 @@ index f9b1a5d715b754729428589ae581e69c5b7de11c..dbde8fc8bbd68f1376cbeafb219728de
#else
Color baseBackgroundColor = backgroundColor.valueOr(Color::white);
diff --git a/Source/WebCore/page/History.cpp b/Source/WebCore/page/History.cpp
-index 38fd7b29b53eab484e30963b51c8ae525c5d7a38..37b2a2b8baeba64a50f12c773f2a1072595806c5 100644
+index 38fd7b29b53eab484e30963b51c8ae525c5d7a38..3c2f2104e3f364d3d6201e3009a448b4db317d03 100644
--- a/Source/WebCore/page/History.cpp
+++ b/Source/WebCore/page/History.cpp
-@@ -260,6 +260,7 @@ ExceptionOr<void> History::stateObjectAdded(RefPtr<SerializedScriptValue>&& data
+@@ -33,6 +33,7 @@
+ #include "FrameLoaderClient.h"
+ #include "HistoryController.h"
+ #include "HistoryItem.h"
++#include "InspectorInstrumentation.h"
+ #include "Logging.h"
+ #include "NavigationScheduler.h"
+ #include "Page.h"
+@@ -260,6 +261,7 @@ ExceptionOr<void> History::stateObjectAdded(RefPtr<SerializedScriptValue>&& data
if (!urlString.isEmpty())
frame->document()->updateURLForPushOrReplaceState(fullURL);
@@ -4443,10 +4436,10 @@ index 38fd7b29b53eab484e30963b51c8ae525c5d7a38..37b2a2b8baeba64a50f12c773f2a1072
if (stateObjectType == StateObjectType::Push) {
frame->loader().history().pushState(WTFMove(data), title, fullURL.string());
diff --git a/Source/WebCore/page/Page.cpp b/Source/WebCore/page/Page.cpp
-index 721ee0d005ed4ca7aa3f4365230c75e0f0185a88..43c49a618d9affa6c758fd68146b5b4269bddcd1 100644
+index d45d3444070a478c32c752f08196ebbf4221e471..0bbc8c37de1d45df57ed2ec5ba65d7d69f834e85 100644
--- a/Source/WebCore/page/Page.cpp
+++ b/Source/WebCore/page/Page.cpp
-@@ -90,6 +90,7 @@
+@@ -89,6 +89,7 @@
#include "PerformanceLoggingClient.h"
#include "PerformanceMonitor.h"
#include "PlatformMediaSessionManager.h"
@@ -4454,7 +4447,7 @@ index 721ee0d005ed4ca7aa3f4365230c75e0f0185a88..43c49a618d9affa6c758fd68146b5b42
#include "PlatformStrategies.h"
#include "PlugInClient.h"
#include "PluginData.h"
-@@ -431,6 +432,37 @@ void Page::setOverrideViewportArguments(const Optional<ViewportArguments>& viewp
+@@ -434,6 +435,37 @@ void Page::setOverrideViewportArguments(const Optional<ViewportArguments>& viewp
document->updateViewportArguments();
}
@@ -4493,7 +4486,7 @@ index 721ee0d005ed4ca7aa3f4365230c75e0f0185a88..43c49a618d9affa6c758fd68146b5b42
{
if (!m_scrollingCoordinator && m_settings->scrollingCoordinatorEnabled()) {
diff --git a/Source/WebCore/page/Page.h b/Source/WebCore/page/Page.h
-index be454300bbd075d0f818c999aca8f3491dc996d2..7a1a8425ba982ba8fb171f829ac59c8dcc6664f7 100644
+index adf9062cb0a2a96899427b4bbba361e8117d9970..6e6421d8162fa87c4bb5bffb9cc108087c5553c7 100644
--- a/Source/WebCore/page/Page.h
+++ b/Source/WebCore/page/Page.h
@@ -197,6 +197,9 @@ public:
@@ -4506,7 +4499,7 @@ index be454300bbd075d0f818c999aca8f3491dc996d2..7a1a8425ba982ba8fb171f829ac59c8d
static void refreshPlugins(bool reload);
WEBCORE_EXPORT PluginData& pluginData();
void clearPluginData();
-@@ -761,6 +764,11 @@ public:
+@@ -757,6 +760,11 @@ public:
WEBCORE_EXPORT Vector<Ref<Element>> editableElementsInRect(const FloatRect&) const;
@@ -4518,7 +4511,7 @@ index be454300bbd075d0f818c999aca8f3491dc996d2..7a1a8425ba982ba8fb171f829ac59c8d
#if ENABLE(DEVICE_ORIENTATION) && PLATFORM(IOS_FAMILY)
DeviceOrientationUpdateProvider* deviceOrientationUpdateProvider() const { return m_deviceOrientationUpdateProvider.get(); }
#endif
-@@ -1060,6 +1068,11 @@ private:
+@@ -1058,6 +1066,11 @@ private:
#endif
Optional<ViewportArguments> m_overrideViewportArguments;
@@ -4561,12 +4554,12 @@ index b4f7fe0d15ee81dbc7b2b7c9e7c0e6cc42dc8e55..1a40df0eadea4f508b7227590b9d5386
}
diff --git a/Source/WebCore/page/SocketProvider.cpp b/Source/WebCore/page/SocketProvider.cpp
-index 803ac83155ff4df1becf75cd4710f6fbf7bbc32a..cc08682748a6d2fdf5d79980cd629812c98aa7ce 100644
+index 3bec0aef174336939838fb1069fffbcb9f3d5604..566ef3806be3c5ccf1bb951251c2a90dba7071a3 100644
--- a/Source/WebCore/page/SocketProvider.cpp
+++ b/Source/WebCore/page/SocketProvider.cpp
@@ -33,7 +33,7 @@ namespace WebCore {
- Ref<SocketStreamHandle> SocketProvider::createSocketStreamHandle(const URL& url, SocketStreamHandleClient& client, PAL::SessionID sessionID, const String& credentialPartition, const StorageSessionProvider* provider)
+ Ref<SocketStreamHandle> SocketProvider::createSocketStreamHandle(const URL& url, SocketStreamHandleClient& client, WebSocketIdentifier, PAL::SessionID sessionID, const String& credentialPartition, const StorageSessionProvider* provider)
{
- return SocketStreamHandleImpl::create(url, client, sessionID, credentialPartition, { }, provider);
+ return SocketStreamHandleImpl::create(url, false, client, sessionID, credentialPartition, { }, provider);
@@ -4650,10 +4643,10 @@ index 4ca86baa705196baf616649f3c70ca751f078724..2b38953e0b7a148baf15c12014ba49fa
#if PLATFORM(IOS_FAMILY)
diff --git a/Source/WebCore/platform/graphics/FontCascade.h b/Source/WebCore/platform/graphics/FontCascade.h
-index 387399f14543d6a0144ddc9d853c19f194411ee9..56f5ebb8892ea591c17f03ca671950a62da85229 100644
+index fd99ed1543a085b25cb91561c053f32b3f1b04a6..cf3d1934e73bdfce82afdbaec8dd54049c18a643 100644
--- a/Source/WebCore/platform/graphics/FontCascade.h
+++ b/Source/WebCore/platform/graphics/FontCascade.h
-@@ -274,7 +274,8 @@ private:
+@@ -279,7 +279,8 @@ private:
return true;
if (textRenderingMode == TextRenderingMode::OptimizeSpeed)
return false;
@@ -4772,7 +4765,7 @@ index bc87758878d5163a938af8242c7a6800ea9bd13c..3d0751f8dfe1124bbe054daa2fa0c755
String dataURL(CFDataRef, const String& mimeType);
String dataURL(const ImageData&, const String& mimeType, Optional<double> quality);
diff --git a/Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGLBase.cpp b/Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGLBase.cpp
-index 2ac049e9b4c5e743091e54bd1cd0f3d0bc23f12a..71a9cd1e918e4d15bfd4675bff9c7eabf0b0db0e 100644
+index c4f8b6a1e2907edfa07df0c6eb797873bdd69393..9fd0fc56c8d8cd2fde826bfe96d8355db59616b0 100644
--- a/Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGLBase.cpp
+++ b/Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGLBase.cpp
@@ -27,7 +27,7 @@
@@ -5602,7 +5595,7 @@ index 44737686187a06a92c408ea60b63a48ac8481334..c754a763688b52e7ddd47493296ef9b0
bool PlatformKeyboardEvent::currentCapsLockState()
diff --git a/Source/WebKit/NetworkProcess/NetworkProcess.cpp b/Source/WebKit/NetworkProcess/NetworkProcess.cpp
-index 028e0fbb9e1948b0e089f4add3b0a7050c6ed1ce..9779dbdc51476191298b63c2f9a974ef6f8d1268 100644
+index be8d96662be6dcd85fa3c32929ae0f0b5d182343..149deb04c424ab90b871d26206a200c180744da4 100644
--- a/Source/WebKit/NetworkProcess/NetworkProcess.cpp
+++ b/Source/WebKit/NetworkProcess/NetworkProcess.cpp
@@ -26,7 +26,6 @@
@@ -5613,7 +5606,7 @@ index 028e0fbb9e1948b0e089f4add3b0a7050c6ed1ce..9779dbdc51476191298b63c2f9a974ef
#include "ArgumentCoders.h"
#include "Attachment.h"
#include "AuthenticationManager.h"
-@@ -609,6 +608,41 @@ void NetworkProcess::destroySession(PAL::SessionID sessionID)
+@@ -602,6 +601,41 @@ void NetworkProcess::destroySession(PAL::SessionID sessionID)
#endif
}
@@ -5656,7 +5649,7 @@ index 028e0fbb9e1948b0e089f4add3b0a7050c6ed1ce..9779dbdc51476191298b63c2f9a974ef
void NetworkProcess::dumpResourceLoadStatistics(PAL::SessionID sessionID, CompletionHandler<void(String)>&& completionHandler)
{
diff --git a/Source/WebKit/NetworkProcess/NetworkProcess.h b/Source/WebKit/NetworkProcess/NetworkProcess.h
-index f23fd580ef54cadf80f46836656fb23fd4ddf2fc..4d2d9478b9b1f70e66a150108eafee2ffe24b3a6 100644
+index aa73377b732f610b8679056c37df28aeea07af83..c4a1f478d9d716b94cfee761b2b57e633f75c6b3 100644
--- a/Source/WebKit/NetworkProcess/NetworkProcess.h
+++ b/Source/WebKit/NetworkProcess/NetworkProcess.h
@@ -76,6 +76,7 @@ class SessionID;
@@ -5680,10 +5673,10 @@ index f23fd580ef54cadf80f46836656fb23fd4ddf2fc..4d2d9478b9b1f70e66a150108eafee2f
void clearPrevalentResource(PAL::SessionID, const RegistrableDomain&, CompletionHandler<void()>&&);
void clearUserInteraction(PAL::SessionID, const RegistrableDomain&, CompletionHandler<void()>&&);
diff --git a/Source/WebKit/NetworkProcess/NetworkProcess.messages.in b/Source/WebKit/NetworkProcess/NetworkProcess.messages.in
-index 002ecdb833b2941ae8613fa64f01df89896df346..d33a9710d200b6854be6ff873fcbdd8a2b5b8b52 100644
+index d9ddde49e4c5533bf0055c04f95233fc07ed597f..2a6099a695e4137cfa6a0f93ff28d26bc632a352 100644
--- a/Source/WebKit/NetworkProcess/NetworkProcess.messages.in
+++ b/Source/WebKit/NetworkProcess/NetworkProcess.messages.in
-@@ -83,6 +83,11 @@ messages -> NetworkProcess LegacyReceiver {
+@@ -82,6 +82,11 @@ messages -> NetworkProcess LegacyReceiver {
PreconnectTo(PAL::SessionID sessionID, WebKit::WebPageProxyIdentifier webPageProxyID, WebCore::PageIdentifier webPageID, URL url, String userAgent, enum:uint8_t WebCore::StoredCredentialsPolicy storedCredentialsPolicy, enum:bool Optional<WebKit::NavigatingToAppBoundDomain> isNavigatingToAppBoundDomain);
@@ -5696,7 +5689,7 @@ index 002ecdb833b2941ae8613fa64f01df89896df346..d33a9710d200b6854be6ff873fcbdd8a
ClearPrevalentResource(PAL::SessionID sessionID, WebCore::RegistrableDomain resourceDomain) -> () Async
ClearUserInteraction(PAL::SessionID sessionID, WebCore::RegistrableDomain resourceDomain) -> () Async
diff --git a/Source/WebKit/NetworkProcess/NetworkSession.h b/Source/WebKit/NetworkProcess/NetworkSession.h
-index 5d3ef0ef6eb11f501cbfc84b387a79a4836c99ac..748b5bad96c4b6b67552c769dc57d685a19b753e 100644
+index 6deff0d0ba9cd2bdac1b2177346e3a19c40e64e6..b98c6b4591fa56b0aabdbe9ebfb121e91a5ac045 100644
--- a/Source/WebKit/NetworkProcess/NetworkSession.h
+++ b/Source/WebKit/NetworkProcess/NetworkSession.h
@@ -146,6 +146,9 @@ public:
@@ -5709,7 +5702,7 @@ index 5d3ef0ef6eb11f501cbfc84b387a79a4836c99ac..748b5bad96c4b6b67552c769dc57d685
#if ENABLE(SERVICE_WORKER)
void addSoftUpdateLoader(std::unique_ptr<ServiceWorkerSoftUpdateLoader>&& loader) { m_softUpdateLoaders.add(WTFMove(loader)); }
void removeSoftUpdateLoader(ServiceWorkerSoftUpdateLoader* loader) { m_softUpdateLoaders.remove(loader); }
-@@ -179,6 +182,7 @@ protected:
+@@ -178,6 +181,7 @@ protected:
#endif
bool m_isStaleWhileRevalidateEnabled { false };
UniqueRef<AdClickAttributionManager> m_adClickAttribution;
@@ -5731,10 +5724,10 @@ index 5b489cc538f7c071510106c58f5c094ec9a8e1b8..20d0718eb896bcd9f97fd80572844a57
{
}
diff --git a/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm b/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm
-index 36a8c2e6397120f7ccbe8255737fbb264c8f8f44..33323fd012d2177aa36fd7a70b780267145ae001 100644
+index 5072c635f6d54f65e40db84d868c033516318285..513c8652fe45153571c8ffc70e34e167a4f33ef7 100644
--- a/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm
+++ b/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm
-@@ -657,7 +657,7 @@ static inline void processServerTrustEvaluation(NetworkSessionCocoa& session, Se
+@@ -661,7 +661,7 @@ static inline void processServerTrustEvaluation(NetworkSessionCocoa& session, Se
NegotiatedLegacyTLS negotiatedLegacyTLS = NegotiatedLegacyTLS::No;
if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) {
@@ -5878,7 +5871,7 @@ index 4c120d6830582861432e5e58fba5707206350cd0..3509c62ac2c970fdcf78db2503c0cc42
bool isThirdPartyRequest(const WebCore::ResourceRequest&);
bool shouldBlockCookies(const WebCore::ResourceRequest&);
diff --git a/Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp b/Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp
-index daeece2e94a647c18b161fb6854cd88c82e20d7b..3da31e620f2fd3c86fe34729db72d1e7260af72f 100644
+index baa67832b59e94157f307666ae464c8fbf0dda27..90285a3ebda12b7383b98da81aa16415bb30e939 100644
--- a/Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp
+++ b/Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp
@@ -444,6 +444,8 @@ bool NetworkDataTaskSoup::tlsConnectionAcceptCertificate(GTlsCertificate* certif
@@ -5891,10 +5884,10 @@ index daeece2e94a647c18b161fb6854cd88c82e20d7b..3da31e620f2fd3c86fe34729db72d1e7
if (!error)
return true;
diff --git a/Source/WebKit/NetworkProcess/soup/NetworkSessionSoup.cpp b/Source/WebKit/NetworkProcess/soup/NetworkSessionSoup.cpp
-index 90613335efc8af45fbc88feaa3138e7626103346..be36214e279457f16333eee3ca687b3a54cbafe8 100644
+index f575f3b5938db1d1d6266521ba020be614a4cb55..4c05f5deaf1827591b4b4c933e2cc0a6e11c81d6 100644
--- a/Source/WebKit/NetworkProcess/soup/NetworkSessionSoup.cpp
+++ b/Source/WebKit/NetworkProcess/soup/NetworkSessionSoup.cpp
-@@ -103,6 +103,11 @@ static gboolean webSocketAcceptCertificateCallback(GTlsConnection*, GTlsCertific
+@@ -106,6 +106,11 @@ static gboolean webSocketAcceptCertificateCallback(GTlsConnection*, GTlsCertific
return !SoupNetworkSession::checkTLSErrors(soupURIToURL(soup_message_get_uri(soupMessage)), certificate, errors);
}
@@ -5906,7 +5899,7 @@ index 90613335efc8af45fbc88feaa3138e7626103346..be36214e279457f16333eee3ca687b3a
static void webSocketMessageNetworkEventCallback(SoupMessage* soupMessage, GSocketClientEvent event, GIOStream* connection)
{
if (event != G_SOCKET_CLIENT_TLS_HANDSHAKING)
-@@ -111,6 +116,14 @@ static void webSocketMessageNetworkEventCallback(SoupMessage* soupMessage, GSock
+@@ -114,6 +119,14 @@ static void webSocketMessageNetworkEventCallback(SoupMessage* soupMessage, GSock
g_signal_connect(connection, "accept-certificate", G_CALLBACK(webSocketAcceptCertificateCallback), soupMessage);
}
@@ -5921,7 +5914,7 @@ index 90613335efc8af45fbc88feaa3138e7626103346..be36214e279457f16333eee3ca687b3a
std::unique_ptr<WebSocketTask> NetworkSessionSoup::createWebSocketTask(NetworkSocketChannel& channel, const ResourceRequest& request, const String& protocol)
{
GUniquePtr<SoupURI> soupURI = request.createSoupURI();
-@@ -119,8 +132,12 @@ std::unique_ptr<WebSocketTask> NetworkSessionSoup::createWebSocketTask(NetworkSo
+@@ -122,8 +135,12 @@ std::unique_ptr<WebSocketTask> NetworkSessionSoup::createWebSocketTask(NetworkSo
GRefPtr<SoupMessage> soupMessage = adoptGRef(soup_message_new_from_uri(SOUP_METHOD_GET, soupURI.get()));
request.updateSoupMessage(soupMessage.get(), blobRegistry());
@@ -5937,10 +5930,10 @@ index 90613335efc8af45fbc88feaa3138e7626103346..be36214e279457f16333eee3ca687b3a
}
diff --git a/Source/WebKit/PlatformGTK.cmake b/Source/WebKit/PlatformGTK.cmake
-index 85eceea7c94e44a12317aa7dce05e68891b46236..94921202cebda21e76fd50f2ef7c54c178565c94 100644
+index 715d38d76b891489ef95a74e31389b8844ebf102..d86a1c3cdee68b5646a109d9bf56056634c54cb2 100644
--- a/Source/WebKit/PlatformGTK.cmake
+++ b/Source/WebKit/PlatformGTK.cmake
-@@ -443,6 +443,9 @@ list(APPEND WebKit_SYSTEM_INCLUDE_DIRECTORIES
+@@ -444,6 +444,9 @@ list(APPEND WebKit_SYSTEM_INCLUDE_DIRECTORIES
${GSTREAMER_PBUTILS_INCLUDE_DIRS}
${GTK_INCLUDE_DIRS}
${LIBSOUP_INCLUDE_DIRS}
@@ -5950,7 +5943,7 @@ index 85eceea7c94e44a12317aa7dce05e68891b46236..94921202cebda21e76fd50f2ef7c54c1
)
if (USE_WPE_RENDERER)
-@@ -496,9 +499,18 @@ if (USE_LIBWEBRTC)
+@@ -497,9 +500,18 @@ if (USE_LIBWEBRTC)
list(APPEND WebKit_SYSTEM_INCLUDE_DIRECTORIES
"${THIRDPARTY_DIR}/libwebrtc/Source/"
"${THIRDPARTY_DIR}/libwebrtc/Source/webrtc"
@@ -5970,7 +5963,7 @@ index 85eceea7c94e44a12317aa7dce05e68891b46236..94921202cebda21e76fd50f2ef7c54c1
set(WebKit2GTK_ENUM_GENERATION_HEADERS ${WebKit2GTK_INSTALLED_HEADERS})
list(REMOVE_ITEM WebKit2GTK_ENUM_GENERATION_HEADERS ${DERIVED_SOURCES_WEBKIT2GTK_API_DIR}/WebKitEnumTypes.h)
diff --git a/Source/WebKit/PlatformWPE.cmake b/Source/WebKit/PlatformWPE.cmake
-index 22837e4a46e6c05c72fb1afbb3eff3fd4cbd3846..befb481cffc0aa74b4025a1b586f14e0c5dae8e7 100644
+index 5767dd925013604eee66b763df4c3876e6dc1a14..7f9ed66602622de8d71f6a4d23a19b038bce5f2f 100644
--- a/Source/WebKit/PlatformWPE.cmake
+++ b/Source/WebKit/PlatformWPE.cmake
@@ -257,6 +257,7 @@ list(APPEND WebKit_INCLUDE_DIRECTORIES
@@ -5981,9 +5974,9 @@ index 22837e4a46e6c05c72fb1afbb3eff3fd4cbd3846..befb481cffc0aa74b4025a1b586f14e0
"${WEBKIT_DIR}/UIProcess/gstreamer"
"${WEBKIT_DIR}/UIProcess/linux"
"${WEBKIT_DIR}/UIProcess/soup"
-@@ -283,8 +284,17 @@ list(APPEND WebKit_SYSTEM_INCLUDE_DIRECTORIES
+@@ -282,8 +283,17 @@ list(APPEND WebKit_SYSTEM_INCLUDE_DIRECTORIES
+ ${GIO_UNIX_INCLUDE_DIRS}
${GLIB_INCLUDE_DIRS}
- ${LIBSECCOMP_INCLUDE_DIRS}
${LIBSOUP_INCLUDE_DIRS}
+# Playwright begin
+ "${THIRDPARTY_DIR}/libwebrtc/Source/third_party/libyuv/include"
@@ -6000,7 +5993,7 @@ index 22837e4a46e6c05c72fb1afbb3eff3fd4cbd3846..befb481cffc0aa74b4025a1b586f14e0
Cairo::Cairo
Freetype::Freetype
diff --git a/Source/WebKit/PlatformWin.cmake b/Source/WebKit/PlatformWin.cmake
-index 3b94f4dba2c3b9659a1269bfe030d5d010b5b1bd..74df6c2885dcce0e2a1224c193f1d1d4d89baaab 100644
+index 6f057c93c9124a7dd62fab0c82bf1991a426ff0d..b2ade07cb352b29efb6f09c520949a7440cdce9f 100644
--- a/Source/WebKit/PlatformWin.cmake
+++ b/Source/WebKit/PlatformWin.cmake
@@ -59,8 +59,12 @@ list(APPEND WebKit_SOURCES
@@ -6080,7 +6073,7 @@ index 3b94f4dba2c3b9659a1269bfe030d5d010b5b1bd..74df6c2885dcce0e2a1224c193f1d1d4
set(WebKitCommonIncludeDirectories ${WebKit_INCLUDE_DIRECTORIES})
set(WebKitCommonSystemIncludeDirectories ${WebKit_SYSTEM_INCLUDE_DIRECTORIES})
-@@ -169,6 +230,7 @@ if (${WTF_PLATFORM_WIN_CAIRO})
+@@ -170,6 +231,7 @@ if (${WTF_PLATFORM_WIN_CAIRO})
OpenSSL::SSL
mfuuid.lib
strmiids.lib
@@ -6165,10 +6158,10 @@ index d6f9902b963bd9a0036a6008d719c3e5b15402c4..8a23efeab7125f86d3b990bb09921ecd
NSEvent* nativeEvent() const { return m_nativeEvent.get(); }
#elif PLATFORM(GTK)
diff --git a/Source/WebKit/Shared/WebCoreArgumentCoders.cpp b/Source/WebKit/Shared/WebCoreArgumentCoders.cpp
-index 3229da7c48bf5893c1a2126d844bf41e399eac0f..3254b3f4ec2dbe010da1d2eb608c01b554c1a85a 100644
+index 7127f99abe58a1dc34299a20f50dc89bd6eb30d9..a05182e0c00cdc80cc63b76761bb80f8d596d96e 100644
--- a/Source/WebKit/Shared/WebCoreArgumentCoders.cpp
+++ b/Source/WebKit/Shared/WebCoreArgumentCoders.cpp
-@@ -1491,6 +1491,9 @@ void ArgumentCoder<WindowFeatures>::encode(Encoder& encoder, const WindowFeature
+@@ -1490,6 +1490,9 @@ void ArgumentCoder<WindowFeatures>::encode(Encoder& encoder, const WindowFeature
encoder << windowFeatures.resizable;
encoder << windowFeatures.fullscreen;
encoder << windowFeatures.dialog;
@@ -6178,7 +6171,7 @@ index 3229da7c48bf5893c1a2126d844bf41e399eac0f..3254b3f4ec2dbe010da1d2eb608c01b5
}
bool ArgumentCoder<WindowFeatures>::decode(Decoder& decoder, WindowFeatures& windowFeatures)
-@@ -1519,6 +1522,12 @@ bool ArgumentCoder<WindowFeatures>::decode(Decoder& decoder, WindowFeatures& win
+@@ -1518,6 +1521,12 @@ bool ArgumentCoder<WindowFeatures>::decode(Decoder& decoder, WindowFeatures& win
return false;
if (!decoder.decode(windowFeatures.dialog))
return false;
@@ -6313,7 +6306,7 @@ index cccb560418f32fad40587ac083b95f398eb1399d..f6b0aee44e5f12055dd14ad0636d780d
{
}
diff --git a/Source/WebKit/Shared/WebPageCreationParameters.cpp b/Source/WebKit/Shared/WebPageCreationParameters.cpp
-index f1660b29a484b3ec8b040aef0a34395a859d43e8..1d83c80df41b3c484b405ba503606434934b1dc2 100644
+index cd46705db0d00962d316badf1862b1480438e156..8667922dbf4f98f002f407f937e4e22e9e36968d 100644
--- a/Source/WebKit/Shared/WebPageCreationParameters.cpp
+++ b/Source/WebKit/Shared/WebPageCreationParameters.cpp
@@ -147,6 +147,8 @@ void WebPageCreationParameters::encode(IPC::Encoder& encoder) const
@@ -6325,7 +6318,7 @@ index f1660b29a484b3ec8b040aef0a34395a859d43e8..1d83c80df41b3c484b405ba503606434
encoder << shouldCaptureAudioInUIProcess;
encoder << shouldCaptureAudioInGPUProcess;
encoder << shouldCaptureVideoInUIProcess;
-@@ -475,7 +477,10 @@ Optional<WebPageCreationParameters> WebPageCreationParameters::decode(IPC::Decod
+@@ -477,7 +479,10 @@ Optional<WebPageCreationParameters> WebPageCreationParameters::decode(IPC::Decod
if (!processDisplayName)
return WTF::nullopt;
parameters.processDisplayName = WTFMove(*processDisplayName);
@@ -6338,10 +6331,10 @@ index f1660b29a484b3ec8b040aef0a34395a859d43e8..1d83c80df41b3c484b405ba503606434
return WTF::nullopt;
diff --git a/Source/WebKit/Shared/WebPageCreationParameters.h b/Source/WebKit/Shared/WebPageCreationParameters.h
-index f6b7d7726fc4232a7f525584523b094de6009d1d..ba77ded9ff40140b339bf0caab1c013c86c15faa 100644
+index 723a2b1424a50a9146c4ead4a5419f8eeda94bf7..59bb6298193ec26f38eecf11384ae6b5c895b4bb 100644
--- a/Source/WebKit/Shared/WebPageCreationParameters.h
+++ b/Source/WebKit/Shared/WebPageCreationParameters.h
-@@ -234,6 +234,8 @@ struct WebPageCreationParameters {
+@@ -236,6 +236,8 @@ struct WebPageCreationParameters {
WebCore::ShouldRelaxThirdPartyCookieBlocking shouldRelaxThirdPartyCookieBlocking { WebCore::ShouldRelaxThirdPartyCookieBlocking::No };
@@ -6351,10 +6344,10 @@ index f6b7d7726fc4232a7f525584523b094de6009d1d..ba77ded9ff40140b339bf0caab1c013c
String themeName;
#endif
diff --git a/Source/WebKit/Shared/WebPreferences.yaml b/Source/WebKit/Shared/WebPreferences.yaml
-index 6daf3d593a256828feff7ce5751cbff762b540b7..b3069f1aba4ddf6b2a8ebea00df1a7059e86f3a4 100644
+index 8ac89c6728710098b8eb6ea02d672aa0344b85f8..05a28c8eae3a1f993915edc0f1ce0e83e45ff781 100644
--- a/Source/WebKit/Shared/WebPreferences.yaml
+++ b/Source/WebKit/Shared/WebPreferences.yaml
-@@ -325,7 +325,7 @@ MediaControlsScaleWithPageZoom:
+@@ -297,7 +297,7 @@ MediaControlsScaleWithPageZoom:
InspectorStartsAttached:
type: bool
@@ -6363,7 +6356,11 @@ index 6daf3d593a256828feff7ce5751cbff762b540b7..b3069f1aba4ddf6b2a8ebea00df1a705
webcoreBinding: none
ShowsToolTipOverTruncatedText:
-@@ -1493,7 +1493,7 @@ WebGPUEnabled:
+diff --git a/Source/WebKit/Shared/WebPreferencesExperimental.yaml b/Source/WebKit/Shared/WebPreferencesExperimental.yaml
+index 2427554274a9d622a93437cd43d721a1257c9819..456d45263b252e05adc859aa2a340f486f923d1e 100644
+--- a/Source/WebKit/Shared/WebPreferencesExperimental.yaml
++++ b/Source/WebKit/Shared/WebPreferencesExperimental.yaml
+@@ -280,7 +280,7 @@ WebGPUEnabled:
MaskWebGLStringsEnabled:
type: bool
@@ -6371,7 +6368,7 @@ index 6daf3d593a256828feff7ce5751cbff762b540b7..b3069f1aba4ddf6b2a8ebea00df1a705
+ defaultValue: false
humanReadableName: "Mask WebGL Strings"
humanReadableDescription: "Mask WebGL Vendor, Renderer, Shader Language Strings"
- category: experimental
+ webcoreBinding: RuntimeEnabledFeatures
diff --git a/Source/WebKit/Shared/gtk/NativeWebKeyboardEventGtk.cpp b/Source/WebKit/Shared/gtk/NativeWebKeyboardEventGtk.cpp
index c76a9e1f7dae7a31c4048d8f00d849a18ebaff23..1cfd9c7acb69dea69783c42b3f427929509782a4 100644
--- a/Source/WebKit/Shared/gtk/NativeWebKeyboardEventGtk.cpp
@@ -6450,10 +6447,10 @@ index 88d53d236cd6d62735f03678a04ca9c198dddacb..b8f8efc57ab00dc5725660c5a8ad56a3
return WebTouchEvent();
}
diff --git a/Source/WebKit/Sources.txt b/Source/WebKit/Sources.txt
-index ad782c2e62f72f7eea85c31b00f7ba209f22b495..0d141155dabeff15d9cdfd12a865aa0fac0ed1eb 100644
+index c884f0ede8b9dfab332c843de4b85b116120b0b9..fd09924494a966be0bc47b87cd8aade8cb6eebaf 100644
--- a/Source/WebKit/Sources.txt
+++ b/Source/WebKit/Sources.txt
-@@ -272,16 +272,20 @@ Shared/WebsiteData/WebsiteData.cpp
+@@ -274,16 +274,20 @@ Shared/WebsiteData/WebsiteData.cpp
UIProcess/AuxiliaryProcessProxy.cpp
UIProcess/BackgroundProcessResponsivenessTimer.cpp
@@ -6474,7 +6471,7 @@ index ad782c2e62f72f7eea85c31b00f7ba209f22b495..0d141155dabeff15d9cdfd12a865aa0f
UIProcess/ResponsivenessTimer.cpp
UIProcess/SuspendedPageProxy.cpp
UIProcess/SystemPreviewController.cpp
-@@ -318,6 +322,8 @@ UIProcess/WebOpenPanelResultListenerProxy.cpp
+@@ -321,6 +325,8 @@ UIProcess/WebOpenPanelResultListenerProxy.cpp
UIProcess/WebPageDiagnosticLoggingClient.cpp
UIProcess/WebPageGroup.cpp
UIProcess/WebPageInjectedBundleClient.cpp
@@ -6483,7 +6480,7 @@ index ad782c2e62f72f7eea85c31b00f7ba209f22b495..0d141155dabeff15d9cdfd12a865aa0f
UIProcess/WebPageProxy.cpp
UIProcess/WebPasteboardProxy.cpp
UIProcess/WebPreferences.cpp
-@@ -437,6 +443,9 @@ UIProcess/Inspector/WebPageDebuggable.cpp
+@@ -440,6 +446,9 @@ UIProcess/Inspector/WebPageDebuggable.cpp
UIProcess/Inspector/WebPageInspectorController.cpp
UIProcess/Inspector/Agents/InspectorBrowserAgent.cpp
@@ -6494,7 +6491,7 @@ index ad782c2e62f72f7eea85c31b00f7ba209f22b495..0d141155dabeff15d9cdfd12a865aa0f
UIProcess/Media/AudioSessionRoutingArbitratorProxy.cpp
UIProcess/Media/MediaUsageManager.cpp
diff --git a/Source/WebKit/SourcesCocoa.txt b/Source/WebKit/SourcesCocoa.txt
-index 975e761793d881eb64526ec3f52d9eaf8c7f6683..d293c5315467343d4c639fee7bdf2fb277de0d15 100644
+index 23ed4f02cb81782ac1e3a1efa54f364202a70dd4..617663678c1f9096bb7d0b53519ba3951203a038 100644
--- a/Source/WebKit/SourcesCocoa.txt
+++ b/Source/WebKit/SourcesCocoa.txt
@@ -249,6 +249,7 @@ UIProcess/API/Cocoa/_WKApplicationManifest.mm
@@ -6514,7 +6511,7 @@ index 975e761793d881eb64526ec3f52d9eaf8c7f6683..d293c5315467343d4c639fee7bdf2fb2
UIProcess/Inspector/mac/WKInspectorViewController.mm
UIProcess/Inspector/mac/WKInspectorWKWebView.mm
diff --git a/Source/WebKit/SourcesGTK.txt b/Source/WebKit/SourcesGTK.txt
-index fc8861c221a8d10cad7e5e6fa18be3e3619cf31b..277cff2e4bbbf083be2e281e3b4977808464bd48 100644
+index 31dc21754f252d6df56e169e803222a250de8490..94dbac584e99df0b0e80d972cb83669667b0cc88 100644
--- a/Source/WebKit/SourcesGTK.txt
+++ b/Source/WebKit/SourcesGTK.txt
@@ -125,6 +125,7 @@ UIProcess/API/glib/WebKitAuthenticationRequest.cpp @no-unify
@@ -6525,7 +6522,7 @@ index fc8861c221a8d10cad7e5e6fa18be3e3619cf31b..277cff2e4bbbf083be2e281e3b497780
UIProcess/API/glib/WebKitContextMenuClient.cpp @no-unify
UIProcess/API/glib/WebKitCookieManager.cpp @no-unify
UIProcess/API/glib/WebKitCredential.cpp @no-unify
-@@ -236,6 +237,7 @@ UIProcess/WebsiteData/unix/WebsiteDataStoreUnix.cpp
+@@ -237,6 +238,7 @@ UIProcess/WebsiteData/unix/WebsiteDataStoreUnix.cpp
UIProcess/cairo/BackingStoreCairo.cpp @no-unify
@@ -6533,7 +6530,7 @@ index fc8861c221a8d10cad7e5e6fa18be3e3619cf31b..277cff2e4bbbf083be2e281e3b497780
UIProcess/glib/WebProcessPoolGLib.cpp
UIProcess/glib/WebProcessProxyGLib.cpp
UIProcess/glib/WebsiteDataStoreGLib.cpp @no-unify
-@@ -251,6 +253,7 @@ UIProcess/gtk/ClipboardGtk3.cpp @no-unify
+@@ -252,6 +254,7 @@ UIProcess/gtk/ClipboardGtk3.cpp @no-unify
UIProcess/gtk/ClipboardGtk4.cpp @no-unify
UIProcess/gtk/GestureController.cpp
UIProcess/gtk/HardwareAccelerationManager.cpp
@@ -6541,7 +6538,7 @@ index fc8861c221a8d10cad7e5e6fa18be3e3619cf31b..277cff2e4bbbf083be2e281e3b497780
UIProcess/gtk/KeyBindingTranslator.cpp
UIProcess/gtk/PointerLockManager.cpp @no-unify
UIProcess/gtk/PointerLockManagerWayland.cpp @no-unify
-@@ -261,6 +264,8 @@ UIProcess/gtk/WaylandCompositor.cpp @no-unify
+@@ -262,6 +265,8 @@ UIProcess/gtk/WaylandCompositor.cpp @no-unify
UIProcess/gtk/WebColorPickerGtk.cpp
UIProcess/gtk/WebContextMenuProxyGtk.cpp
UIProcess/gtk/WebDataListSuggestionsDropdownGtk.cpp
@@ -6551,7 +6548,7 @@ index fc8861c221a8d10cad7e5e6fa18be3e3619cf31b..277cff2e4bbbf083be2e281e3b497780
UIProcess/gtk/WebPasteboardProxyGtk.cpp
UIProcess/gtk/WebPopupMenuProxyGtk.cpp
diff --git a/Source/WebKit/SourcesWPE.txt b/Source/WebKit/SourcesWPE.txt
-index 6e01f0414e3e728bd6467e81a220723a105685c7..2ddea58b7beb171e4b675b589127f70d1bdaae81 100644
+index 3c299dfd72792cf1b799de6486626c8039ddbc86..c3196cab79ef246cc083d3512957694e42a45e24 100644
--- a/Source/WebKit/SourcesWPE.txt
+++ b/Source/WebKit/SourcesWPE.txt
@@ -117,6 +117,7 @@ UIProcess/API/glib/WebKitAuthenticationRequest.cpp @no-unify
@@ -6562,7 +6559,7 @@ index 6e01f0414e3e728bd6467e81a220723a105685c7..2ddea58b7beb171e4b675b589127f70d
UIProcess/API/glib/WebKitContextMenuClient.cpp @no-unify
UIProcess/API/glib/WebKitCookieManager.cpp @no-unify
UIProcess/API/glib/WebKitCredential.cpp @no-unify
-@@ -194,7 +195,7 @@ UIProcess/Automation/wpe/WebAutomationSessionWPE.cpp
+@@ -195,7 +196,7 @@ UIProcess/Automation/wpe/WebAutomationSessionWPE.cpp
UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp
UIProcess/geoclue/GeoclueGeolocationProvider.cpp
@@ -6571,7 +6568,7 @@ index 6e01f0414e3e728bd6467e81a220723a105685c7..2ddea58b7beb171e4b675b589127f70d
UIProcess/glib/WebProcessPoolGLib.cpp
UIProcess/glib/WebProcessProxyGLib.cpp
UIProcess/glib/WebsiteDataStoreGLib.cpp @no-unify
-@@ -216,6 +217,10 @@ UIProcess/linux/MemoryPressureMonitor.cpp
+@@ -217,6 +218,10 @@ UIProcess/linux/MemoryPressureMonitor.cpp
UIProcess/soup/WebCookieManagerProxySoup.cpp
UIProcess/soup/WebProcessPoolSoup.cpp
@@ -6583,7 +6580,7 @@ index 6e01f0414e3e728bd6467e81a220723a105685c7..2ddea58b7beb171e4b675b589127f70d
WebProcess/GPU/media/gstreamer/VideoLayerRemoteGStreamer.cpp
diff --git a/Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.cpp b/Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.cpp
-index 7227587e55153e3d8a13386dedd07de9a5d498be..c870126fc1ccd4cebe6b7a51074f489c83592c28 100644
+index 18585f61bb6ecabec39ff0c03b862c65856dca24..21bab039d1f6116ebf9c59bc42a695a45f4701e8 100644
--- a/Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.cpp
+++ b/Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.cpp
@@ -53,6 +53,9 @@ Ref<ProcessPoolConfiguration> ProcessPoolConfiguration::copy()
@@ -6597,7 +6594,7 @@ index 7227587e55153e3d8a13386dedd07de9a5d498be..c870126fc1ccd4cebe6b7a51074f489c
copy->m_shouldTakeUIBackgroundAssertion = this->m_shouldTakeUIBackgroundAssertion;
copy->m_shouldCaptureDisplayInUIProcess = this->m_shouldCaptureDisplayInUIProcess;
diff --git a/Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.h b/Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.h
-index 41ed3857db50b2944c78933f22b5acdb84ddaf3d..f1105988b2b0ccf3e8a87f7d0ed5504be84226b4 100644
+index 64924902f19811792537a15a32ed4d706daf9670..28906745477d89bb0e7c2b9c3f1523d2d76803d6 100644
--- a/Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.h
+++ b/Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.h
@@ -98,6 +98,11 @@ public:
@@ -6612,7 +6609,7 @@ index 41ed3857db50b2944c78933f22b5acdb84ddaf3d..f1105988b2b0ccf3e8a87f7d0ed5504b
bool alwaysRunsAtBackgroundPriority() const { return m_alwaysRunsAtBackgroundPriority; }
void setAlwaysRunsAtBackgroundPriority(bool alwaysRunsAtBackgroundPriority) { m_alwaysRunsAtBackgroundPriority = alwaysRunsAtBackgroundPriority; }
-@@ -160,6 +165,9 @@ private:
+@@ -157,6 +162,9 @@ private:
bool m_ignoreSynchronousMessagingTimeoutsForTesting { false };
bool m_attrStyleEnabled { false };
Vector<WTF::String> m_overrideLanguages;
@@ -6623,7 +6620,7 @@ index 41ed3857db50b2944c78933f22b5acdb84ddaf3d..f1105988b2b0ccf3e8a87f7d0ed5504b
bool m_shouldTakeUIBackgroundAssertion { true };
bool m_shouldCaptureDisplayInUIProcess { DEFAULT_CAPTURE_DISPLAY_IN_UI_PROCESS };
diff --git a/Source/WebKit/UIProcess/API/APIUIClient.h b/Source/WebKit/UIProcess/API/APIUIClient.h
-index 2e5be65bdfdccb888915d08df86abda741aadcb5..2da7443b8365431d2640ec54a816435986e285d3 100644
+index ce7fc1ae1fa9bb4c82a8d6746c28194a58bea994..6e87142e6e1e5f72f867e622736869cb4e9ebe4d 100644
--- a/Source/WebKit/UIProcess/API/APIUIClient.h
+++ b/Source/WebKit/UIProcess/API/APIUIClient.h
@@ -97,6 +97,7 @@ public:
@@ -6635,10 +6632,10 @@ index 2e5be65bdfdccb888915d08df86abda741aadcb5..2da7443b8365431d2640ec54a8164359
virtual void setStatusText(WebKit::WebPageProxy*, const WTF::String&) { }
virtual void mouseDidMoveOverElement(WebKit::WebPageProxy&, const WebKit::WebHitTestResultData&, OptionSet<WebKit::WebEvent::Modifier>, Object*) { }
diff --git a/Source/WebKit/UIProcess/API/C/WKContext.cpp b/Source/WebKit/UIProcess/API/C/WKContext.cpp
-index 8fb8e096d466e2361cdb5203efc9c568c9e69511..ed082f4af22e7f5c6942e8cd8fcc3e24b3883623 100644
+index 58c5453f48987f5e1afafef34c43335f1b4cc990..47817453bc2c0e33e848fe7838d5241c9a9666b4 100644
--- a/Source/WebKit/UIProcess/API/C/WKContext.cpp
+++ b/Source/WebKit/UIProcess/API/C/WKContext.cpp
-@@ -436,6 +436,11 @@ WKWebsiteDataStoreRef WKContextGetWebsiteDataStore(WKContextRef)
+@@ -421,6 +421,11 @@ WKWebsiteDataStoreRef WKContextGetWebsiteDataStore(WKContextRef)
return WKWebsiteDataStoreGetDefaultDataStore();
}
@@ -6651,10 +6648,10 @@ index 8fb8e096d466e2361cdb5203efc9c568c9e69511..ed082f4af22e7f5c6942e8cd8fcc3e24
{
return reinterpret_cast<WKApplicationCacheManagerRef>(WKWebsiteDataStoreGetDefaultDataStore());
diff --git a/Source/WebKit/UIProcess/API/C/WKContext.h b/Source/WebKit/UIProcess/API/C/WKContext.h
-index 08f54ff5057f8d04e26adfe2c0e3a472647935e7..8f3ae0f0346514cec926ea7babff40c22fd4097a 100644
+index 1d8fab8a1486aadb494144b98f10e93638d0c5e6..67a92dab224b1e6c5ad006c6b82d87100cdd3397 100644
--- a/Source/WebKit/UIProcess/API/C/WKContext.h
+++ b/Source/WebKit/UIProcess/API/C/WKContext.h
-@@ -168,6 +168,7 @@ WK_EXPORT void WKContextStartMemorySampler(WKContextRef context, WKDoubleRef int
+@@ -166,6 +166,7 @@ WK_EXPORT void WKContextStartMemorySampler(WKContextRef context, WKDoubleRef int
WK_EXPORT void WKContextStopMemorySampler(WKContextRef context);
WK_EXPORT WKWebsiteDataStoreRef WKContextGetWebsiteDataStore(WKContextRef context) WK_C_API_DEPRECATED_WITH_REPLACEMENT(WKWebsiteDataStoreGetDefaultDataStore);
@@ -6706,7 +6703,7 @@ index 026121d114c5fcad84c1396be8d692625beaa3bd..edd6e5cae033124c589959a42522fde0
}
#endif
diff --git a/Source/WebKit/UIProcess/API/C/WKPage.cpp b/Source/WebKit/UIProcess/API/C/WKPage.cpp
-index 617d018611110b8dadb1252a5c5768fb2c937e12..108972f39fe9d7dcb1a39a88114783f2e1db1486 100644
+index 648f300961a5060c9cdf03e3cf80458bf2bb50dd..633414bd46653198882409e0e305156581aebbee 100644
--- a/Source/WebKit/UIProcess/API/C/WKPage.cpp
+++ b/Source/WebKit/UIProcess/API/C/WKPage.cpp
@@ -1692,6 +1692,13 @@ void WKPageSetPageUIClient(WKPageRef pageRef, const WKPageUIClientBase* wkClient
@@ -6753,20 +6750,20 @@ index 1d2febfba8833912f72216aa53c8c20090ee2d8b..1b2c3d84b15b12f1a187c0b7622db43c
#ifdef __cplusplus
diff --git a/Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.cpp b/Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.cpp
-index f3563e9441ce6b14b42cfce85f19d9d92900d353..26753419a3609120067a62fd5a58c136e2c20dfd 100644
+index 9dda591c95189ab0c25ac55466c0a2bfc3927ebc..17163db6cff5c2fac0b698d25eafd9f91b3d2347 100644
--- a/Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.cpp
+++ b/Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.cpp
-@@ -653,7 +653,7 @@ void WKWebsiteDataStoreSetResourceLoadStatisticsThirdPartyCNAMEDomainForTesting(
+@@ -686,7 +686,7 @@ void WKWebsiteDataStoreSetResourceLoadStatisticsThirdPartyCNAMEDomainForTesting(
void WKWebsiteDataStoreSetAppBoundDomainsForTesting(WKArrayRef originURLsRef, void* context, WKWebsiteDataStoreSetAppBoundDomainsForTestingFunction completionHandler)
{
- #if PLATFORM(COCOA)
+ #if ENABLE(APP_BOUND_DOMAINS)
- RefPtr<API::Array> originURLsArray = toImpl(originURLsRef);
+ RefPtr<API::Array> originURLsArray = WebKit::toImpl(originURLsRef);
size_t newSize = originURLsArray ? originURLsArray->size() : 0;
HashSet<WebCore::RegistrableDomain> domains;
domains.reserveInitialCapacity(newSize);
diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKProcessPool.mm b/Source/WebKit/UIProcess/API/Cocoa/WKProcessPool.mm
-index 6820f491e947595e00d0cbd2d5889520703a5808..749c43bcd2b4160601d1e50b82601f732d3ee5db 100644
+index ff3094986c243d0474f252d391e6ccb74f1fed5b..ebeffc391e49446416a1f85442f012fe46ab4cf0 100644
--- a/Source/WebKit/UIProcess/API/Cocoa/WKProcessPool.mm
+++ b/Source/WebKit/UIProcess/API/Cocoa/WKProcessPool.mm
@@ -47,6 +47,7 @@
@@ -6797,7 +6794,7 @@ index 6820f491e947595e00d0cbd2d5889520703a5808..749c43bcd2b4160601d1e50b82601f73
{
return [self _initWithConfiguration:adoptNS([[_WKProcessPoolConfiguration alloc] init]).get()];
diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKProcessPoolPrivate.h b/Source/WebKit/UIProcess/API/Cocoa/WKProcessPoolPrivate.h
-index d39db1ddb09c08cc78017d4e1f45fc8d256f5cdf..83685cc2e24950c459cd3e93ab526cdb786681ef 100644
+index 6769015e08558994cd8a219a17a9c68ade3b5383..ecc2ad71b9a54378e87a2e496dda44197b2211a9 100644
--- a/Source/WebKit/UIProcess/API/Cocoa/WKProcessPoolPrivate.h
+++ b/Source/WebKit/UIProcess/API/Cocoa/WKProcessPoolPrivate.h
@@ -38,6 +38,7 @@
@@ -6848,7 +6845,7 @@ index 245580d7e15679b82a61c4639850da02d81a4e1e..5fd5c4afbdc167f817b4ae961f446ec4
NS_ASSUME_NONNULL_END
diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm b/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm
-index 9dea3e6f320f2015391e1e208c8766b64a1bb8f5..1cdf34d6c701851395389533ccbbfa48308f4426 100644
+index 298d9cec9e84d8a5122065cc99233ef4f0b95389..b588df46f749c12db36f4c6fbba36ba0e0e4fff0 100644
--- a/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm
+++ b/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm
@@ -45,6 +45,7 @@
@@ -6999,7 +6996,7 @@ index 0000000000000000000000000000000000000000..e7143513ea2be8e1cdab5c86a28643ff
+}
+@end
diff --git a/Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h b/Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h
-index df2b919c9ba18cc9cc0471a4334eb85c45e3820e..b5a73c8d6863217da0edb97688d17a7debab3c11 100644
+index 7226cc2cb605d2384b5fdf9210ac731b41610c1e..7883367044356751886f5c1f89250c29fcc58d3a 100644
--- a/Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h
+++ b/Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h
@@ -62,6 +62,7 @@ WK_CLASS_AVAILABLE(macos(10.10), ios(8.0))
@@ -7011,7 +7008,7 @@ index df2b919c9ba18cc9cc0471a4334eb85c45e3820e..b5a73c8d6863217da0edb97688d17a7d
@property (nonatomic) BOOL processSwapsOnWindowOpenWithOpener WK_API_AVAILABLE(macos(10.14), ios(12.0));
@property (nonatomic) BOOL prewarmsProcessesAutomatically WK_API_AVAILABLE(macos(10.14.4), ios(12.2));
diff --git a/Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm b/Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm
-index 9c6aa9a080acd3e9e3a4a744141bb5caab9504ba..27f385dd1e823cd59b16d3df6e7bea2742092719 100644
+index b4c35e8854c61055655aeff2bfb909cdc542839c..11d685c58d7c148430dd664636f5d51e251800c7 100644
--- a/Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm
+++ b/Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm
@@ -231,6 +231,16 @@
@@ -7261,10 +7258,10 @@ index 2ceb2b4f49f409bbe6e6810115e36d0c84f83b5d..16d2062b746b80ace6f39d779e9c3b87
bool canRunBeforeUnloadConfirmPanel() const final { return true; }
diff --git a/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp b/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp
-index e8d25f8bcf2463db16221ce700206f348975a2a8..3adf0395d360bb569b7c83fb30e2942a1650fdfc 100644
+index 89be56ad71d7156912a269153057df527cdd4460..0ccb8afd667c834fa61fa2fc50b86fbcccf00ca6 100644
--- a/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp
+++ b/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp
-@@ -120,8 +120,8 @@ enum {
+@@ -121,8 +121,8 @@ enum {
PROP_LOCAL_STORAGE_DIRECTORY,
#endif
PROP_WEBSITE_DATA_MANAGER,
@@ -7274,7 +7271,7 @@ index e8d25f8bcf2463db16221ce700206f348975a2a8..3adf0395d360bb569b7c83fb30e2942a
#if !USE(GTK4)
PROP_USE_SYSYEM_APPEARANCE_FOR_SCROLLBARS
#endif
-@@ -206,8 +206,8 @@ struct _WebKitWebContextPrivate {
+@@ -207,8 +207,8 @@ struct _WebKitWebContextPrivate {
RefPtr<WebProcessPool> processPool;
bool clientsDetached;
@@ -7284,7 +7281,7 @@ index e8d25f8bcf2463db16221ce700206f348975a2a8..3adf0395d360bb569b7c83fb30e2942a
#if !USE(GTK4)
bool useSystemAppearanceForScrollbars;
#endif
-@@ -307,11 +307,9 @@ WEBKIT_DEFINE_TYPE(WebKitWebContext, webkit_web_context, G_TYPE_OBJECT)
+@@ -308,11 +308,9 @@ WEBKIT_DEFINE_TYPE(WebKitWebContext, webkit_web_context, G_TYPE_OBJECT)
static const char* injectedBundleDirectory()
{
@@ -7296,7 +7293,7 @@ index e8d25f8bcf2463db16221ce700206f348975a2a8..3adf0395d360bb569b7c83fb30e2942a
#if PLATFORM(GTK)
static const char* injectedBundlePath = LIBDIR G_DIR_SEPARATOR_S "webkit2gtk-" WEBKITGTK_API_VERSION_STRING
-@@ -336,10 +334,10 @@ static void webkitWebContextGetProperty(GObject* object, guint propID, GValue* v
+@@ -337,10 +335,10 @@ static void webkitWebContextGetProperty(GObject* object, guint propID, GValue* v
case PROP_WEBSITE_DATA_MANAGER:
g_value_set_object(value, webkit_web_context_get_website_data_manager(context));
break;
@@ -7308,7 +7305,7 @@ index e8d25f8bcf2463db16221ce700206f348975a2a8..3adf0395d360bb569b7c83fb30e2942a
#if !USE(GTK4)
case PROP_USE_SYSYEM_APPEARANCE_FOR_SCROLLBARS:
g_value_set_boolean(value, webkit_web_context_get_use_system_appearance_for_scrollbars(context));
-@@ -366,10 +364,10 @@ static void webkitWebContextSetProperty(GObject* object, guint propID, const GVa
+@@ -367,10 +365,10 @@ static void webkitWebContextSetProperty(GObject* object, guint propID, const GVa
context->priv->websiteDataManager = manager ? WEBKIT_WEBSITE_DATA_MANAGER(manager) : nullptr;
break;
}
@@ -7320,7 +7317,7 @@ index e8d25f8bcf2463db16221ce700206f348975a2a8..3adf0395d360bb569b7c83fb30e2942a
#if !USE(GTK4)
case PROP_USE_SYSYEM_APPEARANCE_FOR_SCROLLBARS:
webkit_web_context_set_use_system_appearance_for_scrollbars(context, g_value_get_boolean(value));
-@@ -381,10 +379,19 @@ static void webkitWebContextSetProperty(GObject* object, guint propID, const GVa
+@@ -382,10 +380,19 @@ static void webkitWebContextSetProperty(GObject* object, guint propID, const GVa
}
}
@@ -7340,7 +7337,7 @@ index e8d25f8bcf2463db16221ce700206f348975a2a8..3adf0395d360bb569b7c83fb30e2942a
GUniquePtr<char> bundleFilename(g_build_filename(injectedBundleDirectory(), INJECTED_BUNDLE_FILENAME, nullptr));
WebKitWebContext* webContext = WEBKIT_WEB_CONTEXT(object);
-@@ -392,8 +399,8 @@ static void webkitWebContextConstructed(GObject* object)
+@@ -393,8 +400,8 @@ static void webkitWebContextConstructed(GObject* object)
API::ProcessPoolConfiguration configuration;
configuration.setInjectedBundlePath(FileSystem::stringFromFileSystemRepresentation(bundleFilename.get()));
@@ -7350,19 +7347,7 @@ index e8d25f8bcf2463db16221ce700206f348975a2a8..3adf0395d360bb569b7c83fb30e2942a
#if !USE(GTK4)
configuration.setUseSystemAppearanceForScrollbars(priv->useSystemAppearanceForScrollbars);
#endif
-@@ -405,6 +412,11 @@ static void webkitWebContextConstructed(GObject* object)
- if (!webkit_website_data_manager_is_ephemeral(priv->websiteDataManager.get()))
- configuration.setHSTSStorageDirectory(FileSystem::stringFromFileSystemRepresentation(webkit_website_data_manager_get_hsts_cache_directory(priv->websiteDataManager.get())));
-
-+ const gchar *singleprocess = g_getenv("MINIBROWSER_SINGLEPROCESS");
-+ if (singleprocess && *singleprocess) {
-+ // processModel is not set at this point, force single process.
-+ configuration.setUsesSingleWebProcess(true);
-+ }
- priv->processPool = WebProcessPool::create(configuration);
- priv->processPool->setPrimaryDataStore(webkitWebsiteDataManagerGetDataStore(priv->websiteDataManager.get()));
- priv->processPool->setUserMessageHandler([webContext](UserMessage&& message, CompletionHandler<void(UserMessage&&)>&& completionHandler) {
-@@ -439,6 +451,8 @@ static void webkitWebContextConstructed(GObject* object)
+@@ -437,6 +444,8 @@ static void webkitWebContextConstructed(GObject* object)
static void webkitWebContextDispose(GObject* object)
{
@@ -7371,7 +7356,7 @@ index e8d25f8bcf2463db16221ce700206f348975a2a8..3adf0395d360bb569b7c83fb30e2942a
WebKitWebContextPrivate* priv = WEBKIT_WEB_CONTEXT(object)->priv;
if (!priv->clientsDetached) {
priv->clientsDetached = true;
-@@ -516,7 +530,6 @@ static void webkit_web_context_class_init(WebKitWebContextClass* webContextClass
+@@ -514,7 +523,6 @@ static void webkit_web_context_class_init(WebKitWebContextClass* webContextClass
WEBKIT_TYPE_WEBSITE_DATA_MANAGER,
static_cast<GParamFlags>(WEBKIT_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)));
@@ -7379,7 +7364,7 @@ index e8d25f8bcf2463db16221ce700206f348975a2a8..3adf0395d360bb569b7c83fb30e2942a
/**
* WebKitWebContext:process-swap-on-cross-site-navigation-enabled:
*
-@@ -540,6 +553,7 @@ static void webkit_web_context_class_init(WebKitWebContextClass* webContextClass
+@@ -538,6 +546,7 @@ static void webkit_web_context_class_init(WebKitWebContextClass* webContextClass
FALSE,
static_cast<GParamFlags>(WEBKIT_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)));
@@ -7587,10 +7572,10 @@ index 0000000000000000000000000000000000000000..9f1a0173a5641d6f158d815b8f7b9ea6
+
+#endif
diff --git a/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp b/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp
-index 5d01dab5c149cd173e8ef75558f92d98304e960e..80d778b9830e9d91000ce84546fc13d4e0dcee0d 100644
+index 507ad5a556dc29947c0c3243eb18be8407ea3fba..b8d73376720245da2bab3492e1742b83685d7cba 100644
--- a/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp
+++ b/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp
-@@ -2265,6 +2265,11 @@ void webkitWebViewBaseResetClickCounter(WebKitWebViewBase* webkitWebViewBase)
+@@ -2266,6 +2266,11 @@ void webkitWebViewBaseResetClickCounter(WebKitWebViewBase* webkitWebViewBase)
#endif
}
@@ -7633,7 +7618,7 @@ index c358118360a38c7b462227aa4ab8388bd7942c3e..70bdfbda231b481e8c5ac34fe6d8825f
#include <webkit2/WebKitContextMenuActions.h>
#include <webkit2/WebKitContextMenuItem.h>
diff --git a/Source/WebKit/UIProcess/API/wpe/PageClientImpl.cpp b/Source/WebKit/UIProcess/API/wpe/PageClientImpl.cpp
-index 8a20cecc153459bfd976b9d0b9aa06b1e5a53574..493873c7f8da40e52d5bedfa4b4c3e7136408a4d 100644
+index 2e758227c7274e8a1297c35bfea7ffc2861f6759..160fbce41d7fb868fc8acaab815e7b80593865e6 100644
--- a/Source/WebKit/UIProcess/API/wpe/PageClientImpl.cpp
+++ b/Source/WebKit/UIProcess/API/wpe/PageClientImpl.cpp
@@ -194,7 +194,7 @@ WebCore::IntPoint PageClientImpl::accessibilityScreenToRootView(const WebCore::I
@@ -7825,7 +7810,7 @@ index 27c680d46428d349b0d1119f12da56ff283a60aa..1980aff7d662a1eea450d2db78b41f12
#include <wpe/WebKitContextMenuActions.h>
#include <wpe/WebKitContextMenuItem.h>
diff --git a/Source/WebKit/UIProcess/Automation/WebAutomationSession.h b/Source/WebKit/UIProcess/Automation/WebAutomationSession.h
-index 3627660395cb5f44e77a9f861d42e971dba1bbfc..4a1fb710da6b69be39c5b6bf54ee2b86689d7b5a 100644
+index 8d90892a4b134264a4e85be4f65dfa20fc013a2e..10099d5ae0b794048db08b288d8336f92da04ef5 100644
--- a/Source/WebKit/UIProcess/Automation/WebAutomationSession.h
+++ b/Source/WebKit/UIProcess/Automation/WebAutomationSession.h
@@ -216,6 +216,8 @@ public:
@@ -7965,10 +7950,10 @@ index 0000000000000000000000000000000000000000..cd66887de171cda7d15a8e4dc6dbff63
+
+#endif // ENABLE(REMOTE_INSPECTOR)
diff --git a/Source/WebKit/UIProcess/Cocoa/PageClientImplCocoa.mm b/Source/WebKit/UIProcess/Cocoa/PageClientImplCocoa.mm
-index c7484a54558b8fbbecd74717c159a915a6114423..2c8809ef697cb9e54356fd9dbb41ea4425ef00e4 100644
+index cae36b6174bca8bb06656f8a7704e24ae70dc01e..8061bfbd462af0d51da86cf4f9525f7a7be3a29f 100644
--- a/Source/WebKit/UIProcess/Cocoa/PageClientImplCocoa.mm
+++ b/Source/WebKit/UIProcess/Cocoa/PageClientImplCocoa.mm
-@@ -36,7 +36,7 @@ namespace WebKit {
+@@ -38,7 +38,7 @@ namespace WebKit {
PageClientImplCocoa::PageClientImplCocoa(WKWebView *webView)
: m_webView { webView }
@@ -8012,7 +7997,7 @@ index 0f18038de989e69a8432c85b71b6c04e931302b3..82a966779403346aed174dcfcd01a796
#import "WKUIDelegate.h"
#import "WKWebViewConfigurationPrivate.h"
diff --git a/Source/WebKit/UIProcess/Cocoa/UIDelegate.h b/Source/WebKit/UIProcess/Cocoa/UIDelegate.h
-index cdefd4287b1f5b2222d50ac6dab195dab236fc34..b8ee75742ce3569aaf668395d8dfe0bc6cafb6f7 100644
+index f2b5a7b26eda5f6c884b19bccc04b0908549ac67..105d24305eb6e27fd0b610c0da3a4acecf8cb984 100644
--- a/Source/WebKit/UIProcess/Cocoa/UIDelegate.h
+++ b/Source/WebKit/UIProcess/Cocoa/UIDelegate.h
@@ -91,6 +91,7 @@ private:
@@ -8023,7 +8008,7 @@ index cdefd4287b1f5b2222d50ac6dab195dab236fc34..b8ee75742ce3569aaf668395d8dfe0bc
void presentStorageAccessConfirmDialog(const WTF::String& requestingDomain, const WTF::String& currentDomain, CompletionHandler<void(bool)>&&);
void requestStorageAccessConfirm(WebPageProxy&, WebFrameProxy*, const WebCore::RegistrableDomain& requestingDomain, const WebCore::RegistrableDomain& currentDomain, CompletionHandler<void(bool)>&&) final;
void decidePolicyForGeolocationPermissionRequest(WebPageProxy&, WebFrameProxy&, const FrameInfoData&, Function<void(bool)>&) final;
-@@ -171,6 +172,7 @@ private:
+@@ -172,6 +173,7 @@ private:
bool webViewRunJavaScriptAlertPanelWithMessageInitiatedByFrameCompletionHandler : 1;
bool webViewRunJavaScriptConfirmPanelWithMessageInitiatedByFrameCompletionHandler : 1;
bool webViewRunJavaScriptTextInputPanelWithPromptDefaultTextInitiatedByFrameCompletionHandler : 1;
@@ -8032,10 +8017,10 @@ index cdefd4287b1f5b2222d50ac6dab195dab236fc34..b8ee75742ce3569aaf668395d8dfe0bc
bool webViewRunBeforeUnloadConfirmPanelWithMessageInitiatedByFrameCompletionHandler : 1;
bool webViewRequestGeolocationPermissionForFrameDecisionHandler : 1;
diff --git a/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm b/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm
-index bd93ca6929d07ee42dd814219b84fa3667430a59..67a4fa0280a9f37ae1f9f0fb9db2da92416e2664 100644
+index 65a92cab377d711ef8359f21b02f705112ad3219..61d31b6d5b6794cde481d2045ace238b54c91749 100644
--- a/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm
+++ b/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm
-@@ -100,6 +100,7 @@ void UIDelegate::setDelegate(id <WKUIDelegate> delegate)
+@@ -101,6 +101,7 @@ void UIDelegate::setDelegate(id <WKUIDelegate> delegate)
m_delegateMethods.webViewRunJavaScriptAlertPanelWithMessageInitiatedByFrameCompletionHandler = [delegate respondsToSelector:@selector(webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:completionHandler:)];
m_delegateMethods.webViewRunJavaScriptConfirmPanelWithMessageInitiatedByFrameCompletionHandler = [delegate respondsToSelector:@selector(webView:runJavaScriptConfirmPanelWithMessage:initiatedByFrame:completionHandler:)];
m_delegateMethods.webViewRunJavaScriptTextInputPanelWithPromptDefaultTextInitiatedByFrameCompletionHandler = [delegate respondsToSelector:@selector(webView:runJavaScriptTextInputPanelWithPrompt:defaultText:initiatedByFrame:completionHandler:)];
@@ -8043,7 +8028,7 @@ index bd93ca6929d07ee42dd814219b84fa3667430a59..67a4fa0280a9f37ae1f9f0fb9db2da92
m_delegateMethods.webViewRequestStorageAccessPanelUnderFirstPartyCompletionHandler = [delegate respondsToSelector:@selector(_webView:requestStorageAccessPanelForDomain:underCurrentDomain:completionHandler:)];
m_delegateMethods.webViewRunBeforeUnloadConfirmPanelWithMessageInitiatedByFrameCompletionHandler = [delegate respondsToSelector:@selector(_webView:runBeforeUnloadConfirmPanelWithMessage:initiatedByFrame:completionHandler:)];
m_delegateMethods.webViewRequestGeolocationPermissionForFrameDecisionHandler = [delegate respondsToSelector:@selector(_webView:requestGeolocationPermissionForFrame:decisionHandler:)];
-@@ -339,6 +340,15 @@ void UIDelegate::UIClient::runJavaScriptPrompt(WebPageProxy& page, const WTF::St
+@@ -341,6 +342,15 @@ void UIDelegate::UIClient::runJavaScriptPrompt(WebPageProxy& page, const WTF::St
}).get()];
}
@@ -8060,10 +8045,10 @@ index bd93ca6929d07ee42dd814219b84fa3667430a59..67a4fa0280a9f37ae1f9f0fb9db2da92
{
auto delegate = m_uiDelegate.m_delegate.get();
diff --git a/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm b/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm
-index 5d960e1f326d2b7291e713096deeeed98caca06a..aeca7e0ca71e0986c8523c83ada66da485fc3e6d 100644
+index 76d7a64041a291d5f29735176e31ea70f5ed556c..aca6d83a88930e153ed058e257e6d5b3a8cc0cba 100644
--- a/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm
+++ b/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm
-@@ -398,7 +398,7 @@ void WebProcessPool::platformInitializeWebProcess(const WebProcessProxy& process
+@@ -410,7 +410,7 @@ void WebProcessPool::platformInitializeWebProcess(const WebProcessProxy& process
auto screenProperties = WebCore::collectScreenProperties();
parameters.screenProperties = WTFMove(screenProperties);
#if PLATFORM(MAC)
@@ -8072,7 +8057,7 @@ index 5d960e1f326d2b7291e713096deeeed98caca06a..aeca7e0ca71e0986c8523c83ada66da4
#endif
#if PLATFORM(IOS)
-@@ -677,8 +677,8 @@ void WebProcessPool::registerNotificationObservers()
+@@ -688,8 +688,8 @@ void WebProcessPool::registerNotificationObservers()
#if ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING)
m_scrollerStyleNotificationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:NSPreferredScrollerStyleDidChangeNotification object:nil queue:[NSOperationQueue currentQueue] usingBlock:^(NSNotification *notification) {
@@ -8084,10 +8069,10 @@ index 5d960e1f326d2b7291e713096deeeed98caca06a..aeca7e0ca71e0986c8523c83ada66da4
#endif
diff --git a/Source/WebKit/UIProcess/Cocoa/WebViewImpl.h b/Source/WebKit/UIProcess/Cocoa/WebViewImpl.h
-index d8f25b7ed5194616f064f5e2e1c3ec81490608b3..54048e141a5c23186191718f91fad219d66dbfe6 100644
+index 70084ece22ea8fb1ce6d4d6f4d0e4300d0b46781..11ec3abcf31e2e4b9e0c44bbee0c3f15ff248af0 100644
--- a/Source/WebKit/UIProcess/Cocoa/WebViewImpl.h
+++ b/Source/WebKit/UIProcess/Cocoa/WebViewImpl.h
-@@ -478,6 +478,9 @@ public:
+@@ -491,6 +491,9 @@ public:
void provideDataForPasteboard(NSPasteboard *, NSString *type);
NSArray *namesOfPromisedFilesDroppedAtDestination(NSURL *dropDestination);
@@ -8098,10 +8083,10 @@ index d8f25b7ed5194616f064f5e2e1c3ec81490608b3..54048e141a5c23186191718f91fad219
void saveBackForwardSnapshotForCurrentItem();
void saveBackForwardSnapshotForItem(WebBackForwardListItem&);
diff --git a/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm b/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm
-index 5ca77af82344641ffa0f701d3e62c9b5cf7119a8..4f2ab97dbf5a77f321465dcbcab0efdaf0e10840 100644
+index 199448e2e529e4fd6659ce201db04b332bee9ae6..1900fea6ee3269e0e50461f33ca40f107c43fc7f 100644
--- a/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm
+++ b/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm
-@@ -4438,6 +4438,18 @@ static RetainPtr<CGImageRef> takeWindowSnapshot(CGSWindowID windowID, bool captu
+@@ -4511,6 +4511,18 @@ static RetainPtr<CGImageRef> takeWindowSnapshot(CGSWindowID windowID, bool captu
return adoptCF(CGWindowListCreateImage(CGRectNull, kCGWindowListOptionIncludingWindow, windowID, imageOptions));
}
@@ -8406,10 +8391,10 @@ index b0722e7da81e56530deb570b82ed7cfece970362..05ec3e3ea97ba49135a27d7f9b91f14c
}
diff --git a/Source/WebKit/UIProcess/Inspector/Agents/InspectorScreencastAgent.cpp b/Source/WebKit/UIProcess/Inspector/Agents/InspectorScreencastAgent.cpp
new file mode 100644
-index 0000000000000000000000000000000000000000..1b87dad9771aaff2c77fcaa8f03982f461177cbd
+index 0000000000000000000000000000000000000000..e6fb1922885d4650f6adb1ddd758fe5c7c7ea6f5
--- /dev/null
+++ b/Source/WebKit/UIProcess/Inspector/Agents/InspectorScreencastAgent.cpp
-@@ -0,0 +1,174 @@
+@@ -0,0 +1,167 @@
+/*
+ * Copyright (C) 2020 Microsoft Corporation.
+ *
@@ -8495,32 +8480,23 @@ index 0000000000000000000000000000000000000000..1b87dad9771aaff2c77fcaa8f03982f4
+}
+#endif
+
-+void InspectorScreencastAgent::start(Inspector::ErrorString& errorString, const String& file, int width, int height, const double* scale, String* screencastID)
++Inspector::Protocol::ErrorStringOr<String /* screencastID */> InspectorScreencastAgent::start(const String& file, int width, int height, Optional<double>&& scale)
+{
-+ if (m_encoder) {
-+ errorString = "Already recording"_s;
-+ return;
-+ }
++ if (m_encoder)
++ return makeUnexpected("Already recording"_s);
+
-+ if (width < 10 || width > 10000 || height < 10 || height > 10000) {
-+ errorString = "Invalid size"_s;
-+ return;
-+ }
-+ Optional<double> optionalScale;
-+ if (scale) {
-+ if (*scale <= 0 || *scale > 1) {
-+ errorString = "Unsupported scale"_s;
-+ return;
-+ }
++ if (width < 10 || width > 10000 || height < 10 || height > 10000)
++ return makeUnexpected("Invalid size"_s);
+
-+ optionalScale = *scale;
-+ }
-+ m_encoder = ScreencastEncoder::create(errorString, file, WebCore::IntSize(width, height), optionalScale);
++ if (scale && (*scale <= 0 || *scale > 1))
++ return makeUnexpected("Unsupported scale"_s);
++
++ String errorString;
++ m_encoder = ScreencastEncoder::create(errorString, file, WebCore::IntSize(width, height), WTFMove(scale));
+ if (!m_encoder)
-+ return;
++ return makeUnexpected(errorString);
+
+ m_currentScreencastID = createCanonicalUUIDString();
-+ *screencastID = m_currentScreencastID;
+
+#if PLATFORM(MAC)
+ m_encoder->setOffsetTop(m_page.pageClient().browserToolbarHeight());
@@ -8530,6 +8506,8 @@ index 0000000000000000000000000000000000000000..1b87dad9771aaff2c77fcaa8f03982f4
+#endif
+ // Force at least one frame on WPE.
+ m_page.forceRepaint(VoidCallback::create([] (CallbackBase::Error) { }));
++
++ return { { m_currentScreencastID } };
+}
+
+void InspectorScreencastAgent::stop(Ref<StopCallback>&& callback)
@@ -8586,7 +8564,7 @@ index 0000000000000000000000000000000000000000..1b87dad9771aaff2c77fcaa8f03982f4
+} // namespace WebKit
diff --git a/Source/WebKit/UIProcess/Inspector/Agents/InspectorScreencastAgent.h b/Source/WebKit/UIProcess/Inspector/Agents/InspectorScreencastAgent.h
new file mode 100644
-index 0000000000000000000000000000000000000000..31a922667462de1a1edc24a10f25c0640dc034e3
+index 0000000000000000000000000000000000000000..0d4a837cbb0bbba71e32ed083a4c4cfe9b5e4a27
--- /dev/null
+++ b/Source/WebKit/UIProcess/Inspector/Agents/InspectorScreencastAgent.h
@@ -0,0 +1,77 @@
@@ -8650,7 +8628,7 @@ index 0000000000000000000000000000000000000000..31a922667462de1a1edc24a10f25c064
+ void didPaint(cairo_surface_t*);
+#endif
+
-+ void start(Inspector::ErrorString&, const String& file, int width, int height, const double* scale, String* screencastID) override;
++ Inspector::Protocol::ErrorStringOr<String /* screencastID */> start(const String& file, int width, int height, Optional<double>&& scale) override;
+ void stop(Ref<StopCallback>&&) override;
+
+
@@ -9395,7 +9373,7 @@ index a2239cec8e18850f35f7f88a9c4ebadc62bf4023..79f3ff84327dc075ec96983e04db4b10
} // namespace WebKit
diff --git a/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.cpp b/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.cpp
-index 1861cff806131196ea49b4f8aca6665beebbf6e8..76aae0165617d0540ffe5404d58bd341f568bc70 100644
+index 1861cff806131196ea49b4f8aca6665beebbf6e8..901c0fdd6bc1bd62b078a07cc9dd3a4c46c2bfd8 100644
--- a/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.cpp
+++ b/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.cpp
@@ -26,12 +26,20 @@
@@ -9637,15 +9615,14 @@ index 1861cff806131196ea49b4f8aca6665beebbf6e8..76aae0165617d0540ffe5404d58bd341
void WebPageInspectorController::createInspectorTarget(const String& targetId, Inspector::InspectorTargetType type)
{
addTarget(InspectorTargetProxy::create(m_page, targetId, type));
-@@ -169,6 +333,33 @@ void WebPageInspectorController::sendMessageToInspectorFrontend(const String& ta
+@@ -169,6 +333,32 @@ void WebPageInspectorController::sendMessageToInspectorFrontend(const String& ta
m_targetAgent->sendMessageFromTargetToFrontend(targetId, message);
}
+void WebPageInspectorController::setPauseOnStart(bool shouldPause)
+{
+ ASSERT(m_frontendRouter->hasFrontends());
-+ String errorString;
-+ m_targetAgent->setPauseOnStart(errorString, shouldPause);
++ m_targetAgent->setPauseOnStart(shouldPause);
+}
+
+bool WebPageInspectorController::shouldPauseLoading() const
@@ -9671,7 +9648,7 @@ index 1861cff806131196ea49b4f8aca6665beebbf6e8..76aae0165617d0540ffe5404d58bd341
bool WebPageInspectorController::shouldPauseLoading(const ProvisionalPageProxy& provisionalPage) const
{
if (!m_frontendRouter->hasFrontends())
-@@ -188,7 +379,7 @@ void WebPageInspectorController::setContinueLoadingCallback(const ProvisionalPag
+@@ -188,7 +378,7 @@ void WebPageInspectorController::setContinueLoadingCallback(const ProvisionalPag
void WebPageInspectorController::didCreateProvisionalPage(ProvisionalPageProxy& provisionalPage)
{
@@ -9680,7 +9657,7 @@ index 1861cff806131196ea49b4f8aca6665beebbf6e8..76aae0165617d0540ffe5404d58bd341
}
void WebPageInspectorController::willDestroyProvisionalPage(const ProvisionalPageProxy& provisionalPage)
-@@ -241,4 +432,20 @@ void WebPageInspectorController::addTarget(std::unique_ptr<InspectorTargetProxy>
+@@ -241,4 +431,20 @@ void WebPageInspectorController::addTarget(std::unique_ptr<InspectorTargetProxy>
m_targets.set(target->identifier(), WTFMove(target));
}
@@ -9904,10 +9881,10 @@ index 0000000000000000000000000000000000000000..0700f3624b34ab536f4101a12ba5fbd9
+} // namespace WebKit
diff --git a/Source/WebKit/UIProcess/InspectorDialogAgent.cpp b/Source/WebKit/UIProcess/InspectorDialogAgent.cpp
new file mode 100644
-index 0000000000000000000000000000000000000000..ca5965f9d682c0821a40f0d1d43e5cbeda1353a5
+index 0000000000000000000000000000000000000000..663f92f0df76042cf6385b056f8a917d688259f9
--- /dev/null
+++ b/Source/WebKit/UIProcess/InspectorDialogAgent.cpp
-@@ -0,0 +1,86 @@
+@@ -0,0 +1,88 @@
+/*
+ * Copyright (C) 2019 Microsoft Corporation.
+ *
@@ -9956,8 +9933,7 @@ index 0000000000000000000000000000000000000000..ca5965f9d682c0821a40f0d1d43e5cbe
+
+InspectorDialogAgent::~InspectorDialogAgent()
+{
-+ Inspector::ErrorString err;
-+ disable(err);
++ disable();
+}
+
+void InspectorDialogAgent::didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*)
@@ -9968,35 +9944,38 @@ index 0000000000000000000000000000000000000000..ca5965f9d682c0821a40f0d1d43e5cbe
+{
+}
+
-+void InspectorDialogAgent::enable(Inspector::ErrorString& errorString)
++Inspector::Protocol::ErrorStringOr<void> InspectorDialogAgent::enable()
+{
-+ if (m_page.inspectorDialogAgent()) {
-+ errorString = "Dialog domain is already enabled."_s;
-+ return;
-+ }
++ if (m_page.inspectorDialogAgent())
++ return makeUnexpected("Dialog domain is already enabled."_s);
++
+ m_page.setInspectorDialogAgent(this);
++ return { };
+}
+
-+void InspectorDialogAgent::disable(Inspector::ErrorString&)
++Inspector::Protocol::ErrorStringOr<void> InspectorDialogAgent::disable()
+{
+ if (m_page.inspectorDialogAgent() != this)
-+ return;
++ return { };
++
+ m_page.setInspectorDialogAgent(nullptr);
++ return { };
+}
+
-+void InspectorDialogAgent::handleJavaScriptDialog(Inspector::ErrorString& errorString, bool accept, const String* value)
++Inspector::Protocol::ErrorStringOr<void> InspectorDialogAgent::handleJavaScriptDialog(bool accept, const String& value)
+{
-+ m_page.uiClient().handleJavaScriptDialog(m_page, accept, value ? *value : String());
++ m_page.uiClient().handleJavaScriptDialog(m_page, accept, value);
++ return { };
+}
+
-+void InspectorDialogAgent::javascriptDialogOpening(const String& type, const String& message, const String* defaultValue) {
++void InspectorDialogAgent::javascriptDialogOpening(const String& type, const String& message, const String& defaultValue) {
+ m_frontendDispatcher->javascriptDialogOpening(type, message, defaultValue);
+}
+
+} // namespace WebKit
diff --git a/Source/WebKit/UIProcess/InspectorDialogAgent.h b/Source/WebKit/UIProcess/InspectorDialogAgent.h
new file mode 100644
-index 0000000000000000000000000000000000000000..f356c613945fd263889bc74166bef2b279ab4ca1
+index 0000000000000000000000000000000000000000..d0e11ed81a6257c011df23d5870da7403f8e9fe4
--- /dev/null
+++ b/Source/WebKit/UIProcess/InspectorDialogAgent.h
@@ -0,0 +1,70 @@
@@ -10056,11 +10035,11 @@ index 0000000000000000000000000000000000000000..f356c613945fd263889bc74166bef2b2
+ void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*) override;
+ void willDestroyFrontendAndBackend(Inspector::DisconnectReason) override;
+
-+ void enable(Inspector::ErrorString&) override;
-+ void disable(Inspector::ErrorString&) override;
-+ void handleJavaScriptDialog(Inspector::ErrorString& errorString, bool accept, const String* promptText) override;
++ Inspector::Protocol::ErrorStringOr<void> enable() override;
++ Inspector::Protocol::ErrorStringOr<void> disable() override;
++ Inspector::Protocol::ErrorStringOr<void> handleJavaScriptDialog(bool accept, const String& promptText) override;
+
-+ void javascriptDialogOpening(const String& type, const String& message, const String* defaultValue = nullptr);
++ void javascriptDialogOpening(const String& type, const String& message, const String& defaultValue = String());
+
+private:
+ void platformHandleJavaScriptDialog(bool accept, const String* promptText);
@@ -10072,10 +10051,10 @@ index 0000000000000000000000000000000000000000..f356c613945fd263889bc74166bef2b2
+} // namespace WebKit
diff --git a/Source/WebKit/UIProcess/InspectorPlaywrightAgent.cpp b/Source/WebKit/UIProcess/InspectorPlaywrightAgent.cpp
new file mode 100644
-index 0000000000000000000000000000000000000000..1af880600f7a0b4034ea88be0ace8b8408870970
+index 0000000000000000000000000000000000000000..9b0952539783e2ddd8b5335c824894b6abd382be
--- /dev/null
+++ b/Source/WebKit/UIProcess/InspectorPlaywrightAgent.cpp
-@@ -0,0 +1,854 @@
+@@ -0,0 +1,875 @@
+/*
+ * Copyright (C) 2019 Microsoft Corporation.
+ *
@@ -10176,12 +10155,12 @@ index 0000000000000000000000000000000000000000..1af880600f7a0b4034ea88be0ace8b84
+ }
+
+ String addTabIdToMessage(const String& message) {
-+ RefPtr<JSON::Value> parsedMessage;
-+ if (!JSON::Value::parseJSON(message, parsedMessage))
++ RefPtr<JSON::Value> parsedMessage = JSON::Value::parseJSON(message);
++ if (!parsedMessage)
+ return message;
+
-+ RefPtr<JSON::Object> messageObject;
-+ if (!parsedMessage->asObject(messageObject))
++ RefPtr<JSON::Object> messageObject = parsedMessage->asObject();
++ if (!messageObject)
+ return message;
+
+ messageObject->setString("browserContextId"_s, m_browserContextID);
@@ -10210,7 +10189,7 @@ index 0000000000000000000000000000000000000000..1af880600f7a0b4034ea88be0ace8b84
+}
+
+
-+static RefPtr<JSON::ArrayOf<String>> getEnabledWindowFeatures(const WebCore::WindowFeatures& features) {
++static Ref<JSON::ArrayOf<String>> getEnabledWindowFeatures(const WebCore::WindowFeatures& features) {
+ auto result = JSON::ArrayOf<String>::create();
+ if (features.x)
+ result->addItem("left=" + String::number(*features.x));
@@ -10351,8 +10330,7 @@ index 0000000000000000000000000000000000000000..1af880600f7a0b4034ea88be0ace8b84
+{
+ ASSERT(m_frontendChannel);
+
-+ ErrorString error;
-+ disable(error);
++ disable();
+
+ m_frontendRouter->disconnectFrontend(*m_frontendChannel);
+ ASSERT(!m_frontendRouter->hasFrontends());
@@ -10383,14 +10361,14 @@ index 0000000000000000000000000000000000000000..1af880600f7a0b4034ea88be0ace8b84
+ return BackendDispatcher::InterceptionResult::Intercepted;
+ }
+
-+ long requestId = 0;
-+ if (!idValue->asInteger(requestId)) {
++ Optional<int> requestId = idValue->asInteger();
++ if (!requestId) {
+ m_backendDispatcher->reportProtocolError(BackendDispatcher::InvalidRequest, "The type of 'id' must be number"_s);
+ m_backendDispatcher->sendPendingErrors();
+ return BackendDispatcher::InterceptionResult::Intercepted;
+ }
+
-+ m_backendDispatcher->reportProtocolError(requestId, BackendDispatcher::InvalidParams, "Cannot find page proxy with provided 'pageProxyId'"_s);
++ m_backendDispatcher->reportProtocolError(*requestId, BackendDispatcher::InvalidParams, "Cannot find page proxy with provided 'pageProxyId'"_s);
+ m_backendDispatcher->sendPendingErrors();
+ return BackendDispatcher::InterceptionResult::Intercepted;
+ });
@@ -10415,8 +10393,7 @@ index 0000000000000000000000000000000000000000..1af880600f7a0b4034ea88be0ace8b84
+
+ BrowserContext* browserContext = getExistingBrowserContext(browserContextID);
+ browserContext->pages.add(&page);
-+ m_frontendDispatcher->pageProxyCreated(
-+ browserContextID, pageProxyID, openerId.isNull() ? nullptr : &openerId);
++ m_frontendDispatcher->pageProxyCreated(browserContextID, pageProxyID, openerId);
+
+ // Auto-connect to all new pages.
+ auto pageProxyChannel = makeUnique<PageProxyChannel>(*m_frontendChannel, browserContextID, pageProxyID, page);
@@ -10482,10 +10459,10 @@ index 0000000000000000000000000000000000000000..1af880600f7a0b4034ea88be0ace8b84
+ m_frontendDispatcher->screencastFinished(screencastID);
+}
+
-+void InspectorPlaywrightAgent::enable(ErrorString&)
++Inspector::Protocol::ErrorStringOr<void> InspectorPlaywrightAgent::enable()
+{
+ if (m_isEnabled)
-+ return;
++ return { };
+
+ m_isEnabled = true;
+
@@ -10510,12 +10487,13 @@ index 0000000000000000000000000000000000000000..1af880600f7a0b4034ea88be0ace8b84
+ didCreateInspectorController(*page);
+ }
+ }
++ return { };
+}
+
-+void InspectorPlaywrightAgent::disable(ErrorString&)
++Inspector::Protocol::ErrorStringOr<void> InspectorPlaywrightAgent::disable()
+{
+ if (!m_isEnabled)
-+ return;
++ return { };
+
+ m_isEnabled = false;
+
@@ -10535,6 +10513,7 @@ index 0000000000000000000000000000000000000000..1af880600f7a0b4034ea88be0ace8b84
+ it.value->pages.clear();
+ }
+ m_browserContextDeletions.clear();
++ return { };
+}
+
+void InspectorPlaywrightAgent::close(Ref<CloseCallback>&& callback)
@@ -10557,7 +10536,14 @@ index 0000000000000000000000000000000000000000..1af880600f7a0b4034ea88be0ace8b84
+ return;
+ }
+
-+ WebProcessPool::allProcessPools().first()->syncLocalStorage([this, callback = WTFMove(callback)] () {
++ auto* dataStore = WebProcessPool::allProcessPools().first()->websiteDataStore();
++ if (!dataStore) {
++ m_client->closeBrowser();
++ callback->sendSuccess();
++ return;
++ }
++
++ dataStore->syncLocalStorage([this, callback = WTFMove(callback)] () {
+ if (!callback->isActive())
+ return;
+
@@ -10571,25 +10557,28 @@ index 0000000000000000000000000000000000000000..1af880600f7a0b4034ea88be0ace8b84
+
+}
+
-+void InspectorPlaywrightAgent::createContext(ErrorString& errorString, const String* proxyServer, const String* proxyBypassList, String* browserContextID)
++Inspector::Protocol::ErrorStringOr<String /* browserContextID */> InspectorPlaywrightAgent::createContext(const String& proxyServer, const String& proxyBypassList)
+{
-+ std::unique_ptr<BrowserContext> browserContext = m_client->createBrowserContext(errorString, proxyServer ? *proxyServer : String(), proxyBypassList ? *proxyBypassList : String());
++ String errorString;
++ std::unique_ptr<BrowserContext> browserContext = m_client->createBrowserContext(errorString, proxyServer, proxyBypassList);
+ if (!browserContext)
-+ return;
++ return makeUnexpected(errorString);
++
+ browserContext->processPool->setPrimaryDataStore(*browserContext->dataStore);
+ browserContext->processPool->ensureNetworkProcess(browserContext->dataStore.get());
+ browserContext->dataStore->setDownloadInstrumentation(this);
+
+ PAL::SessionID sessionID = browserContext->dataStore->sessionID();
-+ *browserContextID = toBrowserContextIDProtocolString(sessionID);
-+ m_browserContexts.set(*browserContextID, WTFMove(browserContext));
++ String browserContextID = toBrowserContextIDProtocolString(sessionID);
++ m_browserContexts.set(browserContextID, WTFMove(browserContext));
++ return browserContextID;
+}
+
+void InspectorPlaywrightAgent::deleteContext(const String& browserContextID, Ref<DeleteContextCallback>&& callback)
+{
+ String errorString;
-+ BrowserContext* browserContext = lookupBrowserContext(errorString, &browserContextID);
-+ if (!lookupBrowserContext(errorString, &browserContextID)) {
++ BrowserContext* browserContext = lookupBrowserContext(errorString, browserContextID);
++ if (!lookupBrowserContext(errorString, browserContextID)) {
+ callback->sendFailure(errorString);
+ return;
+ }
@@ -10612,15 +10601,18 @@ index 0000000000000000000000000000000000000000..1af880600f7a0b4034ea88be0ace8b84
+ m_client->deleteBrowserContext(errorString, sessionID);
+}
+
-+void InspectorPlaywrightAgent::createPage(ErrorString& errorString, const String* browserContextID, String* pageProxyID)
++Inspector::Protocol::ErrorStringOr<String /* pageProxyID */> InspectorPlaywrightAgent::createPage(const String& browserContextID)
+{
++ String errorString;
+ BrowserContext* browserContext = lookupBrowserContext(errorString, browserContextID);
+ if (!browserContext)
-+ return;
++ return makeUnexpected(errorString);
++
+ RefPtr<WebPageProxy> page = m_client->createPage(errorString, *browserContext);
+ if (!page)
-+ return;
-+ *pageProxyID = toPageProxyIDProtocolString(*page);
++ return makeUnexpected(errorString);
++
++ return toPageProxyIDProtocolString(*page);
+}
+
+WebFrameProxy* InspectorPlaywrightAgent::frameForID(const String& frameID, String& error)
@@ -10657,7 +10649,7 @@ index 0000000000000000000000000000000000000000..1af880600f7a0b4034ea88be0ace8b84
+ return frame;
+}
+
-+void InspectorPlaywrightAgent::navigate(const String& url, const String& pageProxyID, const String* frameID, const String* referrer, Ref<NavigateCallback>&& callback)
++void InspectorPlaywrightAgent::navigate(const String& url, const String& pageProxyID, const String& frameID, const String& referrer, Ref<NavigateCallback>&& callback)
+{
+ auto* pageProxyChannel = m_pageProxyChannels.get(pageProxyID);
+ if (!pageProxyChannel) {
@@ -10667,8 +10659,8 @@ index 0000000000000000000000000000000000000000..1af880600f7a0b4034ea88be0ace8b84
+
+ WebCore::ResourceRequest resourceRequest { url };
+
-+ if (referrer)
-+ resourceRequest.setHTTPReferrer(*referrer);
++ if (!!referrer)
++ resourceRequest.setHTTPReferrer(referrer);
+
+ if (!resourceRequest.url().isValid()) {
+ callback->sendFailure("Cannot navigate to invalid URL"_s);
@@ -10676,9 +10668,9 @@ index 0000000000000000000000000000000000000000..1af880600f7a0b4034ea88be0ace8b84
+ }
+
+ WebFrameProxy* frame = nullptr;
-+ if (frameID) {
++ if (!!frameID) {
+ String error;
-+ frame = frameForID(*frameID, error);
++ frame = frameForID(frameID, error);
+ if (!frame) {
+ callback->sendFailure(error);
+ return;
@@ -10696,25 +10688,27 @@ index 0000000000000000000000000000000000000000..1af880600f7a0b4034ea88be0ace8b84
+ return;
+ }
+
-+ Optional<String> navigationIDString;
++ String navigationIDString;
+ if (navigationID)
+ navigationIDString = String::number(navigationID);
+ callback->sendSuccess(navigationIDString);
+ });
+}
+
-+void InspectorPlaywrightAgent::setIgnoreCertificateErrors(ErrorString& errorString, const String* browserContextID, bool ignore)
++Inspector::Protocol::ErrorStringOr<void> InspectorPlaywrightAgent::setIgnoreCertificateErrors(const String& browserContextID, bool ignore)
+{
++ String errorString;
+ BrowserContext* browserContext = lookupBrowserContext(errorString, browserContextID);
+ if (!errorString.isEmpty())
-+ return;
++ return makeUnexpected(errorString);
+
+ PAL::SessionID sessionID = browserContext->dataStore->sessionID();
+ NetworkProcessProxy* networkProcess = browserContext->processPool->networkProcess();
+ networkProcess->send(Messages::NetworkProcess::SetIgnoreCertificateErrors(sessionID, ignore), 0);
++ return { };
+}
+
-+void InspectorPlaywrightAgent::getAllCookies(const String* browserContextID, Ref<GetAllCookiesCallback>&& callback) {
++void InspectorPlaywrightAgent::getAllCookies(const String& browserContextID, Ref<GetAllCookiesCallback>&& callback) {
+ String errorString;
+ BrowserContext* browserContext = lookupBrowserContext(errorString, browserContextID);
+ if (!errorString.isEmpty()) {
@@ -10735,7 +10729,7 @@ index 0000000000000000000000000000000000000000..1af880600f7a0b4034ea88be0ace8b84
+ }, 0);
+}
+
-+void InspectorPlaywrightAgent::setCookies(const String* browserContextID, const JSON::Array& in_cookies, Ref<SetCookiesCallback>&& callback) {
++void InspectorPlaywrightAgent::setCookies(const String& browserContextID, Ref<JSON::Array>&& in_cookies, Ref<SetCookiesCallback>&& callback) {
+ String errorString;
+ BrowserContext* browserContext = lookupBrowserContext(errorString, browserContextID);
+ if (!errorString.isEmpty()) {
@@ -10747,29 +10741,33 @@ index 0000000000000000000000000000000000000000..1af880600f7a0b4034ea88be0ace8b84
+ PAL::SessionID sessionID = browserContext->dataStore->sessionID();
+
+ Vector<WebCore::Cookie> cookies;
-+ for (unsigned i = 0; i < in_cookies.length(); ++i) {
-+ RefPtr<JSON::Value> item = in_cookies.get(i);
-+ RefPtr<JSON::Object> obj;
-+ if (!item->asObject(obj)) {
-+ errorString = "Invalid cookie payload format"_s;
++ for (unsigned i = 0; i < in_cookies->length(); ++i) {
++ RefPtr<JSON::Value> item = in_cookies->get(i);
++ RefPtr<JSON::Object> obj = item->asObject();
++ if (!obj) {
++ callback->sendFailure("Invalid cookie payload format"_s);
+ return;
+ }
+
+ WebCore::Cookie cookie;
-+ if (!obj->getString("name", cookie.name) ||
-+ !obj->getString("value", cookie.value) ||
-+ !obj->getString("domain", cookie.domain) ||
-+ !obj->getString("path", cookie.path)) {
-+ errorString = "Invalid file payload format"_s;
++ cookie.name = obj->getString("name");
++ cookie.value = obj->getString("value");
++ cookie.domain = obj->getString("domain");
++ cookie.path = obj->getString("path");
++ if (!cookie.name || !cookie.value || !cookie.domain || !cookie.path) {
++ callback->sendFailure("Invalid file payload format"_s);
+ return;
+ }
+
-+ double expires;
-+ if (obj->getDouble("expires", expires) && expires != -1)
-+ cookie.expires = expires;
-+ obj->getBoolean("httpOnly", cookie.httpOnly);
-+ obj->getBoolean("secure", cookie.secure);
-+ obj->getBoolean("session", cookie.session);
++ Optional<double> expires = obj->getDouble("expires");
++ if (expires && *expires != -1)
++ cookie.expires = *expires;
++ if (Optional<bool> value = obj->getBoolean("httpOnly"))
++ cookie.httpOnly = *value;
++ if (Optional<bool> value = obj->getBoolean("secure"))
++ cookie.secure = *value;
++ if (Optional<bool> value = obj->getBoolean("session"))
++ cookie.session = *value;
+ String sameSite;
+ if (obj->getString("sameSite", sameSite)) {
+ if (sameSite == "None")
@@ -10795,7 +10793,7 @@ index 0000000000000000000000000000000000000000..1af880600f7a0b4034ea88be0ace8b84
+ }, 0);
+}
+
-+void InspectorPlaywrightAgent::deleteAllCookies(const String* browserContextID, Ref<DeleteAllCookiesCallback>&& callback) {
++void InspectorPlaywrightAgent::deleteAllCookies(const String& browserContextID, Ref<DeleteAllCookiesCallback>&& callback) {
+ String errorString;
+ BrowserContext* browserContext = lookupBrowserContext(errorString, browserContextID);
+ if (!errorString.isEmpty()) {
@@ -10816,65 +10814,67 @@ index 0000000000000000000000000000000000000000..1af880600f7a0b4034ea88be0ace8b84
+ }, 0);
+}
+
-+void InspectorPlaywrightAgent::setLanguages(ErrorString& errorString, const JSON::Array& languages, const String* browserContextID)
++Inspector::Protocol::ErrorStringOr<void> InspectorPlaywrightAgent::setLanguages(Ref<JSON::Array>&& languages, const String& browserContextID)
+{
++ String errorString;
+ BrowserContext* browserContext = lookupBrowserContext(errorString, browserContextID);
+ if (!errorString.isEmpty())
-+ return;
++ return makeUnexpected(errorString);
+
+ Vector<String> items;
-+ for (const auto& value : languages) {
++ for (const auto& value : languages.get()) {
+ String language;
-+ if (!value->asString(language)) {
-+ errorString = "Language must be a string"_s;
-+ return;
-+ }
++ if (!value->asString(language))
++ return makeUnexpected("Language must be a string"_s);
++
+ items.append(language);
+ }
+
+ browserContext->dataStore->setLanguagesForAutomation(WTFMove(items));
++ return { };
+}
+
-+void InspectorPlaywrightAgent::setDownloadBehavior(ErrorString& errorString, const String* behavior, const String* downloadPath, const String* browserContextID)
++Inspector::Protocol::ErrorStringOr<void> InspectorPlaywrightAgent::setDownloadBehavior(const String& behavior, const String& downloadPath, const String& browserContextID)
+{
++ String errorString;
+ BrowserContext* browserContext = lookupBrowserContext(errorString, browserContextID);
+ if (!errorString.isEmpty())
-+ return;
++ return makeUnexpected(errorString);
++
+ Optional<bool> allow;
-+ if (behavior && *behavior == "allow"_s)
++ if (behavior == "allow"_s)
+ allow = true;
-+ if (behavior && *behavior == "deny"_s)
++ if (behavior == "deny"_s)
+ allow = false;
-+ browserContext->dataStore->setDownloadForAutomation(allow, downloadPath ? *downloadPath : String());
++ browserContext->dataStore->setDownloadForAutomation(allow, downloadPath);
++ return { };
+}
+
-+void InspectorPlaywrightAgent::setGeolocationOverride(ErrorString& errorString, const String* browserContextID, const JSON::Object* geolocation)
++Inspector::Protocol::ErrorStringOr<void> InspectorPlaywrightAgent::setGeolocationOverride(const String& browserContextID, RefPtr<JSON::Object>&& geolocation)
+{
++ String errorString;
+ BrowserContext* browserContext = lookupBrowserContext(errorString, browserContextID);
+ if (!errorString.isEmpty())
-+ return;
++ return makeUnexpected(errorString);
++
+ auto* geoManager = browserContext->processPool->supplement<WebGeolocationManagerProxy>();
-+ if (!geoManager) {
-+ errorString = "Internal error: geolocation manager is not available."_s;
-+ return;
-+ }
++ if (!geoManager)
++ return makeUnexpected("Internal error: geolocation manager is not available."_s);
++
+ if (geolocation) {
-+ double timestamp = 0;
-+ double latitude = 0;
-+ double longitude = 0;
-+ double accuracy = 0;
-+ if (!geolocation->getDouble("timestamp"_s, timestamp) ||
-+ !geolocation->getDouble("latitude"_s, latitude) ||
-+ !geolocation->getDouble("longitude"_s, longitude) ||
-+ !geolocation->getDouble("accuracy"_s, accuracy)) {
-+ errorString = "Invalid geolocation format"_s;
-+ return;
-+ }
-+ auto position = WebGeolocationPosition::create(WebCore::GeolocationPositionData(timestamp, latitude, longitude, accuracy));
++ Optional<double> timestamp = geolocation->getDouble("timestamp");
++ Optional<double> latitude = geolocation->getDouble("latitude");
++ Optional<double> longitude = geolocation->getDouble("longitude");
++ Optional<double> accuracy = geolocation->getDouble("accuracy");
++ if (!timestamp || !latitude || !longitude || !accuracy)
++ return makeUnexpected("Invalid geolocation format"_s);
++
++ auto position = WebGeolocationPosition::create(WebCore::GeolocationPositionData(*timestamp, *latitude, *longitude, *accuracy));
+ geoManager->providerDidChangePosition(&position.get());
+ } else {
+ geoManager->providerDidFailToDeterminePosition("Position unavailable"_s);
+ }
++ return { };
+}
+
+void InspectorPlaywrightAgent::downloadCreated(const String& uuid, const WebCore::ResourceRequest& request, const FrameInfoData& frameInfoData, WebPageProxy* page)
@@ -10913,7 +10913,7 @@ index 0000000000000000000000000000000000000000..1af880600f7a0b4034ea88be0ace8b84
+ return it->value->context();
+}
+
-+BrowserContext* InspectorPlaywrightAgent::lookupBrowserContext(ErrorString& errorString, const String* browserContextID)
++BrowserContext* InspectorPlaywrightAgent::lookupBrowserContext(ErrorString& errorString, const String& browserContextID)
+{
+ if (!browserContextID) {
+ if (!m_defaultContext)
@@ -10921,7 +10921,7 @@ index 0000000000000000000000000000000000000000..1af880600f7a0b4034ea88be0ace8b84
+ return m_defaultContext;
+ }
+
-+ BrowserContext* browserContext = m_browserContexts.get(*browserContextID);
++ BrowserContext* browserContext = m_browserContexts.get(browserContextID);
+ if (!browserContext)
+ errorString = "Could not find browser context for given id"_s;
+ return browserContext;
@@ -10932,7 +10932,7 @@ index 0000000000000000000000000000000000000000..1af880600f7a0b4034ea88be0ace8b84
+#endif // ENABLE(REMOTE_INSPECTOR)
diff --git a/Source/WebKit/UIProcess/InspectorPlaywrightAgent.h b/Source/WebKit/UIProcess/InspectorPlaywrightAgent.h
new file mode 100644
-index 0000000000000000000000000000000000000000..5e1606320cf6d0f5a14a53c9d61f979081a0270b
+index 0000000000000000000000000000000000000000..0b6cd5c9357c90ac81c0c2d197699855062926af
--- /dev/null
+++ b/Source/WebKit/UIProcess/InspectorPlaywrightAgent.h
@@ -0,0 +1,122 @@
@@ -11016,22 +11016,22 @@ index 0000000000000000000000000000000000000000..5e1606320cf6d0f5a14a53c9d61f9790
+ void didFinishScreencast(const PAL::SessionID& sessionID, const String& screencastID) override;
+
+ // PlaywrightDispatcherHandler
-+ void enable(Inspector::ErrorString&) override;
-+ void disable(Inspector::ErrorString&) override;
++ Inspector::Protocol::ErrorStringOr<void> enable() override;
++ Inspector::Protocol::ErrorStringOr<void> disable() override;
+ void close(Ref<CloseCallback>&&) override;
-+ void createContext(Inspector::ErrorString&, const String* proxyServer, const String* proxyBypassList, String* browserContextID) override;
++ Inspector::Protocol::ErrorStringOr<String /* browserContextID */> createContext(const String& proxyServer, const String& proxyBypassList) override;
+ void deleteContext(const String& browserContextID, Ref<DeleteContextCallback>&& callback) override;
-+ void createPage(Inspector::ErrorString&, const String* browserContextID, String* pageProxyID) override;
-+ void navigate(const String& url, const String& pageProxyID, const String* frameId, const String* referrer, Ref<NavigateCallback>&&) override;
-+ void setIgnoreCertificateErrors(Inspector::ErrorString&, const String* browserContextID, bool ignore) override;
++ Inspector::Protocol::ErrorStringOr<String /* pageProxyID */> createPage(const String& browserContextID) override;
++ void navigate(const String& url, const String& pageProxyID, const String& frameId, const String& referrer, Ref<NavigateCallback>&&) override;
++ Inspector::Protocol::ErrorStringOr<void> setIgnoreCertificateErrors(const String& browserContextID, bool ignore) override;
+
-+ void getAllCookies(const String* browserContextID, Ref<GetAllCookiesCallback>&&) override;
-+ void setCookies(const String* browserContextID, const JSON::Array& in_cookies, Ref<SetCookiesCallback>&&) override;
-+ void deleteAllCookies(const String* browserContextID, Ref<DeleteAllCookiesCallback>&&) override;
++ void getAllCookies(const String& browserContextID, Ref<GetAllCookiesCallback>&&) override;
++ void setCookies(const String& browserContextID, Ref<JSON::Array>&& in_cookies, Ref<SetCookiesCallback>&&) override;
++ void deleteAllCookies(const String& browserContextID, Ref<DeleteAllCookiesCallback>&&) override;
+
-+ void setGeolocationOverride(Inspector::ErrorString&, const String* browserContextID, const JSON::Object* geolocation) override;
-+ void setLanguages(Inspector::ErrorString&, const JSON::Array& languages, const String* browserContextID) override;
-+ void setDownloadBehavior(Inspector::ErrorString&, const String* behavior, const String* downloadPath, const String* browserContextID) override;
++ Inspector::Protocol::ErrorStringOr<void> setGeolocationOverride(const String& browserContextID, RefPtr<JSON::Object>&& geolocation) override;
++ Inspector::Protocol::ErrorStringOr<void> setLanguages(Ref<JSON::Array>&& languages, const String& browserContextID) override;
++ Inspector::Protocol::ErrorStringOr<void> setDownloadBehavior(const String& behavior, const String& downloadPath, const String& browserContextID) override;
+
+ // DownloadInstrumentation
+ void downloadCreated(const String& uuid, const WebCore::ResourceRequest&, const FrameInfoData& frameInfoData, WebPageProxy* page) override;
@@ -11039,7 +11039,7 @@ index 0000000000000000000000000000000000000000..5e1606320cf6d0f5a14a53c9d61f9790
+ void downloadFinished(const String& uuid, const String& error) override;
+
+ BrowserContext* getExistingBrowserContext(const String& browserContextID);
-+ BrowserContext* lookupBrowserContext(Inspector::ErrorString&, const String* browserContextID);
++ BrowserContext* lookupBrowserContext(Inspector::ErrorString&, const String& browserContextID);
+ WebFrameProxy* frameForID(const String& frameID, String& error);
+
+ Inspector::FrontendChannel* m_frontendChannel { nullptr };
@@ -11148,10 +11148,10 @@ index 7a14cfba15c103a2d4fe263fa49d25af3c396ec2..3ee0e154349661632799057c71f1d1f1
BOOL result = ::CreateProcess(0, commandLine.data(), 0, 0, true, 0, 0, 0, &startupInfo, &processInformation);
diff --git a/Source/WebKit/UIProcess/PageClient.h b/Source/WebKit/UIProcess/PageClient.h
-index 06056a4f2827e485f2dfbefd3c6aacf991ccf821..42cae575337006ad283e30af0559e467f290093a 100644
+index 5befc4df2001f87a9a7eeb4d687f13e946d703f3..aee9c052729fd6e8c528459262483a9a1d96fb29 100644
--- a/Source/WebKit/UIProcess/PageClient.h
+++ b/Source/WebKit/UIProcess/PageClient.h
-@@ -247,7 +247,7 @@ public:
+@@ -259,7 +259,7 @@ public:
virtual void showSafeBrowsingWarning(const SafeBrowsingWarning&, CompletionHandler<void(Variant<ContinueUnsafeLoad, URL>&&)>&& completionHandler) { completionHandler(ContinueUnsafeLoad::Yes); }
virtual void clearSafeBrowsingWarning() { }
virtual void clearSafeBrowsingWarningIfForMainFrameNavigation() { }
@@ -11160,7 +11160,7 @@ index 06056a4f2827e485f2dfbefd3c6aacf991ccf821..42cae575337006ad283e30af0559e467
#if ENABLE(DRAG_SUPPORT)
#if PLATFORM(GTK)
virtual void startDrag(WebCore::SelectionData&&, OptionSet<WebCore::DragOperation>, RefPtr<ShareableBitmap>&& dragImage) = 0;
-@@ -286,6 +286,11 @@ public:
+@@ -298,6 +298,11 @@ public:
virtual void selectionDidChange() = 0;
#endif
@@ -11172,7 +11172,7 @@ index 06056a4f2827e485f2dfbefd3c6aacf991ccf821..42cae575337006ad283e30af0559e467
#if PLATFORM(COCOA) || PLATFORM(GTK)
virtual RefPtr<ViewSnapshot> takeViewSnapshot(Optional<WebCore::IntRect>&&) = 0;
#endif
-@@ -302,6 +307,7 @@ public:
+@@ -314,6 +319,7 @@ public:
virtual WebCore::IntRect rootViewToAccessibilityScreen(const WebCore::IntRect&) = 0;
#if PLATFORM(MAC)
virtual WebCore::IntRect rootViewToWindow(const WebCore::IntRect&) = 0;
@@ -11180,7 +11180,7 @@ index 06056a4f2827e485f2dfbefd3c6aacf991ccf821..42cae575337006ad283e30af0559e467
#endif
#if PLATFORM(IOS_FAMILY)
virtual void didNotHandleTapAsClick(const WebCore::IntPoint&) = 0;
-@@ -346,7 +352,7 @@ public:
+@@ -362,7 +368,7 @@ public:
virtual void setTextIndicator(Ref<WebCore::TextIndicator>, WebCore::TextIndicatorWindowLifetime) = 0;
virtual void clearTextIndicator(WebCore::TextIndicatorWindowDismissalAnimation) = 0;
virtual void setTextIndicatorAnimationProgress(float) = 0;
@@ -11189,7 +11189,7 @@ index 06056a4f2827e485f2dfbefd3c6aacf991ccf821..42cae575337006ad283e30af0559e467
virtual void didPerformDictionaryLookup(const WebCore::DictionaryPopupInfo&) = 0;
#endif
-@@ -476,7 +482,7 @@ public:
+@@ -493,7 +499,7 @@ public:
virtual bool hasSafeBrowsingWarning() const { return false; }
virtual void setMouseEventPolicy(WebCore::MouseEventPolicy) { }
@@ -11536,10 +11536,10 @@ index 04f3227cd55c992a42cd96a3f25d697aed7965a2..f0d36935f47bab03ea2ec50b70509206
diff --git a/Source/WebKit/UIProcess/WebPageInspectorEmulationAgent.cpp b/Source/WebKit/UIProcess/WebPageInspectorEmulationAgent.cpp
new file mode 100644
-index 0000000000000000000000000000000000000000..3983c25682b06bbbf9ae9fde95b5b9c349ae6abe
+index 0000000000000000000000000000000000000000..c09db72a276875db36077bb49f8c7d6ff7b4eb8f
--- /dev/null
+++ b/Source/WebKit/UIProcess/WebPageInspectorEmulationAgent.cpp
-@@ -0,0 +1,145 @@
+@@ -0,0 +1,146 @@
+/*
+ * Copyright (C) 2019 Microsoft Corporation.
+ *
@@ -11633,48 +11633,49 @@ index 0000000000000000000000000000000000000000..3983c25682b06bbbf9ae9fde95b5b9c3
+ });
+}
+
-+void WebPageInspectorEmulationAgent::setJavaScriptEnabled(ErrorString&, bool enabled)
++Protocol::ErrorStringOr<void> WebPageInspectorEmulationAgent::setJavaScriptEnabled(bool enabled)
+{
+ auto copy = m_page.preferences().copy();
+ copy->setJavaScriptEnabled(enabled);
+ m_page.setPreferences(copy);
++ return { };
+}
+
-+void WebPageInspectorEmulationAgent::setAuthCredentials(Inspector::ErrorString&, const String* username, const String* password)
++Protocol::ErrorStringOr<void> WebPageInspectorEmulationAgent::setAuthCredentials(const String& username, const String& password)
+{
-+ if (username && password)
-+ m_page.setAuthCredentialsForAutomation(WebCore::Credential(*username, *password, CredentialPersistencePermanent));
++ if (!!username && !!password)
++ m_page.setAuthCredentialsForAutomation(WebCore::Credential(username, password, CredentialPersistencePermanent));
+ else
+ m_page.setAuthCredentialsForAutomation(Optional<WebCore::Credential>());
++ return { };
+}
+
-+void WebPageInspectorEmulationAgent::setActiveAndFocused(Inspector::ErrorString&, const bool* active)
++Protocol::ErrorStringOr<void> WebPageInspectorEmulationAgent::setActiveAndFocused(Optional<bool>&& active)
+{
-+ Optional<bool> value;
-+ if (active)
-+ value = *active;
-+ m_page.setActiveForAutomation(value);
++ m_page.setActiveForAutomation(WTFMove(active));
++ return { };
+}
+
-+void WebPageInspectorEmulationAgent::grantPermissions(Inspector::ErrorString& errorString, const String& origin, const JSON::Array& values)
++Protocol::ErrorStringOr<void> WebPageInspectorEmulationAgent::grantPermissions(const String& origin, Ref<JSON::Array>&& values)
+{
+ HashSet<String> set;
-+ for (const auto& value : values) {
++ for (const auto& value : values.get()) {
+ String name;
-+ if (!value->asString(name)) {
-+ errorString = "Permission must be a string"_s;
-+ return;
-+ }
++ if (!value->asString(name))
++ return makeUnexpected("Permission must be a string"_s);
++
+ set.add(name);
+ }
+ m_permissions.set(origin, WTFMove(set));
+ m_page.setPermissionsForAutomation(m_permissions);
++ return { };
+}
+
-+void WebPageInspectorEmulationAgent::resetPermissions(Inspector::ErrorString&)
++Protocol::ErrorStringOr<void> WebPageInspectorEmulationAgent::resetPermissions()
+{
+ m_permissions.clear();
+ m_page.setPermissionsForAutomation(m_permissions);
++ return { };
+}
+
+void WebPageInspectorEmulationAgent::didShowPage()
@@ -11687,7 +11688,7 @@ index 0000000000000000000000000000000000000000..3983c25682b06bbbf9ae9fde95b5b9c3
+} // namespace WebKit
diff --git a/Source/WebKit/UIProcess/WebPageInspectorEmulationAgent.h b/Source/WebKit/UIProcess/WebPageInspectorEmulationAgent.h
new file mode 100644
-index 0000000000000000000000000000000000000000..5ae0ce152f06b8316dbfbbbb2efd1990a31687d0
+index 0000000000000000000000000000000000000000..1353851472668b3e77c19db54f224c0ca151e9d3
--- /dev/null
+++ b/Source/WebKit/UIProcess/WebPageInspectorEmulationAgent.h
@@ -0,0 +1,75 @@
@@ -11747,11 +11748,11 @@ index 0000000000000000000000000000000000000000..5ae0ce152f06b8316dbfbbbb2efd1990
+ void willDestroyFrontendAndBackend(Inspector::DisconnectReason) override;
+
+ void setDeviceMetricsOverride(int width, int height, double deviceScaleFactor, bool fixedlayout, Ref<SetDeviceMetricsOverrideCallback>&&) override;
-+ void setJavaScriptEnabled(Inspector::ErrorString&, bool enabled) override;
-+ void setAuthCredentials(Inspector::ErrorString&, const String*, const String*) override;
-+ void setActiveAndFocused(Inspector::ErrorString&, const bool*) override;
-+ void grantPermissions(Inspector::ErrorString&, const String& origin, const JSON::Array& permissions) override;
-+ void resetPermissions(Inspector::ErrorString&) override;
++ Inspector::Protocol::ErrorStringOr<void> setJavaScriptEnabled(bool enabled) override;
++ Inspector::Protocol::ErrorStringOr<void> setAuthCredentials(const String&, const String&) override;
++ Inspector::Protocol::ErrorStringOr<void> setActiveAndFocused(Optional<bool>&&) override;
++ Inspector::Protocol::ErrorStringOr<void> grantPermissions(const String& origin, Ref<JSON::Array>&& permissions) override;
++ Inspector::Protocol::ErrorStringOr<void> resetPermissions() override;
+
+ void didShowPage();
+
@@ -11768,10 +11769,10 @@ index 0000000000000000000000000000000000000000..5ae0ce152f06b8316dbfbbbb2efd1990
+} // namespace WebKit
diff --git a/Source/WebKit/UIProcess/WebPageInspectorInputAgent.cpp b/Source/WebKit/UIProcess/WebPageInspectorInputAgent.cpp
new file mode 100644
-index 0000000000000000000000000000000000000000..5d19607e019489b33318be50ccdc94c2fcfae914
+index 0000000000000000000000000000000000000000..a0013cf99bec3807c316f782693a38f0d04cafd7
--- /dev/null
+++ b/Source/WebKit/UIProcess/WebPageInspectorInputAgent.cpp
-@@ -0,0 +1,282 @@
+@@ -0,0 +1,270 @@
+/*
+ * Copyright (C) 2019 Microsoft Corporation.
+ *
@@ -11902,7 +11903,7 @@ index 0000000000000000000000000000000000000000..5d19607e019489b33318be50ccdc94c2
+ return key;
+}
+
-+void WebPageInspectorInputAgent::dispatchKeyEvent(const String& type, const int* modifiers, const String* text, const String* unmodifiedText, const String* code, const String* key, const int* windowsVirtualKeyCode, const int* nativeVirtualKeyCode, const bool* autoRepeat, const bool* isKeypad, const bool* isSystemKey, const JSON::Array* commands, Ref<Inspector::InputBackendDispatcherHandler::DispatchKeyEventCallback>&& callback)
++void WebPageInspectorInputAgent::dispatchKeyEvent(const String& type, Optional<int>&& modifiers, const String& text, const String& unmodifiedText, const String& code, const String& key, Optional<int>&& windowsVirtualKeyCode, Optional<int>&& nativeVirtualKeyCode, Optional<bool>&& autoRepeat, Optional<bool>&& isKeypad, Optional<bool>&& isSystemKey, RefPtr<JSON::Array>&& commands, Ref<Inspector::InputBackendDispatcherHandler::DispatchKeyEventCallback>&& callback)
+{
+ WebKit::WebEvent::Type eventType;
+ if (type == "keyDown") {
@@ -11916,18 +11917,6 @@ index 0000000000000000000000000000000000000000..5d19607e019489b33318be50ccdc94c2
+ OptionSet<WebEvent::Modifier> eventModifiers;
+ if (modifiers)
+ eventModifiers = eventModifiers.fromRaw(*modifiers);
-+ String eventText;
-+ if (text)
-+ eventText = *text;
-+ String eventUnmodifiedText;
-+ if (unmodifiedText)
-+ eventUnmodifiedText = *unmodifiedText;
-+ String eventCode;
-+ if (code)
-+ eventCode = *code;
-+ String eventKey;
-+ if (key)
-+ eventKey = *key;
+ int eventWindowsVirtualKeyCode = 0;
+ if (windowsVirtualKeyCode)
+ eventWindowsVirtualKeyCode = *windowsVirtualKeyCode;
@@ -11946,7 +11935,7 @@ index 0000000000000000000000000000000000000000..5d19607e019489b33318be50ccdc94c2
+ }
+ }
+
-+ String keyIdentifier = keyIdentifierForKey(eventKey);
++ String keyIdentifier = keyIdentifierForKey(key);
+
+ bool eventIsAutoRepeat = false;
+ if (autoRepeat)
@@ -11962,10 +11951,10 @@ index 0000000000000000000000000000000000000000..5d19607e019489b33318be50ccdc94c2
+ m_keyboardCallbacks->append(WTFMove(callback));
+ platformDispatchKeyEvent(
+ eventType,
-+ eventText,
-+ eventUnmodifiedText,
-+ eventKey,
-+ eventCode,
++ text,
++ unmodifiedText,
++ key,
++ code,
+ keyIdentifier,
+ eventWindowsVirtualKeyCode,
+ eventNativeVirtualKeyCode,
@@ -11977,7 +11966,7 @@ index 0000000000000000000000000000000000000000..5d19607e019489b33318be50ccdc94c2
+ timestamp);
+}
+
-+void WebPageInspectorInputAgent::dispatchMouseEvent(const String& type, int x, int y, const int* modifiers, const String* button, const int* buttons, const int* clickCount, const int* deltaX, const int* deltaY, Ref<DispatchMouseEventCallback>&& callback)
++void WebPageInspectorInputAgent::dispatchMouseEvent(const String& type, int x, int y, Optional<int>&& modifiers, const String& button, Optional<int>&& buttons, Optional<int>&& clickCount, Optional<int>&& deltaX, Optional<int>&& deltaY, Ref<DispatchMouseEventCallback>&& callback)
+{
+ WebEvent::Type eventType = WebEvent::NoType;
+ if (type == "down")
@@ -11996,14 +11985,14 @@ index 0000000000000000000000000000000000000000..5d19607e019489b33318be50ccdc94c2
+ eventModifiers = eventModifiers.fromRaw(*modifiers);
+
+ WebMouseEvent::Button eventButton = WebMouseEvent::NoButton;
-+ if (button) {
-+ if (*button == "left")
++ if (!!button) {
++ if (button == "left")
+ eventButton = WebMouseEvent::LeftButton;
-+ else if (*button == "middle")
++ else if (button == "middle")
+ eventButton = WebMouseEvent::MiddleButton;
-+ else if (*button == "right")
++ else if (button == "right")
+ eventButton = WebMouseEvent::RightButton;
-+ else if (*button == "none")
++ else if (button == "none")
+ eventButton = WebMouseEvent::NoButton;
+ else {
+ callback->sendFailure("Unsupported eventButton");
@@ -12034,7 +12023,7 @@ index 0000000000000000000000000000000000000000..5d19607e019489b33318be50ccdc94c2
+ eventDeltaY = clampToInteger(roundf(eventDeltaY * totalScale));
+
+#if PLATFORM(MAC)
-+ platformDispatchMouseEvent(type, x, y, modifiers, button, clickCount);
++ platformDispatchMouseEvent(type, x, y, WTFMove(modifiers), button, WTFMove(clickCount));
+#elif PLATFORM(GTK) || PLATFORM(WPE) || PLATFORM(WIN)
+ WallTime timestamp = WallTime::now();
+ NativeWebMouseEvent event(
@@ -12056,7 +12045,7 @@ index 0000000000000000000000000000000000000000..5d19607e019489b33318be50ccdc94c2
+} // namespace WebKit
diff --git a/Source/WebKit/UIProcess/WebPageInspectorInputAgent.h b/Source/WebKit/UIProcess/WebPageInspectorInputAgent.h
new file mode 100644
-index 0000000000000000000000000000000000000000..20311d530090b0229010957a96fc60f44b4823fe
+index 0000000000000000000000000000000000000000..1f7ae90e218e9801ea70561246cb5e703a16662d
--- /dev/null
+++ b/Source/WebKit/UIProcess/WebPageInspectorInputAgent.h
@@ -0,0 +1,84 @@
@@ -12120,8 +12109,8 @@ index 0000000000000000000000000000000000000000..20311d530090b0229010957a96fc60f4
+ void willDestroyFrontendAndBackend(Inspector::DisconnectReason) override;
+
+ // Protocol handler
-+ void dispatchKeyEvent(const String& type, const int* modifiers, const String* text, const String* unmodifiedText, const String* code, const String* key, const int* windowsVirtualKeyCode, const int* nativeVirtualKeyCode, const bool* autoRepeat, const bool* isKeypad, const bool* isSystemKey, const JSON::Array*, Ref<DispatchKeyEventCallback>&& callback) override;
-+ void dispatchMouseEvent(const String& type, int x, int y, const int* modifiers, const String* button, const int* buttons, const int* clickCount, const int* deltaX, const int* deltaY, Ref<DispatchMouseEventCallback>&& callback) override;
++ void dispatchKeyEvent(const String& type, Optional<int>&& modifiers, const String& text, const String& unmodifiedText, const String& code, const String& key, Optional<int>&& windowsVirtualKeyCode, Optional<int>&& nativeVirtualKeyCode, Optional<bool>&& autoRepeat, Optional<bool>&& isKeypad, Optional<bool>&& isSystemKey, RefPtr<JSON::Array>&&, Ref<DispatchKeyEventCallback>&& callback) override;
++ void dispatchMouseEvent(const String& type, int x, int y, Optional<int>&& modifiers, const String& button, Optional<int>&& buttons, Optional<int>&& clickCount, Optional<int>&& deltaX, Optional<int>&& deltaY, Ref<DispatchMouseEventCallback>&& callback) override;
+
+private:
+ void platformDispatchKeyEvent(WebKeyboardEvent::Type 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<WebEvent::Modifier> modifiers, Vector<String>& commands, WallTime timestamp);
@@ -12129,7 +12118,7 @@ index 0000000000000000000000000000000000000000..20311d530090b0229010957a96fc60f4
+ void platformDispatchMouseEvent(WebMouseEvent::Type type, int x, int y, WebMouseEvent::Button button, OptionSet<WebEvent::Modifier> modifiers);
+#endif
+#if PLATFORM(MAC)
-+ void platformDispatchMouseEvent(const String& type, int x, int y, const int* modifier, const String* button, const int* clickCount);
++ void platformDispatchMouseEvent(const String& type, int x, int y, Optional<int>&& modifier, const String& button, Optional<int>&& clickCount);
+#endif
+
+ Ref<Inspector::InputBackendDispatcher> m_backendDispatcher;
@@ -12145,10 +12134,10 @@ index 0000000000000000000000000000000000000000..20311d530090b0229010957a96fc60f4
+
+} // namespace WebKit
diff --git a/Source/WebKit/UIProcess/WebPageProxy.cpp b/Source/WebKit/UIProcess/WebPageProxy.cpp
-index 47f6815441d04fb5e51df4c126f28c929346f487..43bd0c432b5749775663b4317dfd5adf1daf1705 100644
+index d3b8c35540f3f2456f71055f5b4d7a782260d387..ceddebaed964d011a62c97daab1ffe7632908fe6 100644
--- a/Source/WebKit/UIProcess/WebPageProxy.cpp
+++ b/Source/WebKit/UIProcess/WebPageProxy.cpp
-@@ -956,6 +956,7 @@ void WebPageProxy::finishAttachingToWebProcess(ProcessLaunchReason reason)
+@@ -978,6 +978,7 @@ void WebPageProxy::finishAttachingToWebProcess(ProcessLaunchReason reason)
m_pageLoadState.didSwapWebProcesses();
if (reason != ProcessLaunchReason::InitialProcess)
m_drawingArea->waitForBackingStoreUpdateOnNextPaint();
@@ -12156,7 +12145,7 @@ index 47f6815441d04fb5e51df4c126f28c929346f487..43bd0c432b5749775663b4317dfd5adf
}
void WebPageProxy::didAttachToRunningProcess()
-@@ -1271,6 +1272,21 @@ WebProcessProxy& WebPageProxy::ensureRunningProcess()
+@@ -1290,6 +1291,21 @@ WebProcessProxy& WebPageProxy::ensureRunningProcess()
return m_process;
}
@@ -12178,7 +12167,7 @@ index 47f6815441d04fb5e51df4c126f28c929346f487..43bd0c432b5749775663b4317dfd5adf
RefPtr<API::Navigation> WebPageProxy::loadRequest(ResourceRequest&& request, ShouldOpenExternalURLsPolicy shouldOpenExternalURLsPolicy, API::Object* userData)
{
if (m_isClosed)
-@@ -1730,6 +1746,31 @@ void WebPageProxy::setControlledByAutomation(bool controlled)
+@@ -1749,6 +1765,31 @@ void WebPageProxy::setControlledByAutomation(bool controlled)
m_process->processPool().sendToNetworkingProcess(Messages::NetworkProcess::SetSessionIsControlledByAutomation(m_websiteDataStore->sessionID(), m_controlledByAutomation));
}
@@ -12210,7 +12199,7 @@ index 47f6815441d04fb5e51df4c126f28c929346f487..43bd0c432b5749775663b4317dfd5adf
void WebPageProxy::createInspectorTarget(const String& targetId, Inspector::InspectorTargetType type)
{
MESSAGE_CHECK(m_process, !targetId.isEmpty());
-@@ -1872,6 +1913,25 @@ void WebPageProxy::updateActivityState(OptionSet<ActivityState::Flag> flagsToUpd
+@@ -1891,6 +1932,25 @@ void WebPageProxy::updateActivityState(OptionSet<ActivityState::Flag> flagsToUpd
{
bool wasVisible = isViewVisible();
m_activityState.remove(flagsToUpdate);
@@ -12236,7 +12225,7 @@ index 47f6815441d04fb5e51df4c126f28c929346f487..43bd0c432b5749775663b4317dfd5adf
if (flagsToUpdate & ActivityState::IsFocused && pageClient().isViewFocused())
m_activityState.add(ActivityState::IsFocused);
if (flagsToUpdate & ActivityState::WindowIsActive && pageClient().isViewWindowActive())
-@@ -2838,7 +2898,7 @@ static TrackingType mergeTrackingTypes(TrackingType a, TrackingType b)
+@@ -2869,7 +2929,7 @@ static TrackingType mergeTrackingTypes(TrackingType a, TrackingType b)
void WebPageProxy::updateTouchEventTracking(const WebTouchEvent& touchStartEvent)
{
@@ -12245,7 +12234,7 @@ index 47f6815441d04fb5e51df4c126f28c929346f487..43bd0c432b5749775663b4317dfd5adf
const EventNames& names = eventNames();
for (auto& touchPoint : touchStartEvent.touchPoints()) {
IntPoint location = touchPoint.location();
-@@ -2871,7 +2931,7 @@ void WebPageProxy::updateTouchEventTracking(const WebTouchEvent& touchStartEvent
+@@ -2902,7 +2962,7 @@ void WebPageProxy::updateTouchEventTracking(const WebTouchEvent& touchStartEvent
m_touchAndPointerEventTracking.touchStartTracking = TrackingType::Synchronous;
m_touchAndPointerEventTracking.touchMoveTracking = TrackingType::Synchronous;
m_touchAndPointerEventTracking.touchEndTracking = TrackingType::Synchronous;
@@ -12254,7 +12243,7 @@ index 47f6815441d04fb5e51df4c126f28c929346f487..43bd0c432b5749775663b4317dfd5adf
}
TrackingType WebPageProxy::touchEventTrackingType(const WebTouchEvent& touchStartEvent) const
-@@ -3309,6 +3369,7 @@ void WebPageProxy::receivedNavigationPolicyDecision(PolicyAction policyAction, A
+@@ -3334,6 +3394,7 @@ void WebPageProxy::receivedNavigationPolicyDecision(PolicyAction policyAction, A
void WebPageProxy::receivedPolicyDecision(PolicyAction action, API::Navigation* navigation, RefPtr<API::WebsitePolicies>&& websitePolicies, Ref<PolicyDecisionSender>&& sender, Optional<SandboxExtension::Handle> sandboxExtensionHandle, WillContinueLoadInNewProcess willContinueLoadInNewProcess)
{
@@ -12262,7 +12251,7 @@ index 47f6815441d04fb5e51df4c126f28c929346f487..43bd0c432b5749775663b4317dfd5adf
if (!hasRunningProcess()) {
sender->send(PolicyDecision { sender->identifier(), isNavigatingToAppBoundDomain(), PolicyAction::Ignore, 0, DownloadID(), WTF::nullopt });
return;
-@@ -4011,6 +4072,11 @@ void WebPageProxy::pageScaleFactorDidChange(double scaleFactor)
+@@ -4036,6 +4097,11 @@ void WebPageProxy::pageScaleFactorDidChange(double scaleFactor)
m_pageScaleFactor = scaleFactor;
}
@@ -12274,7 +12263,7 @@ index 47f6815441d04fb5e51df4c126f28c929346f487..43bd0c432b5749775663b4317dfd5adf
void WebPageProxy::pluginScaleFactorDidChange(double pluginScaleFactor)
{
m_pluginScaleFactor = pluginScaleFactor;
-@@ -4423,6 +4489,7 @@ void WebPageProxy::didDestroyNavigation(uint64_t navigationID)
+@@ -4448,6 +4514,7 @@ void WebPageProxy::didDestroyNavigation(uint64_t navigationID)
// FIXME: Message check the navigationID.
m_navigationState->didDestroyNavigation(navigationID);
@@ -12282,7 +12271,7 @@ index 47f6815441d04fb5e51df4c126f28c929346f487..43bd0c432b5749775663b4317dfd5adf
}
void WebPageProxy::didStartProvisionalLoadForFrame(FrameIdentifier frameID, FrameInfoData&& frameInfo, ResourceRequest&& request, uint64_t navigationID, URL&& url, URL&& unreachableURL, const UserData& userData)
-@@ -4645,6 +4712,8 @@ void WebPageProxy::didFailProvisionalLoadForFrameShared(Ref<WebProcessProxy>&& p
+@@ -4670,6 +4737,8 @@ void WebPageProxy::didFailProvisionalLoadForFrameShared(Ref<WebProcessProxy>&& p
m_failingProvisionalLoadURL = { };
@@ -12291,7 +12280,7 @@ index 47f6815441d04fb5e51df4c126f28c929346f487..43bd0c432b5749775663b4317dfd5adf
// If the provisional page's load fails then we destroy the provisional page.
if (m_provisionalPage && m_provisionalPage->mainFrame() == frame && willContinueLoading == WillContinueLoading::No)
m_provisionalPage = nullptr;
-@@ -5086,7 +5155,14 @@ void WebPageProxy::decidePolicyForNavigationActionAsync(FrameIdentifier frameID,
+@@ -5110,7 +5179,14 @@ void WebPageProxy::decidePolicyForNavigationActionAsync(FrameIdentifier frameID,
NavigationActionData&& navigationActionData, FrameInfoData&& originatingFrameInfo, Optional<WebPageProxyIdentifier> originatingPageID, const WebCore::ResourceRequest& originalRequest, WebCore::ResourceRequest&& request,
IPC::FormDataReference&& requestBody, WebCore::ResourceResponse&& redirectResponse, const UserData& userData, uint64_t listenerID)
{
@@ -12307,7 +12296,7 @@ index 47f6815441d04fb5e51df4c126f28c929346f487..43bd0c432b5749775663b4317dfd5adf
}
void WebPageProxy::decidePolicyForNavigationActionAsyncShared(Ref<WebProcessProxy>&& process, PageIdentifier webPageID, FrameIdentifier frameID, FrameInfoData&& frameInfo,
-@@ -5600,6 +5676,7 @@ void WebPageProxy::createNewPage(FrameInfoData&& originatingFrameInfoData, WebPa
+@@ -5627,6 +5703,7 @@ void WebPageProxy::createNewPage(FrameInfoData&& originatingFrameInfoData, WebPa
auto* originatingPage = m_process->webPage(originatingPageID);
auto originatingFrameInfo = API::FrameInfo::create(WTFMove(originatingFrameInfoData), originatingPage);
auto mainFrameURL = m_mainFrame ? m_mainFrame->url() : URL();
@@ -12315,7 +12304,7 @@ index 47f6815441d04fb5e51df4c126f28c929346f487..43bd0c432b5749775663b4317dfd5adf
auto completionHandler = [this, protectedThis = makeRef(*this), mainFrameURL, request, reply = WTFMove(reply)] (RefPtr<WebPageProxy> newPage) mutable {
if (!newPage) {
reply(WTF::nullopt, WTF::nullopt);
-@@ -5629,6 +5706,7 @@ void WebPageProxy::createNewPage(FrameInfoData&& originatingFrameInfoData, WebPa
+@@ -5656,6 +5733,7 @@ void WebPageProxy::createNewPage(FrameInfoData&& originatingFrameInfoData, WebPa
void WebPageProxy::showPage()
{
m_uiClient->showPage(this);
@@ -12323,7 +12312,7 @@ index 47f6815441d04fb5e51df4c126f28c929346f487..43bd0c432b5749775663b4317dfd5adf
}
void WebPageProxy::exitFullscreenImmediately()
-@@ -5664,6 +5742,10 @@ void WebPageProxy::closePage()
+@@ -5691,6 +5769,10 @@ void WebPageProxy::closePage()
if (isClosed())
return;
@@ -12334,7 +12323,7 @@ index 47f6815441d04fb5e51df4c126f28c929346f487..43bd0c432b5749775663b4317dfd5adf
RELEASE_LOG_IF_ALLOWED(Process, "closePage:");
pageClient().clearAllEditCommands();
m_uiClient->close(this);
-@@ -5683,6 +5765,8 @@ void WebPageProxy::runJavaScriptAlert(FrameIdentifier frameID, FrameInfoData&& f
+@@ -5710,6 +5792,8 @@ void WebPageProxy::runJavaScriptAlert(FrameIdentifier frameID, FrameInfoData&& f
if (auto* automationSession = process().processPool().automationSession())
automationSession->willShowJavaScriptDialog(*this);
}
@@ -12343,7 +12332,7 @@ index 47f6815441d04fb5e51df4c126f28c929346f487..43bd0c432b5749775663b4317dfd5adf
m_uiClient->runJavaScriptAlert(*this, message, frame, WTFMove(frameInfo), WTFMove(reply));
}
-@@ -5700,6 +5784,8 @@ void WebPageProxy::runJavaScriptConfirm(FrameIdentifier frameID, FrameInfoData&&
+@@ -5727,6 +5811,8 @@ void WebPageProxy::runJavaScriptConfirm(FrameIdentifier frameID, FrameInfoData&&
if (auto* automationSession = process().processPool().automationSession())
automationSession->willShowJavaScriptDialog(*this);
}
@@ -12352,16 +12341,16 @@ index 47f6815441d04fb5e51df4c126f28c929346f487..43bd0c432b5749775663b4317dfd5adf
m_uiClient->runJavaScriptConfirm(*this, message, frame, WTFMove(frameInfo), WTFMove(reply));
}
-@@ -5718,6 +5804,8 @@ void WebPageProxy::runJavaScriptPrompt(FrameIdentifier frameID, FrameInfoData&&
+@@ -5745,6 +5831,8 @@ void WebPageProxy::runJavaScriptPrompt(FrameIdentifier frameID, FrameInfoData&&
if (auto* automationSession = process().processPool().automationSession())
automationSession->willShowJavaScriptDialog(*this);
}
+ if (m_inspectorDialogAgent)
-+ m_inspectorDialogAgent->javascriptDialogOpening("prompt"_s, message, &defaultValue);
++ m_inspectorDialogAgent->javascriptDialogOpening("prompt"_s, message, defaultValue);
m_uiClient->runJavaScriptPrompt(*this, message, defaultValue, frame, WTFMove(frameInfo), WTFMove(reply));
}
-@@ -5873,6 +5961,8 @@ void WebPageProxy::runBeforeUnloadConfirmPanel(FrameIdentifier frameID, FrameInf
+@@ -5900,6 +5988,8 @@ void WebPageProxy::runBeforeUnloadConfirmPanel(FrameIdentifier frameID, FrameInf
return;
}
}
@@ -12370,7 +12359,7 @@ index 47f6815441d04fb5e51df4c126f28c929346f487..43bd0c432b5749775663b4317dfd5adf
// Since runBeforeUnloadConfirmPanel() can spin a nested run loop we need to turn off the responsiveness timer and the tryClose timer.
m_process->stopResponsivenessTimer();
-@@ -6963,6 +7053,7 @@ void WebPageProxy::didReceiveEvent(uint32_t opaqueType, bool handled)
+@@ -7029,6 +7119,7 @@ void WebPageProxy::didReceiveEvent(uint32_t opaqueType, bool handled)
if (auto* automationSession = process().processPool().automationSession())
automationSession->mouseEventsFlushedForPage(*this);
didFinishProcessingAllPendingMouseEvents();
@@ -12378,7 +12367,7 @@ index 47f6815441d04fb5e51df4c126f28c929346f487..43bd0c432b5749775663b4317dfd5adf
}
break;
-@@ -6989,7 +7080,6 @@ void WebPageProxy::didReceiveEvent(uint32_t opaqueType, bool handled)
+@@ -7055,7 +7146,6 @@ void WebPageProxy::didReceiveEvent(uint32_t opaqueType, bool handled)
case WebEvent::RawKeyDown:
case WebEvent::Char: {
LOG(KeyHandling, "WebPageProxy::didReceiveEvent: %s (queue empty %d)", webKeyboardEventTypeString(type), m_keyEventQueue.isEmpty());
@@ -12386,7 +12375,7 @@ index 47f6815441d04fb5e51df4c126f28c929346f487..43bd0c432b5749775663b4317dfd5adf
MESSAGE_CHECK(m_process, !m_keyEventQueue.isEmpty());
NativeWebKeyboardEvent event = m_keyEventQueue.takeFirst();
-@@ -7009,7 +7099,6 @@ void WebPageProxy::didReceiveEvent(uint32_t opaqueType, bool handled)
+@@ -7075,7 +7165,6 @@ void WebPageProxy::didReceiveEvent(uint32_t opaqueType, bool handled)
// The call to doneWithKeyEvent may close this WebPage.
// Protect against this being destroyed.
Ref<WebPageProxy> protect(*this);
@@ -12394,7 +12383,7 @@ index 47f6815441d04fb5e51df4c126f28c929346f487..43bd0c432b5749775663b4317dfd5adf
pageClient().doneWithKeyEvent(event, handled);
if (!handled)
m_uiClient->didNotHandleKeyEvent(this, event);
-@@ -7018,6 +7107,7 @@ void WebPageProxy::didReceiveEvent(uint32_t opaqueType, bool handled)
+@@ -7084,6 +7173,7 @@ void WebPageProxy::didReceiveEvent(uint32_t opaqueType, bool handled)
if (!canProcessMoreKeyEvents) {
if (auto* automationSession = process().processPool().automationSession())
automationSession->keyboardEventsFlushedForPage(*this);
@@ -12402,7 +12391,7 @@ index 47f6815441d04fb5e51df4c126f28c929346f487..43bd0c432b5749775663b4317dfd5adf
}
break;
}
-@@ -7449,8 +7539,10 @@ static bool shouldReloadAfterProcessTermination(ProcessTerminationReason reason)
+@@ -7518,8 +7608,10 @@ static bool shouldReloadAfterProcessTermination(ProcessTerminationReason reason)
void WebPageProxy::dispatchProcessDidTerminate(ProcessTerminationReason reason)
{
RELEASE_LOG_ERROR_IF_ALLOWED(Loading, "dispatchProcessDidTerminate: reason = %d", reason);
@@ -12414,7 +12403,7 @@ index 47f6815441d04fb5e51df4c126f28c929346f487..43bd0c432b5749775663b4317dfd5adf
if (m_loaderClient)
handledByClient = reason != ProcessTerminationReason::RequestedByClient && m_loaderClient->processDidCrash(*this);
else
-@@ -7722,6 +7814,7 @@ void WebPageProxy::resetStateAfterProcessExited(ProcessTerminationReason termina
+@@ -7787,6 +7879,7 @@ void WebPageProxy::resetStateAfterProcessExited(ProcessTerminationReason termina
WebPageCreationParameters WebPageProxy::creationParameters(WebProcessProxy& process, DrawingAreaProxy& drawingArea, RefPtr<API::WebsitePolicies>&& websitePolicies)
{
@@ -12422,7 +12411,7 @@ index 47f6815441d04fb5e51df4c126f28c929346f487..43bd0c432b5749775663b4317dfd5adf
WebPageCreationParameters parameters;
parameters.processDisplayName = configuration().processDisplayName();
-@@ -7879,6 +7972,8 @@ WebPageCreationParameters WebPageProxy::creationParameters(WebProcessProxy& proc
+@@ -7946,6 +8039,8 @@ WebPageCreationParameters WebPageProxy::creationParameters(WebProcessProxy& proc
parameters.shouldRelaxThirdPartyCookieBlocking = m_configuration->shouldRelaxThirdPartyCookieBlocking();
parameters.canUseCredentialStorage = m_canUseCredentialStorage;
@@ -12431,7 +12420,7 @@ index 47f6815441d04fb5e51df4c126f28c929346f487..43bd0c432b5749775663b4317dfd5adf
#if PLATFORM(GTK)
parameters.themeName = pageClient().themeName();
#endif
-@@ -7950,6 +8045,14 @@ void WebPageProxy::gamepadActivity(const Vector<GamepadData>& gamepadDatas, Even
+@@ -8019,6 +8114,14 @@ void WebPageProxy::gamepadActivity(const Vector<GamepadData>& gamepadDatas, Even
void WebPageProxy::didReceiveAuthenticationChallengeProxy(Ref<AuthenticationChallengeProxy>&& authenticationChallenge, NegotiatedLegacyTLS negotiatedLegacyTLS)
{
@@ -12446,7 +12435,7 @@ index 47f6815441d04fb5e51df4c126f28c929346f487..43bd0c432b5749775663b4317dfd5adf
if (negotiatedLegacyTLS == NegotiatedLegacyTLS::Yes) {
m_navigationClient->shouldAllowLegacyTLS(*this, authenticationChallenge.get(), [this, protectedThis = makeRef(*this), authenticationChallenge] (bool shouldAllowLegacyTLS) {
if (shouldAllowLegacyTLS)
-@@ -8035,7 +8138,8 @@ void WebPageProxy::requestGeolocationPermissionForFrame(GeolocationIdentifier ge
+@@ -8104,7 +8207,8 @@ void WebPageProxy::requestGeolocationPermissionForFrame(GeolocationIdentifier ge
MESSAGE_CHECK(m_process, frame);
// FIXME: Geolocation should probably be using toString() as its string representation instead of databaseIdentifier().
@@ -12456,7 +12445,7 @@ index 47f6815441d04fb5e51df4c126f28c929346f487..43bd0c432b5749775663b4317dfd5adf
auto request = m_geolocationPermissionRequestManager.createRequest(geolocationID);
Function<void(bool)> completionHandler = [request = WTFMove(request)](bool allowed) {
if (allowed)
-@@ -8044,6 +8148,14 @@ void WebPageProxy::requestGeolocationPermissionForFrame(GeolocationIdentifier ge
+@@ -8113,6 +8217,14 @@ void WebPageProxy::requestGeolocationPermissionForFrame(GeolocationIdentifier ge
request->deny();
};
@@ -12472,7 +12461,7 @@ index 47f6815441d04fb5e51df4c126f28c929346f487..43bd0c432b5749775663b4317dfd5adf
// and make it one UIClient call that calls the completionHandler with false
// if there is no delegate instead of returning the completionHandler
diff --git a/Source/WebKit/UIProcess/WebPageProxy.h b/Source/WebKit/UIProcess/WebPageProxy.h
-index 131a217d3c4719b10aa76c6952cb35eec7c26df3..9d015bda4a09d5080a08ac7da5164e140cb3aebe 100644
+index e745cfcba1b04ca1372144006b0e53735d3738cc..9aea83138705c51482d5c4aaf4c8aac58cfd63a7 100644
--- a/Source/WebKit/UIProcess/WebPageProxy.h
+++ b/Source/WebKit/UIProcess/WebPageProxy.h
@@ -37,6 +37,7 @@
@@ -12483,7 +12472,7 @@ index 131a217d3c4719b10aa76c6952cb35eec7c26df3..9d015bda4a09d5080a08ac7da5164e14
#include "LayerTreeContext.h"
#include "MessageSender.h"
#include "NotificationPermissionRequestManagerProxy.h"
-@@ -508,6 +509,8 @@ public:
+@@ -513,6 +514,8 @@ public:
void setControlledByAutomation(bool);
WebPageInspectorController& inspectorController() { return *m_inspectorController; }
@@ -12492,7 +12481,7 @@ index 131a217d3c4719b10aa76c6952cb35eec7c26df3..9d015bda4a09d5080a08ac7da5164e14
#if PLATFORM(IOS_FAMILY)
void showInspectorIndication();
-@@ -582,6 +585,11 @@ public:
+@@ -584,6 +587,11 @@ public:
void setPageLoadStateObserver(std::unique_ptr<PageLoadState::Observer>&&);
@@ -12504,15 +12493,15 @@ index 131a217d3c4719b10aa76c6952cb35eec7c26df3..9d015bda4a09d5080a08ac7da5164e14
void initializeWebPage();
void setDrawingArea(std::unique_ptr<DrawingAreaProxy>&&);
-@@ -607,6 +615,7 @@ public:
+@@ -609,6 +617,7 @@ public:
void closePage();
void addPlatformLoadParameters(WebProcessProxy&, LoadParameters&);
+ RefPtr<API::Navigation> loadRequestForInspector(WebCore::ResourceRequest&&, WebFrameProxy*);
- RefPtr<API::Navigation> loadRequest(WebCore::ResourceRequest&&, WebCore::ShouldOpenExternalURLsPolicy = WebCore::ShouldOpenExternalURLsPolicy::ShouldAllowExternalSchemes, API::Object* userData = nullptr);
+ RefPtr<API::Navigation> loadRequest(WebCore::ResourceRequest&&, WebCore::ShouldOpenExternalURLsPolicy = WebCore::ShouldOpenExternalURLsPolicy::ShouldAllowExternalSchemesButNotAppLinks, API::Object* userData = nullptr);
RefPtr<API::Navigation> loadFile(const String& fileURL, const String& resourceDirectoryURL, API::Object* userData = nullptr);
RefPtr<API::Navigation> loadData(const IPC::DataReference&, const String& MIMEType, const String& encoding, const String& baseURL, API::Object* userData = nullptr, WebCore::ShouldOpenExternalURLsPolicy = WebCore::ShouldOpenExternalURLsPolicy::ShouldNotAllow);
-@@ -1096,6 +1105,7 @@ public:
+@@ -1107,6 +1116,7 @@ public:
#endif
void pageScaleFactorDidChange(double);
@@ -12520,7 +12509,7 @@ index 131a217d3c4719b10aa76c6952cb35eec7c26df3..9d015bda4a09d5080a08ac7da5164e14
void pluginScaleFactorDidChange(double);
void pluginZoomFactorDidChange(double);
-@@ -1416,6 +1426,8 @@ public:
+@@ -1429,6 +1439,8 @@ public:
#if PLATFORM(COCOA) || PLATFORM(GTK)
RefPtr<ViewSnapshot> takeViewSnapshot(Optional<WebCore::IntRect>&&);
@@ -12529,7 +12518,7 @@ index 131a217d3c4719b10aa76c6952cb35eec7c26df3..9d015bda4a09d5080a08ac7da5164e14
#endif
#if ENABLE(WEB_CRYPTO)
-@@ -2401,6 +2413,7 @@ private:
+@@ -2440,6 +2452,7 @@ private:
String m_overrideContentSecurityPolicy;
RefPtr<WebInspectorProxy> m_inspector;
@@ -12537,7 +12526,7 @@ index 131a217d3c4719b10aa76c6952cb35eec7c26df3..9d015bda4a09d5080a08ac7da5164e14
#if ENABLE(FULLSCREEN_API)
std::unique_ptr<WebFullScreenManagerProxy> m_fullScreenManager;
-@@ -2832,6 +2845,9 @@ private:
+@@ -2880,6 +2893,9 @@ private:
RefPtr<API::Object> messageBody;
};
Vector<InjectedBundleMessage> m_pendingInjectedBundleMessages;
@@ -12548,7 +12537,7 @@ index 131a217d3c4719b10aa76c6952cb35eec7c26df3..9d015bda4a09d5080a08ac7da5164e14
#if PLATFORM(IOS_FAMILY) && ENABLE(DEVICE_ORIENTATION)
std::unique_ptr<WebDeviceOrientationUpdateProviderProxy> m_webDeviceOrientationUpdateProviderProxy;
diff --git a/Source/WebKit/UIProcess/WebPageProxy.messages.in b/Source/WebKit/UIProcess/WebPageProxy.messages.in
-index f451ab98854054de3ba597c9b35acc0f4dbaca23..bcb873b3ea57e64eb176692a533131dfc45523a7 100644
+index 772f8314a09c9d7c2798b97f58e59a2371676d1d..049b3f35b9c5c7b8909f6f1f07d77e696b730e8f 100644
--- a/Source/WebKit/UIProcess/WebPageProxy.messages.in
+++ b/Source/WebKit/UIProcess/WebPageProxy.messages.in
@@ -29,6 +29,7 @@ messages -> WebPageProxy {
@@ -12559,7 +12548,7 @@ index f451ab98854054de3ba597c9b35acc0f4dbaca23..bcb873b3ea57e64eb176692a533131df
#if ENABLE(NETSCAPE_PLUGIN_API)
UnavailablePluginButtonClicked(uint32_t pluginUnavailabilityReason, String mimeType, String pluginURLString, String pluginspageAttributeURLString, String frameURLString, String pageURLString)
-@@ -202,6 +203,7 @@ messages -> WebPageProxy {
+@@ -207,6 +208,7 @@ messages -> WebPageProxy {
#endif
PageScaleFactorDidChange(double scaleFactor)
@@ -12568,10 +12557,10 @@ index f451ab98854054de3ba597c9b35acc0f4dbaca23..bcb873b3ea57e64eb176692a533131df
PluginZoomFactorDidChange(double zoomFactor)
diff --git a/Source/WebKit/UIProcess/WebProcessPool.cpp b/Source/WebKit/UIProcess/WebProcessPool.cpp
-index 74a3577866dcf304b25755529bd49facbc1e0371..84bfa38b6a90d71ef1ab28fc597611a33851338a 100644
+index d926b33cbdf2bb8bb980d63c5dc52ae525092529..8f3919504ee208fade4b0c62c54638b50d67cfb0 100644
--- a/Source/WebKit/UIProcess/WebProcessPool.cpp
+++ b/Source/WebKit/UIProcess/WebProcessPool.cpp
-@@ -1053,7 +1053,10 @@ void WebProcessPool::initializeNewWebProcess(WebProcessProxy& process, WebsiteDa
+@@ -1049,7 +1049,10 @@ void WebProcessPool::initializeNewWebProcess(WebProcessProxy& process, WebsiteDa
#endif
parameters.cacheModel = LegacyGlobalSettings::singleton().cacheModel();
@@ -12584,10 +12573,10 @@ index 74a3577866dcf304b25755529bd49facbc1e0371..84bfa38b6a90d71ef1ab28fc597611a3
parameters.urlSchemesRegisteredAsEmptyDocument = copyToVector(m_schemesToRegisterAsEmptyDocument);
parameters.urlSchemesRegisteredAsSecure = copyToVector(LegacyGlobalSettings::singleton().schemesToRegisterAsSecure());
diff --git a/Source/WebKit/UIProcess/WebProcessPool.h b/Source/WebKit/UIProcess/WebProcessPool.h
-index 1f46ce4d637e746d94c6e8ae9653bad0ca79827e..a5b7f03ba0348d1f611d047b33674761e01d7bd5 100644
+index d1f1fe961506a1e5f1325fa99a5608b950b6ab71..157dcd4a5ebf07aeb9b529782d591f43b6dce85f 100644
--- a/Source/WebKit/UIProcess/WebProcessPool.h
+++ b/Source/WebKit/UIProcess/WebProcessPool.h
-@@ -734,8 +734,8 @@ private:
+@@ -718,8 +718,8 @@ private:
HashMap<uint64_t, RefPtr<DictionaryCallback>> m_dictionaryCallbacks;
@@ -12599,7 +12588,7 @@ index 1f46ce4d637e746d94c6e8ae9653bad0ca79827e..a5b7f03ba0348d1f611d047b33674761
bool m_memoryCacheDisabled { false };
diff --git a/Source/WebKit/UIProcess/WebProcessProxy.cpp b/Source/WebKit/UIProcess/WebProcessProxy.cpp
-index 5b3c54e587fcc5b893968b61691bfb88cecf0578..a182f493ab7019b624d11d44027addfef212296a 100644
+index d6610338b6cf60a27a6f75daec349a8f72ab3b85..b377fbc53b5160931895d6abf9996fd958d1dff5 100644
--- a/Source/WebKit/UIProcess/WebProcessProxy.cpp
+++ b/Source/WebKit/UIProcess/WebProcessProxy.cpp
@@ -115,6 +115,11 @@ static HashMap<ProcessIdentifier, WebProcessProxy*>& allProcesses()
@@ -12615,10 +12604,10 @@ index 5b3c54e587fcc5b893968b61691bfb88cecf0578..a182f493ab7019b624d11d44027addfe
{
return allProcesses().get(identifier);
diff --git a/Source/WebKit/UIProcess/WebProcessProxy.h b/Source/WebKit/UIProcess/WebProcessProxy.h
-index b1fb0ffb2ebed809af665955d16b5546b6f05fef..87e24456952e58846c6bbc3fe76466b7222b2e5d 100644
+index e0e8dc0ac708b1248b1cc80adcb19d1841239c73..70745bd65448d3ee2de7462e00dd0f5b00e146d8 100644
--- a/Source/WebKit/UIProcess/WebProcessProxy.h
+++ b/Source/WebKit/UIProcess/WebProcessProxy.h
-@@ -131,6 +131,7 @@ public:
+@@ -132,6 +132,7 @@ public:
~WebProcessProxy();
static void forWebPagesWithOrigin(PAL::SessionID, const WebCore::SecurityOriginData&, const Function<void(WebPageProxy&)>&);
@@ -12627,10 +12616,10 @@ index b1fb0ffb2ebed809af665955d16b5546b6f05fef..87e24456952e58846c6bbc3fe76466b7
WebConnection* webConnection() const { return m_webConnection.get(); }
diff --git a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp
-index 4888723e0bda57838c28879dccf27e1e3b414f22..ea4b2ba7c509b24368ad9cd219830ce15f422cd7 100644
+index 0830ca75a7fc38e645b775b39b3375d4c205037d..ace863634bb1ca5c95a24cb1ccd6fa460dc6945c 100644
--- a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp
+++ b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp
-@@ -2496,6 +2496,17 @@ void WebsiteDataStore::renameOriginInWebsiteData(URL&& oldName, URL&& newName, O
+@@ -2539,6 +2539,17 @@ void WebsiteDataStore::renameOriginInWebsiteData(URL&& oldName, URL&& newName, O
}
}
@@ -12645,14 +12634,14 @@ index 4888723e0bda57838c28879dccf27e1e3b414f22..ea4b2ba7c509b24368ad9cd219830ce1
+ m_downloadPathForAutomation = downloadPath;
+}
+
- #if PLATFORM(COCOA)
- void WebsiteDataStore::forwardAppBoundDomainsToITPIfInitialized(CompletionHandler<void()>&& completionHandler)
+ #if ENABLE(APP_BOUND_DOMAINS)
+ 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 4ec13e16fe482d26a2eafa3123e3233a737cb12b..217fb521507e4ad98e0a08440eb909283d7b3243 100644
+index 0dc91f23c4154395c8ebf890f35bd0180cd51aad..f0d3c0afccb7bf9a448e436859d78b3a25b747df 100644
--- a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h
+++ b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h
-@@ -83,6 +83,7 @@ class WebResourceLoadStatisticsStore;
+@@ -84,6 +84,7 @@ class WebResourceLoadStatisticsStore;
enum class CacheModel : uint8_t;
enum class WebsiteDataFetchOption : uint8_t;
enum class WebsiteDataType : uint32_t;
@@ -12660,7 +12649,7 @@ index 4ec13e16fe482d26a2eafa3123e3233a737cb12b..217fb521507e4ad98e0a08440eb90928
struct WebsiteDataRecord;
struct WebsiteDataStoreParameters;
-@@ -96,6 +97,16 @@ enum class StorageAccessPromptStatus;
+@@ -97,6 +98,16 @@ enum class StorageAccessPromptStatus;
struct PluginModuleInfo;
#endif
@@ -12677,7 +12666,7 @@ index 4ec13e16fe482d26a2eafa3123e3233a737cb12b..217fb521507e4ad98e0a08440eb90928
class WebsiteDataStore : public API::ObjectImpl<API::Object::Type::WebsiteDataStore>, public Identified<WebsiteDataStore>, public CanMakeWeakPtr<WebsiteDataStore> {
public:
static Ref<WebsiteDataStore> defaultDataStore();
-@@ -298,6 +309,14 @@ public:
+@@ -309,6 +320,14 @@ public:
static WTF::String defaultJavaScriptConfigurationDirectory();
static bool http3Enabled();
@@ -12690,9 +12679,9 @@ index 4ec13e16fe482d26a2eafa3123e3233a737cb12b..217fb521507e4ad98e0a08440eb90928
+ DownloadInstrumentation* downloadInstrumentation() { return m_downloadInstrumentation; };
+
void resetQuota(CompletionHandler<void()>&&);
- void hasAppBoundSession(CompletionHandler<void(bool)>&&) const;
- void clearAppBoundSession(CompletionHandler<void()>&&);
-@@ -405,6 +424,11 @@ private:
+
+ #if ENABLE(APP_BOUND_DOMAINS)
+@@ -420,6 +439,11 @@ private:
RefPtr<API::HTTPCookieStore> m_cookieStore;
@@ -13271,10 +13260,10 @@ index 0000000000000000000000000000000000000000..d0f9827544994e450e24e3f7a427c35e
+
+} // namespace WebKit
diff --git a/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm b/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm
-index ff7c0bd2a7902d67e1066f135dd09cb3f7861d7a..876636938766bd7b2e8444c02341b8db54a6ed76 100644
+index b3d1b3891d819d4d1d4f2ac91b2c4951904435b9..54e7e65b4c0a48a9cf8a60cb51122f9095f4bbf7 100644
--- a/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm
+++ b/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm
-@@ -437,6 +437,8 @@ IntRect PageClientImpl::rootViewToAccessibilityScreen(const IntRect& rect)
+@@ -436,6 +436,8 @@ IntRect PageClientImpl::rootViewToAccessibilityScreen(const IntRect& rect)
void PageClientImpl::doneWithKeyEvent(const NativeWebKeyboardEvent& event, bool eventWasHandled)
{
@@ -13472,7 +13461,7 @@ index 0000000000000000000000000000000000000000..721826c8c98fc85b68a4f45deaee69c1
+
+#endif
diff --git a/Source/WebKit/UIProcess/mac/PageClientImplMac.h b/Source/WebKit/UIProcess/mac/PageClientImplMac.h
-index 5b0d31702036b6f2cda7726b69372d9aee82852c..39fd6a2834b2e0030dd7fbef1cddfdea8b64d217 100644
+index 81a2c861c9ad71b83221d9a978e67e7379617a2c..8b070646433218dc41d7ce2fa85f5d8f71be436e 100644
--- a/Source/WebKit/UIProcess/mac/PageClientImplMac.h
+++ b/Source/WebKit/UIProcess/mac/PageClientImplMac.h
@@ -53,6 +53,8 @@ class PageClientImpl final : public PageClientImplCocoa
@@ -13492,7 +13481,7 @@ index 5b0d31702036b6f2cda7726b69372d9aee82852c..39fd6a2834b2e0030dd7fbef1cddfdea
#endif
WebCore::IntPoint accessibilityScreenToRootView(const WebCore::IntPoint&) override;
WebCore::IntRect rootViewToAccessibilityScreen(const WebCore::IntRect&) override;
-@@ -154,6 +157,9 @@ private:
+@@ -158,6 +161,9 @@ private:
void updateAcceleratedCompositingMode(const LayerTreeContext&) override;
void didFirstLayerFlush(const LayerTreeContext&) override;
@@ -13502,7 +13491,7 @@ index 5b0d31702036b6f2cda7726b69372d9aee82852c..39fd6a2834b2e0030dd7fbef1cddfdea
RefPtr<ViewSnapshot> takeViewSnapshot(Optional<WebCore::IntRect>&&) override;
void wheelEventWasNotHandledByWebCore(const NativeWebWheelEvent&) override;
#if ENABLE(MAC_GESTURE_EVENTS)
-@@ -201,6 +207,10 @@ private:
+@@ -212,6 +218,10 @@ private:
void beganExitFullScreen(const WebCore::IntRect& initialFrame, const WebCore::IntRect& finalFrame) override;
#endif
@@ -13514,10 +13503,10 @@ index 5b0d31702036b6f2cda7726b69372d9aee82852c..39fd6a2834b2e0030dd7fbef1cddfdea
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 4d3687710c9212b4764deea5ef5eaca0783d5da4..24db60f00929cb4c8d37caf0ec37c12e370dcbef 100644
+index d9ba4d000b94357287434c750bbae66ca6b1d432..f257f52b169669a112d5d08682deeef9d952c59f 100644
--- a/Source/WebKit/UIProcess/mac/PageClientImplMac.mm
+++ b/Source/WebKit/UIProcess/mac/PageClientImplMac.mm
-@@ -79,6 +79,7 @@
+@@ -80,6 +80,7 @@
#import <WebCore/TextUndoInsertionMarkupMac.h>
#import <WebCore/ValidationBubble.h>
#import <WebCore/WebCoreCALayerExtras.h>
@@ -13525,7 +13514,7 @@ index 4d3687710c9212b4764deea5ef5eaca0783d5da4..24db60f00929cb4c8d37caf0ec37c12e
#import <pal/spi/mac/NSApplicationSPI.h>
#import <wtf/ProcessPrivilege.h>
#import <wtf/RetainPtr.h>
-@@ -105,6 +106,13 @@ namespace WebKit {
+@@ -106,6 +107,13 @@ namespace WebKit {
using namespace WebCore;
@@ -13539,7 +13528,7 @@ index 4d3687710c9212b4764deea5ef5eaca0783d5da4..24db60f00929cb4c8d37caf0ec37c12e
PageClientImpl::PageClientImpl(NSView *view, WKWebView *webView)
: PageClientImplCocoa(webView)
, m_view(view)
-@@ -158,6 +166,9 @@ NSWindow *PageClientImpl::activeWindow() const
+@@ -159,6 +167,9 @@ NSWindow *PageClientImpl::activeWindow() const
bool PageClientImpl::isViewWindowActive()
{
@@ -13549,7 +13538,7 @@ index 4d3687710c9212b4764deea5ef5eaca0783d5da4..24db60f00929cb4c8d37caf0ec37c12e
ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));
NSWindow *activeViewWindow = activeWindow();
return activeViewWindow.isKeyWindow || (activeViewWindow && [NSApp keyWindow] == activeViewWindow);
-@@ -165,6 +176,9 @@ bool PageClientImpl::isViewWindowActive()
+@@ -166,6 +177,9 @@ bool PageClientImpl::isViewWindowActive()
bool PageClientImpl::isViewFocused()
{
@@ -13559,7 +13548,7 @@ index 4d3687710c9212b4764deea5ef5eaca0783d5da4..24db60f00929cb4c8d37caf0ec37c12e
// FIXME: This is called from the WebPageProxy constructor before we have a WebViewImpl.
// Once WebViewImpl and PageClient merge, this won't be a problem.
if (!m_impl)
-@@ -188,6 +202,9 @@ void PageClientImpl::makeFirstResponder()
+@@ -189,6 +203,9 @@ void PageClientImpl::makeFirstResponder()
bool PageClientImpl::isViewVisible()
{
@@ -13569,7 +13558,7 @@ index 4d3687710c9212b4764deea5ef5eaca0783d5da4..24db60f00929cb4c8d37caf0ec37c12e
NSView *activeView = this->activeView();
NSWindow *activeViewWindow = activeWindow();
-@@ -271,7 +288,8 @@ void PageClientImpl::didRelaunchProcess()
+@@ -272,7 +289,8 @@ void PageClientImpl::didRelaunchProcess()
void PageClientImpl::preferencesDidChange()
{
@@ -13579,7 +13568,7 @@ index 4d3687710c9212b4764deea5ef5eaca0783d5da4..24db60f00929cb4c8d37caf0ec37c12e
}
void PageClientImpl::toolTipChanged(const String& oldToolTip, const String& newToolTip)
-@@ -435,6 +453,15 @@ IntRect PageClientImpl::rootViewToWindow(const WebCore::IntRect& rect)
+@@ -460,6 +478,15 @@ IntRect PageClientImpl::rootViewToWindow(const WebCore::IntRect& rect)
return enclosingIntRect(tempRect);
}
@@ -13595,7 +13584,7 @@ index 4d3687710c9212b4764deea5ef5eaca0783d5da4..24db60f00929cb4c8d37caf0ec37c12e
IntPoint PageClientImpl::accessibilityScreenToRootView(const IntPoint& point)
{
return screenToRootView(point);
-@@ -447,11 +474,15 @@ IntRect PageClientImpl::rootViewToAccessibilityScreen(const IntRect& rect)
+@@ -472,11 +499,15 @@ IntRect PageClientImpl::rootViewToAccessibilityScreen(const IntRect& rect)
void PageClientImpl::doneWithKeyEvent(const NativeWebKeyboardEvent& event, bool eventWasHandled)
{
@@ -13611,7 +13600,7 @@ index 4d3687710c9212b4764deea5ef5eaca0783d5da4..24db60f00929cb4c8d37caf0ec37c12e
return WebPopupMenuProxyMac::create(m_view, page);
}
-@@ -564,6 +595,12 @@ CALayer *PageClientImpl::acceleratedCompositingRootLayer() const
+@@ -596,6 +627,12 @@ CALayer *PageClientImpl::acceleratedCompositingRootLayer() const
return m_impl->acceleratedCompositingRootLayer();
}
@@ -13624,7 +13613,7 @@ index 4d3687710c9212b4764deea5ef5eaca0783d5da4..24db60f00929cb4c8d37caf0ec37c12e
RefPtr<ViewSnapshot> PageClientImpl::takeViewSnapshot(Optional<WebCore::IntRect>&&)
{
return m_impl->takeViewSnapshot();
-@@ -742,6 +779,13 @@ void PageClientImpl::beganExitFullScreen(const IntRect& initialFrame, const IntR
+@@ -774,6 +811,13 @@ void PageClientImpl::beganExitFullScreen(const IntRect& initialFrame, const IntR
#endif // ENABLE(FULLSCREEN_API)
@@ -13638,7 +13627,7 @@ index 4d3687710c9212b4764deea5ef5eaca0783d5da4..24db60f00929cb4c8d37caf0ec37c12e
void PageClientImpl::navigationGestureDidBegin()
{
m_impl->dismissContentRelativeChildWindowsWithAnimation(true);
-@@ -908,6 +952,9 @@ void PageClientImpl::didRestoreScrollPosition()
+@@ -940,6 +984,9 @@ void PageClientImpl::didRestoreScrollPosition()
bool PageClientImpl::windowIsFrontWindowUnderMouse(const NativeWebMouseEvent& event)
{
@@ -13661,10 +13650,10 @@ index 0bb07e679f30e7b3682b3736b5372cbbb2d31ec8..cc0740c7d88d11d419cf2ca51cbc00b1
void getContextMenuItem(const WebContextMenuItemData&, CompletionHandler<void(NSMenuItem *)>&&);
void getContextMenuFromItems(const Vector<WebContextMenuItemData>&, CompletionHandler<void(NSMenu *)>&&);
diff --git a/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm b/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm
-index 1495ac1476bd513d8a62f82570dc8bcca3b05420..0e47097787b44ba9e6f89dc2abb84d9108abcb9f 100644
+index 5ad887b13fb41224383e40014b48910cbe2e7dcd..b6a2b93f13bdc6be626bcbb9282ac26da1415049 100644
--- a/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm
+++ b/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm
-@@ -325,6 +325,12 @@ void WebContextMenuProxyMac::getShareMenuItem(CompletionHandler<void(NSMenuItem
+@@ -326,6 +326,12 @@ void WebContextMenuProxyMac::getShareMenuItem(CompletionHandler<void(NSMenuItem
}
#endif
@@ -13729,7 +13718,7 @@ index 0000000000000000000000000000000000000000..6113f4cd60a5d72b8ead61176cb43200
+} // namespace WebKit
diff --git a/Source/WebKit/UIProcess/mac/WebPageInspectorInputAgentMac.mm b/Source/WebKit/UIProcess/mac/WebPageInspectorInputAgentMac.mm
new file mode 100644
-index 0000000000000000000000000000000000000000..78bd14ef515e4022dbc251945d60248a791d50b3
+index 0000000000000000000000000000000000000000..726053d74b9283d734d8699daca0e5e7f8893eca
--- /dev/null
+++ b/Source/WebKit/UIProcess/mac/WebPageInspectorInputAgentMac.mm
@@ -0,0 +1,124 @@
@@ -13770,7 +13759,7 @@ index 0000000000000000000000000000000000000000..78bd14ef515e4022dbc251945d60248a
+
+using namespace WebCore;
+
-+void WebPageInspectorInputAgent::platformDispatchMouseEvent(const String& type, int x, int y, const int* optionalModifiers, const String* button, const int* optionalClickCount) {
++void WebPageInspectorInputAgent::platformDispatchMouseEvent(const String& type, int x, int y, Optional<int>&& optionalModifiers, const String& button, Optional<int>&& optionalClickCount) {
+ IntPoint locationInWindow(x, y);
+
+ NSEventModifierFlags modifiers = 0;
@@ -13795,19 +13784,19 @@ index 0000000000000000000000000000000000000000..78bd14ef515e4022dbc251945d60248a
+ NSEventType dragEventType = (NSEventType)0;
+ NSEventType upEventType = (NSEventType)0;
+
-+ if (!button || *button == "none") {
++ if (!button || button == "none") {
+ downEventType = NSEventTypeMouseMoved;
+ dragEventType = NSEventTypeMouseMoved;
+ upEventType = NSEventTypeMouseMoved;
-+ } else if (*button == "left") {
++ } else if (button == "left") {
+ downEventType = NSEventTypeLeftMouseDown;
+ dragEventType = NSEventTypeLeftMouseDragged;
+ upEventType = NSEventTypeLeftMouseUp;
-+ } else if (*button == "middle") {
++ } else if (button == "middle") {
+ downEventType = NSEventTypeOtherMouseDown;
+ dragEventType = NSEventTypeLeftMouseDragged;
+ upEventType = NSEventTypeOtherMouseUp;
-+ } else if (*button == "right") {
++ } else if (button == "right") {
+ downEventType = NSEventTypeRightMouseDown;
+ upEventType = NSEventTypeRightMouseUp;
+ }
@@ -14369,7 +14358,7 @@ index 0000000000000000000000000000000000000000..c3d7cacea987ba2b094d5022c670705e
+
+} // namespace WebKit
diff --git a/Source/WebKit/WebKit.xcodeproj/project.pbxproj b/Source/WebKit/WebKit.xcodeproj/project.pbxproj
-index 1bf63b303952802e090bdc6f1b098a40e7bb5aa0..e783a447248b0b084c85e1a9124e4bafa33aee65 100644
+index dccd0c8cd8475a36c56f22f8d97e59363c61ec1a..e66b0661768d9406644915c868352a19675fd23b 100644
--- a/Source/WebKit/WebKit.xcodeproj/project.pbxproj
+++ b/Source/WebKit/WebKit.xcodeproj/project.pbxproj
@@ -1784,6 +1784,18 @@
@@ -14390,8 +14379,8 @@ index 1bf63b303952802e090bdc6f1b098a40e7bb5aa0..e783a447248b0b084c85e1a9124e4baf
+ D7EB04E72372A73B00F744CE /* InspectorPlaywrightAgentClientMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = D7EB04E62372A73B00F744CE /* InspectorPlaywrightAgentClientMac.mm */; };
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, ); }; };
- E105FE5418D7B9DE008F57A8 /* EditingRange.h in Headers */ = {isa = PBXBuildFile; fileRef = E105FE5318D7B9DE008F57A8 /* EditingRange.h */; };
-@@ -1836,6 +1848,9 @@
+ DF84CEE4249AA24D009096F6 /* WKPDFHUDView.mm in Sources */ = {isa = PBXBuildFile; fileRef = DF84CEE2249AA21F009096F6 /* WKPDFHUDView.mm */; };
+@@ -1840,6 +1852,9 @@
E5BEF6822130C48000F31111 /* WebDataListSuggestionsDropdownIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = E5BEF6802130C47F00F31111 /* WebDataListSuggestionsDropdownIOS.h */; };
E5CB07DC20E1678F0022C183 /* WKFormColorControl.h in Headers */ = {isa = PBXBuildFile; fileRef = E5CB07DA20E1678F0022C183 /* WKFormColorControl.h */; };
ED82A7F2128C6FAF004477B3 /* WKBundlePageOverlay.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A22F0FF1289FCD90085E74F /* WKBundlePageOverlay.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -14401,7 +14390,7 @@ index 1bf63b303952802e090bdc6f1b098a40e7bb5aa0..e783a447248b0b084c85e1a9124e4baf
F409BA181E6E64BC009DA28E /* WKDragDestinationAction.h in Headers */ = {isa = PBXBuildFile; fileRef = F409BA171E6E64B3009DA28E /* WKDragDestinationAction.h */; settings = {ATTRIBUTES = (Private, ); }; };
F42D634122A0EFDF00D2FB3A /* WebAutocorrectionData.h in Headers */ = {isa = PBXBuildFile; fileRef = F42D633F22A0EFD300D2FB3A /* WebAutocorrectionData.h */; };
F430E9422247335F005FE053 /* WebsiteMetaViewportPolicy.h in Headers */ = {isa = PBXBuildFile; fileRef = F430E941224732A9005FE053 /* WebsiteMetaViewportPolicy.h */; };
-@@ -5265,6 +5280,19 @@
+@@ -5264,6 +5279,19 @@
D3B9484311FF4B6500032B39 /* WebPopupMenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPopupMenu.h; sourceTree = "<group>"; };
D3B9484411FF4B6500032B39 /* WebSearchPopupMenu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebSearchPopupMenu.cpp; sourceTree = "<group>"; };
D3B9484511FF4B6500032B39 /* WebSearchPopupMenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSearchPopupMenu.h; sourceTree = "<group>"; };
@@ -14421,7 +14410,7 @@ index 1bf63b303952802e090bdc6f1b098a40e7bb5aa0..e783a447248b0b084c85e1a9124e4baf
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>"; };
-@@ -5368,6 +5396,14 @@
+@@ -5376,6 +5404,14 @@
ECA680D31E6904B500731D20 /* ExtraPrivateSymbolsForTAPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExtraPrivateSymbolsForTAPI.h; sourceTree = "<group>"; };
ECBFC1DB1E6A4D66000300C7 /* ExtraPublicSymbolsForTAPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ExtraPublicSymbolsForTAPI.h; sourceTree = "<group>"; };
F036978715F4BF0500C3A80E /* WebColorPicker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebColorPicker.cpp; sourceTree = "<group>"; };
@@ -14436,7 +14425,7 @@ index 1bf63b303952802e090bdc6f1b098a40e7bb5aa0..e783a447248b0b084c85e1a9124e4baf
F409BA171E6E64B3009DA28E /* WKDragDestinationAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKDragDestinationAction.h; sourceTree = "<group>"; };
F40D1B68220BDC0F00B49A01 /* WebAutocorrectionContext.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = WebAutocorrectionContext.h; path = ios/WebAutocorrectionContext.h; sourceTree = "<group>"; };
F41056612130699A0092281D /* APIAttachmentCocoa.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = APIAttachmentCocoa.mm; sourceTree = "<group>"; };
-@@ -5458,6 +5494,7 @@
+@@ -5466,6 +5502,7 @@
3766F9EF189A1244003CF19B /* QuartzCore.framework in Frameworks */,
37694525184FC6B600CDE21F /* Security.framework in Frameworks */,
37BEC4DD1948FC6A008B4286 /* WebCore.framework in Frameworks */,
@@ -14444,7 +14433,7 @@ index 1bf63b303952802e090bdc6f1b098a40e7bb5aa0..e783a447248b0b084c85e1a9124e4baf
);
runOnlyForDeploymentPostprocessing = 0;
};
-@@ -7187,6 +7224,7 @@
+@@ -7193,6 +7230,7 @@
37C4C08318149C2A003688B9 /* Cocoa */ = {
isa = PBXGroup;
children = (
@@ -14452,7 +14441,7 @@ index 1bf63b303952802e090bdc6f1b098a40e7bb5aa0..e783a447248b0b084c85e1a9124e4baf
1A43E826188F38E2009E4D30 /* Deprecated */,
37A5E01218BBF937000A081E /* _WKActivatedElementInfo.h */,
37A5E01118BBF937000A081E /* _WKActivatedElementInfo.mm */,
-@@ -8093,6 +8131,7 @@
+@@ -8098,6 +8136,7 @@
5750F3292032D4E300389347 /* Frameworks */ = {
isa = PBXGroup;
children = (
@@ -14460,7 +14449,7 @@ index 1bf63b303952802e090bdc6f1b098a40e7bb5aa0..e783a447248b0b084c85e1a9124e4baf
5750F32A2032D4E500389347 /* LocalAuthentication.framework */,
570DAAB0230273D200E8FC04 /* NearField.framework */,
);
-@@ -8495,6 +8534,12 @@
+@@ -8500,6 +8539,12 @@
children = (
9197940423DBC4BB00257892 /* InspectorBrowserAgent.cpp */,
9197940323DBC4BB00257892 /* InspectorBrowserAgent.h */,
@@ -14473,7 +14462,7 @@ index 1bf63b303952802e090bdc6f1b098a40e7bb5aa0..e783a447248b0b084c85e1a9124e4baf
);
path = Agents;
sourceTree = "<group>";
-@@ -8503,6 +8548,7 @@
+@@ -8508,6 +8553,7 @@
isa = PBXGroup;
children = (
A5D3504D1D78F0D2005124A9 /* RemoteWebInspectorProxyMac.mm */,
@@ -14481,7 +14470,7 @@ index 1bf63b303952802e090bdc6f1b098a40e7bb5aa0..e783a447248b0b084c85e1a9124e4baf
1CA8B935127C774E00576C2B /* WebInspectorProxyMac.mm */,
994BADF11F7D77EA00B571E7 /* WKInspectorViewController.h */,
994BADF21F7D77EB00B571E7 /* WKInspectorViewController.mm */,
-@@ -8928,6 +8974,12 @@
+@@ -8935,6 +8981,12 @@
BC032DC310F438260058C15A /* UIProcess */ = {
isa = PBXGroup;
children = (
@@ -14494,7 +14483,7 @@ index 1bf63b303952802e090bdc6f1b098a40e7bb5aa0..e783a447248b0b084c85e1a9124e4baf
BC032DC410F4387C0058C15A /* API */,
512F588D12A8836F00629530 /* Authentication */,
9955A6E81C79809000EB6A93 /* Automation */,
-@@ -9208,6 +9260,7 @@
+@@ -9218,6 +9270,7 @@
BC0C376610F807660076D7CB /* C */ = {
isa = PBXGroup;
children = (
@@ -14502,7 +14491,7 @@ index 1bf63b303952802e090bdc6f1b098a40e7bb5aa0..e783a447248b0b084c85e1a9124e4baf
5123CF18133D25E60056F800 /* cg */,
6EE849C41368D9040038D481 /* mac */,
BCB63477116BF10600603215 /* WebKit2_C.h */,
-@@ -9807,6 +9860,11 @@
+@@ -9817,6 +9870,11 @@
BCCF085C113F3B7500C650C5 /* mac */ = {
isa = PBXGroup;
children = (
@@ -14514,7 +14503,7 @@ index 1bf63b303952802e090bdc6f1b098a40e7bb5aa0..e783a447248b0b084c85e1a9124e4baf
B878B613133428DC006888E9 /* CorrectionPanel.h */,
B878B614133428DC006888E9 /* CorrectionPanel.mm */,
C1817362205844A900DFDA65 /* DisplayLink.cpp */,
-@@ -10596,6 +10654,7 @@
+@@ -10616,6 +10674,7 @@
991F492F23A812C60054642B /* _WKInspectorDebuggableInfo.h in Headers */,
99036AE223A949CF0000B06A /* _WKInspectorDebuggableInfoInternal.h in Headers */,
9197940C23DBC50300257892 /* _WKInspectorDelegate.h in Headers */,
@@ -14522,7 +14511,7 @@ index 1bf63b303952802e090bdc6f1b098a40e7bb5aa0..e783a447248b0b084c85e1a9124e4baf
5CAFDE472130846A00B1F7E1 /* _WKInspectorInternal.h in Headers */,
9979CA58237F49F10039EC05 /* _WKInspectorPrivate.h in Headers */,
A5C0F0AB2000658200536536 /* _WKInspectorWindow.h in Headers */,
-@@ -10835,6 +10894,7 @@
+@@ -10854,6 +10913,7 @@
1A14F8E21D74C834006CBEC6 /* FrameInfoData.h in Headers */,
1AE00D611831792100087DD7 /* FrameLoadState.h in Headers */,
5C121E842410208D00486F9B /* FrameTreeNodeData.h in Headers */,
@@ -14530,7 +14519,7 @@ index 1bf63b303952802e090bdc6f1b098a40e7bb5aa0..e783a447248b0b084c85e1a9124e4baf
2D4AF0892044C3C4006C8817 /* FrontBoardServicesSPI.h in Headers */,
CD78E1151DB7D7ED0014A2DE /* FullscreenClient.h in Headers */,
CD19D2EA2046406F0017074A /* FullscreenTouchSecheuristic.h in Headers */,
-@@ -10847,6 +10907,7 @@
+@@ -10866,6 +10926,7 @@
BC06F43A12DBCCFB002D78DE /* GeolocationPermissionRequestProxy.h in Headers */,
2DA944A41884E4F000ED86DB /* GestureTypes.h in Headers */,
2DA049B8180CCD0A00AAFA9E /* GraphicsLayerCARemote.h in Headers */,
@@ -14538,7 +14527,7 @@ index 1bf63b303952802e090bdc6f1b098a40e7bb5aa0..e783a447248b0b084c85e1a9124e4baf
C0CE72AD1247E78D00BC0EC4 /* HandleMessage.h in Headers */,
1AC75A1B1B3368270056745B /* HangDetectionDisabler.h in Headers */,
57AC8F50217FEED90055438C /* HidConnection.h in Headers */,
-@@ -10975,8 +11036,10 @@
+@@ -10994,8 +11055,10 @@
413075AC1DE85F370039EC69 /* NetworkRTCMonitor.h in Headers */,
41DC45961E3D6E2200B11F51 /* NetworkRTCProvider.h in Headers */,
5C20CBA01BB1ECD800895BB1 /* NetworkSession.h in Headers */,
@@ -14549,7 +14538,7 @@ index 1bf63b303952802e090bdc6f1b098a40e7bb5aa0..e783a447248b0b084c85e1a9124e4baf
570DAAC22303730300E8FC04 /* NfcConnection.h in Headers */,
570DAAAE23026F5C00E8FC04 /* NfcService.h in Headers */,
31A2EC5614899C0900810D71 /* NotificationPermissionRequest.h in Headers */,
-@@ -11061,6 +11124,7 @@
+@@ -11078,6 +11141,7 @@
CD2865EE2255562000606AC7 /* ProcessTaskStateObserver.h in Headers */,
463FD4821EB94EC000A2982C /* ProcessTerminationReason.h in Headers */,
86E67A251910B9D100004AB7 /* ProcessThrottler.h in Headers */,
@@ -14557,7 +14546,7 @@ index 1bf63b303952802e090bdc6f1b098a40e7bb5aa0..e783a447248b0b084c85e1a9124e4baf
83048AE61ACA45DC0082C832 /* ProcessThrottlerClient.h in Headers */,
A1E688701F6E2BAB007006A6 /* QuarantineSPI.h in Headers */,
1A0C227E2451130A00ED614D /* QuickLookThumbnailingSoftLink.h in Headers */,
-@@ -11357,6 +11421,7 @@
+@@ -11379,6 +11443,7 @@
A543E30D215C8A9000279CD9 /* WebPageInspectorTargetController.h in Headers */,
A543E307215AD13700279CD9 /* WebPageInspectorTargetFrontendChannel.h in Headers */,
C0CE72A11247E71D00BC0EC4 /* WebPageMessages.h in Headers */,
@@ -14565,7 +14554,7 @@ index 1bf63b303952802e090bdc6f1b098a40e7bb5aa0..e783a447248b0b084c85e1a9124e4baf
2D5C9D0619C81D8F00B3C5C1 /* WebPageOverlay.h in Headers */,
46C392292316EC4D008EED9B /* WebPageProxyIdentifier.h in Headers */,
BCBD3915125BB1A800D2C29F /* WebPageProxyMessages.h in Headers */,
-@@ -11485,6 +11550,7 @@
+@@ -11507,6 +11572,7 @@
BCD25F1711D6BDE100169B0E /* WKBundleFrame.h in Headers */,
BCF049E611FE20F600F86A58 /* WKBundleFramePrivate.h in Headers */,
BC49862F124D18C100D834E1 /* WKBundleHitTestResult.h in Headers */,
@@ -14573,7 +14562,7 @@ index 1bf63b303952802e090bdc6f1b098a40e7bb5aa0..e783a447248b0b084c85e1a9124e4baf
BC204EF211C83EC8008F3375 /* WKBundleInitialize.h in Headers */,
65B86F1E12F11DE300B7DD8A /* WKBundleInspector.h in Headers */,
1A8B66B41BC45B010082DF77 /* WKBundleMac.h in Headers */,
-@@ -11537,6 +11603,7 @@
+@@ -11559,6 +11625,7 @@
5C795D71229F3757003FF1C4 /* WKContextMenuElementInfoPrivate.h in Headers */,
51A555F6128C6C47009ABCEC /* WKContextMenuItem.h in Headers */,
51A55601128C6D92009ABCEC /* WKContextMenuItemTypes.h in Headers */,
@@ -14581,7 +14570,7 @@ index 1bf63b303952802e090bdc6f1b098a40e7bb5aa0..e783a447248b0b084c85e1a9124e4baf
A1EA02381DABFF7E0096021F /* WKContextMenuListener.h in Headers */,
BCC938E11180DE440085E5FE /* WKContextPrivate.h in Headers */,
9FB5F395169E6A80002C25BF /* WKContextPrivateMac.h in Headers */,
-@@ -11687,6 +11754,7 @@
+@@ -11708,6 +11775,7 @@
1AB8A1F818400BB800E9AE69 /* WKPageContextMenuClient.h in Headers */,
8372DB251A674C8F00C697C5 /* WKPageDiagnosticLoggingClient.h in Headers */,
1AB8A1F418400B8F00E9AE69 /* WKPageFindClient.h in Headers */,
@@ -14589,7 +14578,7 @@ index 1bf63b303952802e090bdc6f1b098a40e7bb5aa0..e783a447248b0b084c85e1a9124e4baf
1AB8A1F618400B9D00E9AE69 /* WKPageFindMatchesClient.h in Headers */,
1AB8A1F018400B0000E9AE69 /* WKPageFormClient.h in Headers */,
BC7B633712A45ABA00D174A4 /* WKPageGroup.h in Headers */,
-@@ -12750,6 +12818,7 @@
+@@ -12771,6 +12839,7 @@
C1A152D724E5A29A00978C8B /* HandleXPCEndpointMessages.mm in Sources */,
2749F6442146561B008380BF /* InjectedBundleNodeHandle.cpp in Sources */,
2749F6452146561E008380BF /* InjectedBundleRangeHandle.cpp in Sources */,
@@ -14597,7 +14586,7 @@ index 1bf63b303952802e090bdc6f1b098a40e7bb5aa0..e783a447248b0b084c85e1a9124e4baf
2D913441212CF9F000128AFD /* JSNPMethod.cpp in Sources */,
2D913442212CF9F000128AFD /* JSNPObject.cpp in Sources */,
C14D37FE24ACE086007FF014 /* LaunchServicesDatabaseManager.mm in Sources */,
-@@ -12763,6 +12832,7 @@
+@@ -12784,6 +12853,7 @@
2D92A781212B6A7100F493FD /* MessageReceiverMap.cpp in Sources */,
2D92A782212B6A7100F493FD /* MessageSender.cpp in Sources */,
2D92A77A212B6A6100F493FD /* Module.cpp in Sources */,
@@ -14605,7 +14594,7 @@ index 1bf63b303952802e090bdc6f1b098a40e7bb5aa0..e783a447248b0b084c85e1a9124e4baf
57B826452304F14000B72EB0 /* NearFieldSoftLink.mm in Sources */,
2D913443212CF9F000128AFD /* NetscapeBrowserFuncs.cpp in Sources */,
2D913444212CF9F000128AFD /* NetscapePlugin.cpp in Sources */,
-@@ -12786,6 +12856,7 @@
+@@ -12807,6 +12877,7 @@
1A2D8439127F65D5001EB962 /* NPObjectMessageReceiverMessageReceiver.cpp in Sources */,
2D92A792212B6AD400F493FD /* NPObjectProxy.cpp in Sources */,
2D92A793212B6AD400F493FD /* NPRemoteObjectMap.cpp in Sources */,
@@ -14613,7 +14602,7 @@ index 1bf63b303952802e090bdc6f1b098a40e7bb5aa0..e783a447248b0b084c85e1a9124e4baf
2D913447212CF9F000128AFD /* NPRuntimeObjectMap.cpp in Sources */,
2D913448212CF9F000128AFD /* NPRuntimeUtilities.cpp in Sources */,
2D92A794212B6AD400F493FD /* NPVariantData.cpp in Sources */,
-@@ -13069,6 +13140,7 @@
+@@ -13092,6 +13163,7 @@
2D92A78C212B6AB100F493FD /* WebMouseEvent.cpp in Sources */,
31BA924D148831260062EDB5 /* WebNotificationManagerMessageReceiver.cpp in Sources */,
2DF6FE52212E110900469030 /* WebPage.cpp in Sources */,
@@ -14622,10 +14611,10 @@ index 1bf63b303952802e090bdc6f1b098a40e7bb5aa0..e783a447248b0b084c85e1a9124e4baf
BCBD3914125BB1A800D2C29F /* WebPageProxyMessageReceiver.cpp in Sources */,
7CE9CE101FA0767A000177DE /* WebPageUpdatePreferences.cpp in Sources */,
diff --git a/Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp b/Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp
-index 8644d590f676c3f50053b7822f0471858cbb2f00..c20110404f112d73ca5f508acaf066cd33a05516 100644
+index e906262a1fc96d38a3e4d4b3dbdf9dea0f75309d..81e6b9944bb010758d96acba25f499cc6159ab82 100644
--- a/Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp
+++ b/Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp
-@@ -227,6 +227,11 @@ void WebLoaderStrategy::scheduleLoad(ResourceLoader& resourceLoader, CachedResou
+@@ -225,6 +225,11 @@ void WebLoaderStrategy::scheduleLoad(ResourceLoader& resourceLoader, CachedResou
}
#endif
@@ -14637,7 +14626,7 @@ index 8644d590f676c3f50053b7822f0471858cbb2f00..c20110404f112d73ca5f508acaf066cd
if (!tryLoadingUsingURLSchemeHandler(resourceLoader, trackingParameters)) {
WEBLOADERSTRATEGY_RELEASE_LOG_IF_ALLOWED("scheduleLoad: URL will be scheduled with the NetworkProcess");
-@@ -765,7 +770,7 @@ void WebLoaderStrategy::didFinishPreconnection(uint64_t preconnectionIdentifier,
+@@ -772,7 +777,7 @@ void WebLoaderStrategy::didFinishPreconnection(uint64_t preconnectionIdentifier,
bool WebLoaderStrategy::isOnLine() const
{
@@ -14646,7 +14635,7 @@ index 8644d590f676c3f50053b7822f0471858cbb2f00..c20110404f112d73ca5f508acaf066cd
}
void WebLoaderStrategy::addOnlineStateChangeListener(Function<void(bool)>&& listener)
-@@ -776,6 +781,11 @@ void WebLoaderStrategy::addOnlineStateChangeListener(Function<void(bool)>&& list
+@@ -792,6 +797,11 @@ void WebLoaderStrategy::isResourceLoadFinished(CachedResource& resource, Complet
void WebLoaderStrategy::setOnLineState(bool isOnLine)
{
@@ -14658,7 +14647,7 @@ index 8644d590f676c3f50053b7822f0471858cbb2f00..c20110404f112d73ca5f508acaf066cd
if (m_isOnLine == isOnLine)
return;
-@@ -784,6 +794,12 @@ void WebLoaderStrategy::setOnLineState(bool isOnLine)
+@@ -800,6 +810,12 @@ void WebLoaderStrategy::setOnLineState(bool isOnLine)
listener(isOnLine);
}
@@ -14672,7 +14661,7 @@ index 8644d590f676c3f50053b7822f0471858cbb2f00..c20110404f112d73ca5f508acaf066cd
{
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 37c4ccecab8661c414cfe6c879aabcdf9bf3255d..372ef4de867e10c15a000e7ea45bab4b78ad2571 100644
+index 9d9884183ec93daeb3ab63218960172a050e0ffb..65ae20cbeaf74d4954590b76ae63a4b2a9c1b506 100644
--- a/Source/WebKit/WebProcess/Network/WebLoaderStrategy.h
+++ b/Source/WebKit/WebProcess/Network/WebLoaderStrategy.h
@@ -88,6 +88,7 @@ public:
@@ -14683,7 +14672,7 @@ index 37c4ccecab8661c414cfe6c879aabcdf9bf3255d..372ef4de867e10c15a000e7ea45bab4b
static uint64_t generateLoadIdentifier();
-@@ -128,6 +129,7 @@ private:
+@@ -130,6 +131,7 @@ private:
HashMap<unsigned long, PreconnectCompletionHandler> m_preconnectCompletionHandlers;
Vector<Function<void(bool)>> m_onlineStateChangeListeners;
bool m_isOnLine { true };
@@ -14692,10 +14681,10 @@ index 37c4ccecab8661c414cfe6c879aabcdf9bf3255d..372ef4de867e10c15a000e7ea45bab4b
} // namespace WebKit
diff --git a/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp b/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp
-index 459d5db972db87bcba8d5edf458c93ee44714460..84effadb13a2f4ae0902831f882cda028ef73c01 100644
+index bcc254ba44f77616d9803928db9b6fa62f586d2b..a1d8a6b1620c4a03bcad21721616c53c1db3846d 100644
--- a/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp
+++ b/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp
-@@ -385,6 +385,8 @@ void WebChromeClient::setResizable(bool resizable)
+@@ -386,6 +386,8 @@ void WebChromeClient::setResizable(bool resizable)
void WebChromeClient::addMessageToConsole(MessageSource source, MessageLevel level, const String& message, unsigned lineNumber, unsigned columnNumber, const String& sourceID)
{
@@ -14704,7 +14693,7 @@ index 459d5db972db87bcba8d5edf458c93ee44714460..84effadb13a2f4ae0902831f882cda02
// Notify the bundle client.
m_page.injectedBundleUIClient().willAddMessageToConsole(&m_page, source, level, message, lineNumber, columnNumber, sourceID);
}
-@@ -775,6 +777,13 @@ bool WebChromeClient::canShowDataListSuggestionLabels() const
+@@ -785,6 +787,13 @@ std::unique_ptr<DateTimeChooser> WebChromeClient::createDateTimeChooser(DateTime
#endif
@@ -14719,7 +14708,7 @@ index 459d5db972db87bcba8d5edf458c93ee44714460..84effadb13a2f4ae0902831f882cda02
{
if (m_page.activeOpenPanelResultListener())
diff --git a/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp b/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
-index 00be1e2d4dd2129fd6469bcdfb9bb6c167de0b92..9b2bb3b18113897b373b4d87b5a8cd242ca2d0e6 100644
+index 1b9a3a9acd53066475a37d00e92058e8d8cb28b4..5c59cba07f51ff34e8def6a874f5d383af543a53 100644
--- a/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
+++ b/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
@@ -1557,13 +1557,6 @@ void WebFrameLoaderClient::transitionToCommittedForNewPage()
@@ -14905,10 +14894,10 @@ index f127d64d005ab7b93875591b94a5899205e91579..df0de26e4dc449a0fbf93e7037444df4
uint64_t m_navigationID;
};
diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.cpp b/Source/WebKit/WebProcess/WebPage/WebPage.cpp
-index c7f202c872119d7482662611ed0efb74d19db00e..65037c00927a258a000b617878deb7c6e5ef2332 100644
+index f4f30b5fb1cb76ad448df874569b265985e618dd..8b3a0f620940d7a2da6d4f5ede989eee9a597c1f 100644
--- a/Source/WebKit/WebProcess/WebPage/WebPage.cpp
+++ b/Source/WebKit/WebProcess/WebPage/WebPage.cpp
-@@ -785,6 +785,9 @@ WebPage::WebPage(PageIdentifier pageID, WebPageCreationParameters&& parameters)
+@@ -797,6 +797,9 @@ WebPage::WebPage(PageIdentifier pageID, WebPageCreationParameters&& parameters)
m_page->setCanUseCredentialStorage(parameters.canUseCredentialStorage);
@@ -14918,7 +14907,7 @@ index c7f202c872119d7482662611ed0efb74d19db00e..65037c00927a258a000b617878deb7c6
updateThrottleState();
}
-@@ -1558,6 +1561,22 @@ void WebPage::platformDidReceiveLoadParameters(const LoadParameters& loadParamet
+@@ -1570,6 +1573,22 @@ void WebPage::platformDidReceiveLoadParameters(const LoadParameters& loadParamet
}
#endif
@@ -14940,8 +14929,8 @@ index c7f202c872119d7482662611ed0efb74d19db00e..65037c00927a258a000b617878deb7c6
+
void WebPage::loadRequest(LoadParameters&& loadParameters)
{
- setIsNavigatingToAppBoundDomain(loadParameters.isNavigatingToAppBoundDomain, &m_mainFrame.get());
-@@ -1764,17 +1783,13 @@ void WebPage::setSize(const WebCore::IntSize& viewSize)
+ #if ENABLE(APP_BOUND_DOMAINS)
+@@ -1780,17 +1799,13 @@ void WebPage::setSize(const WebCore::IntSize& viewSize)
view->resize(viewSize);
m_drawingArea->setNeedsDisplay();
@@ -14960,7 +14949,7 @@ index c7f202c872119d7482662611ed0efb74d19db00e..65037c00927a258a000b617878deb7c6
// Viewport properties have no impact on zero sized fixed viewports.
if (m_viewSize.isEmpty())
-@@ -1791,20 +1806,18 @@ void WebPage::sendViewportAttributesChanged(const ViewportArguments& viewportArg
+@@ -1807,20 +1822,18 @@ void WebPage::sendViewportAttributesChanged(const ViewportArguments& viewportArg
ViewportAttributes attr = computeViewportAttributes(viewportArguments, minimumLayoutFallbackWidth, deviceWidth, deviceHeight, 1, m_viewSize);
@@ -14988,7 +14977,7 @@ index c7f202c872119d7482662611ed0efb74d19db00e..65037c00927a258a000b617878deb7c6
#if USE(COORDINATED_GRAPHICS)
m_drawingArea->didChangeViewportAttributes(WTFMove(attr));
-@@ -1812,7 +1825,6 @@ void WebPage::sendViewportAttributesChanged(const ViewportArguments& viewportArg
+@@ -1828,7 +1841,6 @@ void WebPage::sendViewportAttributesChanged(const ViewportArguments& viewportArg
send(Messages::WebPageProxy::DidChangeViewportProperties(attr));
#endif
}
@@ -14996,7 +14985,7 @@ index c7f202c872119d7482662611ed0efb74d19db00e..65037c00927a258a000b617878deb7c6
void WebPage::scrollMainFrameIfNotAtMaxScrollPosition(const IntSize& scrollOffset)
{
-@@ -2111,6 +2123,7 @@ void WebPage::scaleView(double scale)
+@@ -2127,6 +2139,7 @@ void WebPage::scaleView(double scale)
}
m_page->setViewScaleFactor(scale);
@@ -15004,7 +14993,7 @@ index c7f202c872119d7482662611ed0efb74d19db00e..65037c00927a258a000b617878deb7c6
scalePage(pageScale, scrollPositionAtNewScale);
}
-@@ -2215,17 +2228,13 @@ void WebPage::viewportPropertiesDidChange(const ViewportArguments& viewportArgum
+@@ -2231,17 +2244,13 @@ void WebPage::viewportPropertiesDidChange(const ViewportArguments& viewportArgum
viewportConfigurationChanged();
#endif
@@ -15023,7 +15012,7 @@ index c7f202c872119d7482662611ed0efb74d19db00e..65037c00927a258a000b617878deb7c6
}
void WebPage::listenForLayoutMilestones(OptionSet<WebCore::LayoutMilestone> milestones)
-@@ -3128,6 +3137,11 @@ void WebPage::sendMessageToTargetBackend(const String& targetId, const String& m
+@@ -3144,6 +3153,11 @@ void WebPage::sendMessageToTargetBackend(const String& targetId, const String& m
m_inspectorTargetController->sendMessageToTargetBackend(targetId, message);
}
@@ -15035,7 +15024,7 @@ index c7f202c872119d7482662611ed0efb74d19db00e..65037c00927a258a000b617878deb7c6
void WebPage::insertNewlineInQuotedContent()
{
Frame& frame = m_page->focusController().focusedOrMainFrame();
-@@ -3370,6 +3384,7 @@ void WebPage::didCompletePageTransition()
+@@ -3387,6 +3401,7 @@ void WebPage::didCompletePageTransition()
void WebPage::show()
{
send(Messages::WebPageProxy::ShowPage());
@@ -15043,7 +15032,7 @@ index c7f202c872119d7482662611ed0efb74d19db00e..65037c00927a258a000b617878deb7c6
}
void WebPage::setIsTakingSnapshotsForApplicationSuspension(bool isTakingSnapshotsForApplicationSuspension)
-@@ -6459,6 +6474,9 @@ Ref<DocumentLoader> WebPage::createDocumentLoader(Frame& frame, const ResourceRe
+@@ -6503,6 +6518,9 @@ Ref<DocumentLoader> WebPage::createDocumentLoader(Frame& frame, const ResourceRe
WebsitePoliciesData::applyToDocumentLoader(WTFMove(*m_pendingWebsitePolicies), documentLoader);
m_pendingWebsitePolicies = WTF::nullopt;
}
@@ -15054,10 +15043,10 @@ index c7f202c872119d7482662611ed0efb74d19db00e..65037c00927a258a000b617878deb7c6
return documentLoader;
diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.h b/Source/WebKit/WebProcess/WebPage/WebPage.h
-index d6bd2fce9ec5c7645881174fe4bc0692f2ab63fb..e73243919aadbd4cb8cbd14d2054aa2d769fd50d 100644
+index 2e418462d8398eccc94cc905be1b3388a3b8b9f6..ca30849ce35432b36a6f2d4df11614a069805027 100644
--- a/Source/WebKit/WebProcess/WebPage/WebPage.h
+++ b/Source/WebKit/WebProcess/WebPage/WebPage.h
-@@ -1170,6 +1170,7 @@ public:
+@@ -1185,6 +1185,7 @@ public:
void connectInspector(const String& targetId, Inspector::FrontendChannel::ConnectionType);
void disconnectInspector(const String& targetId);
void sendMessageToTargetBackend(const String& targetId, const String& message);
@@ -15065,7 +15054,7 @@ index d6bd2fce9ec5c7645881174fe4bc0692f2ab63fb..e73243919aadbd4cb8cbd14d2054aa2d
void insertNewlineInQuotedContent();
-@@ -1445,6 +1446,7 @@ private:
+@@ -1462,6 +1463,7 @@ private:
// Actions
void tryClose(CompletionHandler<void(bool)>&&);
void platformDidReceiveLoadParameters(const LoadParameters&);
@@ -15073,7 +15062,7 @@ index d6bd2fce9ec5c7645881174fe4bc0692f2ab63fb..e73243919aadbd4cb8cbd14d2054aa2d
void loadRequest(LoadParameters&&);
NO_RETURN void loadRequestWaitingForProcessLaunch(LoadParameters&&, URL&&, WebPageProxyIdentifier, bool);
void loadData(LoadParameters&&);
-@@ -1597,9 +1599,7 @@ private:
+@@ -1614,9 +1616,7 @@ private:
void countStringMatches(const String&, OptionSet<FindOptions>, uint32_t maxMatchCount);
void replaceMatches(const Vector<uint32_t>& matchIndices, const String& replacementText, bool selectionOnly, CallbackID);
@@ -15083,7 +15072,7 @@ index d6bd2fce9ec5c7645881174fe4bc0692f2ab63fb..e73243919aadbd4cb8cbd14d2054aa2d
void didChangeSelectedIndexForActivePopupMenu(int32_t newIndex);
void setTextForActivePopupMenu(int32_t index);
-@@ -2067,6 +2067,7 @@ private:
+@@ -2093,6 +2093,7 @@ private:
UserActivity m_userActivity;
uint64_t m_pendingNavigationID { 0 };
@@ -15092,10 +15081,10 @@ index d6bd2fce9ec5c7645881174fe4bc0692f2ab63fb..e73243919aadbd4cb8cbd14d2054aa2d
bool m_mainFrameProgressCompleted { false };
diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.messages.in b/Source/WebKit/WebProcess/WebPage/WebPage.messages.in
-index b58e89f84820c68d14409661db37766e332f7dc9..f748b81359bb55af88004f8be5910726644d9ebb 100644
+index 7a8343faa58e52e9408806e4201235436d576349..e03a5524cdf80fa685faf5bf6edd53b30c3ef209 100644
--- a/Source/WebKit/WebProcess/WebPage/WebPage.messages.in
+++ b/Source/WebKit/WebProcess/WebPage/WebPage.messages.in
-@@ -133,6 +133,7 @@ GenerateSyntheticEditingCommand(enum:uint8_t WebKit::SyntheticEditingCommandType
+@@ -132,6 +132,7 @@ GenerateSyntheticEditingCommand(enum:uint8_t WebKit::SyntheticEditingCommandType
ConnectInspector(String targetId, Inspector::FrontendChannel::ConnectionType connectionType)
DisconnectInspector(String targetId)
SendMessageToTargetBackend(String targetId, String message)
@@ -15103,7 +15092,7 @@ index b58e89f84820c68d14409661db37766e332f7dc9..f748b81359bb55af88004f8be5910726
#if ENABLE(REMOTE_INSPECTOR)
SetIndicating(bool indicating);
-@@ -173,6 +174,7 @@ GenerateSyntheticEditingCommand(enum:uint8_t WebKit::SyntheticEditingCommandType
+@@ -177,6 +178,7 @@ GenerateSyntheticEditingCommand(enum:uint8_t WebKit::SyntheticEditingCommandType
LoadURLInFrame(URL url, String referrer, WebCore::FrameIdentifier frameID)
LoadDataInFrame(IPC::DataReference data, String MIMEType, String encodingName, URL baseURL, WebCore::FrameIdentifier frameID)
LoadRequest(struct WebKit::LoadParameters loadParameters)
@@ -15112,7 +15101,7 @@ index b58e89f84820c68d14409661db37766e332f7dc9..f748b81359bb55af88004f8be5910726
LoadData(struct WebKit::LoadParameters loadParameters)
LoadAlternateHTML(struct WebKit::LoadParameters loadParameters)
diff --git a/Source/WebKit/WebProcess/WebProcess.cpp b/Source/WebKit/WebProcess/WebProcess.cpp
-index 6708f9d0a5ce73bfca0a9dd077b93f7383f4d91e..759739935f547ecf46acd7e0474b480e764f6b98 100644
+index 77e8fb6d2fce2ef5ba84f66f926cc53b5e029cc7..9794cfd79bd48bfaa0db81314184548a356cb5d5 100644
--- a/Source/WebKit/WebProcess/WebProcess.cpp
+++ b/Source/WebKit/WebProcess/WebProcess.cpp
@@ -81,6 +81,7 @@
@@ -15123,7 +15112,7 @@ index 6708f9d0a5ce73bfca0a9dd077b93f7383f4d91e..759739935f547ecf46acd7e0474b480e
#include <JavaScriptCore/JSLock.h>
#include <JavaScriptCore/MemoryStatistics.h>
#include <JavaScriptCore/WasmFaultSignalHandler.h>
-@@ -288,6 +289,8 @@ void WebProcess::initializeProcess(const AuxiliaryProcessInitializationParameter
+@@ -292,6 +293,8 @@ void WebProcess::initializeProcess(const AuxiliaryProcessInitializationParameter
platformInitializeProcess(parameters);
updateCPULimit();
@@ -15148,10 +15137,10 @@ index 89bc159df35910abe133c68d71057cdfe1995cbb..aba8e9110a3ec4c59e9888b148e1e908
SetProcessDPIAware();
return true;
diff --git a/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm b/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm
-index 3adf6340e078075c1d7c30a3792aec43b22ea6d6..05c18f912c6be54ac25aac0f4fed71bce9c5df19 100644
+index 61da809eeea2f659ae3676d9a8af9062e0d70111..e5e83986e2c18409f9080d5455b696dd642cae97 100644
--- a/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm
+++ b/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm
-@@ -4215,7 +4215,7 @@ static BOOL currentScrollIsBlit(NSView *clipView)
+@@ -4224,7 +4224,7 @@ static BOOL currentScrollIsBlit(NSView *clipView)
_private->handlingMouseDownEvent = NO;
}
@@ -15161,10 +15150,10 @@ index 3adf6340e078075c1d7c30a3792aec43b22ea6d6..05c18f912c6be54ac25aac0f4fed71bc
- (void)touch:(WebEvent *)event
{
diff --git a/Source/WebKitLegacy/mac/WebView/WebView.mm b/Source/WebKitLegacy/mac/WebView/WebView.mm
-index 7a96995cf12978fd784ad27a1d88861f14366434..b75aa2afe27f40d08d1752e4285275c57a2482bc 100644
+index c887b8534583af0edd02e417f2aa6eb9c5997fdd..3057eb0e7f02853a7fc79878629a44de5540d414 100644
--- a/Source/WebKitLegacy/mac/WebView/WebView.mm
+++ b/Source/WebKitLegacy/mac/WebView/WebView.mm
-@@ -4524,7 +4524,7 @@ IGNORE_WARNINGS_END
+@@ -4515,7 +4515,7 @@ IGNORE_WARNINGS_END
}
#endif // PLATFORM(IOS_FAMILY)
@@ -15173,7 +15162,7 @@ index 7a96995cf12978fd784ad27a1d88861f14366434..b75aa2afe27f40d08d1752e4285275c5
- (NSArray *)_touchEventRegions
{
-@@ -4566,7 +4566,7 @@ IGNORE_WARNINGS_END
+@@ -4557,7 +4557,7 @@ IGNORE_WARNINGS_END
}).autorelease();
}
@@ -15214,12 +15203,12 @@ index 0000000000000000000000000000000000000000..dd6a53e2d57318489b7e49dd7373706d
+ LIBVPX_LIBRARIES
+)
diff --git a/Source/cmake/OptionsGTK.cmake b/Source/cmake/OptionsGTK.cmake
-index 087f458b8f21b5069a0e2313474d7b84b4e4c019..e990d39bb6bf0d7718bf693eebf1ff7e5c991860 100644
+index 74f0c9e8c76d6271bc619955198f01787a6e86b1..12024d6622ffebb3046711f67b8dbcd6239ac6ce 100644
--- a/Source/cmake/OptionsGTK.cmake
+++ b/Source/cmake/OptionsGTK.cmake
@@ -6,6 +6,8 @@ WEBKIT_OPTION_DEFINE(USE_GTK4 "Whether to enable usage of GTK4 instead of GTK3."
- SET_PROJECT_VERSION(2 29 4)
+ SET_PROJECT_VERSION(2 31 0)
+set(ENABLE_WEBKIT_LEGACY OFF)
+
@@ -15252,16 +15241,16 @@ index 087f458b8f21b5069a0e2313474d7b84b4e4c019..e990d39bb6bf0d7718bf693eebf1ff7e
# Finalize the value for all options. Do not attempt to use an option before
diff --git a/Source/cmake/OptionsWPE.cmake b/Source/cmake/OptionsWPE.cmake
-index b4d3e3a2d30049c21a4416c51cf1e747e85af9b4..adfefe730a5700d9767fa37042b2e68c4a3faf56 100644
+index de5e1c20cdd046643b722fb5dda7708caa526fd2..72046d38a37dc703e55cd72afb9767e31e2170ba 100644
--- a/Source/cmake/OptionsWPE.cmake
+++ b/Source/cmake/OptionsWPE.cmake
@@ -3,6 +3,7 @@ include(VersioningUtils)
- SET_PROJECT_VERSION(2 29 2)
+ SET_PROJECT_VERSION(2 31 0)
set(WPE_API_VERSION 1.0)
+set(ENABLE_WEBKIT_LEGACY OFF)
- CALCULATE_LIBRARY_VERSIONS_FROM_LIBTOOL_TRIPLE(WEBKIT 14 0 11)
+ CALCULATE_LIBRARY_VERSIONS_FROM_LIBTOOL_TRIPLE(WEBKIT 15 0 12)
@@ -80,13 +81,21 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEBGL2 PRIVATE OFF)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEB_RTC PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES})
@@ -15287,7 +15276,7 @@ index b4d3e3a2d30049c21a4416c51cf1e747e85af9b4..adfefe730a5700d9767fa37042b2e68c
# Private options specific to the WPE port.
diff --git a/Source/cmake/OptionsWin.cmake b/Source/cmake/OptionsWin.cmake
-index 4785d5a01d86462d8a897f90ce233df650af0cf4..a804a5df69b817e901a7d7408d43de41c89b5347 100644
+index c861d73366791cecd118075619e7fddd163f9eed..99144b261581a6788d19523c5335d51ea2843f8c 100644
--- a/Source/cmake/OptionsWin.cmake
+++ b/Source/cmake/OptionsWin.cmake
@@ -7,8 +7,9 @@ add_definitions(-D_WINDOWS -DWINVER=0x601 -D_WIN32_WINNT=0x601)
@@ -15301,7 +15290,7 @@ index 4785d5a01d86462d8a897f90ce233df650af0cf4..a804a5df69b817e901a7d7408d43de41
set(ENABLE_WEBKIT OFF)
endif ()
-@@ -90,6 +91,13 @@ if (${WTF_PLATFORM_WIN_CAIRO})
+@@ -89,6 +90,13 @@ if (${WTF_PLATFORM_WIN_CAIRO})
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEBDRIVER PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES})
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEB_CRYPTO PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES})
@@ -15316,7 +15305,7 @@ index 4785d5a01d86462d8a897f90ce233df650af0cf4..a804a5df69b817e901a7d7408d43de41
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_NETSCAPE_PLUGIN_API PRIVATE OFF)
else ()
diff --git a/Source/cmake/OptionsWinCairo.cmake b/Source/cmake/OptionsWinCairo.cmake
-index 8a9c9e8d5bc6c283bf766efdf8cdc5e6aff546fb..29fb661996f2e280fc80cfa4940567896819e53c 100644
+index 5f912e2ca60f4853f197f1ba4b09d77c9a2dcb6e..a2cd354c14b2367cb5d6fc7783a3aa2845e5e8b5 100644
--- a/Source/cmake/OptionsWinCairo.cmake
+++ b/Source/cmake/OptionsWinCairo.cmake
@@ -27,15 +27,36 @@ if (OpenJPEG_FOUND)
@@ -15394,7 +15383,7 @@ index 3845eabba3e964f9e11bb0ffcb8726fd4ea96fc4..2e0e3929907d4760eb681c743984d4c8
}
diff --git a/Tools/MiniBrowser/gtk/BrowserWindow.c b/Tools/MiniBrowser/gtk/BrowserWindow.c
-index 26bf3be8dbe6869a827a291e72b1ef2a22e07a1e..ab9c0ae73404a8a51de645c169cfa5aaa140437e 100644
+index 90f29c8732d3269f9ff2c0e5707a1e8361cbcc10..81ab85819e78f293353d8ed853a7f48e87c13bf1 100644
--- a/Tools/MiniBrowser/gtk/BrowserWindow.c
+++ b/Tools/MiniBrowser/gtk/BrowserWindow.c
@@ -1335,6 +1335,12 @@ static gboolean browserWindowDeleteEvent(GtkWidget *widget, GdkEventAny* event)
@@ -15820,10 +15809,10 @@ index 53486d2b4022ee88007ea1dee11b95abf1d2e5e7..a01fdf6a1b5dd9026034167e7c09bcfb
return 0;
diff --git a/Tools/PlatformWin.cmake b/Tools/PlatformWin.cmake
-index 44301d5fef9c977dc0228b9de1ae75263efd9014..0c8c7e176a6e02ca04872cdd362d0a8927728557 100644
+index ef4407cfc114e602d98ed81724da504f453e258f..448dd483715162baba484f756fbcc1d72de4ba0c 100644
--- a/Tools/PlatformWin.cmake
+++ b/Tools/PlatformWin.cmake
-@@ -10,4 +10,5 @@ endif ()
+@@ -12,4 +12,5 @@ endif ()
if (ENABLE_WEBKIT)
add_subdirectory(WebKitTestRunner)
@@ -15843,10 +15832,10 @@ index 9a25452ae45f7437252b87336b7f6042db7613d5..acbf64c242a843dc1056d8be22fcb623
# WebInspectorUI must come after JavaScriptCore and WebCore but before WebKit and WebKit2
my $webKitIndex = first { $projects[$_] eq "Source/WebKitLegacy" } 0..$#projects;
diff --git a/Tools/WebKitTestRunner/TestController.cpp b/Tools/WebKitTestRunner/TestController.cpp
-index 4c2608f9b1ecf6c256c2d0ab3f967caae90324a2..74c5c2909698a620f6e9b886f447d28ab2c30214 100644
+index 9d37cceddb82157475d81f1220f456b864c3b171..813eea10ec6d5dd96551e53b7d0a617033d58e89 100644
--- a/Tools/WebKitTestRunner/TestController.cpp
+++ b/Tools/WebKitTestRunner/TestController.cpp
-@@ -732,7 +732,8 @@ void TestController::createWebViewWithOptions(const TestOptions& options)
+@@ -731,7 +731,8 @@ void TestController::createWebViewWithOptions(const TestOptions& options)
0, // didResignInputElementStrongPasswordAppearance
0, // requestStorageAccessConfirm
shouldAllowDeviceOrientationAndMotionAccess,
@@ -15857,10 +15846,10 @@ index 4c2608f9b1ecf6c256c2d0ab3f967caae90324a2..74c5c2909698a620f6e9b886f447d28a
WKPageSetPageUIClient(m_mainWebView->page(), &pageUIClient.base);
diff --git a/Tools/WebKitTestRunner/mac/EventSenderProxy.mm b/Tools/WebKitTestRunner/mac/EventSenderProxy.mm
-index f83bf7dd57dc481fe365dfe03bf7bd2b6a745fd6..aa646dcf816838da9482405dee380ce4da6d84c9 100644
+index 0672b581bf65b5ad9a2b85fea861648f223eb4c5..38a710f26f836c024ec1dc4913eff7df1afa530b 100644
--- a/Tools/WebKitTestRunner/mac/EventSenderProxy.mm
+++ b/Tools/WebKitTestRunner/mac/EventSenderProxy.mm
-@@ -878,4 +878,51 @@ void EventSenderProxy::mouseScrollByWithWheelAndMomentumPhases(int x, int y, int
+@@ -884,4 +884,51 @@ void EventSenderProxy::mouseScrollByWithWheelAndMomentumPhases(int x, int y, int
}
}