From c623920f90f0d65cfd0ff4f0ad3e2d5ac5be788f Mon Sep 17 00:00:00 2001 From: Devin Rousso Date: Fri, 24 Jul 2026 14:56:07 -0600 Subject: [PATCH 1/5] chore: roll `browser_patches` (#41969) roll `browser_patches` from `playwright-browsers` for the v1.62 release, pinned at the 6 weeks old snapshot (`d44b3cc26`). --- browser_patches/webkit/UPSTREAM_CONFIG.sh | 2 +- .../embedder/Playwright/win/WinMain.cpp | 16 +- browser_patches/webkit/patches/bootstrap.diff | 2057 ++++++++++------- 3 files changed, 1195 insertions(+), 880 deletions(-) diff --git a/browser_patches/webkit/UPSTREAM_CONFIG.sh b/browser_patches/webkit/UPSTREAM_CONFIG.sh index 949eaeae6398a..1b73874e1bc76 100644 --- a/browser_patches/webkit/UPSTREAM_CONFIG.sh +++ b/browser_patches/webkit/UPSTREAM_CONFIG.sh @@ -1,3 +1,3 @@ REMOTE_URL="https://github.com/WebKit/WebKit.git" BASE_BRANCH="main" -BASE_REVISION="343e13bf22dca9d0ec227801419aab0f9001a32f" +BASE_REVISION="4d05d732e5a84f32675bef4cc135a2e7a9269a87" diff --git a/browser_patches/webkit/embedder/Playwright/win/WinMain.cpp b/browser_patches/webkit/embedder/Playwright/win/WinMain.cpp index 8dde328f19415..585e1778b0a6d 100644 --- a/browser_patches/webkit/embedder/Playwright/win/WinMain.cpp +++ b/browser_patches/webkit/embedder/Playwright/win/WinMain.cpp @@ -40,6 +40,7 @@ #include #include "WebKitBrowserWindow.h" #include +#include #include SOFT_LINK_LIBRARY(user32); @@ -76,7 +77,6 @@ int WINAPI wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE); #endif - MSG msg { }; HACCEL hAccelTable, hPreAccelTable; INITCOMMONCONTROLSEX InitCtrlEx; @@ -143,17 +143,15 @@ int WINAPI wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, // Main message loop: __try { - while (GetMessage(&msg, nullptr, 0, 0)) { + RunLoop::setWindowsMessageHandler([hAccelTable, hPreAccelTable] (MSG& msg) { if (TranslateAccelerator(msg.hwnd, hPreAccelTable, &msg)) - continue; + return true; bool processed = false; if (MainWindow::isInstance(msg.hwnd)) processed = TranslateAccelerator(msg.hwnd, hAccelTable, &msg); - if (!processed) { - TranslateMessage(&msg); - DispatchMessage(&msg); - } - } + return processed; + }); + RunLoop::run(); } __except(createCrashReport(GetExceptionInformation()), EXCEPTION_EXECUTE_HANDLER) { } exit: @@ -164,5 +162,5 @@ int WINAPI wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, // Shut down COM. OleUninitialize(); - return static_cast(msg.wParam); + return 0; } diff --git a/browser_patches/webkit/patches/bootstrap.diff b/browser_patches/webkit/patches/bootstrap.diff index f6496e94a03d3..c6fb0a9e5f31b 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 c257f6a5a523ce12f67857e0d344aadffea6601a..f8c46e22eb4fa79c6b9f56846828391c3bf4de21 100644 +index 161c7b52986e742e8a503a1055defc973f1b4a5c..66a6a9e43c39f4098f4dcf0aaa06dc131d1ec775 100644 --- a/Source/JavaScriptCore/CMakeLists.txt +++ b/Source/JavaScriptCore/CMakeLists.txt -@@ -1615,21 +1615,26 @@ set(JavaScriptCore_INSPECTOR_DOMAINS +@@ -1687,21 +1687,26 @@ set(JavaScriptCore_INSPECTOR_DOMAINS ${JAVASCRIPTCORE_DIR}/inspector/protocol/CSS.json ${JAVASCRIPTCORE_DIR}/inspector/protocol/Canvas.json ${JAVASCRIPTCORE_DIR}/inspector/protocol/Console.json @@ -30,10 +30,10 @@ index c257f6a5a523ce12f67857e0d344aadffea6601a..f8c46e22eb4fa79c6b9f56846828391c ${JAVASCRIPTCORE_DIR}/inspector/protocol/ServiceWorker.json ${JAVASCRIPTCORE_DIR}/inspector/protocol/Target.json diff --git a/Source/JavaScriptCore/DerivedSources-input.xcfilelist b/Source/JavaScriptCore/DerivedSources-input.xcfilelist -index 55eacb0d378fddea15ece56db612655ac5d64061..cb6cfa7c542e82671f68984ff9373e1bf58da2b8 100644 +index 726fff0b42d9c68f6bc2264e80ffaba5ecdc9c19..e0467722a0a84a7bd97ee1cf83792e3b21dc21e1 100644 --- a/Source/JavaScriptCore/DerivedSources-input.xcfilelist +++ b/Source/JavaScriptCore/DerivedSources-input.xcfilelist -@@ -101,20 +101,25 @@ $(PROJECT_DIR)/inspector/protocol/CPUProfiler.json +@@ -100,20 +100,25 @@ $(PROJECT_DIR)/inspector/protocol/CPUProfiler.json $(PROJECT_DIR)/inspector/protocol/CSS.json $(PROJECT_DIR)/inspector/protocol/Canvas.json $(PROJECT_DIR)/inspector/protocol/Console.json @@ -60,10 +60,10 @@ index 55eacb0d378fddea15ece56db612655ac5d64061..cb6cfa7c542e82671f68984ff9373e1b $(PROJECT_DIR)/inspector/protocol/Security.json $(PROJECT_DIR)/inspector/protocol/ServiceWorker.json diff --git a/Source/JavaScriptCore/DerivedSources.make b/Source/JavaScriptCore/DerivedSources.make -index 7eb4f1c1e0cd3abdf61203d33cd2f53d77d4264d..01adf210b42055612dc02aba0ed52e6f6ed1d10f 100644 +index f578bae225764bc744094224bbb26135b65fbe95..6aa5de1e3e410dbd261c4eefd7d1b6939ede60bd 100644 --- a/Source/JavaScriptCore/DerivedSources.make +++ b/Source/JavaScriptCore/DerivedSources.make -@@ -298,21 +298,26 @@ INSPECTOR_DOMAINS := \ +@@ -294,21 +294,26 @@ INSPECTOR_DOMAINS := \ $(JavaScriptCore)/inspector/protocol/CSS.json \ $(JavaScriptCore)/inspector/protocol/Canvas.json \ $(JavaScriptCore)/inspector/protocol/Console.json \ @@ -146,7 +146,7 @@ index 4d9152423abf35dfbdf338435b567a822b2f6904..4e6b551494e1d124655c8cc54f121ac4 return nullptr; inspectorObject->setValue(name.string(), inspectorValue.releaseNonNull()); diff --git a/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.cpp b/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.cpp -index e20e61989609a48b3cdb0492f3c5801a3ada3319..9e91d3ca5c92e71b79ec58570c05380e16f410ef 100644 +index 5131f15fbcd16365883508bdb77160c97f0e359a..8862b68b20d9a5610d1a1f7792e68ca6e9b27e04 100644 --- a/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.cpp +++ b/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.cpp @@ -104,7 +104,7 @@ void BackendDispatcher::registerDispatcherForDomain(const String& domain, Supple @@ -380,7 +380,7 @@ index 0b7d732f036fce96b01bd06f4c47f5d471a0ab38..a9efea4bec66aa68966c99d9e77f8a36 // FrontendChannel FrontendChannel::ConnectionType connectionType() const; diff --git a/Source/JavaScriptCore/inspector/protocol/DOM.json b/Source/JavaScriptCore/inspector/protocol/DOM.json -index 0b41f31605a2407fd068e28eaec60dbeabefd4d8..80fc7f1351949447c1f988641a26bcf695d589f2 100644 +index 6e8fdd27aca49bfc534ea3c3f960b419dbb0dc9f..eca174d4507a70ef4066babaa83c992009a00a88 100644 --- a/Source/JavaScriptCore/inspector/protocol/DOM.json +++ b/Source/JavaScriptCore/inspector/protocol/DOM.json @@ -80,6 +80,16 @@ @@ -837,10 +837,10 @@ index 0000000000000000000000000000000000000000..1c43b476603325fa412bcfded9163e7a + ] +} diff --git a/Source/JavaScriptCore/inspector/protocol/Network.json b/Source/JavaScriptCore/inspector/protocol/Network.json -index 29a3ef3294dcdf9e9559b665e9f1bb9a5727cf4b..b6b90f356dd6b7de7752ab4296069c8f07b4de38 100644 +index a535818daee8ec8bea89658d12a04109f2841567..26f19ac2846b72dd71b5defe877b93c47f72b23a 100644 --- a/Source/JavaScriptCore/inspector/protocol/Network.json +++ b/Source/JavaScriptCore/inspector/protocol/Network.json -@@ -360,6 +360,13 @@ +@@ -361,6 +361,13 @@ "parameters": [ { "name": "bytesPerSecondLimit", "type": "integer", "optional": true, "description": "Limits the bytes per second of requests if positive. Removes any limits if zero or not provided." } ] @@ -855,7 +855,7 @@ index 29a3ef3294dcdf9e9559b665e9f1bb9a5727cf4b..b6b90f356dd6b7de7752ab4296069c8f ], "events": [ diff --git a/Source/JavaScriptCore/inspector/protocol/Page.json b/Source/JavaScriptCore/inspector/protocol/Page.json -index 374b26c3ee9acf39aeb23fb60821b39d0afd971c..8843241e3e669c2d7537adb11e83325f216febba 100644 +index 8113d39cf01d78e6d5ba1e0c8bcbdea9b7ff667f..1cec5a9de917834f2671ed0000129bb1435403e7 100644 --- a/Source/JavaScriptCore/inspector/protocol/Page.json +++ b/Source/JavaScriptCore/inspector/protocol/Page.json @@ -20,7 +20,15 @@ @@ -875,7 +875,19 @@ index 374b26c3ee9acf39aeb23fb60821b39d0afd971c..8843241e3e669c2d7537adb11e83325f ] }, { -@@ -62,6 +70,12 @@ +@@ -56,12 +64,24 @@ + "enum": ["Viewport", "Page"], + "description": "Coordinate system used by supplied coordinates." + }, ++ { ++ "id": "ImageFormat", ++ "type": "string", ++ "enum": ["png", "jpeg", "webp"], ++ "description": "Image format used to encode a captured snapshot." ++ }, + { + "id": "CookieSameSitePolicy", + "type": "string", "enum": ["None", "Lax", "Strict"], "description": "Same-Site policy of a cookie." }, @@ -888,7 +900,7 @@ index 374b26c3ee9acf39aeb23fb60821b39d0afd971c..8843241e3e669c2d7537adb11e83325f { "id": "Frame", "type": "object", -@@ -126,6 +140,16 @@ +@@ -126,6 +146,16 @@ { "name": "sameSite", "$ref": "CookieSameSitePolicy", "description": "Cookie Same-Site policy." }, { "name": "partitionKey", "type": "string", "optional": true, "description": "Cookie partition key. If null and partitioned property is true, then key must be computed." } ] @@ -905,7 +917,7 @@ index 374b26c3ee9acf39aeb23fb60821b39d0afd971c..8843241e3e669c2d7537adb11e83325f } ], "commands": [ -@@ -145,6 +169,14 @@ +@@ -145,6 +175,14 @@ { "name": "revalidateAllResources", "type": "boolean", "optional": true, "description": "If true, all cached subresources will be revalidated when the main resource loads. Otherwise, only expired cached subresources will be revalidated (the default behavior for most WebKit clients)." } ] }, @@ -920,7 +932,7 @@ index 374b26c3ee9acf39aeb23fb60821b39d0afd971c..8843241e3e669c2d7537adb11e83325f { "name": "overrideUserAgent", "description": "Override's the user agent of the inspected page", -@@ -153,6 +185,14 @@ +@@ -153,6 +191,14 @@ { "name": "value", "type": "string", "optional": true, "description": "Value to override the user agent with. If this value is not provided, the override is removed. Overrides are removed when Web Inspector closes/disconnects." } ] }, @@ -935,7 +947,7 @@ index 374b26c3ee9acf39aeb23fb60821b39d0afd971c..8843241e3e669c2d7537adb11e83325f { "name": "overrideSetting", "description": "Allows the frontend to override the inspected page's settings.", -@@ -277,6 +317,28 @@ +@@ -277,6 +323,28 @@ { "name": "media", "type": "string", "description": "Media type to emulate. Empty string disables the override." } ] }, @@ -964,17 +976,23 @@ index 374b26c3ee9acf39aeb23fb60821b39d0afd971c..8843241e3e669c2d7537adb11e83325f { "name": "snapshotNode", "description": "Capture a snapshot of the specified node that does not include unrelated layers.", -@@ -297,7 +359,8 @@ +@@ -297,10 +365,13 @@ { "name": "y", "type": "integer", "description": "Y coordinate" }, { "name": "width", "type": "integer", "description": "Rectangle width" }, { "name": "height", "type": "integer", "description": "Rectangle height" }, - { "name": "coordinateSystem", "$ref": "CoordinateSystem", "description": "Indicates the coordinate system of the supplied rectangle." } + { "name": "coordinateSystem", "$ref": "CoordinateSystem", "description": "Indicates the coordinate system of the supplied rectangle." }, -+ { "name": "omitDeviceScaleFactor", "type": "boolean", "optional": true, "description": "By default, screenshot is inflated by device scale factor to avoid blurry image. This flag disables it." } ++ { "name": "omitDeviceScaleFactor", "type": "boolean", "optional": true, "description": "By default, screenshot is inflated by device scale factor to avoid blurry image. This flag disables it." }, ++ { "name": "format", "$ref": "ImageFormat", "optional": true, "description": "Image format of the resulting snapshot. Defaults to \"png\"." }, ++ { "name": "quality", "type": "integer", "optional": true, "description": "Compression quality from 0 to 100 (ignored for the \"png\" format). Defaults to 80." } ], "returns": [ - { "name": "dataURL", "type": "string", "description": "Base64-encoded image data (PNG)." } -@@ -315,12 +378,54 @@ +- { "name": "dataURL", "type": "string", "description": "Base64-encoded image data (PNG)." } ++ { "name": "dataURL", "type": "string", "description": "Base64-encoded image data." } + ] + }, + { +@@ -315,12 +386,54 @@ { "name": "setScreenSizeOverride", "description": "Overrides screen size exposed to DOM and used in media queries for testing with provided values.", @@ -1030,7 +1048,7 @@ index 374b26c3ee9acf39aeb23fb60821b39d0afd971c..8843241e3e669c2d7537adb11e83325f } ], "events": [ -@@ -328,14 +433,16 @@ +@@ -328,14 +441,16 @@ "name": "domContentEventFired", "targetTypes": ["page"], "parameters": [ @@ -1049,7 +1067,7 @@ index 374b26c3ee9acf39aeb23fb60821b39d0afd971c..8843241e3e669c2d7537adb11e83325f ] }, { -@@ -345,6 +452,14 @@ +@@ -345,6 +460,14 @@ { "name": "frame", "$ref": "Frame", "description": "Frame object." } ] }, @@ -1064,7 +1082,7 @@ index 374b26c3ee9acf39aeb23fb60821b39d0afd971c..8843241e3e669c2d7537adb11e83325f { "name": "frameDetached", "description": "Fired when frame has been detached from its parent.", -@@ -353,6 +468,22 @@ +@@ -353,6 +476,22 @@ { "name": "frameId", "$ref": "Network.FrameId", "description": "Id of the frame that has been detached." } ] }, @@ -1087,7 +1105,7 @@ index 374b26c3ee9acf39aeb23fb60821b39d0afd971c..8843241e3e669c2d7537adb11e83325f { "name": "defaultUserPreferencesDidChange", "description": "Fired when the default value of a user preference changes at the system level.", -@@ -360,6 +491,42 @@ +@@ -360,6 +499,42 @@ "parameters": [ { "name": "preferences", "type": "array", "items": { "$ref": "UserPreference" }, "description": "List of user preferences that can be overriden and their new system (default) values." } ] @@ -1613,10 +1631,10 @@ index 607a4b0f761b0aadd3ca8b83e080519ad6f97715..609f5b23e6ebd2629a1313673d9d8ea5 WEBKIT_ADD_TARGET_CXX_FLAGS(Skia diff --git a/Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml b/Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml -index 991cbe56d742a6cdd31d5a142754675272d4abd8..ce7e004a533d87765976b46e1d538799d2226af5 100644 +index aa2cc398647a1ded38c509a379922ce6ed6017cc..106efd19dfcbcabe1c702afe3b5bb8c179422f42 100644 --- a/Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml +++ b/Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml -@@ -605,6 +605,7 @@ ApplePayEnabled: +@@ -619,6 +619,7 @@ ApplePayEnabled: richJavaScript: true # FIXME: This is on by default in WebKit2 PLATFORM(COCOA). Perhaps we should consider turning it on for WebKitLegacy as well. @@ -1624,7 +1642,7 @@ index 991cbe56d742a6cdd31d5a142754675272d4abd8..ce7e004a533d87765976b46e1d538799 AsyncClipboardAPIEnabled: type: bool status: mature -@@ -615,7 +616,7 @@ AsyncClipboardAPIEnabled: +@@ -629,7 +630,7 @@ AsyncClipboardAPIEnabled: default: false WebKit: "PLATFORM(COCOA) || PLATFORM(GTK) || PLATFORM(WPE)" : true @@ -1633,7 +1651,7 @@ index 991cbe56d742a6cdd31d5a142754675272d4abd8..ce7e004a533d87765976b46e1d538799 WebCore: default: false -@@ -871,13 +872,10 @@ BlobFileAccessEnforcementEnabled: +@@ -885,13 +886,10 @@ BlobFileAccessEnforcementEnabled: sharedPreferenceForWebProcess: true defaultValue: WebKitLegacy: @@ -1646,8 +1664,8 @@ index 991cbe56d742a6cdd31d5a142754675272d4abd8..ce7e004a533d87765976b46e1d538799 - "PLATFORM(COCOA)": true default: false - BlockIOKitInWebContentSandbox: -@@ -2073,6 +2071,7 @@ CrossOriginEmbedderPolicyEnabled: + BlockMediaLayerRehostingInWebContentProcess: +@@ -2116,6 +2114,7 @@ CrossOriginEmbedderPolicyEnabled: WebCore: default: false @@ -1655,7 +1673,7 @@ index 991cbe56d742a6cdd31d5a142754675272d4abd8..ce7e004a533d87765976b46e1d538799 CrossOriginOpenerPolicyEnabled: type: bool status: stable -@@ -2146,6 +2145,7 @@ DOMAudioSessionFullEnabled: +@@ -2189,6 +2188,7 @@ DOMAudioSessionFullEnabled: WebCore: default: false @@ -1663,7 +1681,7 @@ index 991cbe56d742a6cdd31d5a142754675272d4abd8..ce7e004a533d87765976b46e1d538799 DOMPasteAccessRequestsEnabled: type: bool status: internal -@@ -2157,7 +2157,7 @@ DOMPasteAccessRequestsEnabled: +@@ -2200,7 +2200,7 @@ DOMPasteAccessRequestsEnabled: default: false WebKit: "PLATFORM(IOS) || PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(WPE) || PLATFORM(VISION)": true @@ -1672,7 +1690,7 @@ index 991cbe56d742a6cdd31d5a142754675272d4abd8..ce7e004a533d87765976b46e1d538799 WebCore: default: false -@@ -2223,10 +2223,10 @@ DataListElementEnabled: +@@ -2281,10 +2281,10 @@ DataListElementEnabled: WebKitLegacy: default: false WebKit: @@ -1685,7 +1703,7 @@ index 991cbe56d742a6cdd31d5a142754675272d4abd8..ce7e004a533d87765976b46e1d538799 default: false sharedPreferenceForWebProcess: true -@@ -2239,7 +2239,7 @@ DataTransferItemsEnabled: +@@ -2297,7 +2297,7 @@ DataTransferItemsEnabled: WebKitLegacy: default: true WebKit: @@ -1694,7 +1712,7 @@ index 991cbe56d742a6cdd31d5a142754675272d4abd8..ce7e004a533d87765976b46e1d538799 default: false WebCore: default: false -@@ -2482,7 +2482,7 @@ DirectoryUploadEnabled: +@@ -2540,7 +2540,7 @@ DirectoryUploadEnabled: WebKitLegacy: default: false WebKit: @@ -1703,7 +1721,7 @@ index 991cbe56d742a6cdd31d5a142754675272d4abd8..ce7e004a533d87765976b46e1d538799 default: false WebCore: default: false -@@ -3188,10 +3188,10 @@ FullScreenEnabled: +@@ -3262,10 +3262,10 @@ FullScreenEnabled: WebKitLegacy: default: false WebKit: @@ -1716,7 +1734,7 @@ index 991cbe56d742a6cdd31d5a142754675272d4abd8..ce7e004a533d87765976b46e1d538799 default: false sharedPreferenceForWebProcess: true -@@ -3503,7 +3503,7 @@ HardwareAccelerationEnabled: +@@ -3606,7 +3606,7 @@ HardwareAccelerationEnabled: status: internal humanReadableName: "Hardware acceleration" humanReadableDescription: "Enable hardware acceleration" @@ -1725,7 +1743,7 @@ index 991cbe56d742a6cdd31d5a142754675272d4abd8..ce7e004a533d87765976b46e1d538799 defaultValue: WebKitLegacy: default: true -@@ -3910,7 +3910,7 @@ InputTypeColorEnabled: +@@ -4044,7 +4044,7 @@ InputTypeColorEnabled: WebKitLegacy: default: false WebKit: @@ -1734,7 +1752,7 @@ index 991cbe56d742a6cdd31d5a142754675272d4abd8..ce7e004a533d87765976b46e1d538799 default: false WebCore: default: false -@@ -3943,7 +3943,7 @@ InputTypeDateEnabled: +@@ -4077,7 +4077,7 @@ InputTypeDateEnabled: "PLATFORM(IOS_FAMILY)": true default: false WebKit: @@ -1743,7 +1761,7 @@ index 991cbe56d742a6cdd31d5a142754675272d4abd8..ce7e004a533d87765976b46e1d538799 default: false WebCore: default: false -@@ -3959,7 +3959,7 @@ InputTypeDateTimeLocalEnabled: +@@ -4093,7 +4093,7 @@ InputTypeDateTimeLocalEnabled: "PLATFORM(IOS_FAMILY)": true default: false WebKit: @@ -1752,7 +1770,7 @@ index 991cbe56d742a6cdd31d5a142754675272d4abd8..ce7e004a533d87765976b46e1d538799 default: false WebCore: default: false -@@ -3991,7 +3991,7 @@ InputTypeTimeEnabled: +@@ -4125,7 +4125,7 @@ InputTypeTimeEnabled: "PLATFORM(IOS_FAMILY)": true default: false WebKit: @@ -1761,7 +1779,7 @@ index 991cbe56d742a6cdd31d5a142754675272d4abd8..ce7e004a533d87765976b46e1d538799 default: false WebCore: default: false -@@ -4052,6 +4052,7 @@ InspectorMaximumResourcesContentSize: +@@ -4186,6 +4186,7 @@ InspectorMaximumResourcesContentSize: "PLATFORM(WPE)": 50 default: 200 @@ -1769,7 +1787,7 @@ index 991cbe56d742a6cdd31d5a142754675272d4abd8..ce7e004a533d87765976b46e1d538799 InspectorStartsAttached: type: bool status: embedder -@@ -4059,7 +4060,7 @@ InspectorStartsAttached: +@@ -4193,7 +4194,7 @@ InspectorStartsAttached: exposed: [ WebKit ] defaultValue: WebKit: @@ -1778,7 +1796,28 @@ index 991cbe56d742a6cdd31d5a142754675272d4abd8..ce7e004a533d87765976b46e1d538799 InspectorSupportsShowingCertificate: type: bool -@@ -6266,7 +6267,7 @@ PointerLockEnabled: +@@ -5830,6 +5831,7 @@ MuteCameraOnMicrophoneInterruptionEnabled: + WebCore: + default: false + ++# Playwright: also enable on Windows to align with other platforms. + NavigationAPIEnabled: + type: bool + status: stable +@@ -5840,10 +5842,10 @@ NavigationAPIEnabled: + WebKitLegacy: + default: false + WebKit: +- "PLATFORM(COCOA) || PLATFORM(GTK) || PLATFORM(WPE)": true ++ "PLATFORM(COCOA) || PLATFORM(GTK) || PLATFORM(WPE) || PLATFORM(WIN)": true + default: false + WebCore: +- "PLATFORM(COCOA) || PLATFORM(GTK) || PLATFORM(WPE)": true ++ "PLATFORM(COCOA) || PLATFORM(GTK) || PLATFORM(WPE) || PLATFORM(WIN)": true + default: false + + NavigatorUserAgentDataJavaScriptAPIEnabled: +@@ -6428,7 +6430,7 @@ PointerLockEnabled: "PLATFORM(IOS_FAMILY)": false default: true WebCore: @@ -1787,7 +1826,7 @@ index 991cbe56d742a6cdd31d5a142754675272d4abd8..ce7e004a533d87765976b46e1d538799 PopoverAttributeEnabled: type: bool -@@ -6896,7 +6897,7 @@ ScreenOrientationAPIEnabled: +@@ -7058,7 +7060,7 @@ ScreenOrientationAPIEnabled: WebKitLegacy: default: false WebKit: @@ -1797,10 +1836,10 @@ index 991cbe56d742a6cdd31d5a142754675272d4abd8..ce7e004a533d87765976b46e1d538799 default: false sharedPreferenceForWebProcess: true diff --git a/Source/WTF/wtf/PlatformEnable.h b/Source/WTF/wtf/PlatformEnable.h -index 61ba5001a3813448c611289b1fba181bc97d6f80..b85131232297784d8db7e7399da8f09504fd2352 100644 +index e6257d7388b973f803175cac7fd1dfa8aa4a8951..20a65d120f0c2f78b3580bc4b6709e992a9da615 100644 --- a/Source/WTF/wtf/PlatformEnable.h +++ b/Source/WTF/wtf/PlatformEnable.h -@@ -455,7 +455,7 @@ +@@ -467,7 +467,7 @@ // ORIENTATION_EVENTS should never get enabled on Desktop, only Mobile. #if !defined(ENABLE_ORIENTATION_EVENTS) @@ -1809,7 +1848,7 @@ index 61ba5001a3813448c611289b1fba181bc97d6f80..b85131232297784d8db7e7399da8f095 #endif #if OS(WINDOWS) -@@ -568,7 +568,7 @@ +@@ -580,7 +580,7 @@ #endif #if !defined(ENABLE_TOUCH_EVENTS) @@ -1819,10 +1858,10 @@ index 61ba5001a3813448c611289b1fba181bc97d6f80..b85131232297784d8db7e7399da8f095 #if !defined(ENABLE_CSS_TAP_HIGHLIGHT_COLOR) && ENABLE(TOUCH_EVENTS) diff --git a/Source/WTF/wtf/PlatformEnableCocoa.h b/Source/WTF/wtf/PlatformEnableCocoa.h -index 2d9da141c5d8ac413d2ed0aa7a6295ae3d817aff..9c0c99590182a7c6d3bcc707a610d434efd645cd 100644 +index 80a068153aa38fb686ea117fe13d2e32f460cc0b..643c12615ced8ab7f97f893428d95806b6b457d7 100644 --- a/Source/WTF/wtf/PlatformEnableCocoa.h +++ b/Source/WTF/wtf/PlatformEnableCocoa.h -@@ -822,7 +822,7 @@ +@@ -832,7 +832,7 @@ #endif #if !defined(ENABLE_SEC_ITEM_SHIM) @@ -1832,10 +1871,10 @@ index 2d9da141c5d8ac413d2ed0aa7a6295ae3d817aff..9c0c99590182a7c6d3bcc707a610d434 #if !defined(ENABLE_SERVER_PRECONNECT) diff --git a/Source/WTF/wtf/StdLibExtras.h b/Source/WTF/wtf/StdLibExtras.h -index ebdcb2707223f582f378d83ccbf31aa115724047..cc2d26b056618c847d6e184f73fff1701d5b921d 100644 +index 0b20a1ae6f61a574689e77b606dabb2589b99ad4..cbd4a349a20e27a590323f458a7ce39c0c688c80 100644 --- a/Source/WTF/wtf/StdLibExtras.h +++ b/Source/WTF/wtf/StdLibExtras.h -@@ -1607,6 +1607,39 @@ template constexpr auto forward_like(U&& value) -> detai +@@ -1621,6 +1621,39 @@ template constexpr auto forward_like(U&& value) -> detai template constexpr auto forward_like_preserving_const(U&& value) -> detail::forward_like_preserving_const_impl { return static_cast>(value); } } // namespace WTF @@ -1892,7 +1931,7 @@ index 8f551b2abcca06a623c432ac52db75de16849e8e..92bbd90bd032b9a9290ec741e7b38f9e namespace Unicode { diff --git a/Source/WebCore/DerivedSources.make b/Source/WebCore/DerivedSources.make -index aeb32c84bdd2c3351a57268b0e8a62d925e603e4..3c53cbdcfe3d0c1826765e8b4c3b1d877300bb35 100644 +index ceaf5b2c47117bfcaa93cf247af87c17de6f81cc..5e59987eb86ba02ad3089ca96274ed325d3d2433 100644 --- a/Source/WebCore/DerivedSources.make +++ b/Source/WebCore/DerivedSources.make @@ -1260,6 +1260,10 @@ JS_BINDING_IDLS := \ @@ -1906,7 +1945,7 @@ index aeb32c84bdd2c3351a57268b0e8a62d925e603e4..3c53cbdcfe3d0c1826765e8b4c3b1d87 $(WebCore)/dom/Text.idl \ $(WebCore)/dom/TextDecoder.idl \ $(WebCore)/dom/TextDecoderStream.idl \ -@@ -1884,9 +1888,6 @@ JS_BINDING_IDLS := \ +@@ -1886,9 +1890,6 @@ JS_BINDING_IDLS := \ ADDITIONAL_BINDING_IDLS = \ DocumentTouch.idl \ GestureEvent.idl \ @@ -1968,10 +2007,10 @@ index de8ce576a7e7156460680e5ea11f10a84cda83ec..3b502fa4663dc528cb892d28e5217c4e [self sendSpeechEndIfNeeded]; diff --git a/Source/WebCore/PlatformWin.cmake b/Source/WebCore/PlatformWin.cmake -index 72b2846f2c82818fc9a64fd90b7cba0c0601e15f..22277ab6c3233f040852d9daf9becf7ba81d12ca 100644 +index f86ea769e299e1f892a777282ac863f4d37769c7..45c5ec2270555eea7b025c318945225f95ac8883 100644 --- a/Source/WebCore/PlatformWin.cmake +++ b/Source/WebCore/PlatformWin.cmake -@@ -217,6 +217,7 @@ if (USE_CAIRO) +@@ -218,6 +218,7 @@ if (USE_CAIRO) platform/graphics/win/cairo/MediaPlayerPrivateMediaFoundationCairo.cpp platform/win/cairo/DragImageWinCairo.cpp @@ -1980,13 +2019,13 @@ index 72b2846f2c82818fc9a64fd90b7cba0c0601e15f..22277ab6c3233f040852d9daf9becf7b elseif (USE_SKIA) list(APPEND WebCore_SOURCES diff --git a/Source/WebCore/SourcesCocoa.txt b/Source/WebCore/SourcesCocoa.txt -index f3882f2579d2053b7ef773d1e786809d8756adaf..a2f7ed7c8172111432a119711bbe858c761d20d8 100644 +index e368c8b033bcf2d8c897d39a4f9d7af45309dbab..5aefd845f429f9a864e0470a3b443a2afdda8c85 100644 --- a/Source/WebCore/SourcesCocoa.txt +++ b/Source/WebCore/SourcesCocoa.txt -@@ -746,3 +746,9 @@ testing/cocoa/WebViewVisualIdentificationOverlay.mm @nonARC - platform/graphics/angle/GraphicsContextGLANGLE.cpp @no-unify - platform/graphics/cocoa/GraphicsContextGLCocoa.mm @nonARC @no-unify - platform/graphics/cv/GraphicsContextGLCVCocoa.mm @nonARC @no-unify +@@ -748,3 +748,9 @@ testing/cocoa/WebViewVisualIdentificationOverlay.mm @nonARC + platform/graphics/angle/GraphicsContextGLANGLE.cpp @no-unify // ANGLE headers redefine GL types/macros that collide with system OpenGL. + platform/graphics/cocoa/GraphicsContextGLCocoa.mm @nonARC @no-unify // ANGLE headers redefine GL types/macros that collide with system OpenGL. + platform/graphics/cv/GraphicsContextGLCVCocoa.mm @nonARC @no-unify // ANGLE headers redefine GL types/macros that collide with system OpenGL. + +// Playwright begin +JSTouch.cpp @@ -1994,10 +2033,10 @@ index f3882f2579d2053b7ef773d1e786809d8756adaf..a2f7ed7c8172111432a119711bbe858c +JSTouchList.cpp +// Playwright end diff --git a/Source/WebCore/SourcesGTK.txt b/Source/WebCore/SourcesGTK.txt -index 8c4a4c5e75fc792adb0c0801b3e81fd220df777c..99da4150c59018176142f34ebfccd4053c55fc49 100644 +index 30fc9d0f848c5d6d2a60a545ac8507e174837ed6..4427441fa947324fc67512ebfffb770068afb89b 100644 --- a/Source/WebCore/SourcesGTK.txt +++ b/Source/WebCore/SourcesGTK.txt -@@ -107,3 +107,10 @@ platform/unix/LoggingUnix.cpp +@@ -110,3 +110,10 @@ platform/unix/LoggingUnix.cpp platform/unix/SharedMemoryUnix.cpp platform/xdg/MIMETypeRegistryXdg.cpp @@ -2009,10 +2048,10 @@ index 8c4a4c5e75fc792adb0c0801b3e81fd220df777c..99da4150c59018176142f34ebfccd405 +JSSpeechSynthesisEventInit.cpp +// Playwright: end. diff --git a/Source/WebCore/SourcesWPE.txt b/Source/WebCore/SourcesWPE.txt -index eb48da502311408b4772385e51b4143da28fc5d0..0cbc5941fa1c659f5a76f77cc4b22ee5842e77af 100644 +index 39f5f71efa4e15ee6a07709bb21aa18c1a9c8389..16ec8acbdaf6d1a465280f592c7fb43edc2870eb 100644 --- a/Source/WebCore/SourcesWPE.txt +++ b/Source/WebCore/SourcesWPE.txt -@@ -114,3 +114,8 @@ platform/wpe/PasteboardWPE.cpp +@@ -119,3 +119,8 @@ platform/wpe/PasteboardWPE.cpp platform/wpe/PlatformScreenWPE.cpp platform/xdg/MIMETypeRegistryXdg.cpp @@ -2022,13 +2061,13 @@ index eb48da502311408b4772385e51b4143da28fc5d0..0cbc5941fa1c659f5a76f77cc4b22ee5 +JSSpeechSynthesisErrorEventInit.cpp +JSSpeechSynthesisEventInit.cpp diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj -index a40df707691eec03783ba07d5102ec84ecda1911..e6f7e081d8e608d28e28a367c0cf731a4e649a58 100644 +index 073d4bbe83549ad1ed3f9e5056c66d4a3da15396..2a16a55fe8feefc28fe397946e26283825585f97 100644 --- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj +++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj -@@ -7070,6 +7070,13 @@ - EE6C530F2F8831FF00C7B706 /* RenderTreeOrder.h in Headers */ = {isa = PBXBuildFile; fileRef = EE6C530D2F8830BD00C7B706 /* RenderTreeOrder.h */; settings = {ATTRIBUTES = (Private, ); }; }; - EEE349082DE0061C00A7D4BB /* StyleScopeIdentifier.h in Headers */ = {isa = PBXBuildFile; fileRef = EEE349072DE005FC00A7D4BB /* StyleScopeIdentifier.h */; settings = {ATTRIBUTES = (Private, ); }; }; - EFCC6C8F20FE914400A2321B /* CanvasActivityRecord.h in Headers */ = {isa = PBXBuildFile; fileRef = EFCC6C8D20FE914000A2321B /* CanvasActivityRecord.h */; settings = {ATTRIBUTES = (Private, ); }; }; +@@ -7076,6 +7076,13 @@ + E5F06AF724D4BB5600BBC4F8 /* DateTimeEditElement.h in Headers */ = {isa = PBXBuildFile; fileRef = E5F06AF524D4BB5600BBC4F8 /* DateTimeEditElement.h */; }; + E5F67D962B65CDBE00CC30DE /* AttachmentAssociatedElement.h in Headers */ = {isa = PBXBuildFile; fileRef = E5F67D932B65CC2400CC30DE /* AttachmentAssociatedElement.h */; settings = {ATTRIBUTES = (Private, ); }; }; + E71467B324ABAEF200FB2F50 /* AudioNodeOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = E71467B124ABAEF100FB2F50 /* AudioNodeOptions.h */; }; + F050E16823AC9C080011CE47 /* PlatformTouchEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = F050E16623AC9C070011CE47 /* PlatformTouchEvent.h */; settings = {ATTRIBUTES = (Private, ); }; }; + F050E16A23AD660C0011CE47 /* Touch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F050E16923AD660C0011CE47 /* Touch.cpp */; }; + F050E16D23AD66630011CE47 /* TouchList.h in Headers */ = {isa = PBXBuildFile; fileRef = F050E16B23AD66620011CE47 /* TouchList.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -2036,10 +2075,10 @@ index a40df707691eec03783ba07d5102ec84ecda1911..e6f7e081d8e608d28e28a367c0cf731a + F050E17123AD669F0011CE47 /* TouchEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F050E16F23AD669E0011CE47 /* TouchEvent.cpp */; }; + F050E17423AD6A800011CE47 /* DocumentTouch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F050E17323AD6A800011CE47 /* DocumentTouch.cpp */; }; + F050E17823AD70C50011CE47 /* PlatformTouchPoint.h in Headers */ = {isa = PBXBuildFile; fileRef = F050E17623AD70C40011CE47 /* PlatformTouchPoint.h */; settings = {ATTRIBUTES = (Private, ); }; }; - F12171F616A8CF0B000053CA /* WebVTTElement.h in Headers */ = {isa = PBXBuildFile; fileRef = F12171F416A8BC63000053CA /* WebVTTElement.h */; }; - F30EE46B2E721BA800935B60 /* FrameInspectorController.h in Headers */ = {isa = PBXBuildFile; fileRef = F30EE46A2E721B9D00935B60 /* FrameInspectorController.h */; settings = {ATTRIBUTES = (Private, ); }; }; - F32BDCD92363AACA0073B6AE /* UserGestureEmulationScope.h in Headers */ = {isa = PBXBuildFile; fileRef = F32BDCD72363AACA0073B6AE /* UserGestureEmulationScope.h */; }; -@@ -22865,6 +22872,14 @@ + E71467B624ABAF1D00FB2F50 /* PannerOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = E71467B524ABAF1D00FB2F50 /* PannerOptions.h */; }; + E755E89224C7434B009F7C23 /* PeriodicWaveConstraints.h in Headers */ = {isa = PBXBuildFile; fileRef = E755E88F24C7434B009F7C23 /* PeriodicWaveConstraints.h */; }; + E755E89924C7461D009F7C23 /* PeriodicWaveOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = E755E89624C7461D009F7C23 /* PeriodicWaveOptions.h */; }; +@@ -23189,6 +23196,14 @@ EFCC6C8D20FE914000A2321B /* CanvasActivityRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CanvasActivityRecord.h; sourceTree = ""; }; F088343F2E721B29001B2348 /* AXLocalFrame.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AXLocalFrame.h; sourceTree = ""; }; F08834402E721B33001B2348 /* AXLocalFrame.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = AXLocalFrame.cpp; sourceTree = ""; }; @@ -2053,8 +2092,8 @@ index a40df707691eec03783ba07d5102ec84ecda1911..e6f7e081d8e608d28e28a367c0cf731a + F050E17623AD70C40011CE47 /* PlatformTouchPoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformTouchPoint.h; sourceTree = ""; }; F12171F316A8BC63000053CA /* WebVTTElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebVTTElement.cpp; sourceTree = ""; }; F12171F416A8BC63000053CA /* WebVTTElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebVTTElement.h; sourceTree = ""; }; - F30EE46A2E721B9D00935B60 /* FrameInspectorController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FrameInspectorController.h; sourceTree = ""; }; -@@ -30981,6 +30996,11 @@ + F2462F05A319D5DE971FCFBC /* UnifiedSource60-header-RenderStyleGetters.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = "UnifiedSource60-header-RenderStyleGetters.cpp"; sourceTree = ""; }; +@@ -31328,6 +31343,11 @@ BC4A5324256055590028C592 /* TextDirectionSubmenuInclusionBehavior.h */, 2D4F96F11A1ECC240098BF88 /* TextIndicator.cpp */, 2D4F96F21A1ECC240098BF88 /* TextIndicator.h */, @@ -2066,7 +2105,7 @@ index a40df707691eec03783ba07d5102ec84ecda1911..e6f7e081d8e608d28e28a367c0cf731a F48570A42644C76D00C05F71 /* TranslationContextMenuInfo.h */, D640B24C2E3058C800EB6C49 /* UADataValues.h */, D640B24E2E3058C800EB6C49 /* UADataValues.idl */, -@@ -38987,6 +39007,8 @@ +@@ -39532,6 +39552,8 @@ 29E4D8DF16B0940F00C84704 /* PlatformSpeechSynthesizer.h */, 1AD8F81A11CAB9E900E93E54 /* PlatformStrategies.cpp */, 1AD8F81911CAB9E900E93E54 /* PlatformStrategies.h */, @@ -2075,7 +2114,7 @@ index a40df707691eec03783ba07d5102ec84ecda1911..e6f7e081d8e608d28e28a367c0cf731a FE3DC9932D0C063C0021B6FC /* PlatformTZoneImpls.cpp */, 0FD7C21D23CE41E30096D102 /* PlatformWheelEvent.cpp */, 935C476A09AC4D4F00A6AAB4 /* PlatformWheelEvent.h */, -@@ -41998,6 +42020,7 @@ +@@ -42549,6 +42571,7 @@ AD6E71AB1668899D00320C13 /* DocumentSharedObjectPool.h */, 6BDB5DC1227BD3B800919770 /* DocumentStorageAccess.cpp */, 6BDB5DC0227BD3B800919770 /* DocumentStorageAccess.h */, @@ -2083,7 +2122,7 @@ index a40df707691eec03783ba07d5102ec84ecda1911..e6f7e081d8e608d28e28a367c0cf731a 7CE7FA5B1EF882300060C9D6 /* DocumentTouch.cpp */, 7CE7FA591EF882300060C9D6 /* DocumentTouch.h */, A8185F3209765765005826D9 /* DocumentType.cpp */, -@@ -47190,6 +47213,8 @@ +@@ -47774,6 +47797,8 @@ F4E90A3C2B52038E002DA469 /* PlatformTextAlternatives.h in Headers */, 0F7D07331884C56C00B4AF86 /* PlatformTextTrack.h in Headers */, 074E82BB18A69F0E007EF54C /* PlatformTimeRanges.h in Headers */, @@ -2092,7 +2131,7 @@ index a40df707691eec03783ba07d5102ec84ecda1911..e6f7e081d8e608d28e28a367c0cf731a CDD08ABD277E542600EA3755 /* PlatformTrackConfiguration.h in Headers */, CD1F9B022700323D00617EB6 /* PlatformVideoColorPrimaries.h in Headers */, CD1F9B01270020B700617EB6 /* PlatformVideoColorSpace.h in Headers */, -@@ -48863,6 +48888,7 @@ +@@ -49450,6 +49475,7 @@ 0F54DD081881D5F5003EEDBB /* Touch.h in Headers */, 71B7EE0D21B5C6870031C1EF /* TouchAction.h in Headers */, 0F54DD091881D5F5003EEDBB /* TouchEvent.h in Headers */, @@ -2100,7 +2139,7 @@ index a40df707691eec03783ba07d5102ec84ecda1911..e6f7e081d8e608d28e28a367c0cf731a 0F54DD0A1881D5F5003EEDBB /* TouchList.h in Headers */, 070334D71459FFD5008D8D45 /* TrackBase.h in Headers */, 513C7B6E2E7C2E7A00079881 /* TrackInfo.h in Headers */, -@@ -50137,7 +50163,9 @@ +@@ -50724,7 +50750,9 @@ 2D22830323A8470700364B7E /* CursorMac.mm in Sources */, 5CBD59592280E926002B22AA /* CustomHeaderFields.cpp in Sources */, 07E4BDBF2A3A5FAB000D5509 /* DictationCaretAnimator.cpp in Sources */, @@ -2110,7 +2149,7 @@ index a40df707691eec03783ba07d5102ec84ecda1911..e6f7e081d8e608d28e28a367c0cf731a 7CE6CBFD187F394900D46BF5 /* FormatConverter.cpp in Sources */, 4667EA3E2968D9DA00BAB1E2 /* GameControllerHapticEffect.mm in Sources */, 46FE73D32968E52000B8064C /* GameControllerHapticEngines.mm in Sources */, -@@ -50233,6 +50261,9 @@ +@@ -50821,6 +50849,9 @@ 072F696F2E755BFA00281FC5 /* TextListParser.cpp in Sources */, BE39137129B267F500FA5D4F /* TextTransformCocoa.cpp in Sources */, 51DF6D800B92A18E00C2DC85 /* ThreadCheck.mm in Sources */, @@ -2121,7 +2160,7 @@ index a40df707691eec03783ba07d5102ec84ecda1911..e6f7e081d8e608d28e28a367c0cf731a 0B2AA9B7DC40569673FC9868 /* UnifiedSource1-header-RenderStyleGetters.cpp in Sources */, 538EC8031F96AF81004D22A8 /* UnifiedSource1-nonARC.mm in Sources */, diff --git a/Source/WebCore/css/query/MediaQueryFeatures.cpp b/Source/WebCore/css/query/MediaQueryFeatures.cpp -index ab1b8b7d0e7baff7d7564609736a6145472c2e3a..00921097a9f2b5d96937785e62f5a3533afafe55 100644 +index e3d2c06a8c561c7489d7315d80976c8f6feff8c4..349e0486dfe266c8edadc9073d4ed37f5f75c461 100644 --- a/Source/WebCore/css/query/MediaQueryFeatures.cpp +++ b/Source/WebCore/css/query/MediaQueryFeatures.cpp @@ -404,7 +404,11 @@ static const IdentifierSchema& forcedColorsFeatureSchema() @@ -2212,7 +2251,7 @@ index 2feeeac677ee3f36cb13c2bac1afbc57fbe70e12..6ed92e45b7659c48b3bb1e24f7f00751 SecureContext ] interface DeviceOrientationEvent : Event { diff --git a/Source/WebCore/dom/PointerEvent.cpp b/Source/WebCore/dom/PointerEvent.cpp -index dd8c59fe17c70a72f03df3c884b5a92f8f655e61..9c2b847b15f4361ad8199729c2b808a0253b77c2 100644 +index dd8c59fe17c70a72f03df3c884b5a92f8f655e61..97dc2a0d19f856090041cc3b1b23218c35fbcca4 100644 --- a/Source/WebCore/dom/PointerEvent.cpp +++ b/Source/WebCore/dom/PointerEvent.cpp @@ -20,7 +20,7 @@ @@ -2278,7 +2317,7 @@ index dd8c59fe17c70a72f03df3c884b5a92f8f655e61..9c2b847b15f4361ad8199729c2b808a0 +} + +PointerEvent::PointerEvent(const AtomString& type, const PlatformTouchEvent& event, const Vector>& coalescedEvents, const Vector>& predictedEvents, CanBubble canBubble, IsCancelable isCancelable, unsigned touchIndex, bool isPrimary, Ref&& view, const DoublePoint& touchDelta) -+ : MouseEvent(EventInterfaceType::PointerEvent, type, canBubble, isCancelable, typeIsComposed(type), event.timestamp().approximateMonotonicTime(), WTF::move(view), 0, ++ : MouseEvent(EventInterfaceType::PointerEvent, type, canBubble, isCancelable, typeIsComposed(type), event.timestamp().approximate(), WTF::move(view), 0, + event.touchPoints().at(touchIndex).pos(), event.touchPoints().at(touchIndex).pos(), touchDelta.x(), touchDelta.y(), event.modifiers(), buttonForType(type), buttonsForType(type), nullptr, 0, SyntheticClickType::NoTap, { }, { }, std::nullopt, IsSimulated::No, IsTrusted::Yes) + , m_pointerId(event.touchPoints().at(touchIndex).id()) + , m_width(2 * event.touchPoints().at(touchIndex).radius().width()) @@ -2382,7 +2421,7 @@ index d0a3d5c048647b07772e1581c76c4eb60ecf41b0..bec324636991079264e620c0dfdaf984 #endif // USE(LIBWPE) diff --git a/Source/WebCore/html/FileInputType.cpp b/Source/WebCore/html/FileInputType.cpp -index 70293a7486130c23eda9198e399f4fc7a998c2b3..1ff1dc564dbe7f2ed2d35000d82bac6e2fb2cad0 100644 +index ac3447184b6d42244da543184702f5d500bb1a63..e23c649494d88d4610a7c9ac9f142a0f5757c7f3 100644 --- a/Source/WebCore/html/FileInputType.cpp +++ b/Source/WebCore/html/FileInputType.cpp @@ -39,6 +39,7 @@ @@ -2406,10 +2445,10 @@ index 70293a7486130c23eda9198e399f4fc7a998c2b3..1ff1dc564dbe7f2ed2d35000d82bac6e return; diff --git a/Source/WebCore/inspector/FrameInspectorController.cpp b/Source/WebCore/inspector/FrameInspectorController.cpp -index 12650ec508ee1acef286c9b862e37a73f652409f..5721af8def5099347a80e7ad31c7551dbc0be0d5 100644 +index 2af3d6bb16c29ed5f2f09c34fdf8ebf2a173e768..7a36bf7ac7e93f16e9505c3b6df15446bab84a6d 100644 --- a/Source/WebCore/inspector/FrameInspectorController.cpp +++ b/Source/WebCore/inspector/FrameInspectorController.cpp -@@ -170,6 +170,12 @@ void FrameInspectorController::connectFrontend(Inspector::FrontendChannel& front +@@ -161,6 +161,12 @@ void FrameInspectorController::connectFrontend(Inspector::FrontendChannel& front UNUSED_PARAM(isAutomaticInspection); UNUSED_PARAM(immediatelyPause); @@ -2422,7 +2461,7 @@ index 12650ec508ee1acef286c9b862e37a73f652409f..5721af8def5099347a80e7ad31c7551d if (auto* page = m_frame->page()) page->settings().setDeveloperExtrasEnabled(true); -@@ -184,6 +190,19 @@ void FrameInspectorController::connectFrontend(Inspector::FrontendChannel& front +@@ -175,6 +181,19 @@ void FrameInspectorController::connectFrontend(Inspector::FrontendChannel& front m_injectedScriptManager->addClient(); m_agents.didCreateFrontendAndBackend(); } @@ -2443,10 +2482,10 @@ index 12650ec508ee1acef286c9b862e37a73f652409f..5721af8def5099347a80e7ad31c7551d void FrameInspectorController::disconnectFrontend(Inspector::FrontendChannel& frontendChannel) diff --git a/Source/WebCore/inspector/InspectorIdentifierRegistry.cpp b/Source/WebCore/inspector/InspectorIdentifierRegistry.cpp -index 1585d249dafdc13f4258ff1dde95268eeb329f93..24d21908c7a79e744aadf37a6d8ba0918f2dd7b7 100644 +index 5e93584ff771f47495036f43d1c40eb052d1db6d..4ace85cb400111278cc4bdd3ce7d04c7df9e89ca 100644 --- a/Source/WebCore/inspector/InspectorIdentifierRegistry.cpp +++ b/Source/WebCore/inspector/InspectorIdentifierRegistry.cpp -@@ -48,20 +48,22 @@ Protocol::Network::FrameId LegacyIdentifierRegistry::frameId(const WebCore::Fram +@@ -50,20 +50,22 @@ Protocol::Network::FrameId LegacyIdentifierRegistry::frameId(const WebCore::Fram { if (!frame) return emptyString(); @@ -2477,7 +2516,7 @@ index 1585d249dafdc13f4258ff1dde95268eeb329f93..24d21908c7a79e744aadf37a6d8ba091 } WebCore::LocalFrame* LegacyIdentifierRegistry::assertFrame(Protocol::ErrorString& errorString, const Protocol::Network::FrameId& frameId) -@@ -74,15 +76,19 @@ WebCore::LocalFrame* LegacyIdentifierRegistry::assertFrame(Protocol::ErrorString +@@ -76,15 +78,19 @@ WebCore::LocalFrame* LegacyIdentifierRegistry::assertFrame(Protocol::ErrorString Protocol::Network::FrameId LegacyIdentifierRegistry::takeFrame(const WebCore::Frame& frame) { @@ -2500,12 +2539,12 @@ index 1585d249dafdc13f4258ff1dde95268eeb329f93..24d21908c7a79e744aadf37a6d8ba091 + return String::number(navigationID->toUInt64()); } - } // namespace Inspector + // --- BackendIdentifierRegistry --- diff --git a/Source/WebCore/inspector/InspectorInstrumentation.cpp b/Source/WebCore/inspector/InspectorInstrumentation.cpp -index 68b5996d7ae96ce0c3f5eda869e353b448823da7..5227faf95b488a3f67e2e63e30089ba9b9cd0d5c 100644 +index 2a83aecdbc7a799517ea311a26407e72c82443f9..8d36e185ae04ba5c0f79462bbed57baa4608d921 100644 --- a/Source/WebCore/inspector/InspectorInstrumentation.cpp +++ b/Source/WebCore/inspector/InspectorInstrumentation.cpp -@@ -617,6 +617,12 @@ void InspectorInstrumentation::applyUserAgentOverrideImpl(InstrumentingAgents& i +@@ -667,6 +667,12 @@ void InspectorInstrumentation::applyUserAgentOverrideImpl(InstrumentingAgents& i pageAgent->applyUserAgentOverride(userAgent); } @@ -2518,7 +2557,7 @@ index 68b5996d7ae96ce0c3f5eda869e353b448823da7..5227faf95b488a3f67e2e63e30089ba9 void InspectorInstrumentation::applyEmulatedMediaImpl(InstrumentingAgents& instrumentingAgents, AtomString& media) { if (CheckedPtr pageAgent = instrumentingAgents.enabledPageAgent()) -@@ -700,6 +706,12 @@ void InspectorInstrumentation::didFailLoadingImpl(InstrumentingAgents& instrumen +@@ -764,6 +770,12 @@ void InspectorInstrumentation::didFailLoadingImpl(InstrumentingAgents& instrumen consoleAgent->didFailLoading(identifier, error); // This should come AFTER resource notification, front-end relies on this. } @@ -2530,8 +2569,8 @@ index 68b5996d7ae96ce0c3f5eda869e353b448823da7..5227faf95b488a3f67e2e63e30089ba9 + void InspectorInstrumentation::willLoadXHRSynchronouslyImpl(InstrumentingAgents& instrumentingAgents) { - if (auto* networkAgent = instrumentingAgents.enabledNetworkAgent()) -@@ -732,20 +744,17 @@ void InspectorInstrumentation::didReceiveScriptResponseImpl(InstrumentingAgents& + if (CheckedPtr networkAgent = instrumentingAgents.enabledNetworkAgent()) +@@ -796,20 +808,17 @@ void InspectorInstrumentation::didReceiveScriptResponseImpl(InstrumentingAgents& void InspectorInstrumentation::domContentLoadedEventFiredImpl(InstrumentingAgents& instrumentingAgents, LocalFrame& frame) { @@ -2555,7 +2594,7 @@ index 68b5996d7ae96ce0c3f5eda869e353b448823da7..5227faf95b488a3f67e2e63e30089ba9 } void InspectorInstrumentation::frameDetachedFromParentImpl(InstrumentingAgents& instrumentingAgents, LocalFrame& frame) -@@ -825,12 +834,6 @@ void InspectorInstrumentation::frameDocumentUpdatedImpl(InstrumentingAgents& ins +@@ -895,12 +904,6 @@ void InspectorInstrumentation::frameDocumentUpdatedImpl(InstrumentingAgents& ins pageDOMDebuggerAgent->frameDocumentUpdated(frame); } @@ -2568,7 +2607,7 @@ index 68b5996d7ae96ce0c3f5eda869e353b448823da7..5227faf95b488a3f67e2e63e30089ba9 void InspectorInstrumentation::frameStartedLoadingImpl(InstrumentingAgents& instrumentingAgents, LocalFrame& frame) { if (frame.isMainFrame()) { -@@ -861,6 +864,12 @@ void InspectorInstrumentation::accessibilitySettingsDidChangeImpl(InstrumentingA +@@ -931,6 +934,12 @@ void InspectorInstrumentation::accessibilitySettingsDidChangeImpl(InstrumentingA inspectorPageAgent->accessibilitySettingsDidChange(); } @@ -2581,7 +2620,7 @@ index 68b5996d7ae96ce0c3f5eda869e353b448823da7..5227faf95b488a3f67e2e63e30089ba9 #if ENABLE(DARK_MODE_CSS) void InspectorInstrumentation::defaultAppearanceDidChangeImpl(InstrumentingAgents& instrumentingAgents) { -@@ -913,6 +922,12 @@ void InspectorInstrumentation::interceptResponseImpl(InstrumentingAgents& instru +@@ -983,6 +992,12 @@ void InspectorInstrumentation::interceptResponseImpl(InstrumentingAgents& instru networkAgent->interceptResponse(response, identifier, WTF::move(handler)); } @@ -2594,7 +2633,7 @@ index 68b5996d7ae96ce0c3f5eda869e353b448823da7..5227faf95b488a3f67e2e63e30089ba9 // JavaScriptCore InspectorDebuggerAgent should know Console MessageTypes. static bool NODELETE isConsoleAssertMessage(MessageSource source, MessageType type) { -@@ -1050,6 +1065,12 @@ void InspectorInstrumentation::consoleStopRecordingCanvasImpl(InstrumentingAgent +@@ -1120,6 +1135,12 @@ void InspectorInstrumentation::consoleStopRecordingCanvasImpl(InstrumentingAgent canvasAgent->consoleStopRecordingCanvas(context); } @@ -2607,7 +2646,7 @@ index 68b5996d7ae96ce0c3f5eda869e353b448823da7..5227faf95b488a3f67e2e63e30089ba9 void InspectorInstrumentation::didDispatchDOMStorageEventImpl(InstrumentingAgents& instrumentingAgents, const String& key, const String& oldValue, const String& newValue, StorageType storageType, const SecurityOrigin& securityOrigin) { if (auto* domStorageAgent = instrumentingAgents.enabledDOMStorageAgent()) -@@ -1347,6 +1368,36 @@ void InspectorInstrumentation::renderLayerDestroyedImpl(InstrumentingAgents& ins +@@ -1417,6 +1438,36 @@ void InspectorInstrumentation::renderLayerDestroyedImpl(InstrumentingAgents& ins layerTreeAgent->renderLayerDestroyed(renderLayer); } @@ -2645,7 +2684,7 @@ index 68b5996d7ae96ce0c3f5eda869e353b448823da7..5227faf95b488a3f67e2e63e30089ba9 { return globalScope.inspectorController().m_instrumentingAgents; diff --git a/Source/WebCore/inspector/InspectorInstrumentation.h b/Source/WebCore/inspector/InspectorInstrumentation.h -index d3c1a73fd1eaa95dad8e582f8e52ed894a53a8be..24791c5f62638513dd507ff0886ae4d593523919 100644 +index 3eb556054eb2ff2e5c4c484ce35aae1d82ea117a..0d387908225a54788fd2587bc9fde0cbe8a43f4b 100644 --- a/Source/WebCore/inspector/InspectorInstrumentation.h +++ b/Source/WebCore/inspector/InspectorInstrumentation.h @@ -45,6 +45,7 @@ @@ -2656,7 +2695,7 @@ index d3c1a73fd1eaa95dad8e582f8e52ed894a53a8be..24791c5f62638513dd507ff0886ae4d5 #include "ResourceLoader.h" #include "ResourceLoaderIdentifier.h" #include "StorageArea.h" -@@ -79,6 +80,7 @@ class Document; +@@ -80,6 +81,7 @@ class Document; class DocumentLoader; class DocumentThreadableLoader; class EventListener; @@ -2664,7 +2703,7 @@ index d3c1a73fd1eaa95dad8e582f8e52ed894a53a8be..24791c5f62638513dd507ff0886ae4d5 class HTTPHeaderMap; class InspectorTimelineAgent; class InstrumentingAgents; -@@ -203,6 +205,7 @@ public: +@@ -204,6 +206,7 @@ public: static void didRecalculateStyle(Document&); static void didScheduleStyleRecalculation(Document&); static void applyUserAgentOverride(LocalFrame&, String&); @@ -2672,7 +2711,7 @@ index d3c1a73fd1eaa95dad8e582f8e52ed894a53a8be..24791c5f62638513dd507ff0886ae4d5 static void applyEmulatedMedia(LocalFrame&, AtomString&); static void flexibleBoxRendererBeganLayout(const RenderObject&); -@@ -215,6 +218,7 @@ public: +@@ -216,6 +219,7 @@ public: static void didReceiveData(LocalFrame*, ResourceLoaderIdentifier, const SharedBuffer*, int encodedDataLength); static void didFinishLoading(LocalFrame*, DocumentLoader*, ResourceLoaderIdentifier, const NetworkLoadMetrics&, ResourceLoader*); static void didFailLoading(LocalFrame*, DocumentLoader*, ResourceLoaderIdentifier, const ResourceError&); @@ -2723,7 +2762,7 @@ index d3c1a73fd1eaa95dad8e582f8e52ed894a53a8be..24791c5f62638513dd507ff0886ae4d5 static void frontendDeleted(); static bool hasFrontends() { return InspectorInstrumentationPublic::hasFrontends(); } @@ -434,6 +446,7 @@ private: - static void didRecalculateStyleImpl(InstrumentingAgents&); + static void didRecalculateStyleImpl(InstrumentingAgents&, Document&); static void didScheduleStyleRecalculationImpl(InstrumentingAgents&, Document&); static void applyUserAgentOverrideImpl(InstrumentingAgents&, String&); + static void applyPlatformOverrideImpl(InstrumentingAgents&, String&); @@ -2744,7 +2783,7 @@ index d3c1a73fd1eaa95dad8e582f8e52ed894a53a8be..24791c5f62638513dd507ff0886ae4d5 static void frameDocumentUpdatedImpl(InstrumentingAgents&, LocalFrame&); - static void loaderDetachedFromFrameImpl(InstrumentingAgents&, DocumentLoader&); static void frameStartedLoadingImpl(InstrumentingAgents&, LocalFrame&); - static void didCompleteRenderingFrameImpl(InstrumentingAgents&); + static void didCompleteRenderingFrameImpl(InstrumentingAgents&, LocalFrame&); static void frameStoppedLoadingImpl(InstrumentingAgents&, LocalFrame&); static void accessibilitySettingsDidChangeImpl(InstrumentingAgents&); + static void didNavigateWithinPageImpl(InstrumentingAgents&, LocalFrame&); @@ -2951,10 +2990,10 @@ index 01ad196099f09a89717830cd70dded3b495cf5f5..c9d2e97c6f5f5e6b0a8f70c31af947ef + } diff --git a/Source/WebCore/inspector/PageInspectorController.cpp b/Source/WebCore/inspector/PageInspectorController.cpp -index 4fa92ae7d7c2f6e501eecb90691c3dca65e4482e..21dbf683927dec650570a540f0fcd5be6538afa5 100644 +index f5a5196bce1339186a045872f59a18adaffff83e..b476dc81f398f60591d320e66a4cf99d15cd57f6 100644 --- a/Source/WebCore/inspector/PageInspectorController.cpp +++ b/Source/WebCore/inspector/PageInspectorController.cpp -@@ -291,6 +291,8 @@ void PageInspectorController::disconnectFrontend(FrontendChannel& frontendChanne +@@ -295,6 +295,8 @@ void PageInspectorController::disconnectFrontend(FrontendChannel& frontendChanne // Unplug all instrumentations since they aren't needed now. InspectorInstrumentation::unregisterInstrumentingAgents(m_instrumentingAgents.get()); @@ -2963,7 +3002,7 @@ index 4fa92ae7d7c2f6e501eecb90691c3dca65e4482e..21dbf683927dec650570a540f0fcd5be } m_inspectorBackendClient->frontendCountChanged(m_frontendRouter->frontendCount()); -@@ -305,6 +307,8 @@ void PageInspectorController::disconnectAllFrontends() +@@ -309,6 +311,8 @@ void PageInspectorController::disconnectAllFrontends() // The frontend should call setInspectorFrontendClient(nullptr) under closeWindow(). ASSERT(!m_inspectorFrontendClient); @@ -2972,7 +3011,7 @@ index 4fa92ae7d7c2f6e501eecb90691c3dca65e4482e..21dbf683927dec650570a540f0fcd5be if (!m_frontendRouter->hasFrontends()) return; -@@ -384,8 +388,8 @@ void PageInspectorController::inspect(Node* node) +@@ -405,8 +409,8 @@ void PageInspectorController::inspect(Node* node) if (!enabled()) return; @@ -2983,7 +3022,7 @@ index 4fa92ae7d7c2f6e501eecb90691c3dca65e4482e..21dbf683927dec650570a540f0fcd5be CheckedRef { ensureDOMAgent() }->inspect(node); } -@@ -523,4 +527,34 @@ void PageInspectorController::didComposite(LocalFrame& frame) +@@ -544,4 +548,34 @@ void PageInspectorController::didComposite(LocalFrame& frame) InspectorInstrumentation::didComposite(frame); } @@ -3019,10 +3058,10 @@ index 4fa92ae7d7c2f6e501eecb90691c3dca65e4482e..21dbf683927dec650570a540f0fcd5be + } // namespace WebCore diff --git a/Source/WebCore/inspector/PageInspectorController.h b/Source/WebCore/inspector/PageInspectorController.h -index 1418886b19d5310d76deef334ae994ff8afd0562..6217b778b6c0bd73d7da6f9b8ef1454dda156806 100644 +index ebe3fd57747f494efcbe4d62211850ab4e18220b..c864facba5ceec1402b250385d0ec5d5bf9364ec 100644 --- a/Source/WebCore/inspector/PageInspectorController.h +++ b/Source/WebCore/inspector/PageInspectorController.h -@@ -117,6 +117,12 @@ public: +@@ -120,6 +120,12 @@ public: WEBCORE_EXPORT void willComposite(LocalFrame&); WEBCORE_EXPORT void didComposite(LocalFrame&); @@ -3035,7 +3074,7 @@ index 1418886b19d5310d76deef334ae994ff8afd0562..6217b778b6c0bd73d7da6f9b8ef1454d // Testing support. bool isUnderTest() const { return m_isUnderTest; } void setIsUnderTest(bool isUnderTest) { m_isUnderTest = isUnderTest; } -@@ -153,6 +159,7 @@ private: +@@ -158,6 +164,7 @@ private: PageAgentContext pageAgentContext(); void createLazyAgents(); @@ -3043,7 +3082,7 @@ index 1418886b19d5310d76deef334ae994ff8afd0562..6217b778b6c0bd73d7da6f9b8ef1454d WeakRef m_page; const Ref m_instrumentingAgents; -@@ -177,6 +184,7 @@ private: +@@ -182,6 +189,7 @@ private: bool m_isAutomaticInspection { false }; bool m_pauseAfterInitialization = { false }; bool m_didCreateLazyAgents { false }; @@ -3052,7 +3091,7 @@ index 1418886b19d5310d76deef334ae994ff8afd0562..6217b778b6c0bd73d7da6f9b8ef1454d } // namespace WebCore diff --git a/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp b/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp -index 077b6857627c916d6b8d6cfcf0b1018dd597a7af..67d109a50be0a05dd1179c32e20897883558cb09 100644 +index ae136036740e893a6d3755f66af4bf82ce2980fb..85e8afab72349ba6a66a94ae0d42968ac6e8564f 100644 --- a/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp +++ b/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp @@ -54,6 +54,7 @@ @@ -3079,22 +3118,21 @@ index 077b6857627c916d6b8d6cfcf0b1018dd597a7af..67d109a50be0a05dd1179c32e2089788 #include "HTMLMediaElement.h" #include "HTMLNames.h" #include "HTMLScriptElement.h" -@@ -107,12 +113,14 @@ +@@ -106,11 +112,13 @@ #include "Pasteboard.h" #include "PseudoElement.h" #include "RenderGrid.h" +#include "RenderLayer.h" #include "RenderObject.h" - #include "RenderStyle.h" #include "RenderStyleConstants.h" #include "ScriptController.h" #include "SelectorChecker.h" #include "ShadowRoot.h" +#include "SharedBuffer.h" #include "StaticNodeList.h" + #include "StyleComputedStyle.h" #include "StyleProperties.h" - #include "StyleResolver.h" -@@ -157,7 +165,8 @@ using namespace HTMLNames; +@@ -156,7 +164,8 @@ using namespace HTMLNames; static const size_t maxTextSize = 10000; static const char16_t horizontalEllipsisUTF16[] = { horizontalEllipsis, 0 }; @@ -3104,7 +3142,7 @@ index 077b6857627c916d6b8d6cfcf0b1018dd597a7af..67d109a50be0a05dd1179c32e2089788 { if (!colorObject) return std::nullopt; -@@ -176,7 +185,7 @@ static std::optional parseColor(RefPtr&& colorObject) +@@ -175,7 +184,7 @@ static std::optional parseColor(RefPtr&& colorObject) static std::optional parseRequiredConfigColor(const String& fieldName, JSON::Object& configObject) { @@ -3113,7 +3151,7 @@ index 077b6857627c916d6b8d6cfcf0b1018dd597a7af..67d109a50be0a05dd1179c32e2089788 } static Color parseOptionalConfigColor(const String& fieldName, JSON::Object& configObject) -@@ -203,6 +212,20 @@ static bool parseQuad(Ref&& quadArray, FloatQuad* quad) +@@ -202,6 +211,20 @@ static bool parseQuad(Ref&& quadArray, FloatQuad* quad) return true; } @@ -3134,7 +3172,7 @@ index 077b6857627c916d6b8d6cfcf0b1018dd597a7af..67d109a50be0a05dd1179c32e2089788 class RevalidateStyleAttributeTask final : public CanMakeCheckedPtr { WTF_MAKE_TZONE_ALLOCATED(RevalidateStyleAttributeTask); WTF_OVERRIDE_DELETE_FOR_CHECKED_PTR(RevalidateStyleAttributeTask); -@@ -486,6 +509,20 @@ Node* InspectorDOMAgent::assertNode(Inspector::Protocol::ErrorString& errorStrin +@@ -485,6 +508,20 @@ Node* InspectorDOMAgent::assertNode(Inspector::Protocol::ErrorString& errorStrin return node.unsafeGet(); } @@ -3155,7 +3193,7 @@ index 077b6857627c916d6b8d6cfcf0b1018dd597a7af..67d109a50be0a05dd1179c32e2089788 Document* InspectorDOMAgent::assertDocument(Inspector::Protocol::ErrorString& errorString, Inspector::Protocol::DOM::NodeId nodeId) { RefPtr node = assertNode(errorString, nodeId); -@@ -1603,15 +1640,7 @@ Inspector::Protocol::ErrorStringOr InspectorDOMAgent::highlightNode(std::o +@@ -1602,15 +1639,7 @@ Inspector::Protocol::ErrorStringOr InspectorDOMAgent::highlightNode(std::o { Inspector::Protocol::ErrorString errorString; @@ -3172,7 +3210,7 @@ index 077b6857627c916d6b8d6cfcf0b1018dd597a7af..67d109a50be0a05dd1179c32e2089788 if (!node) return makeUnexpected(errorString); -@@ -1862,15 +1891,159 @@ Inspector::Protocol::ErrorStringOr InspectorDOMAgent::setInspectedNode(Ins +@@ -1861,15 +1890,159 @@ Inspector::Protocol::ErrorStringOr InspectorDOMAgent::setInspectedNode(Ins return { }; } @@ -3335,7 +3373,7 @@ index 077b6857627c916d6b8d6cfcf0b1018dd597a7af..67d109a50be0a05dd1179c32e2089788 if (!object) return makeUnexpected("Missing injected script for given nodeId"_s); -@@ -3134,7 +3307,7 @@ Inspector::Protocol::ErrorStringOr InspectorDO +@@ -3133,7 +3306,7 @@ Inspector::Protocol::ErrorStringOr InspectorDO return makeUnexpected("Missing node for given path"_s); } @@ -3344,7 +3382,7 @@ index 077b6857627c916d6b8d6cfcf0b1018dd597a7af..67d109a50be0a05dd1179c32e2089788 { RefPtr document = &node->document(); if (auto* templateHost = document->templateDocumentHost()) -@@ -3143,12 +3316,18 @@ RefPtr InspectorDOMAgent::resolveNod +@@ -3142,12 +3315,18 @@ RefPtr InspectorDOMAgent::resolveNod if (!frame) return nullptr; @@ -3366,7 +3404,7 @@ index 077b6857627c916d6b8d6cfcf0b1018dd597a7af..67d109a50be0a05dd1179c32e2089788 } Node* InspectorDOMAgent::scriptValueAsNode(JSC::JSValue value) -@@ -3302,4 +3481,53 @@ Inspector::Protocol::ErrorStringOr> In +@@ -3301,4 +3480,53 @@ Inspector::Protocol::ErrorStringOr> In #endif } @@ -3494,7 +3532,7 @@ index 8f83cc5eaca550bbcea167c98b944f704d9a9cb1..2f655b6534f1428a23907e1cada99c24 void discardBindings(); diff --git a/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp b/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp -index dd164a0c7161396ee21bc3e1e4f7889f5ddbb770..58a528c6ac0efea4b383688d5369606013282075 100644 +index 51f9c0efda1011e93a2c85bd44b85e4e0db5e8f3..991231e85c4ceb3a8f62a6c2fc3529472d66087f 100644 --- a/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp +++ b/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp @@ -62,6 +62,7 @@ @@ -3505,7 +3543,7 @@ index dd164a0c7161396ee21bc3e1e4f7889f5ddbb770..58a528c6ac0efea4b383688d53696060 #include "Page.h" #include "PlatformStrategies.h" #include "ProgressTracker.h" -@@ -275,8 +276,8 @@ static Ref buildObjectForResourceRequest( +@@ -276,8 +277,8 @@ static Ref buildObjectForResourceRequest( .release(); if (request.httpBody() && !request.httpBody()->isEmpty()) { @@ -3516,7 +3554,7 @@ index dd164a0c7161396ee21bc3e1e4f7889f5ddbb770..58a528c6ac0efea4b383688d53696060 } if (resourceLoader) { -@@ -328,6 +329,8 @@ RefPtr InspectorNetworkAgent::buildObjec +@@ -329,6 +330,8 @@ RefPtr InspectorNetworkAgent::buildObjec .setSource(responseSource(response.source())) .release(); @@ -3525,7 +3563,7 @@ index dd164a0c7161396ee21bc3e1e4f7889f5ddbb770..58a528c6ac0efea4b383688d53696060 if (resourceLoader) { auto* metrics = response.deprecatedNetworkLoadMetricsOrNull(); responseObject->setTiming(buildObjectForTiming(metrics ? *metrics : NetworkLoadMetrics::emptyMetrics(), *resourceLoader)); -@@ -522,7 +525,7 @@ void InspectorNetworkAgent::didReceiveResponse(ResourceLoaderIdentifier identifi +@@ -523,7 +526,7 @@ void InspectorNetworkAgent::didReceiveResponse(ResourceLoaderIdentifier identifi // 'Raw' is used for loading worker scripts, and those should stay as 'Script' and not change to 'XHR' type. if (type != newType && newType != ResourceType::XHR && newType != ResourceType::Other) type = newType; @@ -3534,7 +3572,7 @@ index dd164a0c7161396ee21bc3e1e4f7889f5ddbb770..58a528c6ac0efea4b383688d53696060 // FIXME: 304 Not Modified responses for XHR/Fetch do not have all their information from the cache. if (isNotModified && (type == ResourceType::XHR || type == ResourceType::Fetch) && (!cachedResource || !cachedResource->encodedSize())) { if (auto previousResourceData = m_resourcesData->dataForURL(response.url().string())) { -@@ -533,12 +536,12 @@ void InspectorNetworkAgent::didReceiveResponse(ResourceLoaderIdentifier identifi +@@ -534,12 +537,12 @@ void InspectorNetworkAgent::didReceiveResponse(ResourceLoaderIdentifier identifi m_resourcesData->maybeAddResourceData(requestId, buffer); }); } @@ -3550,7 +3588,7 @@ index dd164a0c7161396ee21bc3e1e4f7889f5ddbb770..58a528c6ac0efea4b383688d53696060 resourceResponse->setString("source"_s, Inspector::Protocol::Helpers::getEnumConstantValue(Inspector::Protocol::Network::Response::Source::DiskCache)); } } -@@ -617,6 +620,9 @@ void InspectorNetworkAgent::didFailLoading(ResourceLoaderIdentifier identifier, +@@ -618,6 +621,9 @@ void InspectorNetworkAgent::didFailLoading(ResourceLoaderIdentifier identifier, String requestId = IdentifiersFactory::requestId(identifier.toUInt64()); if (loader && m_resourcesData->resourceType(requestId) == ResourceType::Document) { @@ -3560,7 +3598,7 @@ index dd164a0c7161396ee21bc3e1e4f7889f5ddbb770..58a528c6ac0efea4b383688d53696060 auto* frame = loader->frame(); if (frame && frame->loader().documentLoader() && frame->document()) { m_resourcesData->addResourceSharedBuffer(requestId, -@@ -846,6 +852,7 @@ Inspector::Protocol::ErrorStringOr InspectorNetworkAgent::disable() +@@ -847,6 +853,7 @@ Inspector::Protocol::ErrorStringOr InspectorNetworkAgent::disable() Ref { m_instrumentingAgents.get() }->setEnabledNetworkAgent(nullptr); m_resourcesData->clear(); m_extraRequestHeaders.clear(); @@ -3568,7 +3606,7 @@ index dd164a0c7161396ee21bc3e1e4f7889f5ddbb770..58a528c6ac0efea4b383688d53696060 continuePendingRequests(); continuePendingResponses(); -@@ -904,6 +911,7 @@ void InspectorNetworkAgent::continuePendingResponses() +@@ -905,6 +912,7 @@ void InspectorNetworkAgent::continuePendingResponses() Inspector::Protocol::ErrorStringOr InspectorNetworkAgent::setExtraHTTPHeaders(Ref&& headers) { @@ -3576,7 +3614,7 @@ index dd164a0c7161396ee21bc3e1e4f7889f5ddbb770..58a528c6ac0efea4b383688d53696060 for (auto& entry : headers.get()) { auto stringValue = entry.value->asString(); if (!!stringValue) -@@ -1158,6 +1166,11 @@ void InspectorNetworkAgent::interceptResponse(const ResourceResponse& response, +@@ -1169,6 +1177,11 @@ void InspectorNetworkAgent::interceptResponse(const ResourceResponse& response, m_frontendDispatcher->responseIntercepted(requestId, resourceResponse.releaseNonNull()); } @@ -3588,7 +3626,7 @@ index dd164a0c7161396ee21bc3e1e4f7889f5ddbb770..58a528c6ac0efea4b383688d53696060 Inspector::Protocol::ErrorStringOr InspectorNetworkAgent::interceptContinue(const Inspector::Protocol::Network::RequestId& requestId, Inspector::Protocol::Network::NetworkStage networkStage) { switch (networkStage) { -@@ -1187,6 +1200,9 @@ Inspector::Protocol::ErrorStringOr InspectorNetworkAgent::interceptWithReq +@@ -1198,6 +1211,9 @@ Inspector::Protocol::ErrorStringOr InspectorNetworkAgent::interceptWithReq return makeUnexpected("Missing pending intercept request for given requestId"_s); auto& loader = *pendingRequest->m_loader; @@ -3598,7 +3636,7 @@ index dd164a0c7161396ee21bc3e1e4f7889f5ddbb770..58a528c6ac0efea4b383688d53696060 ResourceRequest request = loader.request(); if (!!url) request.setURL(URL({ }, url)); -@@ -1282,13 +1298,22 @@ Inspector::Protocol::ErrorStringOr InspectorNetworkAgent::interceptRequest +@@ -1293,13 +1309,22 @@ Inspector::Protocol::ErrorStringOr InspectorNetworkAgent::interceptRequest response.setHTTPStatusCode(status); response.setHTTPStatusText(String { statusText }); HTTPHeaderMap explicitHeaders; @@ -3622,7 +3660,7 @@ index dd164a0c7161396ee21bc3e1e4f7889f5ddbb770..58a528c6ac0efea4b383688d53696060 loader->didReceiveResponse(WTF::move(response), [loader, buffer = data.releaseNonNull()]() { if (loader->reachedTerminalState()) return; -@@ -1352,6 +1377,12 @@ Inspector::Protocol::ErrorStringOr InspectorNetworkAgent::setEmulatedCondi +@@ -1363,6 +1388,12 @@ Inspector::Protocol::ErrorStringOr InspectorNetworkAgent::setEmulatedCondi #endif // ENABLE(INSPECTOR_NETWORK_THROTTLING) @@ -3636,19 +3674,19 @@ index dd164a0c7161396ee21bc3e1e4f7889f5ddbb770..58a528c6ac0efea4b383688d53696060 { auto searchResult = Inspector::Protocol::Page::SearchResult::create() diff --git a/Source/WebCore/inspector/agents/InspectorNetworkAgent.h b/Source/WebCore/inspector/agents/InspectorNetworkAgent.h -index 5875ac43836d8cbd9b40e82ebf964a34eb65254f..175bd8649c496232fed546ccbb12102722d8608b 100644 +index 306305d101151c4e1e1ac710add6e95dc237d935..848177b164a308d6916df22e022e14c1752a5f14 100644 --- a/Source/WebCore/inspector/agents/InspectorNetworkAgent.h +++ b/Source/WebCore/inspector/agents/InspectorNetworkAgent.h -@@ -35,6 +35,8 @@ - #include "InspectorPageAgent.h" +@@ -36,6 +36,8 @@ #include "InspectorWebAgentBase.h" + #include "NetworkAgentInstrumentation.h" #include "NetworkResourcesData.h" +#include "ResourceError.h" +#include "SharedBuffer.h" #include "WebSocket.h" #include #include -@@ -105,6 +107,7 @@ public: +@@ -106,6 +108,7 @@ public: #if ENABLE(INSPECTOR_NETWORK_THROTTLING) Inspector::Protocol::ErrorStringOr setEmulatedConditions(std::optional&& bytesPerSecondLimit) final; #endif @@ -3656,7 +3694,7 @@ index 5875ac43836d8cbd9b40e82ebf964a34eb65254f..175bd8649c496232fed546ccbb121027 // InspectorInstrumentation void NODELETE willRecalculateStyle(); -@@ -136,6 +139,7 @@ public: +@@ -137,6 +140,7 @@ public: bool shouldInterceptResponse(const ResourceResponse&); void interceptResponse(const ResourceResponse&, ResourceLoaderIdentifier, CompletionHandler)>&&); void interceptRequest(ResourceLoader&, Function&&); @@ -3664,7 +3702,7 @@ index 5875ac43836d8cbd9b40e82ebf964a34eb65254f..175bd8649c496232fed546ccbb121027 void searchOtherRequests(const JSC::Yarr::RegularExpression&, Ref>&); void searchInRequest(Inspector::Protocol::ErrorString&, const Inspector::Protocol::Network::RequestId&, const String& query, bool caseSensitive, bool isRegex, RefPtr>&); -@@ -192,6 +196,7 @@ private: +@@ -193,6 +197,7 @@ private: bool m_loadingXHRSynchronously { false }; bool m_interceptionEnabled { false }; bool m_clearResourceDataOnNavigate { true }; @@ -3673,7 +3711,7 @@ index 5875ac43836d8cbd9b40e82ebf964a34eb65254f..175bd8649c496232fed546ccbb121027 } // namespace WebCore diff --git a/Source/WebCore/inspector/agents/InspectorPageAgent.cpp b/Source/WebCore/inspector/agents/InspectorPageAgent.cpp -index 6bb8dd192ae2fedac06e2b35bb9c6711950d5b23..5fb689a1a62b8fd687b73c590236ac11d5e1fb03 100644 +index 3f9caf323ad1fb608aab868e20dce4cdb0ef1749..b79f19f291d2546fc517529168e1ecf8a7494827 100644 --- a/Source/WebCore/inspector/agents/InspectorPageAgent.cpp +++ b/Source/WebCore/inspector/agents/InspectorPageAgent.cpp @@ -32,6 +32,7 @@ @@ -3684,13 +3722,12 @@ index 6bb8dd192ae2fedac06e2b35bb9c6711950d5b23..5fb689a1a62b8fd687b73c590236ac11 #include "CachedResource.h" #include "Cookie.h" #include "CookieJar.h" -@@ -39,14 +40,17 @@ +@@ -39,13 +40,16 @@ #include "DocumentLoader.h" #include "DocumentResourceLoader.h" #include "DocumentView.h" +#include "Editor.h" #include "ElementInlines.h" - #include "EventTargetInlines.h" +#include "FocusController.h" #include "ForcedAccessibilityValue.h" #include "FrameInlines.h" @@ -3702,7 +3739,7 @@ index 6bb8dd192ae2fedac06e2b35bb9c6711950d5b23..5fb689a1a62b8fd687b73c590236ac11 #include "HTMLNames.h" #include "ImageBuffer.h" #include "ImageUtilities.h" -@@ -57,30 +61,38 @@ +@@ -56,6 +60,7 @@ #include "InspectorOverlay.h" #include "InspectorResourceUtilities.h" #include "InstrumentingAgents.h" @@ -3710,9 +3747,10 @@ index 6bb8dd192ae2fedac06e2b35bb9c6711950d5b23..5fb689a1a62b8fd687b73c590236ac11 #include "LocalFrame.h" #include "LocalFrameView.h" #include "MIMETypeRegistry.h" - #include "MemoryCache.h" +@@ -63,24 +68,32 @@ #include "Page.h" #include "PageInspectorController.h" + #include "RemoteFrame.h" +#include "PlatformScreen.h" #include "RenderObjectInlines.h" #include "RenderTheme.h" @@ -3730,6 +3768,7 @@ index 6bb8dd192ae2fedac06e2b35bb9c6711950d5b23..5fb689a1a62b8fd687b73c590236ac11 #include #include +#include ++#include #include +#include #include @@ -3741,7 +3780,7 @@ index 6bb8dd192ae2fedac06e2b35bb9c6711950d5b23..5fb689a1a62b8fd687b73c590236ac11 #include #if ENABLE(APPLICATION_MANIFEST) -@@ -102,6 +114,11 @@ using namespace Inspector; +@@ -102,6 +115,11 @@ using namespace Inspector; WTF_MAKE_TZONE_ALLOCATED_IMPL(InspectorPageAgent); @@ -3753,7 +3792,7 @@ index 6bb8dd192ae2fedac06e2b35bb9c6711950d5b23..5fb689a1a62b8fd687b73c590236ac11 InspectorOverlay& InspectorPageAgent::overlay() const { return m_overlay.get(); -@@ -112,6 +129,7 @@ InspectorPageAgent::InspectorPageAgent(PageAgentContext& context, InspectorBacke +@@ -112,6 +130,7 @@ InspectorPageAgent::InspectorPageAgent(PageAgentContext& context, InspectorBacke , m_frontendDispatcher(makeUniqueRef(context.frontendRouter)) , m_backendDispatcher(Inspector::PageBackendDispatcher::create(context.backendDispatcher, this)) , m_inspectedPage(context.inspectedPage) @@ -3761,7 +3800,7 @@ index 6bb8dd192ae2fedac06e2b35bb9c6711950d5b23..5fb689a1a62b8fd687b73c590236ac11 , m_client(client) , m_overlay(overlay) { -@@ -142,12 +160,20 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::enable() +@@ -142,12 +161,20 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::enable() defaultUserPreferencesDidChange(); @@ -3782,7 +3821,7 @@ index 6bb8dd192ae2fedac06e2b35bb9c6711950d5b23..5fb689a1a62b8fd687b73c590236ac11 std::ignore = setShowPaintRects(false); #if !PLATFORM(IOS_FAMILY) -@@ -200,6 +226,22 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::reload(std::optiona +@@ -200,6 +227,22 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::reload(std::optiona return { }; } @@ -3805,7 +3844,7 @@ index 6bb8dd192ae2fedac06e2b35bb9c6711950d5b23..5fb689a1a62b8fd687b73c590236ac11 Inspector::Protocol::ErrorStringOr InspectorPageAgent::overrideUserAgent(const String& value) { m_userAgentOverride = value; -@@ -207,6 +249,13 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::overrideUserAgent(c +@@ -207,6 +250,13 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::overrideUserAgent(c return { }; } @@ -3819,7 +3858,7 @@ index 6bb8dd192ae2fedac06e2b35bb9c6711950d5b23..5fb689a1a62b8fd687b73c590236ac11 Inspector::Protocol::ErrorStringOr InspectorPageAgent::overrideSetting(Inspector::Protocol::Page::Setting setting, std::optional&& value) { auto& inspectedPageSettings = m_inspectedPage->settings(); -@@ -220,6 +269,12 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::overrideSetting(Ins +@@ -220,6 +270,12 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::overrideSetting(Ins inspectedPageSettings.setAuthorAndUserStylesEnabledInspectorOverride(value); return { }; @@ -3832,7 +3871,7 @@ index 6bb8dd192ae2fedac06e2b35bb9c6711950d5b23..5fb689a1a62b8fd687b73c590236ac11 case Inspector::Protocol::Page::Setting::ICECandidateFilteringEnabled: inspectedPageSettings.setICECandidateFilteringEnabledInspectorOverride(value); return { }; -@@ -246,6 +301,39 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::overrideSetting(Ins +@@ -246,6 +302,39 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::overrideSetting(Ins m_client->setDeveloperPreferenceOverride(InspectorBackendClient::DeveloperPreference::NeedsSiteSpecificQuirks, value); return { }; @@ -3872,7 +3911,7 @@ index 6bb8dd192ae2fedac06e2b35bb9c6711950d5b23..5fb689a1a62b8fd687b73c590236ac11 case Inspector::Protocol::Page::Setting::ScriptEnabled: inspectedPageSettings.setScriptEnabledInspectorOverride(value); return { }; -@@ -258,6 +346,12 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::overrideSetting(Ins +@@ -258,6 +347,12 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::overrideSetting(Ins inspectedPageSettings.setShowRepaintCounterInspectorOverride(value); return { }; @@ -3885,7 +3924,7 @@ index 6bb8dd192ae2fedac06e2b35bb9c6711950d5b23..5fb689a1a62b8fd687b73c590236ac11 case Inspector::Protocol::Page::Setting::WebSecurityEnabled: inspectedPageSettings.setWebSecurityEnabledInspectorOverride(value); return { }; -@@ -670,15 +764,16 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::setShowPaintRects(b +@@ -670,15 +765,16 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::setShowPaintRects(b return { }; } @@ -3907,7 +3946,7 @@ index 6bb8dd192ae2fedac06e2b35bb9c6711950d5b23..5fb689a1a62b8fd687b73c590236ac11 } void InspectorPageAgent::frameNavigated(LocalFrame& frame) -@@ -686,6 +781,22 @@ void InspectorPageAgent::frameNavigated(LocalFrame& frame) +@@ -686,6 +782,22 @@ void InspectorPageAgent::frameNavigated(LocalFrame& frame) m_frontendDispatcher->frameNavigated(buildObjectForFrame(&frame)); } @@ -3930,7 +3969,7 @@ index 6bb8dd192ae2fedac06e2b35bb9c6711950d5b23..5fb689a1a62b8fd687b73c590236ac11 void InspectorPageAgent::frameDetached(LocalFrame& frame) { auto identifier = m_inspectedPage->inspectorController().identifierRegistry().takeFrame(frame); -@@ -758,6 +869,12 @@ void InspectorPageAgent::defaultUserPreferencesDidChange() +@@ -758,6 +870,12 @@ void InspectorPageAgent::defaultUserPreferencesDidChange() m_frontendDispatcher->defaultUserPreferencesDidChange(WTF::move(defaultUserPreferences)); } @@ -3943,7 +3982,7 @@ index 6bb8dd192ae2fedac06e2b35bb9c6711950d5b23..5fb689a1a62b8fd687b73c590236ac11 #if ENABLE(DARK_MODE_CSS) void InspectorPageAgent::defaultAppearanceDidChange() { -@@ -771,6 +888,9 @@ void InspectorPageAgent::didClearWindowObjectInWorld(LocalFrame& frame, DOMWrapp +@@ -771,6 +889,9 @@ void InspectorPageAgent::didClearWindowObjectInWorld(LocalFrame& frame, DOMWrapp return; if (m_bootstrapScript.isEmpty()) @@ -3953,7 +3992,7 @@ index 6bb8dd192ae2fedac06e2b35bb9c6711950d5b23..5fb689a1a62b8fd687b73c590236ac11 return; frame.script().evaluateIgnoringException(ScriptSourceCode(m_bootstrapScript, JSC::SourceTaintedOrigin::Untainted, URL { "web-inspector://bootstrap.js"_str })); -@@ -818,6 +938,51 @@ void InspectorPageAgent::didRecalculateStyle() +@@ -818,6 +939,51 @@ void InspectorPageAgent::didRecalculateStyle() protect(overlay())->update(); } @@ -4005,7 +4044,7 @@ index 6bb8dd192ae2fedac06e2b35bb9c6711950d5b23..5fb689a1a62b8fd687b73c590236ac11 Ref InspectorPageAgent::buildObjectForFrame(LocalFrame* frame) { ASSERT_ARG(frame, frame); -@@ -911,6 +1076,12 @@ void InspectorPageAgent::applyUserAgentOverride(String& userAgent) +@@ -933,6 +1099,12 @@ void InspectorPageAgent::applyUserAgentOverride(String& userAgent) userAgent = m_userAgentOverride; } @@ -4018,7 +4057,7 @@ index 6bb8dd192ae2fedac06e2b35bb9c6711950d5b23..5fb689a1a62b8fd687b73c590236ac11 void InspectorPageAgent::applyEmulatedMedia(AtomString& media) { if (!m_emulatedMedia.isEmpty()) -@@ -926,7 +1097,7 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::snapshotNode(Insp +@@ -948,7 +1120,7 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::snapshotNode(Insp RefPtr node = domAgent->assertNode(errorString, nodeId); if (!node) return makeUnexpected(errorString); @@ -4027,13 +4066,16 @@ index 6bb8dd192ae2fedac06e2b35bb9c6711950d5b23..5fb689a1a62b8fd687b73c590236ac11 RefPtr localMainFrame = m_inspectedPage->localMainFrame(); if (!localMainFrame) return makeUnexpected("Main frame isn't local"_s); -@@ -937,11 +1108,13 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::snapshotNode(Insp +@@ -959,11 +1131,16 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::snapshotNode(Insp return encodeDataURL(WTF::move(snapshot), "image/png"_s); } -Inspector::Protocol::ErrorStringOr InspectorPageAgent::snapshotRect(int x, int y, int width, int height, Inspector::Protocol::Page::CoordinateSystem coordinateSystem) -+Inspector::Protocol::ErrorStringOr InspectorPageAgent::snapshotRect(int x, int y, int width, int height, Inspector::Protocol::Page::CoordinateSystem coordinateSystem, std::optional&& omitDeviceScaleFactor) ++Inspector::Protocol::ErrorStringOr InspectorPageAgent::snapshotRect(int x, int y, int width, int height, Inspector::Protocol::Page::CoordinateSystem coordinateSystem, std::optional&& omitDeviceScaleFactor, std::optional&& format, std::optional&& quality) { ++ if (quality && (*quality < 0 || *quality > 100)) ++ return makeUnexpected("Quality must be between 0 and 100"_s); ++ SnapshotOptions options { { }, PixelFormat::BGRA8, DestinationColorSpace::SRGB() }; if (coordinateSystem == Inspector::Protocol::Page::CoordinateSystem::Viewport) options.flags.add(SnapshotFlags::InViewCoordinates); @@ -4042,10 +4084,30 @@ index 6bb8dd192ae2fedac06e2b35bb9c6711950d5b23..5fb689a1a62b8fd687b73c590236ac11 IntRect rectangle(x, y, width, height); RefPtr localMainFrame = m_inspectedPage->localMainFrame(); -@@ -954,6 +1127,43 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::snapshotRect(int - return encodeDataURL(WTF::move(snapshot), "image/png"_s); - } +@@ -973,9 +1150,68 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::snapshotRect(int + if (!snapshot) + return makeUnexpected("Could not capture snapshot"_s); +- return encodeDataURL(WTF::move(snapshot), "image/png"_s); ++ ++ String mimeType; ++ std::optional encodingQuality; ++ switch (format.value_or(Inspector::Protocol::Page::ImageFormat::Png)) { ++ case Inspector::Protocol::Page::ImageFormat::Png: ++ mimeType = "image/png"_s; ++ break; ++ case Inspector::Protocol::Page::ImageFormat::Jpeg: ++ mimeType = "image/jpeg"_s; ++ encodingQuality = quality.value_or(80) / 100.0; ++ break; ++ case Inspector::Protocol::Page::ImageFormat::Webp: ++ mimeType = "image/webp"_s; ++ encodingQuality = quality.value_or(80) / 100.0; ++ break; ++ } ++ return encodeDataURL(WTF::move(snapshot), mimeType, encodingQuality); ++} ++ +Inspector::Protocol::ErrorStringOr InspectorPageAgent::setForcedColors(std::optional&& forcedColors) +{ + if (!forcedColors) { @@ -4072,9 +4134,15 @@ index 6bb8dd192ae2fedac06e2b35bb9c6711950d5b23..5fb689a1a62b8fd687b73c590236ac11 + if (!success) + return makeUnexpected(makeString("Invalid time zone "_s, timeZone)); + ++#if PLATFORM(COCOA) ++ // JSC caches time zone information process-wide using lastTimeZoneID as the cache ++ // key. The cache is normally invalidated only by the system time zone change ++ // notification, so bump the counter explicitly to force re-reading the override. ++ ++JSC::lastTimeZoneID; ++#endif + return { }; -+} -+ + } + +Inspector::Protocol::ErrorStringOr InspectorPageAgent::setTouchEmulationEnabled(bool enabled) +{ + setScreenHasTouchDeviceOverride(enabled); @@ -4086,7 +4154,7 @@ index 6bb8dd192ae2fedac06e2b35bb9c6711950d5b23..5fb689a1a62b8fd687b73c590236ac11 #if ENABLE(WEB_ARCHIVE) && USE(CF) Inspector::Protocol::ErrorStringOr InspectorPageAgent::archive() { -@@ -970,7 +1180,6 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::archive() +@@ -992,7 +1228,6 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::archive() } #endif @@ -4094,7 +4162,7 @@ index 6bb8dd192ae2fedac06e2b35bb9c6711950d5b23..5fb689a1a62b8fd687b73c590236ac11 Inspector::Protocol::ErrorStringOr InspectorPageAgent::setScreenSizeOverride(std::optional&& width, std::optional&& height) { if (width.has_value() != height.has_value()) -@@ -988,6 +1197,86 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::setScreenSizeOverri +@@ -1010,6 +1245,86 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::setScreenSizeOverri localMainFrame->setOverrideScreenSize(FloatSize(width.value_or(0), height.value_or(0))); return { }; } @@ -4183,7 +4251,7 @@ index 6bb8dd192ae2fedac06e2b35bb9c6711950d5b23..5fb689a1a62b8fd687b73c590236ac11 } // namespace WebCore diff --git a/Source/WebCore/inspector/agents/InspectorPageAgent.h b/Source/WebCore/inspector/agents/InspectorPageAgent.h -index 97c3cf09961f5c5ea7ede70d35755639fc66a3df..d5aabfbb3062f6037415bb3e136d3d7cebdfbbfd 100644 +index 0af80809258326e52818831166b3ff901e4b9663..ed85e4d92b1c2a5aa56fd390d8711322575e8050 100644 --- a/Source/WebCore/inspector/agents/InspectorPageAgent.h +++ b/Source/WebCore/inspector/agents/InspectorPageAgent.h @@ -43,10 +43,12 @@ @@ -4194,7 +4262,7 @@ index 97c3cf09961f5c5ea7ede70d35755639fc66a3df..d5aabfbb3062f6037415bb3e136d3d7c #include namespace Inspector { - enum class ResourceType; + enum class ResourceType : uint8_t; +class InjectedScriptManager; } @@ -4207,7 +4275,7 @@ index 97c3cf09961f5c5ea7ede70d35755639fc66a3df..d5aabfbb3062f6037415bb3e136d3d7c class InspectorOverlay; class LocalFrame; class Page; -@@ -68,6 +71,9 @@ public: +@@ -69,6 +72,9 @@ public: InspectorPageAgent(PageAgentContext&, InspectorBackendClient*, InspectorOverlay&); ~InspectorPageAgent(); @@ -4217,7 +4285,7 @@ index 97c3cf09961f5c5ea7ede70d35755639fc66a3df..d5aabfbb3062f6037415bb3e136d3d7c // InspectorAgentBase void didCreateFrontendAndBackend(); void willDestroyFrontendAndBackend(Inspector::DisconnectReason); -@@ -76,7 +82,10 @@ public: +@@ -77,7 +83,10 @@ public: Inspector::Protocol::ErrorStringOr enable(); Inspector::Protocol::ErrorStringOr disable(); Inspector::Protocol::ErrorStringOr reload(std::optional&& ignoreCache, std::optional&& revalidateAllResources); @@ -4228,7 +4296,7 @@ index 97c3cf09961f5c5ea7ede70d35755639fc66a3df..d5aabfbb3062f6037415bb3e136d3d7c Inspector::Protocol::ErrorStringOr overrideSetting(Inspector::Protocol::Page::Setting, std::optional&& value); Inspector::Protocol::ErrorStringOr overrideUserPreference(Inspector::Protocol::Page::UserPreferenceName, std::optional&&); Inspector::Protocol::ErrorStringOr>> getCookies(); -@@ -92,41 +101,60 @@ public: +@@ -93,41 +102,60 @@ public: #endif Inspector::Protocol::ErrorStringOr setShowPaintRects(bool); Inspector::Protocol::ErrorStringOr setEmulatedMedia(const String&); @@ -4237,7 +4305,7 @@ index 97c3cf09961f5c5ea7ede70d35755639fc66a3df..d5aabfbb3062f6037415bb3e136d3d7c + Inspector::Protocol::ErrorStringOr setTouchEmulationEnabled(bool); Inspector::Protocol::ErrorStringOr snapshotNode(Inspector::Protocol::DOM::NodeId); - Inspector::Protocol::ErrorStringOr snapshotRect(int x, int y, int width, int height, Inspector::Protocol::Page::CoordinateSystem); -+ Inspector::Protocol::ErrorStringOr snapshotRect(int x, int y, int width, int height, Inspector::Protocol::Page::CoordinateSystem, std::optional&& omitDeviceScaleFactor); ++ Inspector::Protocol::ErrorStringOr snapshotRect(int x, int y, int width, int height, Inspector::Protocol::Page::CoordinateSystem, std::optional&& omitDeviceScaleFactor, std::optional&& format, std::optional&& quality); #if ENABLE(WEB_ARCHIVE) && USE(CF) Inspector::Protocol::ErrorStringOr archive(); #endif @@ -4294,7 +4362,7 @@ index 97c3cf09961f5c5ea7ede70d35755639fc66a3df..d5aabfbb3062f6037415bb3e136d3d7c InspectorOverlay& NODELETE overlay() const; -@@ -141,14 +169,19 @@ private: +@@ -142,14 +170,19 @@ private: const Ref m_backendDispatcher; WeakRef m_inspectedPage; @@ -4313,9 +4381,70 @@ index 97c3cf09961f5c5ea7ede70d35755639fc66a3df..d5aabfbb3062f6037415bb3e136d3d7c + bool m_ignoreDidClearWindowObject { false }; }; + } // namespace WebCore +diff --git a/Source/WebCore/inspector/agents/frame/FrameDOMAgent.h b/Source/WebCore/inspector/agents/frame/FrameDOMAgent.h +index 5f424acadd1ed82e70947aec894134feedfc36b7..cb3e406cf2893c998d10d80a56b21752f0fabec1 100644 +--- a/Source/WebCore/inspector/agents/frame/FrameDOMAgent.h ++++ b/Source/WebCore/inspector/agents/frame/FrameDOMAgent.h +@@ -115,7 +115,7 @@ public: + Inspector::CommandResult showFlexOverlay(int nodeId, Ref&& flexOverlayConfig) override; + Inspector::CommandResult hideFlexOverlay(std::optional&& nodeId) override; + Inspector::CommandResult pushNodeByPathToFrontend(const String& path) override; +- Inspector::CommandResult> resolveNode(int nodeId, const String& objectGroup) override; ++ Inspector::CommandResult> resolveNode(std::optional&&, const String&, const String&, std::optional&&, const String&) override; + Inspector::CommandResult moveTo(int nodeId, int targetNodeId, std::optional&& insertBeforeNodeId) override; + Inspector::CommandResult undo() override; + Inspector::CommandResult redo() override; +@@ -124,6 +124,10 @@ public: + Inspector::CommandResult setInspectedNode(int nodeId) override; + Inspector::CommandResult setAllowEditingUserAgentShadowTrees(bool) override; + Inspector::CommandResult> getMediaStats(int nodeId) override; ++ Inspector::CommandResultOf describeNode(const String&) override; ++ Inspector::CommandResult scrollIntoViewIfNeeded(const String&, RefPtr&&) override; ++ Inspector::CommandResult>> getContentQuads(const String&) override; ++ void setInputFiles(const String&, Ref&&, Ref&&) override; + + // InspectorInstrumentation hooks + void didInsertDOMNode(Node&); +diff --git a/Source/WebCore/inspector/agents/frame/FrameDOMAgentStubs.cpp b/Source/WebCore/inspector/agents/frame/FrameDOMAgentStubs.cpp +index fbf7088fd151b7744e2e6f424b65b0bd513fb4f6..386232b2c6ad0e1bb7f894d91dae2547670b3e79 100644 +--- a/Source/WebCore/inspector/agents/frame/FrameDOMAgentStubs.cpp ++++ b/Source/WebCore/inspector/agents/frame/FrameDOMAgentStubs.cpp +@@ -196,7 +196,7 @@ Inspector::CommandResult FrameDOMAgent::hideFlexOverlay(std::optional + return makeUnexpected("Not supported for frame targets"_s); + } + +-Inspector::CommandResult> FrameDOMAgent::resolveNode(int, const String&) ++Inspector::CommandResult> FrameDOMAgent::resolveNode(std::optional&&, const String&, const String&, std::optional&&, const String&) + { + return makeUnexpected("Not yet implemented for frame targets"_s); + } +@@ -241,4 +241,23 @@ Inspector::CommandResult> FrameDOMAgen + return makeUnexpected("Not supported for frame targets"_s); + } + ++Inspector::CommandResultOf FrameDOMAgent::describeNode(const String&) ++{ ++ return makeUnexpected("Not supported for frame targets"_s); ++} ++ ++Inspector::CommandResult FrameDOMAgent::scrollIntoViewIfNeeded(const String&, RefPtr&&) ++{ ++ return makeUnexpected("Not supported for frame targets"_s); ++} ++ ++Inspector::CommandResult>> FrameDOMAgent::getContentQuads(const String&) ++{ ++ return makeUnexpected("Not supported for frame targets"_s); ++} ++ ++void FrameDOMAgent::setInputFiles(const String&, Ref&&, Ref&&) ++{ ++} ++ } // namespace WebCore diff --git a/Source/WebCore/inspector/agents/page/PageRuntimeAgent.cpp b/Source/WebCore/inspector/agents/page/PageRuntimeAgent.cpp -index e93e93df33a77cf1995340ff1375488efee0a9df..002c160eec98597f97d547f6f2722b7edb58be72 100644 +index d0c409f4832ea16ace7ee6c9f35ee06b0348c764..6d47d17cc4508d84bc3e4c5fa0885b8275732ca3 100644 --- a/Source/WebCore/inspector/agents/page/PageRuntimeAgent.cpp +++ b/Source/WebCore/inspector/agents/page/PageRuntimeAgent.cpp @@ -35,7 +35,9 @@ @@ -4328,15 +4457,15 @@ index e93e93df33a77cf1995340ff1375488efee0a9df..002c160eec98597f97d547f6f2722b7e #include "InstrumentingAgents.h" #include "JSDOMWindowCustom.h" #include "JSExecState.h" -@@ -43,6 +45,7 @@ - #include "Page.h" +@@ -44,6 +46,7 @@ #include "PageInspectorController.h" + #include "RuntimeAgentUtilities.h" #include "ScriptController.h" +#include "ScriptSourceCode.h" #include "SecurityOrigin.h" #include "UserGestureEmulationScope.h" #include -@@ -90,13 +93,74 @@ Inspector::Protocol::ErrorStringOr PageRuntimeAgent::disable() +@@ -91,13 +94,74 @@ Inspector::Protocol::ErrorStringOr PageRuntimeAgent::disable() { Ref { m_instrumentingAgents.get() }->setEnabledPageRuntimeAgent(nullptr); @@ -4411,7 +4540,7 @@ index e93e93df33a77cf1995340ff1375488efee0a9df..002c160eec98597f97d547f6f2722b7e } void PageRuntimeAgent::didClearWindowObjectInWorld(LocalFrame& frame, DOMWrapperWorld& world) -@@ -105,7 +169,29 @@ void PageRuntimeAgent::didClearWindowObjectInWorld(LocalFrame& frame, DOMWrapper +@@ -106,7 +170,29 @@ void PageRuntimeAgent::didClearWindowObjectInWorld(LocalFrame& frame, DOMWrapper if (frameId.isEmpty()) return; @@ -4441,7 +4570,7 @@ index e93e93df33a77cf1995340ff1375488efee0a9df..002c160eec98597f97d547f6f2722b7e } InjectedScript PageRuntimeAgent::injectedScriptForEval(Inspector::Protocol::ErrorString& errorString, std::optional&& executionContextId) -@@ -142,9 +228,6 @@ void PageRuntimeAgent::reportExecutionContextCreation() +@@ -143,9 +229,6 @@ void PageRuntimeAgent::reportExecutionContextCreation() Ref identifierRegistry = m_inspectedPage->inspectorController().identifierRegistry(); m_inspectedPage->forEachLocalFrame([&](LocalFrame& frame) { @@ -4508,10 +4637,10 @@ index c2f9d5d90ff590154ef39132453194c162be0cc5..ff36e34f9e5963f1deaa41341174a7fd protected: static SameSiteInfo sameSiteInfo(const Document&, IsForDOMCookieAccess = IsForDOMCookieAccess::No); diff --git a/Source/WebCore/loader/DocumentLoader.cpp b/Source/WebCore/loader/DocumentLoader.cpp -index d4925cee087ccd79875945bb2b222401cc390a53..c595fb4793b5b8d33a3ad0c659bdc27770d55c0c 100644 +index bd624699105ee090f2fbe6143a80f9682ee355a3..528d8f7c93dfe0a5b0c8603d4e538061f1f0d349 100644 --- a/Source/WebCore/loader/DocumentLoader.cpp +++ b/Source/WebCore/loader/DocumentLoader.cpp -@@ -787,8 +787,10 @@ void DocumentLoader::willSendRequest(ResourceRequest&& newRequest, const Resourc +@@ -775,8 +775,10 @@ void DocumentLoader::willSendRequest(ResourceRequest&& newRequest, const Resourc if (!didReceiveRedirectResponse) return completionHandler(WTF::move(newRequest)); @@ -4522,7 +4651,7 @@ index d4925cee087ccd79875945bb2b222401cc390a53..c595fb4793b5b8d33a3ad0c659bdc277 switch (navigationPolicyDecision) { case NavigationPolicyDecision::IgnoreLoad: case NavigationPolicyDecision::LoadWillContinueInAnotherProcess: -@@ -1597,11 +1599,17 @@ void DocumentLoader::detachFromFrame(LoadWillContinueInAnotherProcess loadWillCo +@@ -1586,11 +1588,17 @@ void DocumentLoader::detachFromFrame(LoadWillContinueInAnotherProcess loadWillCo if (auto navigationID = std::exchange(m_navigationID, { })) frame->loader().client().documentLoaderDetached(*navigationID, loadWillContinueInAnotherProcess); @@ -4543,10 +4672,10 @@ index d4925cee087ccd79875945bb2b222401cc390a53..c595fb4793b5b8d33a3ad0c659bdc277 { m_navigationID = navigationID; diff --git a/Source/WebCore/loader/DocumentLoader.h b/Source/WebCore/loader/DocumentLoader.h -index ffebadc8882ffd9a519fdaec8d42ac2909c5fe65..145e7ee21440d14da048d59f7c177c8d334e0ee3 100644 +index df3efd07ebcadc1eb790d1e909031407152902d1..33fd4709e5b3b3d9453d951e72c7907b273b8c76 100644 --- a/Source/WebCore/loader/DocumentLoader.h +++ b/Source/WebCore/loader/DocumentLoader.h -@@ -209,6 +209,8 @@ public: +@@ -210,6 +210,8 @@ public: WEBCORE_EXPORT virtual void detachFromFrame(LoadWillContinueInAnotherProcess); @@ -4556,10 +4685,10 @@ index ffebadc8882ffd9a519fdaec8d42ac2909c5fe65..145e7ee21440d14da048d59f7c177c8d WEBCORE_EXPORT SubresourceLoader* NODELETE mainResourceLoader() const; WEBCORE_EXPORT RefPtr mainResourceData() const; diff --git a/Source/WebCore/loader/FrameLoader.cpp b/Source/WebCore/loader/FrameLoader.cpp -index 994f22fa6190e271f9f9927caa6a331c355cc43e..3f469ef6abebeea6f7df6b9406c8c0e9cd5fe386 100644 +index d09aaee884faad69924de5db1e5515f8d21bb6d2..afa48d41bb19b9b3eeccaddbf3f1f88ee15e4bb0 100644 --- a/Source/WebCore/loader/FrameLoader.cpp +++ b/Source/WebCore/loader/FrameLoader.cpp -@@ -1385,6 +1385,7 @@ void FrameLoader::loadInSameDocument(URL url, RefPtr stat +@@ -1409,6 +1409,7 @@ void FrameLoader::loadInSameDocument(URL url, RefPtr stat } m_client->dispatchDidNavigateWithinPage(); @@ -4567,7 +4696,7 @@ index 994f22fa6190e271f9f9927caa6a331c355cc43e..3f469ef6abebeea6f7df6b9406c8c0e9 document->statePopped(stateObject ? stateObject.releaseNonNull() : SerializedScriptValue::nullValue()); m_client->dispatchDidPopStateWithinPage(); -@@ -1938,6 +1939,7 @@ void FrameLoader::loadWithDocumentLoader(DocumentLoader* loader, FrameLoadType t +@@ -1967,6 +1968,7 @@ void FrameLoader::loadWithDocumentLoader(DocumentLoader* loader, FrameLoadType t const String& httpMethod = loader->request().httpMethod(); if (shouldPerformFragmentNavigation(isFormSubmission, httpMethod, policyChecker().loadType(), newURL) && !loader->substituteData().isValid()) { @@ -4575,17 +4704,17 @@ index 994f22fa6190e271f9f9927caa6a331c355cc43e..3f469ef6abebeea6f7df6b9406c8c0e9 RefPtr oldDocumentLoader = m_documentLoader; NavigationAction action { protect(frame->document()).releaseNonNull(), loader->request(), InitiatedByMainFrame::Unknown, loader->isRequestFromClientOrUserInput(), policyChecker().loadType(), isFormSubmission }; -@@ -1977,7 +1979,9 @@ void FrameLoader::loadWithDocumentLoader(DocumentLoader* loader, FrameLoadType t +@@ -2008,7 +2010,9 @@ void FrameLoader::loadWithDocumentLoader(DocumentLoader* loader, FrameLoadType t auto policyDecisionMode = loader->triggeringAction().isFromNavigationAPI() ? PolicyDecisionMode::Synchronous : PolicyDecisionMode::Asynchronous; RELEASE_ASSERT(!isBackForwardLoadType(policyChecker().loadType()) || history().provisionalItem()); + InspectorInstrumentation::willCheckNavigationPolicy(m_frame); - policyChecker().checkNavigationPolicy(ResourceRequest(loader->request()), ResourceResponse { } /* redirectResponse */, loader, WTF::move(formSubmission), [this, protectedThis = Ref { *this }, allowNavigationToInvalidURL, completionHandler = completionHandlerCaller.release()] (const ResourceRequest& request, WeakPtr&& weakFormSubmission, NavigationPolicyDecision navigationPolicyDecision) mutable { + policyChecker().checkNavigationPolicy(ResourceRequest(loader->request()), ResourceResponse { } /* redirectResponse */, loader, WTF::move(formSubmission), [this, protectedThis = Ref { *this }, allowNavigationToInvalidURL, shouldRestoreFromBackForwardCache, completionHandler = completionHandlerCaller.release()] (const ResourceRequest& request, WeakPtr&& weakFormSubmission, NavigationPolicyDecision navigationPolicyDecision) mutable { + InspectorInstrumentation::didCheckNavigationPolicy(m_frame, navigationPolicyDecision != NavigationPolicyDecision::ContinueLoad); - continueLoadAfterNavigationPolicy(request, RefPtr { weakFormSubmission.get() }.get(), navigationPolicyDecision, allowNavigationToInvalidURL); + continueLoadAfterNavigationPolicy(request, RefPtr { weakFormSubmission.get() }.get(), navigationPolicyDecision, allowNavigationToInvalidURL, shouldRestoreFromBackForwardCache); completionHandler(); }, policyDecisionMode, determineNavigationType(type, NavigationHistoryBehavior::Auto)); -@@ -3324,10 +3328,15 @@ String FrameLoader::userAgent(const URL& url) const +@@ -3383,10 +3387,15 @@ String FrameLoader::userAgent(const URL& url) const String FrameLoader::navigatorPlatform() const { @@ -4603,7 +4732,7 @@ index 994f22fa6190e271f9f9927caa6a331c355cc43e..3f469ef6abebeea6f7df6b9406c8c0e9 } void FrameLoader::dispatchOnloadEvents() -@@ -3785,6 +3794,8 @@ void FrameLoader::receivedMainResourceError(const ResourceError& error, LoadWill +@@ -3844,6 +3853,8 @@ void FrameLoader::receivedMainResourceError(const ResourceError& error, LoadWill } if (frame->page()) checkLoadComplete(loadWillContinueInAnotherProcess); @@ -4612,7 +4741,7 @@ index 994f22fa6190e271f9f9927caa6a331c355cc43e..3f469ef6abebeea6f7df6b9406c8c0e9 } void FrameLoader::continueFragmentScrollAfterNavigationPolicy(const ResourceRequest& request, const SecurityOrigin* requesterOrigin, bool shouldContinue, NavigationHistoryBehavior historyHandling) -@@ -4789,9 +4800,6 @@ String FrameLoader::referrer() const +@@ -4853,9 +4864,6 @@ String FrameLoader::referrer() const void FrameLoader::dispatchDidClearWindowObjectsInAllWorlds() { @@ -4622,7 +4751,7 @@ index 994f22fa6190e271f9f9927caa6a331c355cc43e..3f469ef6abebeea6f7df6b9406c8c0e9 Vector> worlds; ScriptController::getAllWorlds(worlds); for (auto& world : worlds) -@@ -4801,13 +4809,12 @@ void FrameLoader::dispatchDidClearWindowObjectsInAllWorlds() +@@ -4865,13 +4873,12 @@ void FrameLoader::dispatchDidClearWindowObjectsInAllWorlds() void FrameLoader::dispatchDidClearWindowObjectInWorld(DOMWrapperWorld& world) { Ref frame = m_frame.get(); @@ -4677,10 +4806,10 @@ index 3acb026789c46395be3f8cd6b837ebf207e215f7..a4e3c1e69fbbb108badd23f32e879423 } diff --git a/Source/WebCore/loader/cache/CachedResourceLoader.cpp b/Source/WebCore/loader/cache/CachedResourceLoader.cpp -index 01466dae0f43c53e7e50dad34c73731fbc8240d6..f37b4130add559d50a869ab494a3f7fb99b275d1 100644 +index 7be02354989d0b0d52732318c676313d01ca83a4..c568730f75b62fdeff861a443c8a9cc5557ac9c4 100644 --- a/Source/WebCore/loader/cache/CachedResourceLoader.cpp +++ b/Source/WebCore/loader/cache/CachedResourceLoader.cpp -@@ -1159,8 +1159,11 @@ ResourceErrorOr> CachedResourceLoader::requestResource(Cache +@@ -1172,8 +1172,11 @@ ResourceErrorOr> CachedResourceLoader::requestResource(Cache request.updateReferrerPolicy(document ? document->referrerPolicy() : ReferrerPolicy::Default); @@ -4694,7 +4823,7 @@ index 01466dae0f43c53e7e50dad34c73731fbc8240d6..f37b4130add559d50a869ab494a3f7fb if (RefPtr documentLoader = m_documentLoader) { bool madeHTTPS { request.resourceRequest().wasSchemeOptimisticallyUpgraded() }; -@@ -1817,8 +1820,9 @@ Vector> CachedResourceLoader::allCachedSVGImages() const +@@ -1830,8 +1833,9 @@ Vector> CachedResourceLoader::allCachedSVGImages() const ResourceErrorOr> CachedResourceLoader::preload(CachedResource::Type type, CachedResourceRequest&& request) { @@ -4707,10 +4836,10 @@ index 01466dae0f43c53e7e50dad34c73731fbc8240d6..f37b4130add559d50a869ab494a3f7fb RefPtr document = m_document; ASSERT(document); diff --git a/Source/WebCore/page/ChromeClient.h b/Source/WebCore/page/ChromeClient.h -index 1a4fae919b725be107c91cde64f8ccfa30b1e839..2687ebc237823715ebfa06440d54e9dd6dbddd8e 100644 +index 86a65aa2b510255e130013985c3c1de48c4ddf8e..8868f815f521424b47b349b2d65856b58ed9aabc 100644 --- a/Source/WebCore/page/ChromeClient.h +++ b/Source/WebCore/page/ChromeClient.h -@@ -408,7 +408,7 @@ public: +@@ -409,7 +409,7 @@ public: #endif #if ENABLE(ORIENTATION_EVENTS) @@ -4720,10 +4849,10 @@ index 1a4fae919b725be107c91cde64f8ccfa30b1e839..2687ebc237823715ebfa06440d54e9dd virtual RefPtr createColorChooser(ColorChooserClient&, const Color&) = 0; diff --git a/Source/WebCore/page/EventHandler.cpp b/Source/WebCore/page/EventHandler.cpp -index c3b1e5711e275b22c4237f46fa307072f34edefb..28f2f4ea96febba6bf4c6c8b729e18d58cb2e141 100644 +index 91ce2cf2c5d4da9b816d73a5132c80536946a9d2..8966fd4fda62a813c79d31231d8a7963aca05cde 100644 --- a/Source/WebCore/page/EventHandler.cpp +++ b/Source/WebCore/page/EventHandler.cpp -@@ -4836,6 +4836,12 @@ bool EventHandler::handleDrag(const MouseEventWithHitTestResults& event, CheckDr +@@ -4832,6 +4832,12 @@ bool EventHandler::handleDrag(const MouseEventWithHitTestResults& event, CheckDr if (!document) return false; @@ -4736,7 +4865,7 @@ index c3b1e5711e275b22c4237f46fa307072f34edefb..28f2f4ea96febba6bf4c6c8b729e18d5 dragState().dataTransfer = DataTransfer::createForDrag(*document); auto hasNonDefaultPasteboardData = HasNonDefaultPasteboardData::No; -@@ -5440,6 +5446,7 @@ static HitTestResult hitTestResultInFrame(LocalFrame* frame, const LayoutPoint& +@@ -5436,6 +5442,7 @@ static HitTestResult hitTestResultInFrame(LocalFrame* frame, const LayoutPoint& return result; } @@ -4744,7 +4873,7 @@ index c3b1e5711e275b22c4237f46fa307072f34edefb..28f2f4ea96febba6bf4c6c8b729e18d5 Expected EventHandler::handleTouchEvent(const PlatformTouchEvent& event) { Ref frame = m_frame.get(); -@@ -5571,7 +5578,7 @@ Expected EventHandler::handleTouchEvent(co +@@ -5567,7 +5574,7 @@ Expected EventHandler::handleTouchEvent(co if (!targetFrame) continue; @@ -4753,7 +4882,7 @@ index c3b1e5711e275b22c4237f46fa307072f34edefb..28f2f4ea96febba6bf4c6c8b729e18d5 RefPtr pointerTarget = touchTarget; if (pointState != PlatformTouchPoint::TouchPressed) { -@@ -5667,6 +5674,7 @@ Expected EventHandler::handleTouchEvent(co +@@ -5663,6 +5670,7 @@ Expected EventHandler::handleTouchEvent(co return swallowedEvent; } @@ -4783,10 +4912,10 @@ index 2afe4760de2da985bb31273ef3deb6d927093b80..54539f5b9779e3cffa6d7737c4649b88 } diff --git a/Source/WebCore/page/FrameConsoleClient.cpp b/Source/WebCore/page/FrameConsoleClient.cpp -index 23e6d8380ec1e3488bc746887ea06be8eed79fb9..7a1b91c923530472bf1bd613a237dd5a8739b88f 100644 +index bc7d6367981561914f4e0acbd2f9efabce6eb42f..4802a6d571a9f5d2fa032dbb5b61abce46d0209c 100644 --- a/Source/WebCore/page/FrameConsoleClient.cpp +++ b/Source/WebCore/page/FrameConsoleClient.cpp -@@ -478,4 +478,12 @@ void FrameConsoleClient::screenshot(JSC::JSGlobalObject* lexicalGlobalObject, Re +@@ -476,4 +476,12 @@ void FrameConsoleClient::screenshot(JSC::JSGlobalObject* lexicalGlobalObject, Re addMessage(makeUnique(MessageSource::ConsoleAPI, MessageType::Image, MessageLevel::Log, dataURL, ScriptArguments::create(lexicalGlobalObject, WTF::move(adjustedArguments)), lexicalGlobalObject, /* requestIdentifier */ 0, timestamp)); } @@ -4812,10 +4941,10 @@ index 7a6671ff0da0bbec833318a1c37e6280ad9f4255..5a16fa04c515f0c3842d1187eeacc487 WeakRef m_frame; }; diff --git a/Source/WebCore/page/FrameSnapshotting.cpp b/Source/WebCore/page/FrameSnapshotting.cpp -index dd21eb7cd8958c99a153769d26e03a8eb5bed0fb..a94d8b5d2eced11e03f963d3848159914d554ae3 100644 +index 2ab269da2d54786965489c0a07596be3e8784f3c..f0a2cb19308288cec3178a265c7da8cb12b73ace 100644 --- a/Source/WebCore/page/FrameSnapshotting.cpp +++ b/Source/WebCore/page/FrameSnapshotting.cpp -@@ -121,7 +121,7 @@ RefPtr snapshotFrameRectWithClip(LocalFrame& frame, const IntRect& +@@ -123,7 +123,7 @@ RefPtr snapshotFrameRectWithClip(LocalFrame& frame, const IntRect& // Other paint behaviors are set by paintContentsForSnapshot. frame.view()->setPaintBehavior(paintBehavior); @@ -4824,7 +4953,7 @@ index dd21eb7cd8958c99a153769d26e03a8eb5bed0fb..a94d8b5d2eced11e03f963d384815991 if (options.flags.contains(SnapshotFlags::PaintWith3xBaseScale)) scaleFactor = 3; -@@ -140,6 +140,8 @@ RefPtr snapshotFrameRectWithClip(LocalFrame& frame, const IntRect& +@@ -142,6 +142,8 @@ RefPtr snapshotFrameRectWithClip(LocalFrame& frame, const IntRect& return nullptr; buffer->context().translate(-imageRect.location()); @@ -4833,7 +4962,7 @@ index dd21eb7cd8958c99a153769d26e03a8eb5bed0fb..a94d8b5d2eced11e03f963d384815991 if (!clipRects.isEmpty()) { Path clipPath; -@@ -148,7 +150,10 @@ RefPtr snapshotFrameRectWithClip(LocalFrame& frame, const IntRect& +@@ -150,7 +152,10 @@ RefPtr snapshotFrameRectWithClip(LocalFrame& frame, const IntRect& buffer->context().clipPath(clipPath); } @@ -4846,19 +4975,28 @@ index dd21eb7cd8958c99a153769d26e03a8eb5bed0fb..a94d8b5d2eced11e03f963d384815991 } diff --git a/Source/WebCore/page/FrameSnapshotting.h b/Source/WebCore/page/FrameSnapshotting.h -index c34982712f798dff6c484e4a4b6b6a9b23905d4a..52da92d68344cd4d734db4565f174bbd05e26ad9 100644 +index 5126a48555a951dd4c705850f619fb6730166eb6..c043cf360a488ad41db6b457baaa5634712fff35 100644 --- a/Source/WebCore/page/FrameSnapshotting.h +++ b/Source/WebCore/page/FrameSnapshotting.h -@@ -60,6 +60,7 @@ enum class SnapshotFlags : uint16_t { - FixedAndStickyLayersOnly = 1 << 12, +@@ -44,7 +44,7 @@ class ImageBuffer; + class LocalFrame; + class Node; + +-enum class SnapshotFlags : uint16_t { ++enum class SnapshotFlags : uint32_t { + ExcludeSelectionHighlighting = 1 << 0, + PaintSelectionOnly = 1 << 1, + InViewCoordinates = 1 << 2, +@@ -61,6 +61,7 @@ enum class SnapshotFlags : uint16_t { DraggableElement = 1 << 13, IncludeDocumentMarkers = 1 << 14, -+ OmitDeviceScaleFactor = 1 << 15, + FastAndLowQualityFilters = 1 << 15, ++ OmitDeviceScaleFactor = 1 << 16, }; struct SnapshotOptions { diff --git a/Source/WebCore/page/History.cpp b/Source/WebCore/page/History.cpp -index 6cde8d25af42de8e96f6aa23dbeedb5abaa7feab..bef6092300de6f6d33c5a9e2a9354e00c200d9ef 100644 +index 4e43a48341c52ac028f48dfdf8620fa75f9eb0d1..bb23998151b69451ff749e0c39c739bc7104f0a5 100644 --- a/Source/WebCore/page/History.cpp +++ b/Source/WebCore/page/History.cpp @@ -35,6 +35,7 @@ @@ -4888,7 +5026,7 @@ index 6cde8d25af42de8e96f6aa23dbeedb5abaa7feab..bef6092300de6f6d33c5a9e2a9354e00 } diff --git a/Source/WebCore/page/LocalFrame.cpp b/Source/WebCore/page/LocalFrame.cpp -index cc2cb6b9918d4059514fb82b124eee533473b75e..dbe0d101ee889090bdfe473268a52fca6818ea6d 100644 +index 80ca45ad29bef4523c42bcc66d4f06083a58b53b..28af933cf7af65579046979b19e19f157dc09d21 100644 --- a/Source/WebCore/page/LocalFrame.cpp +++ b/Source/WebCore/page/LocalFrame.cpp @@ -93,6 +93,7 @@ @@ -4899,7 +5037,7 @@ index cc2cb6b9918d4059514fb82b124eee533473b75e..dbe0d101ee889090bdfe473268a52fca #include "NodeTraversal.h" #include "Page.h" #include "PaymentSession.h" -@@ -227,6 +228,7 @@ LocalFrame::LocalFrame(Page& page, ClientCreator&& clientCreator, FrameIdentifie +@@ -229,6 +230,7 @@ LocalFrame::LocalFrame(Page& page, ClientCreator&& clientCreator, FrameIdentifie void LocalFrame::init() { @@ -4907,7 +5045,7 @@ index cc2cb6b9918d4059514fb82b124eee533473b75e..dbe0d101ee889090bdfe473268a52fca loader().init(); } -@@ -467,7 +469,7 @@ void LocalFrame::orientationChanged() +@@ -462,7 +464,7 @@ void LocalFrame::orientationChanged() IntDegrees LocalFrame::orientation() const { if (RefPtr page = this->page()) @@ -4916,7 +5054,7 @@ index cc2cb6b9918d4059514fb82b124eee533473b75e..dbe0d101ee889090bdfe473268a52fca return 0; } #endif // ENABLE(ORIENTATION_EVENTS) -@@ -1677,7 +1679,6 @@ String LocalFrame::frameURLProtocol() const +@@ -1679,7 +1681,6 @@ String LocalFrame::frameURLProtocol() const return ""_s; } @@ -4924,7 +5062,7 @@ index cc2cb6b9918d4059514fb82b124eee533473b75e..dbe0d101ee889090bdfe473268a52fca static bool nodeIsMouseFocusable(Node& node) { -@@ -1913,7 +1914,7 @@ RefPtr LocalFrame::nodeRespondingToDoubleClickEvent(const FloatPoint& view +@@ -1915,7 +1916,7 @@ RefPtr LocalFrame::nodeRespondingToDoubleClickEvent(const FloatPoint& view for (; node && node != terminationNode; node = node->parentInComposedTree()) { if (!node->hasEventListeners(eventNames().dblclickEvent)) continue; @@ -4933,7 +5071,7 @@ index cc2cb6b9918d4059514fb82b124eee533473b75e..dbe0d101ee889090bdfe473268a52fca if (!node->allowsDoubleTapGesture()) continue; #endif -@@ -1927,7 +1928,6 @@ RefPtr LocalFrame::nodeRespondingToDoubleClickEvent(const FloatPoint& view +@@ -1929,7 +1930,6 @@ RefPtr LocalFrame::nodeRespondingToDoubleClickEvent(const FloatPoint& view return qualifyingNodeAtViewportLocation(viewportLocation, adjustedViewportLocation, WTF::move(ancestorRespondingToDoubleClickEvent), ShouldApproximate::Yes); } @@ -4942,7 +5080,7 @@ index cc2cb6b9918d4059514fb82b124eee533473b75e..dbe0d101ee889090bdfe473268a52fca } // namespace WebCore diff --git a/Source/WebCore/page/LocalFrame.h b/Source/WebCore/page/LocalFrame.h -index 8f81b0ea3fc343e6c214ad566ab4a6d9b95f5c3b..53ac6ea36a6fb13debd0f029f78c4dc4037d24f2 100644 +index 04ba5a1ede9495bad18c532676b2121c09c407d9..614217e465ff12a26f35b69f3f82e8b6d0ce06b4 100644 --- a/Source/WebCore/page/LocalFrame.h +++ b/Source/WebCore/page/LocalFrame.h @@ -29,6 +29,7 @@ @@ -4952,8 +5090,8 @@ index 8f81b0ea3fc343e6c214ad566ab4a6d9b95f5c3b..53ac6ea36a6fb13debd0f029f78c4dc4 +#include #include #include - #include -@@ -129,9 +130,7 @@ enum { + #include +@@ -127,9 +128,7 @@ enum { enum OverflowScrollAction { DoNotPerformOverflowScroll, PerformOverflowScroll }; #endif @@ -4963,7 +5101,7 @@ index 8f81b0ea3fc343e6c214ad566ab4a6d9b95f5c3b..53ac6ea36a6fb13debd0f029f78c4dc4 class LocalFrame final : public Frame { public: -@@ -232,7 +231,6 @@ public: +@@ -230,7 +229,6 @@ public: WEBCORE_EXPORT DataDetectionResultsStorage& dataDetectionResults() LIFETIME_BOUND; #endif @@ -4971,7 +5109,7 @@ index 8f81b0ea3fc343e6c214ad566ab4a6d9b95f5c3b..53ac6ea36a6fb13debd0f029f78c4dc4 RefPtr betterApproximateNode(const IntPoint& testPoint, const NodeQualifier&, Node* best, Node* failedNode, IntPoint& bestPoint, IntRect& bestRect, const IntRect& testRect); WEBCORE_EXPORT RefPtr nodeRespondingToInteraction(const FloatPoint& viewportLocation, FloatPoint& adjustedViewportLocation); -@@ -246,7 +244,6 @@ public: +@@ -244,7 +242,6 @@ public: WEBCORE_EXPORT RefPtr nodeRespondingToDoubleClickEvent(const FloatPoint& viewportLocation, FloatPoint& adjustedViewportLocation); static bool nodeWillRespondToMouseEvents(Node&); @@ -4979,7 +5117,7 @@ index 8f81b0ea3fc343e6c214ad566ab4a6d9b95f5c3b..53ac6ea36a6fb13debd0f029f78c4dc4 #if PLATFORM(IOS_FAMILY) const ViewportArguments& viewportArguments() const LIFETIME_BOUND; -@@ -324,6 +321,7 @@ public: +@@ -322,6 +319,7 @@ public: WEBCORE_EXPORT FloatSize screenSize() const; void setOverrideScreenSize(FloatSize&&); @@ -4987,11 +5125,41 @@ index 8f81b0ea3fc343e6c214ad566ab4a6d9b95f5c3b..53ac6ea36a6fb13debd0f029f78c4dc4 void NODELETE selfOnlyRef(); void selfOnlyDeref(); +diff --git a/Source/WebCore/page/Navigation.cpp b/Source/WebCore/page/Navigation.cpp +index 11edcb95f3bab26b3e1f6ab14a38f058098eac49..2d80fdee2e0df781271c56a7ed8d96f9c0d1532f 100644 +--- a/Source/WebCore/page/Navigation.cpp ++++ b/Source/WebCore/page/Navigation.cpp +@@ -47,6 +47,7 @@ + #include "HTMLFormElement.h" + #include "HistoryController.h" + #include "HistoryItem.h" ++#include "InspectorInstrumentation.h" + #include "JSDOMConvertAny.h" + #include "JSDOMConvertInterface.h" + #include "JSDOMGlobalObject.h" +@@ -1147,6 +1148,8 @@ void Navigation::setupInterceptionState(NavigateEvent& event, NavigationNavigati + // Only notify committed now if there are no handlers to wait for + auto shouldNotifyCommited = event.handlers().isEmpty() ? ShouldNotifyCommitted::Yes : ShouldNotifyCommitted::No; + updateForNavigation(entry->associatedHistoryItem(), navigationType, ShouldCopyStateObjectFromCurrentEntry::No, shouldNotifyCommited); ++ ++ InspectorInstrumentation::didNavigateWithinPage(*frame()); + } + } + } else if (navigationType == NavigationNavigationType::Reload) { +@@ -1155,6 +1158,8 @@ void Navigation::setupInterceptionState(NavigateEvent& event, NavigationNavigati + } else if (navigationType == NavigationNavigationType::Push || navigationType == NavigationNavigationType::Replace) { + auto historyHandling = navigationType == NavigationNavigationType::Replace ? NavigationHistoryBehavior::Replace : NavigationHistoryBehavior::Push; + frame()->loader().updateURLAndHistory(destination.url(), classicHistoryAPIState, historyHandling); ++ ++ InspectorInstrumentation::didNavigateWithinPage(*frame()); + } + } + diff --git a/Source/WebCore/page/Page.cpp b/Source/WebCore/page/Page.cpp -index 4431c7101d9f7637b951eaa80c1b68fa68ce0861..2b76f240f8e49c798dad3593ab4c3c9668e57241 100644 +index a523afe99c8dc4fc5925f2151500bab5eea67dfd..0a8ad0c18660bf9f41a04f662132221e06f634d5 100644 --- a/Source/WebCore/page/Page.cpp +++ b/Source/WebCore/page/Page.cpp -@@ -697,6 +697,44 @@ void Page::setOverrideViewportArguments(const std::optional& +@@ -699,6 +699,44 @@ void Page::setOverrideViewportArguments(const std::optional& localTopDocument->updateViewportArguments(); } @@ -5036,7 +5204,7 @@ index 4431c7101d9f7637b951eaa80c1b68fa68ce0861..2b76f240f8e49c798dad3593ab4c3c96 ScrollingCoordinator* Page::scrollingCoordinator() { if (!m_scrollingCoordinator && m_settings->scrollingCoordinatorEnabled()) { -@@ -4411,6 +4449,26 @@ void Page::setUseDarkAppearanceOverride(std::optional valueOverride) +@@ -4397,6 +4435,26 @@ void Page::setUseDarkAppearanceOverride(std::optional valueOverride) appearanceDidChange(); } @@ -5064,10 +5232,10 @@ index 4431c7101d9f7637b951eaa80c1b68fa68ce0861..2b76f240f8e49c798dad3593ab4c3c96 { if (insets == m_fullscreenInsets) diff --git a/Source/WebCore/page/Page.h b/Source/WebCore/page/Page.h -index 5bfae7e81b70cbd14f12e307bebd5b551f10c18b..ef95a268fd4aeb4ff5a325517386716ab17f257c 100644 +index f3d16a786093631e5eabe981478aeb66e14f2d32..ce7a7cae69455f79057bb0fd671c901939152c8f 100644 --- a/Source/WebCore/page/Page.h +++ b/Source/WebCore/page/Page.h -@@ -413,6 +413,9 @@ public: +@@ -410,6 +410,9 @@ public: const ViewportArguments* overrideViewportArguments() const LIFETIME_BOUND { return m_overrideViewportArguments.get(); } WEBCORE_EXPORT void setOverrideViewportArguments(const std::optional&); @@ -5077,7 +5245,7 @@ index 5bfae7e81b70cbd14f12e307bebd5b551f10c18b..ef95a268fd4aeb4ff5a325517386716a static void refreshPlugins(bool reload); WEBCORE_EXPORT PluginData& pluginData(); void clearPluginData(); -@@ -498,6 +501,10 @@ public: +@@ -496,6 +499,10 @@ public: #if ENABLE(DRAG_SUPPORT) DragController& dragController() LIFETIME_BOUND { return m_dragController.get(); } const DragController& dragController() const LIFETIME_BOUND { return m_dragController.get(); } @@ -5088,7 +5256,7 @@ index 5bfae7e81b70cbd14f12e307bebd5b551f10c18b..ef95a268fd4aeb4ff5a325517386716a #endif FocusController& focusController() const { return m_focusController; } #if ENABLE(CONTEXT_MENUS) -@@ -687,6 +694,10 @@ public: +@@ -685,6 +692,10 @@ public: WEBCORE_EXPORT void setUseColorAppearance(bool useDarkAppearance, bool useElevatedUserInterfaceLevel); bool defaultUseDarkAppearance() const { return m_useDarkAppearance; } void setUseDarkAppearanceOverride(std::optional); @@ -5111,7 +5279,7 @@ index 5bfae7e81b70cbd14f12e307bebd5b551f10c18b..ef95a268fd4aeb4ff5a325517386716a #if ENABLE(DEVICE_ORIENTATION) && PLATFORM(IOS_FAMILY) DeviceOrientationUpdateProvider* deviceOrientationUpdateProvider() const { return m_deviceOrientationUpdateProvider.get(); } #endif -@@ -1484,6 +1500,9 @@ private: +@@ -1490,6 +1506,9 @@ private: #if ENABLE(DRAG_SUPPORT) const UniqueRef m_dragController; @@ -5121,7 +5289,7 @@ index 5bfae7e81b70cbd14f12e307bebd5b551f10c18b..ef95a268fd4aeb4ff5a325517386716a #endif const UniqueRef m_focusController; #if ENABLE(CONTEXT_MENUS) -@@ -1562,6 +1581,8 @@ private: +@@ -1567,6 +1586,8 @@ private: bool m_useElevatedUserInterfaceLevel { false }; bool m_useDarkAppearance { false }; std::optional m_useDarkAppearanceOverride; @@ -5130,7 +5298,7 @@ index 5bfae7e81b70cbd14f12e307bebd5b551f10c18b..ef95a268fd4aeb4ff5a325517386716a #if ENABLE(TEXT_AUTOSIZING) float m_textAutosizingWidth { 0 }; -@@ -1739,6 +1760,11 @@ private: +@@ -1745,6 +1766,11 @@ private: #endif std::unique_ptr m_overrideViewportArguments; @@ -5143,7 +5311,7 @@ index 5bfae7e81b70cbd14f12e307bebd5b551f10c18b..ef95a268fd4aeb4ff5a325517386716a #if ENABLE(DEVICE_ORIENTATION) && PLATFORM(IOS_FAMILY) RefPtr m_deviceOrientationUpdateProvider; diff --git a/Source/WebCore/page/PointerCaptureController.cpp b/Source/WebCore/page/PointerCaptureController.cpp -index e9fa28ab43ecb4f3139791eca2bbb7bd82cfd6e0..8bbb8c76d913c37b60472972eb1647c58622c5a7 100644 +index ca28b7db28b39b711fa9c0a537fa8bb0e22187b0..3f36bd4c2e9c4e860be6cf1717161456df821057 100644 --- a/Source/WebCore/page/PointerCaptureController.cpp +++ b/Source/WebCore/page/PointerCaptureController.cpp @@ -213,7 +213,7 @@ bool PointerCaptureController::preventsCompatibilityMouseEventsForIdentifier(Poi @@ -5155,7 +5323,7 @@ index e9fa28ab43ecb4f3139791eca2bbb7bd82cfd6e0..8bbb8c76d913c37b60472972eb1647c5 static bool hierarchyHasCapturingEventListeners(Element* target, const AtomString& eventName) { for (RefPtr currentNode = target; currentNode; currentNode = currentNode->parentInComposedTree()) { -@@ -574,7 +574,7 @@ void PointerCaptureController::cancelPointer(PointerID pointerId, const IntPoint +@@ -571,7 +571,7 @@ void PointerCaptureController::cancelPointer(PointerID pointerId, const IntPoint capturingData->pendingTargetOverride = nullptr; capturingData->state = CapturingData::State::Cancelled; @@ -5165,7 +5333,7 @@ index e9fa28ab43ecb4f3139791eca2bbb7bd82cfd6e0..8bbb8c76d913c37b60472972eb1647c5 #endif diff --git a/Source/WebCore/page/PointerCaptureController.h b/Source/WebCore/page/PointerCaptureController.h -index bafa2e9995a142e1bc07d506204ff5f14cbeab9c..d06922b691b02699ca89483c6e4e5c43bb49303c 100644 +index 118fc0cbab5550f3aefa01d3c2b9dcd6a57033df..2f4ffa4b957d21ea3b8c0c31f34074e979adf619 100644 --- a/Source/WebCore/page/PointerCaptureController.h +++ b/Source/WebCore/page/PointerCaptureController.h @@ -63,7 +63,7 @@ public: @@ -5177,7 +5345,7 @@ index bafa2e9995a142e1bc07d506204ff5f14cbeab9c..d06922b691b02699ca89483c6e4e5c43 void dispatchEventForTouchAtIndex(EventTarget&, const PlatformTouchEvent&, unsigned, bool isPrimary, WindowProxy&, const DoublePoint&); #endif -@@ -91,12 +91,12 @@ private: +@@ -88,12 +88,12 @@ private: WeakPtr activeDocument; RefPtr pendingTargetOverride; RefPtr targetOverride; @@ -5237,10 +5405,10 @@ index cd1f3ce09ba0ab6e414bfcb12f38918404946700..f78cd1f89fb32ce4b9109c80f1f7c303 } diff --git a/Source/WebCore/page/csp/ContentSecurityPolicy.cpp b/Source/WebCore/page/csp/ContentSecurityPolicy.cpp -index cb4f081221a783cb05b6f65dba5cf338600148d5..88c4adcd84270f24bc4394125d44f34d7b2011c6 100644 +index d79832247cdbc228c21513ee2d76bec47f5d8ff8..cea351e8b6b8016697702967f3bdab8e17ea7f2d 100644 --- a/Source/WebCore/page/csp/ContentSecurityPolicy.cpp +++ b/Source/WebCore/page/csp/ContentSecurityPolicy.cpp -@@ -352,6 +352,8 @@ template +@@ -360,6 +360,8 @@ template bool ContentSecurityPolicy::allPoliciesWithDispositionAllow(Disposition disposition, Predicate&& predicate, Args&&... args) const requires (!std::is_convertible_v) { @@ -5249,7 +5417,7 @@ index cb4f081221a783cb05b6f65dba5cf338600148d5..88c4adcd84270f24bc4394125d44f34d bool isReportOnly = disposition == ContentSecurityPolicy::Disposition::ReportOnly; for (auto& policy : m_policies) { if (policy->isReportOnly() != isReportOnly) -@@ -365,6 +367,8 @@ bool ContentSecurityPolicy::allPoliciesWithDispositionAllow(Disposition disposit +@@ -373,6 +375,8 @@ bool ContentSecurityPolicy::allPoliciesWithDispositionAllow(Disposition disposit template bool ContentSecurityPolicy::allPoliciesWithDispositionAllow(Disposition disposition, ViolatedDirectiveCallback&& callback, Predicate&& predicate, Args&&... args) const { @@ -5258,7 +5426,7 @@ index cb4f081221a783cb05b6f65dba5cf338600148d5..88c4adcd84270f24bc4394125d44f34d bool isReportOnly = disposition == ContentSecurityPolicy::Disposition::ReportOnly; bool isAllowed = true; for (auto& policy : m_policies) { -@@ -381,6 +385,8 @@ bool ContentSecurityPolicy::allPoliciesWithDispositionAllow(Disposition disposit +@@ -389,6 +393,8 @@ bool ContentSecurityPolicy::allPoliciesWithDispositionAllow(Disposition disposit template bool ContentSecurityPolicy::allPoliciesAllow(NOESCAPE const ViolatedDirectiveCallback& callback, Predicate&& predicate, Args&&... args) const { @@ -5380,7 +5548,7 @@ index 9e2964b6e5f27f3a9c9f39e95b37de574cd52b1b..20e211ebc0217e6f4e66118fd98a7eb4 bool m_disallowFileAccess { false }; }; diff --git a/Source/WebCore/platform/Pasteboard.h b/Source/WebCore/platform/Pasteboard.h -index e4117f5fd101b2eb995fde1f27b1201827b894ea..1dcd26ce5381e0703b25cbb90f4104f9d1dc1eba 100644 +index d9385d5b78da7bc44fca6de52ff68f73726cd80b..81e810655b1b5e1ee1218e5606cc58ba34a57ed3 100644 --- a/Source/WebCore/platform/Pasteboard.h +++ b/Source/WebCore/platform/Pasteboard.h @@ -322,6 +322,7 @@ public: @@ -5412,10 +5580,10 @@ index 071f9fa0e6cfaa84d9b077e39a64bec9361ead9a..fdd0ec667cc7e2f59bd2d21c5c381ae5 #endif diff --git a/Source/WebCore/platform/PlatformScreen.cpp b/Source/WebCore/platform/PlatformScreen.cpp -index eac5bf40c150dba990c13775db0ae9e10f883574..563106c0d9fb259c2171aedd5d57efbf81049cc9 100644 +index 2f0f8a0c34ee8af144ef7b8787cae5f7eac9cf45..454f2a08ebddb21c4980a684697836b21f1f098f 100644 --- a/Source/WebCore/platform/PlatformScreen.cpp +++ b/Source/WebCore/platform/PlatformScreen.cpp -@@ -85,3 +85,24 @@ OptionSet screenContentsFormatsForTesting() +@@ -128,3 +128,24 @@ void PlatformScreen::updateSingletonContentsFormatsForTesting(OptionSet& touchPoints) { m_touchPoints = touchPoints; } diff --git a/Source/WebCore/platform/adwaita/AdwaitaScrollbarPainter.h b/Source/WebCore/platform/adwaita/AdwaitaScrollbarPainter.h -index a251b8f6a5e05997594a2962e7fcb3fab49a27b2..fd95b909650098869d44c8860a525051fc6996f8 100644 +index 6bf01bfe47a8802f53435afc946d5208c7d55533..ebc7558fdb9db1046f5d9f52b4cecc6e5057828e 100644 --- a/Source/WebCore/platform/adwaita/AdwaitaScrollbarPainter.h +++ b/Source/WebCore/platform/adwaita/AdwaitaScrollbarPainter.h -@@ -36,7 +36,7 @@ class GraphicsContext; +@@ -37,7 +37,7 @@ class GraphicsContext; namespace AdwaitaScrollbarPainter { @@ -5571,18 +5739,18 @@ index 775df102268b397e6c96e8b93296a7dbe6afcd26..cdbb7b79bde8ba30bc2b0f6bb579b44d // Determine the string for this item. const char16_t* str = cp.data() + items[i].iCharPos; diff --git a/Source/WebCore/platform/gtk/PlatformScreenGtk.cpp b/Source/WebCore/platform/gtk/PlatformScreenGtk.cpp -index 98d93889a1b97450fde21cee53e45111b622dca7..9362518e8351eb8fe5b30a2d7875417bb3da770d 100644 +index 0b4e0487f2288673918cdebdd13b70f5df4391a5..626679fa93f05c5a667fdcd6191128d915f4f988 100644 --- a/Source/WebCore/platform/gtk/PlatformScreenGtk.cpp +++ b/Source/WebCore/platform/gtk/PlatformScreenGtk.cpp -@@ -121,7 +121,7 @@ bool screenSupportsExtendedColor(Widget*) +@@ -127,7 +127,7 @@ bool screenSupportsExtendedColor(Widget*) } #if ENABLE(TOUCH_EVENTS) -bool screenHasTouchDevice() +bool platformScreenHasTouchDevice() { - return getScreenProperties().screenHasTouchDevice; - } + Ref platformScreen = PlatformScreen::singleton(); + return platformScreen->screenProperties().screenHasTouchDevice; diff --git a/Source/WebCore/platform/libwpe/PlatformKeyboardEventLibWPE.cpp b/Source/WebCore/platform/libwpe/PlatformKeyboardEventLibWPE.cpp index ee7238303b628d0be016c80e391fe8edb9de1439..dc3b000902cd7d8344ed3a16f49f57766864dd47 100644 --- a/Source/WebCore/platform/libwpe/PlatformKeyboardEventLibWPE.cpp @@ -5996,7 +6164,7 @@ index 0640345cf5f133b7f84d3e32b272871d9beff519..320dce768def18327ee25e889109cd6d WEBCORE_EXPORT HTTPCookieAcceptPolicy cookieAcceptPolicy() const; WEBCORE_EXPORT void setCookie(const Cookie&); diff --git a/Source/WebCore/platform/network/ResourceResponseBase.cpp b/Source/WebCore/platform/network/ResourceResponseBase.cpp -index e413db463376bcf31da4cd0f8e2f869f4b6a0a95..6d43a62553f3e82968964a89608a121a72bc3d74 100644 +index 8c5d3ca76595bdac8127b85901c1417b45e11210..77230ddedeb32d90edf610ac4479d24c41e6d1bd 100644 --- a/Source/WebCore/platform/network/ResourceResponseBase.cpp +++ b/Source/WebCore/platform/network/ResourceResponseBase.cpp @@ -21,7 +21,7 @@ @@ -6008,7 +6176,7 @@ index e413db463376bcf31da4cd0f8e2f869f4b6a0a95..6d43a62553f3e82968964a89608a121a */ #include "config.h" -@@ -77,6 +77,7 @@ ResourceResponseBase::ResourceResponseBase(std::optional&& +@@ -78,6 +78,7 @@ ResourceResponseBase::ResourceResponseBase(std::optional&& , m_httpStatusText(data ? WTF::move(data->httpStatusText) : String { }) , m_httpVersion(data ? WTF::move(data->httpVersion) : String { }) , m_httpHeaderFields(data ? WTF::move(data->httpHeaderFields) : HTTPHeaderMap { }) @@ -6016,7 +6184,7 @@ index e413db463376bcf31da4cd0f8e2f869f4b6a0a95..6d43a62553f3e82968964a89608a121a , m_networkLoadMetrics(data && data->networkLoadMetrics ? Box::create(WTF::move(*data->networkLoadMetrics)) : Box { }) , m_certificateInfo(data ? WTF::move(data->certificateInfo) : std::nullopt) , m_httpStatusCode(data ? data->httpStatusCode : 0) -@@ -277,7 +278,7 @@ const String& ResourceResponseBase::mimeType() const +@@ -278,7 +279,7 @@ const String& ResourceResponseBase::mimeType() const { lazyInit(CommonFieldsOnly); @@ -6025,7 +6193,7 @@ index e413db463376bcf31da4cd0f8e2f869f4b6a0a95..6d43a62553f3e82968964a89608a121a } void ResourceResponseBase::setMimeType(String&& mimeType) -@@ -291,7 +292,7 @@ void ResourceResponseBase::setMimeType(String&& mimeType) +@@ -292,7 +293,7 @@ void ResourceResponseBase::setMimeType(String&& mimeType) // FIXME: Should invalidate or update platform response if present. } @@ -6034,7 +6202,7 @@ index e413db463376bcf31da4cd0f8e2f869f4b6a0a95..6d43a62553f3e82968964a89608a121a { lazyInit(CommonFieldsOnly); -@@ -304,7 +305,7 @@ void ResourceResponseBase::setExpectedContentLength(long long expectedContentLen +@@ -305,7 +306,7 @@ void ResourceResponseBase::setExpectedContentLength(long long expectedContentLen m_isNull = false; // FIXME: Content length is determined by HTTP Content-Length header. We should update the header, so that it doesn't disagree with m_expectedContentLength. @@ -6161,7 +6329,7 @@ index e413db463376bcf31da4cd0f8e2f869f4b6a0a95..6d43a62553f3e82968964a89608a121a *source, *type, diff --git a/Source/WebCore/platform/network/ResourceResponseBase.h b/Source/WebCore/platform/network/ResourceResponseBase.h -index ef0c552143191b48c1a52a0702c7596da349eff4..b69149fef86c536d95dd01c39da64f719b86e89d 100644 +index a1e2bc02c8b9803f29c9896067b5a36ffef74970..05476499c284130c65aff44691ffa8f11365ab6a 100644 --- a/Source/WebCore/platform/network/ResourceResponseBase.h +++ b/Source/WebCore/platform/network/ResourceResponseBase.h @@ -21,7 +21,7 @@ @@ -6173,7 +6341,7 @@ index ef0c552143191b48c1a52a0702c7596da349eff4..b69149fef86c536d95dd01c39da64f71 */ #pragma once -@@ -228,9 +228,9 @@ public: +@@ -226,9 +226,9 @@ public: WEBCORE_EXPORT bool containsInvalidHTTPHeaders() const; WEBCORE_EXPORT static ResourceResponse dataURLResponse(const URL&, const DataURLDecoder::Result&); @@ -6185,7 +6353,7 @@ index ef0c552143191b48c1a52a0702c7596da349eff4..b69149fef86c536d95dd01c39da64f71 WEBCORE_EXPORT std::optional getResponseData() const; protected: -@@ -265,6 +265,11 @@ protected: +@@ -263,6 +263,11 @@ protected: String m_httpStatusText; String m_httpVersion; HTTPHeaderMap m_httpHeaderFields; @@ -6197,7 +6365,7 @@ index ef0c552143191b48c1a52a0702c7596da349eff4..b69149fef86c536d95dd01c39da64f71 Box m_networkLoadMetrics; mutable std::optional m_certificateInfo; -@@ -308,7 +313,7 @@ struct ResourceResponseData { +@@ -306,7 +311,7 @@ struct ResourceResponseData { ResourceResponseData() = default; ResourceResponseData(ResourceResponseData&&) = default; ResourceResponseData& operator=(ResourceResponseData&&) = default; @@ -6206,7 +6374,7 @@ index ef0c552143191b48c1a52a0702c7596da349eff4..b69149fef86c536d95dd01c39da64f71 : url(WTF::move(url)) , mimeType(WTF::move(mimeType)) , expectedContentLength(expectedContentLength) -@@ -317,6 +322,7 @@ struct ResourceResponseData { +@@ -315,6 +320,7 @@ struct ResourceResponseData { , httpStatusText(WTF::move(httpStatusText)) , httpVersion(WTF::move(httpVersion)) , httpHeaderFields(WTF::move(httpHeaderFields)) @@ -6214,7 +6382,7 @@ index ef0c552143191b48c1a52a0702c7596da349eff4..b69149fef86c536d95dd01c39da64f71 , networkLoadMetrics(WTF::move(networkLoadMetrics)) , source(source) , type(type) -@@ -341,6 +347,7 @@ struct ResourceResponseData { +@@ -339,6 +345,7 @@ struct ResourceResponseData { String httpStatusText; String httpVersion; HTTPHeaderMap httpHeaderFields; @@ -6223,7 +6391,7 @@ index ef0c552143191b48c1a52a0702c7596da349eff4..b69149fef86c536d95dd01c39da64f71 ResourceResponseBase::Source source; ResourceResponseBase::Type type; diff --git a/Source/WebCore/platform/network/cocoa/NetworkStorageSessionCocoa.mm b/Source/WebCore/platform/network/cocoa/NetworkStorageSessionCocoa.mm -index 3ed98966972014b88f2a4ca24ea615717a9a812c..7b75b20a84474ac8f227666d2d8305a60c1923f5 100644 +index 7b992ba6167f49f41841d907bce45f70c99417f9..f3c7f7fc3db242a6b18f52ab9a16c845be9a11da 100644 --- a/Source/WebCore/platform/network/cocoa/NetworkStorageSessionCocoa.mm +++ b/Source/WebCore/platform/network/cocoa/NetworkStorageSessionCocoa.mm @@ -582,6 +582,27 @@ bool NetworkStorageSession::setCookieFromDOM(const URL& firstParty, const SameSi @@ -6267,6 +6435,93 @@ index 96e0a63b347c170c963bc7e851f383b91665c5c8..2f0afc26bcc87e9440e201728778892b String m_databasePath; bool m_detectedDatabaseCorruption { false }; +diff --git a/Source/WebCore/platform/network/curl/CurlContext.cpp b/Source/WebCore/platform/network/curl/CurlContext.cpp +index 145c3e2b04c8120d80d07159bcc2db91de328352..2f8eae1a79cca273ec1e5abe9333813a66edc774 100644 +--- a/Source/WebCore/platform/network/curl/CurlContext.cpp ++++ b/Source/WebCore/platform/network/curl/CurlContext.cpp +@@ -437,6 +437,11 @@ void CurlHandle::appendRequestHeaders(const HTTPHeaderMap& headers) + } + } + ++static bool isProxyHeader(const String& name) ++{ ++ return startsWithLettersIgnoringASCIICase(name, "proxy-"_s); ++} ++ + void CurlHandle::appendRequestHeader(const String& name, const String& value) + { + String header; +@@ -448,14 +453,20 @@ void CurlHandle::appendRequestHeader(const String& name, const String& value) + header = makeString(name, ": "_s, value); + } + +- appendRequestHeader(WTF::move(header)); ++ if (isProxyHeader(name)) ++ appendProxyRequestHeader(WTF::move(header)); ++ else ++ appendRequestHeader(WTF::move(header)); + } + + void CurlHandle::removeRequestHeader(const String& name) + { +- // Add a header with no content, the internally used header will get disabled. ++ // Add a header with no content, the internally used header will get disabled. + auto header = makeString(name, ':'); +- appendRequestHeader(WTF::move(header)); ++ if (isProxyHeader(name)) ++ appendProxyRequestHeader(WTF::move(header)); ++ else ++ appendRequestHeader(WTF::move(header)); + } + + void CurlHandle::appendRequestHeader(const String& header) +@@ -477,6 +488,25 @@ void CurlHandle::enableRequestHeaders() + curl_easy_setopt(m_handle, CURLOPT_HTTPHEADER, headers); + } + ++void CurlHandle::appendProxyRequestHeader(String&& header) ++{ ++ bool needToEnable = m_proxyRequestHeaders.isEmpty(); ++ ++ m_proxyRequestHeaders.append(header); ++ ++ if (needToEnable) ++ enableProxyRequestHeaders(); ++} ++ ++void CurlHandle::enableProxyRequestHeaders() ++{ ++ if (m_proxyRequestHeaders.isEmpty()) ++ return; ++ ++ const struct curl_slist* headers = m_proxyRequestHeaders.head(); ++ curl_easy_setopt(m_handle, CURLOPT_PROXYHEADER, headers); ++} ++ + void CurlHandle::enableHttp() + { + auto isHttp2Enabled = CurlContext::singleton().isHttp2Enabled(); +diff --git a/Source/WebCore/platform/network/curl/CurlContext.h b/Source/WebCore/platform/network/curl/CurlContext.h +index 807138b0202ea76b5b505e47ac4dd0064364f129..4f39f0f5105d7c807dc67f70fbe6100c94d6968d 100644 +--- a/Source/WebCore/platform/network/curl/CurlContext.h ++++ b/Source/WebCore/platform/network/curl/CurlContext.h +@@ -328,6 +328,8 @@ private: + }; + + void enableRequestHeaders(); ++ void appendProxyRequestHeader(String&&); ++ void enableProxyRequestHeaders(); + + static CURLcode willSetupSslCtxCallback(CURL*, void* sslCtx, void* userData); + CURLcode willSetupSslCtx(void* sslCtx); +@@ -340,6 +342,7 @@ private: + URL m_url; + CurlSList m_localhostAlias; + CurlSList m_requestHeaders; ++ CurlSList m_proxyRequestHeaders; + + std::unique_ptr m_sslVerifier; + std::unique_ptr m_tlsConnectionInfo; diff --git a/Source/WebCore/platform/network/curl/NetworkStorageSessionCurl.cpp b/Source/WebCore/platform/network/curl/NetworkStorageSessionCurl.cpp index 5a78d6c775542cd62d3b192dc60972fdbea92270..5dab0edfef83cc1672012d94bcb4d6390b91bc97 100644 --- a/Source/WebCore/platform/network/curl/NetworkStorageSessionCurl.cpp @@ -6352,7 +6607,7 @@ index 8e6023c5f1200884723bd0871bf602ba4a37ad04..582365cfb1c9a109308d0133922ee4d2 ReleaseStgMedium(&store); } diff --git a/Source/WebCore/platform/win/ClipboardUtilitiesWin.h b/Source/WebCore/platform/win/ClipboardUtilitiesWin.h -index 61624f0c555886e11a82e933aa89a093b5273693..4471b458941d3394d99f85e983cf0d86e1a562d3 100644 +index 6ffe5f9345576be626ded3470c74a0ff661af98b..dbcfc108a67d580d6f6ab7cb3125973ebab3e613 100644 --- a/Source/WebCore/platform/win/ClipboardUtilitiesWin.h +++ b/Source/WebCore/platform/win/ClipboardUtilitiesWin.h @@ -34,6 +34,7 @@ namespace WebCore { @@ -6416,7 +6671,7 @@ index f6c0cc49e9c39686bb5a5b36c29762173f2b4d1f..f396b564ee4aa7203d1728ff84608373 OptionSet PlatformKeyboardEvent::currentStateOfModifierKeys() diff --git a/Source/WebCore/platform/win/PasteboardWin.cpp b/Source/WebCore/platform/win/PasteboardWin.cpp -index 89eb26e07f1bc8174ed50f088a1a9e61e227c627..5949b188bf03caa7c35af1966b3879465f2a92f6 100644 +index d079788986aedd2800a9870e9d4325a1d6fe98fe..24c1e2d4493c8afd95bfdfb7a088333427373a77 100644 --- a/Source/WebCore/platform/win/PasteboardWin.cpp +++ b/Source/WebCore/platform/win/PasteboardWin.cpp @@ -1145,7 +1145,21 @@ void Pasteboard::writeCustomData(const Vector& data) @@ -6468,10 +6723,10 @@ index 89eb26e07f1bc8174ed50f088a1a9e61e227c627..5949b188bf03caa7c35af1966b387946 + } // namespace WebCore diff --git a/Source/WebCore/rendering/RenderLayerCompositor.cpp b/Source/WebCore/rendering/RenderLayerCompositor.cpp -index 7cf7bbc03d7824b38b097427587367b50978c2c0..00f87e2b8155d18385cd2aae8461c442266634ef 100644 +index e55914e2ddd81f0c5cde874a25fb3677bfe5e518..9644bc8d9242598b3bdd2251ec0927ea20b06d87 100644 --- a/Source/WebCore/rendering/RenderLayerCompositor.cpp +++ b/Source/WebCore/rendering/RenderLayerCompositor.cpp -@@ -1065,8 +1065,10 @@ bool RenderLayerCompositor::updateCompositingLayers(CompositingUpdateType update +@@ -1067,8 +1067,10 @@ bool RenderLayerCompositor::updateCompositingLayers(CompositingUpdateType update return false; } @@ -6483,10 +6738,10 @@ index 7cf7bbc03d7824b38b097427587367b50978c2c0..00f87e2b8155d18385cd2aae8461c442 bool isPageScroll = !updateRootArg || updateRootArg == &rootRenderLayer(); CheckedPtr updateRoot = &rootRenderLayer(); diff --git a/Source/WebCore/rendering/RenderTextControl.cpp b/Source/WebCore/rendering/RenderTextControl.cpp -index 7b1911e2444250e1b87bb9fd9b2d6e1e56fa43f0..fdbb83e5ac55b35390f2bf5f383cff5f7bbcf0ae 100644 +index 6b4d0d81a5f64b78e8a628fa9a8323f465539a1f..9076eec04a892f371cc12d2a59b3c64d48b5755c 100644 --- a/Source/WebCore/rendering/RenderTextControl.cpp +++ b/Source/WebCore/rendering/RenderTextControl.cpp -@@ -244,13 +244,13 @@ void RenderTextControl::layoutExcludedChildren(RelayoutChildren relayoutChildren +@@ -258,13 +258,13 @@ void RenderTextControl::layoutExcludedChildren(RelayoutChildren relayoutChildren } } @@ -6502,7 +6757,7 @@ index 7b1911e2444250e1b87bb9fd9b2d6e1e56fa43f0..fdbb83e5ac55b35390f2bf5f383cff5f { if (auto innerTextElement = this->innerTextElement(); innerTextElement && innerTextElement->renderer()) diff --git a/Source/WebCore/rendering/RenderTextControl.h b/Source/WebCore/rendering/RenderTextControl.h -index 00011d61c20cf7509b03407ecbcc29ce2da0ccca..d939e62c37573487cf4df7a16cf6201b5400cf0c 100644 +index 4d3cc813b6dfe35c26ae57d6d8221754e79ce10e..8d2c14fa19dab737fdfd1ad4fffc3c309e24f36b 100644 --- a/Source/WebCore/rendering/RenderTextControl.h +++ b/Source/WebCore/rendering/RenderTextControl.h @@ -38,8 +38,8 @@ public: @@ -6516,10 +6771,10 @@ index 00011d61c20cf7509b03407ecbcc29ce2da0ccca..d939e62c37573487cf4df7a16cf6201b #endif diff --git a/Source/WebCore/workers/WorkerConsoleClient.cpp b/Source/WebCore/workers/WorkerConsoleClient.cpp -index fe03d2c8d0625725e07a2aa0eef3a0d9127cf211..9c661ee5f91766bb6d903cfd25f3c7a43d9f3538 100644 +index 03a2f715a535fc93c035076a07ec2047cd16ef49..db27ba21ede7d96c3635dab610fad619316f02dc 100644 --- a/Source/WebCore/workers/WorkerConsoleClient.cpp +++ b/Source/WebCore/workers/WorkerConsoleClient.cpp -@@ -257,4 +257,6 @@ void WorkerConsoleClient::screenshot(JSC::JSGlobalObject* lexicalGlobalObject, R +@@ -260,4 +260,6 @@ void WorkerConsoleClient::screenshot(JSC::JSGlobalObject* lexicalGlobalObject, R InspectorInstrumentation::addMessageToConsole(protect(globalScope()), makeUnique(MessageSource::ConsoleAPI, MessageType::Image, MessageLevel::Log, dataURL, ScriptArguments::create(lexicalGlobalObject, WTF::move(adjustedArguments)), lexicalGlobalObject, /* requestIdentifier */ 0, timestamp)); } @@ -6539,7 +6794,7 @@ index 60e744703647b7593426c59814975bf12dc4ebaa..d5156a30396fb2ad7e73c5c5429a07d5 WorkerOrWorkletGlobalScope& globalScope() { return m_globalScope; } diff --git a/Source/WebGPU/WGSL/UniformityAnalysis.cpp b/Source/WebGPU/WGSL/UniformityAnalysis.cpp -index 85806067d986a7f9047708500e1c510fd0df1834..39e066e5882c4fbe8f7b31bfa5d62e3188761709 100644 +index e8032692ff9b48bfe6994c4202b7c67993aee5da..3da1878782599d7dca9dcac47b023f674913c365 100644 --- a/Source/WebGPU/WGSL/UniformityAnalysis.cpp +++ b/Source/WebGPU/WGSL/UniformityAnalysis.cpp @@ -118,8 +118,10 @@ struct FunctionInfo { @@ -6565,7 +6820,7 @@ index 85806067d986a7f9047708500e1c510fd0df1834..39e066e5882c4fbe8f7b31bfa5d62e31 info.cfStart = info.createNode(); diff --git a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp b/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp -index 964de6c27cb21b49ba83e54ce80c96bad7081d5e..3f6d6bd758205cc8a3922c7c5be5bc44979868a9 100644 +index 3c29eca336f76ad99a2680552f8fef67331493af..550bbd001147a0468ae3a22426a29104867d6ea3 100644 --- a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp +++ b/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp @@ -99,6 +99,8 @@ @@ -6577,7 +6832,7 @@ index 964de6c27cb21b49ba83e54ce80c96bad7081d5e..3f6d6bd758205cc8a3922c7c5be5bc44 #include #include #endif -@@ -1318,6 +1320,14 @@ void NetworkConnectionToWebProcess::clearPageSpecificData(PageIdentifier pageID) +@@ -1332,6 +1334,14 @@ void NetworkConnectionToWebProcess::clearPageSpecificData(PageIdentifier pageID) storageSession->clearPageSpecificDataForResourceLoadStatistics(pageID); } @@ -6593,7 +6848,7 @@ index 964de6c27cb21b49ba83e54ce80c96bad7081d5e..3f6d6bd758205cc8a3922c7c5be5bc44 { if (CheckedPtr storageSession = m_networkProcess->storageSession(m_sessionID)) diff --git a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h b/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h -index 5d24c2e36dcdbee25a0bb005bf0a20963d442a31..aff9bb1a0a64d689e15f7be57bed9e5bec80be6a 100644 +index d367a92d9859dcc686f1fa020471d04821a5f4fe..3ccd6bfd43cd735c48cff2df68feb2db4900ba23 100644 --- a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h +++ b/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h @@ -399,6 +399,8 @@ private: @@ -6606,10 +6861,10 @@ index 5d24c2e36dcdbee25a0bb005bf0a20963d442a31..aff9bb1a0a64d689e15f7be57bed9e5b void logUserInteraction(RegistrableDomain&&); diff --git a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in b/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in -index 6f43a9c68ee5c247184e327bdda83ce65df444f5..b34971ca9e296106dda574f165c4f28d157ecdc6 100644 +index 7881aacfe9a52a3375173727e061000bd75a0fcc..3740b503f84992c48f175a6354d27242af9a3d52 100644 --- a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in +++ b/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in -@@ -83,6 +83,8 @@ messages -> NetworkConnectionToWebProcess WantsDispatchMessage { +@@ -85,6 +85,8 @@ messages -> NetworkConnectionToWebProcess WantsDispatchMessage { ClearPageSpecificData(WebCore::PageIdentifier pageID); @@ -6619,10 +6874,10 @@ index 6f43a9c68ee5c247184e327bdda83ce65df444f5..b34971ca9e296106dda574f165c4f28d LogUserInteraction(WebCore::RegistrableDomain domain) ResourceLoadStatisticsUpdated(Vector statistics) -> () diff --git a/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm b/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm -index 446f6d91016132ceb2a28122990e844e4576ed4c..0886e0642ac2353de9184b12b8a0d23d6f0f0fd3 100644 +index 9dd97c0cb8685f61f9a6d8a5dcb5748716a1037e..3588f4911b7d9151e5bcf4f166b4e9879ccb81f5 100644 --- a/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm +++ b/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm -@@ -894,6 +894,14 @@ - (void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)data +@@ -896,6 +896,14 @@ - (void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)data resourceResponse.setDeprecatedNetworkLoadMetrics(WebCore::copyTimingData(taskMetrics.get(), networkDataTask->networkLoadMetrics())); resourceResponse.setProxyName(WTF::move(proxyName)); @@ -6650,10 +6905,10 @@ index 0a2c25f815f594b2de6168ffd8b083c625e42e1f..682c4584f34d6fab8b576b331561102d handleCookieHeaders(request.resourceRequest(), receivedResponse); diff --git a/Source/WebKit/NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in b/Source/WebKit/NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in -index b0a007b87d78f871b00db3bd37b5f5116b9d72f6..2dc529916b8b833284898107c0d942aedd3000d9 100644 +index 9185d134cdc35b19517b5ad22a84bb1152550dc9..5ae9654b1e051d0e562c48d134ec810438ca18e4 100644 --- a/Source/WebKit/NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in +++ b/Source/WebKit/NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in -@@ -451,9 +451,11 @@ +@@ -446,9 +446,11 @@ ;; FIXME: This should be removed when is fixed. ;; Restrict AppSandboxed processes from creating /Library/Keychains, but allow access to the contents of /Library/Keychains: @@ -6669,10 +6924,10 @@ index b0a007b87d78f871b00db3bd37b5f5116b9d72f6..2dc529916b8b833284898107c0d942ae ;; Except deny access to new-style iOS Keychain folders which are UUIDs. (deny file-read* file-write* diff --git a/Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp b/Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp -index f7edb09dfd0bcee4b60f4bf8ce16f8cbeea937f8..1c10fb6ea21b897015a5c0092fc8f6cd4fb34c0c 100644 +index a9221bc3fb2964776efd2861b906d681f3e90946..9ea9cbaf290b4e74b558959c3af82cff49c3b3b6 100644 --- a/Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp +++ b/Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp -@@ -427,6 +427,8 @@ void NetworkDataTaskSoup::didSendRequest(GRefPtr&& inputStream) +@@ -428,6 +428,8 @@ void NetworkDataTaskSoup::didSendRequest(GRefPtr&& inputStream) else m_inputStream = WTF::move(inputStream); @@ -6682,7 +6937,7 @@ index f7edb09dfd0bcee4b60f4bf8ce16f8cbeea937f8..1c10fb6ea21b897015a5c0092fc8f6cd } diff --git a/Source/WebKit/PlatformWPE.cmake b/Source/WebKit/PlatformWPE.cmake -index f98ae19e9c5fa4b0601572de46b1e0a1c62e92d8..747157cb6b47441ed2c1ca89465c81a89acc7f2a 100644 +index 581e3978a8a66c5b7fd28c877f4b311fbb8381a9..407888510c73788102c3c8e46ab64a9b87c68f88 100644 --- a/Source/WebKit/PlatformWPE.cmake +++ b/Source/WebKit/PlatformWPE.cmake @@ -227,6 +227,7 @@ set(WPE_API_HEADER_TEMPLATES @@ -6694,10 +6949,10 @@ index f98ae19e9c5fa4b0601572de46b1e0a1c62e92d8..747157cb6b47441ed2c1ca89465c81a8 if (ENABLE_2022_GLIB_API) diff --git a/Source/WebKit/PlatformWin.cmake b/Source/WebKit/PlatformWin.cmake -index 86a1febedca9fcbe7203db8cec94e8db1ef25a43..efdc87688149706c783906b643489fbe695d61d2 100644 +index 1003cc3cc60a91e27166ba0891fa63c2d0c27d4c..5d2e09bf814902341a72f4a1cad70a43d0a9b60a 100644 --- a/Source/WebKit/PlatformWin.cmake +++ b/Source/WebKit/PlatformWin.cmake -@@ -54,8 +54,13 @@ list(APPEND WebKit_SOURCES +@@ -55,8 +55,13 @@ list(APPEND WebKit_SOURCES UIProcess/win/AutomationClientWin.cpp UIProcess/win/AutomationSessionClientWin.cpp @@ -6711,7 +6966,7 @@ index 86a1febedca9fcbe7203db8cec94e8db1ef25a43..efdc87688149706c783906b643489fbe UIProcess/win/WebPageProxyWin.cpp UIProcess/win/WebPopupMenuProxyWin.cpp UIProcess/win/WebProcessPoolWin.cpp -@@ -71,6 +76,7 @@ list(APPEND WebKit_SOURCES +@@ -72,6 +77,7 @@ list(APPEND WebKit_SOURCES WebProcess/MediaCache/WebMediaKeyStorageManager.cpp WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp @@ -6732,10 +6987,10 @@ index 5c7a6999176357ad21ca673db75363f27cf33790..faa9a55d561a185a659519bcaa5a1026 #import #import diff --git a/Source/WebKit/Shared/AuxiliaryProcess.h b/Source/WebKit/Shared/AuxiliaryProcess.h -index 04ffbae16bdfe24465e635afce7f5042073158a0..9c87adff05fcdc47fb15cc4bcac86c26882c6e3e 100644 +index 664988a9998acec84a7b2b767b0c6d66a638322c..fb97365201c36db3a1e0da58a93e4e3a64d4f7f9 100644 --- a/Source/WebKit/Shared/AuxiliaryProcess.h +++ b/Source/WebKit/Shared/AuxiliaryProcess.h -@@ -216,6 +216,11 @@ struct AuxiliaryProcessInitializationParameters { +@@ -215,6 +215,11 @@ struct AuxiliaryProcessInitializationParameters { IPC::Connection::Identifier connectionIdentifier; HashMap extraInitializationData; WTF::AuxiliaryProcessType processType; @@ -6834,10 +7089,10 @@ index b5361fedd7d921f512956d20819c49d425221080..3628908eeaba9dda7c19ded41b6da6e5 NSEvent* nativeEvent() const { return m_nativeEvent.get(); } #elif PLATFORM(GTK) diff --git a/Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in b/Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in -index 2ced21e6c88f5ee6f78c8ac44d9ebd9a670507bb..9ef1b28fd00dfe6b5e802b117f597c55a5878108 100644 +index 9322ebc1c7d35e2c17375ee674af6c9d421c5b03..17e37b130d0538461ce86f9e1ce20aa339560e55 100644 --- a/Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in +++ b/Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in -@@ -2732,6 +2732,9 @@ class WebCore::AuthenticationChallenge { +@@ -2743,6 +2743,9 @@ class WebCore::AuthenticationChallenge { class WebCore::DragData { #if PLATFORM(COCOA) String pasteboardName(); @@ -6847,7 +7102,7 @@ index 2ced21e6c88f5ee6f78c8ac44d9ebd9a670507bb..9ef1b28fd00dfe6b5e802b117f597c55 #endif WebCore::IntPoint clientPosition(); WebCore::IntPoint globalPosition(); -@@ -3164,6 +3167,7 @@ enum class WebCore::WasPrivateRelayed : bool; +@@ -3175,6 +3178,7 @@ enum class WebCore::WasPrivateRelayed : bool; String httpStatusText; String httpVersion; WebCore::HTTPHeaderMap httpHeaderFields; @@ -6981,10 +7236,10 @@ index 3accf5c66062f746029665e4a9ef970418784df2..e16205860562432eedeb017d354cd0c9 void setPosition(const WebCore::DoublePoint& position) { m_position = position; } const WebCore::DoublePoint& globalPosition() const LIFETIME_BOUND { return m_globalPosition; } diff --git a/Source/WebKit/Shared/WebPageCreationParameters.h b/Source/WebKit/Shared/WebPageCreationParameters.h -index d0e04502450eedf0dc1e6104f10fe122edee992e..aaa5dfced49e1f20cbd02da81364dbf0285a04d9 100644 +index 523c1617004315196f6bad9135e0ce19870c4173..4c68eb42fd03a2f3f399818e3398cfb78a837698 100644 --- a/Source/WebKit/Shared/WebPageCreationParameters.h +++ b/Source/WebKit/Shared/WebPageCreationParameters.h -@@ -317,6 +317,9 @@ struct WebPageCreationParameters { +@@ -319,6 +319,9 @@ struct WebPageCreationParameters { WebCore::ShouldRelaxThirdPartyCookieBlocking shouldRelaxThirdPartyCookieBlocking { WebCore::ShouldRelaxThirdPartyCookieBlocking::No }; bool httpsUpgradeEnabled { true }; @@ -6995,10 +7250,10 @@ index d0e04502450eedf0dc1e6104f10fe122edee992e..aaa5dfced49e1f20cbd02da81364dbf0 #if ENABLE(APP_HIGHLIGHTS) WebCore::HighlightVisibility appHighlightsVisible { WebCore::HighlightVisibility::Hidden }; diff --git a/Source/WebKit/Shared/WebPageCreationParameters.serialization.in b/Source/WebKit/Shared/WebPageCreationParameters.serialization.in -index 707a31d075afd590890fb3e0054f256b4a567ac1..55ac3de3488b82b77888101d6677fb76c1b1c00c 100644 +index 578b3ac57d759663efc094a30d29f57d7fd72507..84a3fd354acd057098dae4243835628b2cede1a7 100644 --- a/Source/WebKit/Shared/WebPageCreationParameters.serialization.in +++ b/Source/WebKit/Shared/WebPageCreationParameters.serialization.in -@@ -233,6 +233,9 @@ enum class WebCore::UserInterfaceLayoutDirection : bool; +@@ -234,6 +234,9 @@ enum class WebCore::UserInterfaceLayoutDirection : bool; bool httpsUpgradeEnabled; @@ -7339,11 +7594,11 @@ index b321d93d23d0d1862385b022569dc65323e8691c..ba3bcc9bc20b9512b9288cb2d7e5a3d8 JSC::Config::configureForTesting(); else if (!strcmp(argv[i], "-disable-jit")) diff --git a/Source/WebKit/Sources.txt b/Source/WebKit/Sources.txt -index 382ea8985d8781d7d49f12a90bf0ecc65232985f..ebe6f275fed47f09490052f0548641b1dec4b8f4 100644 +index 1d107e47fea02bdf78144460df5a4e94d629f262..285027ccfba22952b023eb8a137e3ae87730feff 100644 --- a/Source/WebKit/Sources.txt +++ b/Source/WebKit/Sources.txt @@ -403,6 +403,7 @@ UIProcess/AboutSchemeHandler.cpp - UIProcess/AuxiliaryProcessProxy.cpp + UIProcess/AuxiliaryProcessProxy.cpp @cost:4 UIProcess/BackgroundProcessResponsivenessTimer.cpp UIProcess/BrowsingContextGroup.cpp +UIProcess/BrowserInspectorPipe.cpp @@ -7352,12 +7607,12 @@ index 382ea8985d8781d7d49f12a90bf0ecc65232985f..ebe6f275fed47f09490052f0548641b1 UIProcess/DisplayLinkProcessProxyClient.cpp @@ -414,17 +415,21 @@ UIProcess/FrameLoadState.cpp UIProcess/FrameProcess.cpp - UIProcess/GeolocationPermissionRequestManagerProxy.cpp + UIProcess/GeolocationPermissionRequestManagerProxy.cpp @cost:3 UIProcess/GeolocationPermissionRequestProxy.cpp +UIProcess/InspectorDialogAgent.cpp +UIProcess/InspectorPlaywrightAgent.cpp UIProcess/LegacyGlobalSettings.cpp - UIProcess/MediaKeySystemPermissionRequestManagerProxy.cpp + UIProcess/MediaKeySystemPermissionRequestManagerProxy.cpp @cost:4 UIProcess/MediaKeySystemPermissionRequestProxy.cpp UIProcess/OverrideLanguages.cpp UIProcess/PageClient.cpp @@ -7371,38 +7626,38 @@ index 382ea8985d8781d7d49f12a90bf0ecc65232985f..ebe6f275fed47f09490052f0548641b1 +UIProcess/RemoteInspectorPipe.cpp UIProcess/RemotePageDrawingAreaProxy.cpp UIProcess/RemotePageFullscreenManagerProxy.cpp - UIProcess/RemotePagePlaybackSessionManagerProxy.cpp -@@ -472,6 +477,8 @@ UIProcess/WebOpenPanelResultListenerProxy.cpp + UIProcess/RemotePageMediaSessionManagerProxy.cpp +@@ -474,6 +479,8 @@ UIProcess/WebOpenPanelResultListenerProxy.cpp UIProcess/WebPageDiagnosticLoggingClient.cpp UIProcess/WebPageGroup.cpp UIProcess/WebPageInjectedBundleClient.cpp +UIProcess/WebPageInspectorEmulationAgent.cpp +UIProcess/WebPageInspectorInputAgent.cpp UIProcess/WebPageProxy.cpp - UIProcess/WebPageProxyMessageReceiverRegistration.cpp - UIProcess/WebPageProxyTesting.cpp + UIProcess/WebPageProxyMessageReceiverRegistration.cpp @cost:3 + UIProcess/WebPageProxyTesting.cpp @cost:4 @@ -641,6 +648,7 @@ UIProcess/Inspector/WebPageDebuggable.cpp UIProcess/Inspector/WebPageInspectorController.cpp UIProcess/Inspector/Agents/InspectorBrowserAgent.cpp +UIProcess/Inspector/Agents/InspectorScreencastAgent.cpp + UIProcess/Inspector/Agents/ProxyingNetworkAgent.cpp + UIProcess/Inspector/Agents/ProxyingPageAgent.cpp - UIProcess/Media/AudioSessionRoutingArbitratorProxy.cpp - UIProcess/Media/MediaUsageManager.cpp diff --git a/Source/WebKit/SourcesCocoa.txt b/Source/WebKit/SourcesCocoa.txt -index 8f5e05d7905c09452701a390277d8528d3c53170..3ac17db7930b41d33d7e0f6ee9564b997967a8a6 100644 +index 97950c298c16becd2958bdb966efe9748af3c5e4..9bd63968ceb756a9a1f89f4d6091eb10e1774ea2 100644 --- a/Source/WebKit/SourcesCocoa.txt +++ b/Source/WebKit/SourcesCocoa.txt -@@ -286,6 +286,7 @@ UIProcess/API/Cocoa/_WKArchiveExclusionRule.mm @nonARC - UIProcess/API/Cocoa/_WKAttachment.mm @nonARC +@@ -287,6 +287,7 @@ UIProcess/API/Cocoa/_WKAttachment.mm @nonARC UIProcess/API/Cocoa/_WKAutomationSession.mm @nonARC UIProcess/API/Cocoa/_WKAutomationSessionConfiguration.mm @nonARC + UIProcess/API/Cocoa/_WKAutomationSessionTesting.mm @nonARC +UIProcess/API/Cocoa/_WKBrowserInspector.mm @nonARC UIProcess/API/Cocoa/_WKContentRuleListAction.mm @nonARC UIProcess/API/Cocoa/_WKContextMenuElementInfo.mm @nonARC - UIProcess/API/Cocoa/_WKCustomHeaderFields.mm @nonARC @no-unify + UIProcess/API/Cocoa/_WKCustomHeaderFields.mm @nonARC @no-unify-when(bundle<=8) diff --git a/Source/WebKit/SourcesGTK.txt b/Source/WebKit/SourcesGTK.txt -index 4b68f079d9d43d1b0bef8e3b31cd0d6f3a730ae9..3799718e6e5791791335171a8adb0365231501bf 100644 +index f05f1323f3516a4a0e18759c5776cac4778575fb..304d7783165bc9e7f03344d5375c3e83301f3317 100644 --- a/Source/WebKit/SourcesGTK.txt +++ b/Source/WebKit/SourcesGTK.txt @@ -134,6 +134,7 @@ UIProcess/API/glib/WebKitAutomationSession.cpp @no-unify @@ -7428,8 +7683,8 @@ index 4b68f079d9d43d1b0bef8e3b31cd0d6f3a730ae9..3799718e6e5791791335171a8adb0365 +UIProcess/glib/InspectorPlaywrightAgentClientGLib.cpp UIProcess/glib/ScreenManager.cpp UIProcess/glib/SystemSettingsManagerProxy.cpp - UIProcess/glib/WebPageProxyGLib.cpp -@@ -287,9 +290,9 @@ UIProcess/gtk/DisplayX11.cpp @no-unify + UIProcess/glib/TextCheckerGLib.cpp @no-unify +@@ -290,9 +293,9 @@ UIProcess/gtk/DisplayX11.cpp @no-unify UIProcess/gtk/DisplayWayland.cpp @no-unify UIProcess/gtk/GRefPtrGtk.cpp @no-unify UIProcess/gtk/GtkUtilities.cpp @no-unify @@ -7440,7 +7695,7 @@ index 4b68f079d9d43d1b0bef8e3b31cd0d6f3a730ae9..3799718e6e5791791335171a8adb0365 UIProcess/gtk/PointerLockManager.cpp @no-unify UIProcess/gtk/PointerLockManagerWayland.cpp @no-unify UIProcess/gtk/PointerLockManagerX11.cpp @no-unify -@@ -303,6 +306,9 @@ UIProcess/gtk/ViewGestureControllerGtk.cpp +@@ -305,6 +308,9 @@ UIProcess/gtk/ViewGestureControllerGtk.cpp UIProcess/gtk/WebColorPickerGtk.cpp UIProcess/gtk/WebContextMenuProxyGtk.cpp UIProcess/gtk/WebDataListSuggestionsDropdownGtk.cpp @@ -7451,7 +7706,7 @@ index 4b68f079d9d43d1b0bef8e3b31cd0d6f3a730ae9..3799718e6e5791791335171a8adb0365 UIProcess/gtk/WebPasteboardProxyGtk.cpp UIProcess/gtk/WebPopupMenuProxyGtk.cpp diff --git a/Source/WebKit/SourcesWPE.txt b/Source/WebKit/SourcesWPE.txt -index 3d1ed6156127f02614905e30835fa4c6334ae914..fb362b66d00c2081d6eb5380fb2bd7967223f489 100644 +index 2b1d3588fcbbbd9a8a72f259e58aadc282009749..b5a51b3c0339322d8827a9816460ac789635bb70 100644 --- a/Source/WebKit/SourcesWPE.txt +++ b/Source/WebKit/SourcesWPE.txt @@ -138,6 +138,7 @@ UIProcess/API/glib/WebKitAuthenticationRequest.cpp @no-unify @@ -7485,8 +7740,8 @@ index 3d1ed6156127f02614905e30835fa4c6334ae914..fb362b66d00c2081d6eb5380fb2bd796 +UIProcess/glib/InspectorPlaywrightAgentClientGLib.cpp UIProcess/glib/ScreenManager.cpp UIProcess/glib/SystemSettingsManagerProxy.cpp - UIProcess/glib/WebPageProxyGLib.cpp -@@ -284,9 +288,15 @@ UIProcess/soup/WebProcessPoolSoup.cpp + UIProcess/glib/TextCheckerGLib.cpp +@@ -287,9 +291,15 @@ UIProcess/soup/WebProcessPoolSoup.cpp UIProcess/wpe/AcceleratedBackingStore.cpp UIProcess/wpe/DisplayVBlankMonitorWPE.cpp @@ -7659,10 +7914,10 @@ index 026121d114c5fcad84c1396be8d692625beaa3bd..edd6e5cae033124c589959a42522fde0 } #endif diff --git a/Source/WebKit/UIProcess/API/C/WKPage.cpp b/Source/WebKit/UIProcess/API/C/WKPage.cpp -index a14d69ad745f665e6769d0d781e31010b6440e15..2c16da61112a7e8457a4845682453091a1ddfda5 100644 +index 2a30fd22991944ac82a1fa61886d1b0bd55a616c..1e0ab703701bd3550e3929bb8728f83f49671afb 100644 --- a/Source/WebKit/UIProcess/API/C/WKPage.cpp +++ b/Source/WebKit/UIProcess/API/C/WKPage.cpp -@@ -1913,6 +1913,13 @@ void WKPageSetPageUIClient(WKPageRef pageRef, const WKPageUIClientBase* wkClient +@@ -1918,6 +1918,13 @@ void WKPageSetPageUIClient(WKPageRef pageRef, const WKPageUIClientBase* wkClient m_client.addMessageToConsole(toAPI(&page), toAPI(message.impl()), m_client.base.clientInfo); } @@ -7676,7 +7931,7 @@ index a14d69ad745f665e6769d0d781e31010b6440e15..2c16da61112a7e8457a4845682453091 void setStatusText(WebPageProxy* page, const String& text) final { if (!m_client.setStatusText) -@@ -1950,6 +1957,8 @@ void WKPageSetPageUIClient(WKPageRef pageRef, const WKPageUIClientBase* wkClient +@@ -1955,6 +1962,8 @@ void WKPageSetPageUIClient(WKPageRef pageRef, const WKPageUIClientBase* wkClient { if (!m_client.didNotHandleKeyEvent) return; @@ -7686,7 +7941,7 @@ index a14d69ad745f665e6769d0d781e31010b6440e15..2c16da61112a7e8457a4845682453091 } diff --git a/Source/WebKit/UIProcess/API/C/WKPageUIClient.h b/Source/WebKit/UIProcess/API/C/WKPageUIClient.h -index ae4a98c2fe5782eb2356dc8b6b486f6b44db6db3..62b2f3c351fe287af11c1ee2815f1fabe044d537 100644 +index aa395e66a7dee2a08085fcf0041748d062400181..bcfdd3e9a3f469d4c18186d9bcc711afe0d52838 100644 --- a/Source/WebKit/UIProcess/API/C/WKPageUIClient.h +++ b/Source/WebKit/UIProcess/API/C/WKPageUIClient.h @@ -98,6 +98,7 @@ typedef void (*WKPageRunBeforeUnloadConfirmPanelCallback)(WKPageRef page, WKStri @@ -7697,7 +7952,7 @@ index ae4a98c2fe5782eb2356dc8b6b486f6b44db6db3..62b2f3c351fe287af11c1ee2815f1fab typedef void (*WKPageRequestStorageAccessConfirmCallback)(WKPageRef page, WKFrameRef frame, WKStringRef requestingDomain, WKStringRef currentDomain, WKPageRequestStorageAccessConfirmResultListenerRef listener, const void *clientInfo); typedef void (*WKPageTakeFocusCallback)(WKPageRef page, WKFocusDirection direction, const void *clientInfo); typedef void (*WKPageFocusCallback)(WKPageRef page, const void *clientInfo); -@@ -1366,6 +1367,7 @@ typedef struct WKPageUIClientV14 { +@@ -1364,6 +1365,7 @@ typedef struct WKPageUIClientV14 { // Version 14. WKPageRunWebAuthenticationPanelCallback runWebAuthenticationPanel; @@ -7705,46 +7960,46 @@ index ae4a98c2fe5782eb2356dc8b6b486f6b44db6db3..62b2f3c351fe287af11c1ee2815f1fab } WKPageUIClientV14; typedef struct WKPageUIClientV15 { -@@ -1473,6 +1475,7 @@ typedef struct WKPageUIClientV15 { +@@ -1471,6 +1473,7 @@ typedef struct WKPageUIClientV15 { // Version 14. WKPageRunWebAuthenticationPanelCallback runWebAuthenticationPanel; + WKPageHandleJavaScriptDialogCallback handleJavaScriptDialog; // Version 15. - WKPageDecidePolicyForSpeechRecognitionPermissionRequestCallback decidePolicyForSpeechRecognitionPermissionRequest; -@@ -1584,6 +1587,7 @@ typedef struct WKPageUIClientV16 { + void* unused8; // Used to be decidePolicyForSpeechRecognitionPermissionRequest. +@@ -1582,6 +1585,7 @@ typedef struct WKPageUIClientV16 { // Version 14. WKPageRunWebAuthenticationPanelCallback runWebAuthenticationPanel; + WKPageHandleJavaScriptDialogCallback handleJavaScriptDialog; // Version 15. - WKPageDecidePolicyForSpeechRecognitionPermissionRequestCallback decidePolicyForSpeechRecognitionPermissionRequest; -@@ -1698,6 +1702,7 @@ typedef struct WKPageUIClientV17 { + void* unused8; // Used to be decidePolicyForSpeechRecognitionPermissionRequest. +@@ -1696,6 +1700,7 @@ typedef struct WKPageUIClientV17 { // Version 14. WKPageRunWebAuthenticationPanelCallback runWebAuthenticationPanel; + WKPageHandleJavaScriptDialogCallback handleJavaScriptDialog; // Version 15. - WKPageDecidePolicyForSpeechRecognitionPermissionRequestCallback decidePolicyForSpeechRecognitionPermissionRequest; -@@ -1812,6 +1817,7 @@ typedef struct WKPageUIClientV18 { + void* unused8; // Used to be decidePolicyForSpeechRecognitionPermissionRequest. +@@ -1810,6 +1815,7 @@ typedef struct WKPageUIClientV18 { // Version 14. WKPageRunWebAuthenticationPanelCallback runWebAuthenticationPanel; + WKPageHandleJavaScriptDialogCallback handleJavaScriptDialog; // Version 15. - WKPageDecidePolicyForSpeechRecognitionPermissionRequestCallback decidePolicyForSpeechRecognitionPermissionRequest; -@@ -1928,6 +1934,7 @@ typedef struct WKPageUIClientV19 { + void* unused8; // Used to be decidePolicyForSpeechRecognitionPermissionRequest. +@@ -1926,6 +1932,7 @@ typedef struct WKPageUIClientV19 { // Version 14. WKPageRunWebAuthenticationPanelCallback runWebAuthenticationPanel; + WKPageHandleJavaScriptDialogCallback handleJavaScriptDialog; // Version 15. - WKPageDecidePolicyForSpeechRecognitionPermissionRequestCallback decidePolicyForSpeechRecognitionPermissionRequest; + void* unused8; // Used to be decidePolicyForSpeechRecognitionPermissionRequest. diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKUIDelegate.h b/Source/WebKit/UIProcess/API/Cocoa/WKUIDelegate.h index acaeaef1be6d64f16d56d966db12cf9bb1f0507e..bb81783b20e33f69ceef2d00785a2e9c811dabe8 100644 --- a/Source/WebKit/UIProcess/API/Cocoa/WKUIDelegate.h @@ -7776,7 +8031,7 @@ index dcab0400bfdd58f9d16726aba6ce66492f7be34b..a1337cc7ab9f04fea3f51a3003fdb946 NS_ASSUME_NONNULL_END diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm b/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm -index 632bf6f982628fe174eac150b36a10c1d7677b09..09f3075420aa9aa84a93c40533d3eea7acbdc587 100644 +index 74bb3649a58725889cdb8d61988b2e9159fdb7fb..512804cde9c46d4eb9193bc402166638e10fdf31 100644 --- a/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm +++ b/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm @@ -57,6 +57,7 @@ @@ -7787,7 +8042,7 @@ index 632bf6f982628fe174eac150b36a10c1d7677b09..09f3075420aa9aa84a93c40533d3eea7 #import #import #import -@@ -532,6 +533,11 @@ - (void)removeDataOfTypes:(NSSet *)dataTypes modifiedSince:(NSDate *)date comple +@@ -510,6 +511,11 @@ - (void)removeDataOfTypes:(NSSet *)dataTypes modifiedSince:(NSDate *)date comple }); } @@ -8206,7 +8461,7 @@ index 0000000000000000000000000000000000000000..e0b1da48465c850f541532ed961d1b77 +WebKit::WebPageProxy* webkitBrowserInspectorCreateNewPageInContext(WebKitWebContext*); +void webkitBrowserInspectorQuitApplication(); diff --git a/Source/WebKit/UIProcess/API/glib/WebKitProtocolHandler.cpp b/Source/WebKit/UIProcess/API/glib/WebKitProtocolHandler.cpp -index c816d0248895d9aa670e2226798237c696451b45..4d317eb4aaa630a97c03d70e7b15b05460354b01 100644 +index 432afab488fb4bd96640ed218c30065070fe8eda..ba050c8b762e81353d22cf232bf45126af1d16a9 100644 --- a/Source/WebKit/UIProcess/API/glib/WebKitProtocolHandler.cpp +++ b/Source/WebKit/UIProcess/API/glib/WebKitProtocolHandler.cpp @@ -160,51 +160,7 @@ static bool canvasAccelerationEnabled(WebKitURISchemeRequest* request) @@ -8413,7 +8668,7 @@ index c816d0248895d9aa670e2226798237c696451b45..4d317eb4aaa630a97c03d70e7b15b054 return builder.toString(); } #endif -@@ -732,14 +726,18 @@ void WebKitProtocolHandler::handleGPU(WebKitURISchemeRequest* request, RenderPro +@@ -734,14 +728,18 @@ void WebKitProtocolHandler::handleGPU(WebKitURISchemeRequest* request, RenderPro if (showBuffersInfo) { #if PLATFORM(GTK) || (PLATFORM(WPE) && ENABLE(WPE_PLATFORM)) addTableRow(hardwareAccelerationObject, "Renderer"_s, dmabufRendererWithSupportedBuffers()); @@ -8518,7 +8773,7 @@ index c1945fbe717a42afc1f51d64a80c7de3fa9009ba..ab63fe19b00ecbd64c9421e6eecad3e2 #endif +int webkitWebContextExistingCount(); diff --git a/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp b/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp -index 3ed130d4fb0345c7309a240d3a412991e15f9904..10c9c0c89e4a9caf68d8075cde195bbf805e6887 100644 +index d4dadc3f50368a2768fbd2b453bf0b63d2b79e28..0abc5f9bcaee216e61307383afcaa0f5c9c88610 100644 --- a/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp +++ b/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp @@ -40,6 +40,7 @@ @@ -8788,7 +9043,7 @@ index 496079da90993ac37689b060b69ecd4a67c2b6a8..af30181ca922f16c0f6e245c70e5ce7d G_BEGIN_DECLS diff --git a/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp b/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp -index d5bb72f0ffbf99eddebc9819cb3f24fdaffdf468..d248c201e0ee9db63a117b8cde34661595a594fa 100644 +index 12d114c4823bd64b2b836fa76157c44fe8291a07..521db62435bc244e28bd861ce560ff1416d99279 100644 --- a/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp +++ b/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp @@ -2879,6 +2879,11 @@ void webkitWebViewBaseResetClickCounter(WebKitWebViewBase* webkitWebViewBase) @@ -9165,10 +9420,10 @@ index 21131a4d26ba115f3249b227d3e1dabd42398c80..7b1a6e98f3c1fb5ef5d54f416c49ba3e + +PlatformImage webkitWebViewBackendTakeScreenshot(WebKitWebViewBackend*); diff --git a/Source/WebKit/UIProcess/Automation/WebAutomationSession.h b/Source/WebKit/UIProcess/Automation/WebAutomationSession.h -index c38751ae3064aa6a42a3ed8fdb902f70473a8e08..f6bf1a674402bc08f69bccc97058954981ad4ebc 100644 +index b7596a4c384d5cc0c21cc1bef1bc695c2c5275af..4fdb0cdb0c761aa48373e1eae0d132c0b40aa1b7 100644 --- a/Source/WebKit/UIProcess/Automation/WebAutomationSession.h +++ b/Source/WebKit/UIProcess/Automation/WebAutomationSession.h -@@ -318,6 +318,8 @@ public: +@@ -333,6 +333,8 @@ public: void didDestroyFrame(WebCore::FrameIdentifier); @@ -9177,7 +9432,7 @@ index c38751ae3064aa6a42a3ed8fdb902f70473a8e08..f6bf1a674402bc08f69bccc970589549 RefPtr webPageProxyForHandle(const String&); String effectiveHandleForWebFrameProxy(const WebFrameProxy&); String handleForWebFrameID(std::optional); -@@ -385,7 +387,6 @@ private: +@@ -400,7 +402,6 @@ private: // Get base64-encoded PNG data from a bitmap. static std::optional platformGetBase64EncodedPNGData(WebCore::ShareableBitmap::Handle&&); @@ -9186,7 +9441,7 @@ index c38751ae3064aa6a42a3ed8fdb902f70473a8e08..f6bf1a674402bc08f69bccc970589549 // Save base64-encoded file contents to a local file path and return the path. // This reuses the basename of the remote file path so that the filename exposed to DOM API remains the same. diff --git a/Source/WebKit/UIProcess/AuxiliaryProcessProxy.cpp b/Source/WebKit/UIProcess/AuxiliaryProcessProxy.cpp -index ae33d4c8ed5dd321a940f67351447d698c4e1e47..f704e6f32cbb3b0bb357862c366762fd145cba4d 100644 +index 696ac95f824b3aaf97394dae5969d901c3e75797..02fc887d85625ec56fc7b4c82c9b878958265e82 100644 --- a/Source/WebKit/UIProcess/AuxiliaryProcessProxy.cpp +++ b/Source/WebKit/UIProcess/AuxiliaryProcessProxy.cpp @@ -177,7 +177,11 @@ void AuxiliaryProcessProxy::getLaunchOptions(ProcessLauncher::LaunchOptions& lau @@ -9202,10 +9457,10 @@ index ae33d4c8ed5dd321a940f67351447d698c4e1e47..f704e6f32cbb3b0bb357862c366762fd platformGetLaunchOptions(launchOptions); } diff --git a/Source/WebKit/UIProcess/AuxiliaryProcessProxy.h b/Source/WebKit/UIProcess/AuxiliaryProcessProxy.h -index 0241fd8531d53a1f773e7c4a2c871e1903816eba..f199f4096d254ce0242c569db600554efac8c226 100644 +index 290a382e8c22691772d36041c116d048229898be..1173ad74843de165ba46812a39e1cc515519a72a 100644 --- a/Source/WebKit/UIProcess/AuxiliaryProcessProxy.h +++ b/Source/WebKit/UIProcess/AuxiliaryProcessProxy.h -@@ -296,13 +296,16 @@ protected: +@@ -304,13 +304,16 @@ protected: InitializationActivityAndGrant initializationActivityAndGrant(); @@ -9351,12 +9606,12 @@ index 0000000000000000000000000000000000000000..cd66887de171cda7d15a8e4dc6dbff63 + +#endif // ENABLE(REMOTE_INSPECTOR) diff --git a/Source/WebKit/UIProcess/Cocoa/SOAuthorization/NavigationSOAuthorizationSession.h b/Source/WebKit/UIProcess/Cocoa/SOAuthorization/NavigationSOAuthorizationSession.h -index 45abb108899e19cfe0cecd6716083afbff03d73c..11ced1bb2d03c949cb31435eeeee2a196928a2de 100644 +index 3db7f7b2c30ed7adb942dd37dfd8a4de048ad714..4b2a3a6c3b22155f0780c77a3e25dfff3efe1b71 100644 --- a/Source/WebKit/UIProcess/Cocoa/SOAuthorization/NavigationSOAuthorizationSession.h +++ b/Source/WebKit/UIProcess/Cocoa/SOAuthorization/NavigationSOAuthorizationSession.h -@@ -31,6 +31,7 @@ - #include "WebViewDidMoveToWindowObserver.h" +@@ -32,6 +32,7 @@ #include + #include #include +#include @@ -9423,7 +9678,7 @@ index c660d8204b89997bb25637ed24198acf5028e280..6d7c9102b1bc57fd179ba742cf703b1b { RefPtr uiDelegate = m_uiDelegate.get(); diff --git a/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm b/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm -index 177ac869fe4128bb459d2577d90f6b208e8395a2..e6ade97d800a2119d4abd9e241186915c432fd9c 100644 +index 2c860d013e41a4233c45ffa1e3c941c4e03c30af..c871f13b90c0389c0af55497eb900942c333806a 100644 --- a/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm +++ b/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm @@ -45,7 +45,9 @@ @@ -9436,7 +9691,7 @@ index 177ac869fe4128bb459d2577d90f6b208e8395a2..e6ade97d800a2119d4abd9e241186915 #import "PlatformXRSystem.h" #import "PlaybackSessionManagerProxy.h" #import "RemoteLayerTreeCommitBundle.h" -@@ -446,11 +448,85 @@ bool WebPageProxy::scrollingUpdatesDisabledForTesting() +@@ -493,11 +495,85 @@ bool WebPageProxy::scrollingUpdatesDisabledForTesting() void WebPageProxy::startDrag(const DragItem& dragItem, ShareableBitmap::Handle&& dragImageHandle, const std::optional& nodeID, const std::optional& frameID) { @@ -9524,10 +9779,10 @@ index 177ac869fe4128bb459d2577d90f6b208e8395a2..e6ade97d800a2119d4abd9e241186915 #if ENABLE(ATTACHMENT_ELEMENT) diff --git a/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm b/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm -index 4b43164f215ca8e72a68252f36862e25b2742ea8..0804791f8ef0174b905cb18851962f04b43151e4 100644 +index 6a07ad8cf130407f7a59f28a58e4478452de6f40..dd11957f65b3cdbc655a3d124b8e18cf8edb962b 100644 --- a/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm +++ b/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm -@@ -451,7 +451,7 @@ ALLOW_DEPRECATED_DECLARATIONS_END +@@ -461,7 +461,7 @@ ALLOW_DEPRECATED_DECLARATIONS_END auto screenProperties = WebCore::collectScreenProperties(); parameters.screenProperties = WTF::move(screenProperties); #if PLATFORM(MAC) @@ -9536,7 +9791,7 @@ index 4b43164f215ca8e72a68252f36862e25b2742ea8..0804791f8ef0174b905cb18851962f04 #endif #if PLATFORM(VISION) -@@ -864,8 +864,8 @@ void WebProcessPool::registerNotificationObservers() +@@ -880,8 +880,8 @@ void WebProcessPool::registerNotificationObservers() }]; m_scrollerStyleNotificationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:NSPreferredScrollerStyleDidChangeNotification object:nil queue:[NSOperationQueue currentQueue] usingBlock:^(NSNotification *notification) { @@ -9548,7 +9803,7 @@ index 4b43164f215ca8e72a68252f36862e25b2742ea8..0804791f8ef0174b905cb18851962f04 m_activationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:NSApplicationDidBecomeActiveNotification object:NSAppSingleton() queue:[NSOperationQueue currentQueue] usingBlock:^(NSNotification *notification) { diff --git a/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp b/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp -index be40fa0e3e3e8698c29f70a2b8dac324225aba97..4e6cc206ed0a25914d8df604f61746562fd9c976 100644 +index be40fa0e3e3e8698c29f70a2b8dac324225aba97..6f8d77d390d41b40b1099baf53e3a3c1131de679 100644 --- a/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp +++ b/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp @@ -33,6 +33,7 @@ @@ -9559,7 +9814,7 @@ index be40fa0e3e3e8698c29f70a2b8dac324225aba97..4e6cc206ed0a25914d8df604f6174656 #include "WebPageProxy.h" #include "WebPreferences.h" #include "WebProcessPool.h" -@@ -40,6 +41,15 @@ +@@ -40,6 +41,16 @@ #include #include #include @@ -9567,6 +9822,7 @@ index be40fa0e3e3e8698c29f70a2b8dac324225aba97..4e6cc206ed0a25914d8df604f6174656 + +#if PLATFORM(GTK) +#include "WebKitWebViewBasePrivate.h" ++#include +#include +#include +#include @@ -9575,7 +9831,7 @@ index be40fa0e3e3e8698c29f70a2b8dac324225aba97..4e6cc206ed0a25914d8df604f6174656 #if USE(GLIB_EVENT_LOOP) #include -@@ -175,6 +185,11 @@ void DrawingAreaProxyCoordinatedGraphics::deviceScaleFactorDidChange(CompletionH +@@ -175,6 +186,11 @@ void DrawingAreaProxyCoordinatedGraphics::deviceScaleFactorDidChange(CompletionH sendWithAsyncReply(Messages::DrawingArea::SetDeviceScaleFactor(page()->deviceScaleFactor()), WTF::move(completionHandler)); } @@ -9587,51 +9843,29 @@ index be40fa0e3e3e8698c29f70a2b8dac324225aba97..4e6cc206ed0a25914d8df604f6174656 void DrawingAreaProxyCoordinatedGraphics::setBackingStoreIsDiscardable(bool isBackingStoreDiscardable) { #if !PLATFORM(WPE) && !PLATFORM(GTK) -@@ -234,6 +249,54 @@ void DrawingAreaProxyCoordinatedGraphics::updateAcceleratedCompositingMode(uint6 +@@ -234,6 +250,32 @@ void DrawingAreaProxyCoordinatedGraphics::updateAcceleratedCompositingMode(uint6 updateAcceleratedCompositingMode(layerTreeContext); } +#if PLATFORM(GTK) +void DrawingAreaProxyCoordinatedGraphics::captureFrame() +{ -+ RefPtr surface; -+ if (isInAcceleratedCompositingMode()) { -+ AcceleratedBackingStore* backingStore = webkitWebViewBaseGetAcceleratedBackingStore(WEBKIT_WEB_VIEW_BASE(protect(page())->viewWidget())); -+ if (!backingStore) -+ return; -+ -+ surface = backingStore->surface(); -+ } ++ if (!isInAcceleratedCompositingMode()) ++ return; + -+ if (!surface) ++ AcceleratedBackingStore* backingStore = webkitWebViewBaseGetAcceleratedBackingStore(WEBKIT_WEB_VIEW_BASE(protect(page())->viewWidget())); ++ if (!backingStore) + return; + -+ if (cairo_surface_get_type(surface.get()) != CAIRO_SURFACE_TYPE_IMAGE) ++ // Reuse the backing store's snapshot path (also used by the test runner). It ++ // returns the committed buffer's contents as a NativeImage in the natural ++ // top-down orientation for every buffer type (GBM, SHM, DMA-BUF, EGLImage), ++ // including on GTK 4.16+ where buffers are backed by a GdkTexture. ++ RefPtr image = backingStore->bufferAsNativeImageForTesting(); ++ if (!image) + return; + -+ // The original surface is upside down, so we flip it to match orientation in other accelerated backing stores. -+ auto flippedSurface = adoptRef(cairo_image_surface_create(CAIRO_FORMAT_ARGB32, cairo_image_surface_get_width(surface.get()), cairo_image_surface_get_height(surface.get()))); -+ { -+ RefPtr cr = adoptRef(cairo_create(flippedSurface.get())); -+ cairo_matrix_t transform; -+ cairo_matrix_init(&transform, 1, 0, 0, -1, 0, cairo_image_surface_get_height(surface.get())); -+ cairo_transform(cr.get(), &transform); -+ cairo_set_source_surface(cr.get(), surface.get(), 0, 0); -+ cairo_paint(cr.get()); -+ } -+ cairo_surface_flush(flippedSurface.get()); -+ -+ unsigned char* data = cairo_image_surface_get_data(flippedSurface.get()); -+ int width = cairo_image_surface_get_width(flippedSurface.get()); -+ int height = cairo_image_surface_get_height(flippedSurface.get()); -+ int stride = cairo_image_surface_get_stride(flippedSurface.get()); -+ -+ SkImageInfo info = SkImageInfo::Make( -+ width, height, -+ kBGRA_8888_SkColorType, // matches CAIRO_FORMAT_ARGB32 on LE -+ kPremul_SkAlphaType -+ ); -+ sk_sp skImage = SkImages::RasterFromData(info, SkData::MakeWithCopy(data, height * stride), stride); ++ sk_sp skImage = image->platformImage(); + if (!skImage) + return; + @@ -9642,7 +9876,7 @@ index be40fa0e3e3e8698c29f70a2b8dac324225aba97..4e6cc206ed0a25914d8df604f6174656 bool DrawingAreaProxyCoordinatedGraphics::alwaysUseCompositing() const { if (!page()) -@@ -301,6 +364,12 @@ void DrawingAreaProxyCoordinatedGraphics::didUpdateGeometry() +@@ -301,6 +343,12 @@ void DrawingAreaProxyCoordinatedGraphics::didUpdateGeometry() // we need to resend the new size here. if (m_lastSentSize != size()) sendUpdateGeometry(); @@ -10213,6 +10447,186 @@ index 0000000000000000000000000000000000000000..afadd2371dffab9d4b92e4245f562282 +}; + +} // namespace WebKit +diff --git a/Source/WebKit/UIProcess/Inspector/Agents/ProxyingNetworkAgent.cpp b/Source/WebKit/UIProcess/Inspector/Agents/ProxyingNetworkAgent.cpp +index 7d547b7eee13523e7b8f311a49e9670664c4959e..61e7716b45dc1d7ac28e4cb5f1490d123895ca6a 100644 +--- a/Source/WebKit/UIProcess/Inspector/Agents/ProxyingNetworkAgent.cpp ++++ b/Source/WebKit/UIProcess/Inspector/Agents/ProxyingNetworkAgent.cpp +@@ -399,6 +399,12 @@ CommandResult ProxyingNetworkAgent::interceptRequestWithError(const Protoc + return { }; + } + ++CommandResult ProxyingNetworkAgent::setEmulateOfflineState(bool) ++{ ++ // FIXME: Forward to all WebContent processes. ++ return { }; ++} ++ + #if ENABLE(INSPECTOR_NETWORK_THROTTLING) + + CommandResult ProxyingNetworkAgent::setEmulatedConditions(std::optional&&) +diff --git a/Source/WebKit/UIProcess/Inspector/Agents/ProxyingNetworkAgent.h b/Source/WebKit/UIProcess/Inspector/Agents/ProxyingNetworkAgent.h +index 408a8108556cdd384564091457a28e49976a9402..90de5101b8e2049038ca991754827243c8beb6b8 100644 +--- a/Source/WebKit/UIProcess/Inspector/Agents/ProxyingNetworkAgent.h ++++ b/Source/WebKit/UIProcess/Inspector/Agents/ProxyingNetworkAgent.h +@@ -92,6 +92,7 @@ public: + CommandResult interceptWithResponse(const Protocol::Network::RequestId&, const String& content, bool base64Encoded, const String& mimeType, std::optional&& status, const String& statusText, RefPtr&& headers) final; + CommandResult interceptRequestWithResponse(const Protocol::Network::RequestId&, const String& content, bool base64Encoded, const String& mimeType, int status, const String& statusText, Ref&& headers) final; + CommandResult interceptRequestWithError(const Protocol::Network::RequestId&, Protocol::Network::ResourceErrorType) final; ++ CommandResult setEmulateOfflineState(bool offline) final; + #if ENABLE(INSPECTOR_NETWORK_THROTTLING) + CommandResult setEmulatedConditions(std::optional&& bytesPerSecondLimit) final; + #endif +diff --git a/Source/WebKit/UIProcess/Inspector/Agents/ProxyingPageAgent.cpp b/Source/WebKit/UIProcess/Inspector/Agents/ProxyingPageAgent.cpp +index 0cef1a19215fba7f477b8ae1f7f16e9091ebd4ee..8306beaa340e2d038dfb76a63ec79237788bf131 100644 +--- a/Source/WebKit/UIProcess/Inspector/Agents/ProxyingPageAgent.cpp ++++ b/Source/WebKit/UIProcess/Inspector/Agents/ProxyingPageAgent.cpp +@@ -98,12 +98,14 @@ void ProxyingPageAgent::frameNavigated(FrameIdentifier frameID, const URL& url, + + void ProxyingPageAgent::domContentEventFired(double timestamp) + { +- m_frontendDispatcher->domContentEventFired(timestamp); ++ // FIXME: plumb FrameIdentifier through the IPC message. ++ m_frontendDispatcher->domContentEventFired(timestamp, { }); + } + + void ProxyingPageAgent::loadEventFired(double timestamp) + { +- m_frontendDispatcher->loadEventFired(timestamp); ++ // FIXME: plumb FrameIdentifier through the IPC message. ++ m_frontendDispatcher->loadEventFired(timestamp, { }); + } + + void ProxyingPageAgent::frameDetached(FrameIdentifier frameID) +@@ -346,17 +348,82 @@ CommandResult ProxyingPageAgent::setShowPaintRects(bool) + return { }; + } + ++CommandResult ProxyingPageAgent::goBack() ++{ ++ return { }; ++} ++ ++CommandResult ProxyingPageAgent::goForward() ++{ ++ return { }; ++} ++ ++CommandResult ProxyingPageAgent::overridePlatform(const String&) ++{ ++ return { }; ++} ++ ++CommandResult ProxyingPageAgent::setForcedColors(std::optional&&) ++{ ++ return { }; ++} ++ ++CommandResult ProxyingPageAgent::setTimeZone(const String&) ++{ ++ return { }; ++} ++ ++CommandResult ProxyingPageAgent::setTouchEmulationEnabled(bool) ++{ ++ return { }; ++} ++ + CommandResult ProxyingPageAgent::setEmulatedMedia(const String&) + { + return { }; + } + ++CommandResult ProxyingPageAgent::insertText(const String&) ++{ ++ return { }; ++} ++ ++CommandResult ProxyingPageAgent::setInterceptFileChooserDialog(bool) ++{ ++ return { }; ++} ++ ++CommandResult ProxyingPageAgent::setDefaultBackgroundColorOverride(RefPtr&&) ++{ ++ return { }; ++} ++ ++CommandResult ProxyingPageAgent::createUserWorld(const String&) ++{ ++ return { }; ++} ++ ++CommandResult ProxyingPageAgent::setBypassCSP(bool) ++{ ++ return { }; ++} ++ ++CommandResult ProxyingPageAgent::crash() ++{ ++ return { }; ++} ++ ++CommandResult ProxyingPageAgent::updateScrollingState() ++{ ++ return { }; ++} ++ + CommandResult ProxyingPageAgent::snapshotNode(Protocol::DOM::NodeId) + { + return makeUnexpected("Not yet implemented under Site Isolation"_s); + } + +-CommandResult ProxyingPageAgent::snapshotRect(int, int, int, int, Protocol::Page::CoordinateSystem) ++CommandResult ProxyingPageAgent::snapshotRect(int, int, int, int, Protocol::Page::CoordinateSystem, std::optional&&, std::optional&&, std::optional&&) + { + return makeUnexpected("Not yet implemented under Site Isolation"_s); + } +@@ -368,11 +435,9 @@ CommandResult ProxyingPageAgent::archive() + } + #endif + +-#if !PLATFORM(COCOA) + CommandResult ProxyingPageAgent::setScreenSizeOverride(std::optional&&, std::optional&&) + { + return { }; + } +-#endif + + } // namespace Inspector +diff --git a/Source/WebKit/UIProcess/Inspector/Agents/ProxyingPageAgent.h b/Source/WebKit/UIProcess/Inspector/Agents/ProxyingPageAgent.h +index 5391fbc1d384bd9be7c5f497567caef046fd2a9e..b23b30e28270eb2d615c01659299fe6ca5e6aeec 100644 +--- a/Source/WebKit/UIProcess/Inspector/Agents/ProxyingPageAgent.h ++++ b/Source/WebKit/UIProcess/Inspector/Agents/ProxyingPageAgent.h +@@ -86,15 +86,26 @@ public: + CommandResult setShowRulers(bool) final; + #endif + CommandResult setShowPaintRects(bool) final; ++ CommandResult goBack() final; ++ CommandResult goForward() final; ++ CommandResult overridePlatform(const String&) final; ++ CommandResult setForcedColors(std::optional&&) final; ++ CommandResult setTimeZone(const String&) final; ++ CommandResult setTouchEmulationEnabled(bool) final; + CommandResult setEmulatedMedia(const String&) final; ++ CommandResult insertText(const String&) final; ++ CommandResult setInterceptFileChooserDialog(bool) final; ++ CommandResult setDefaultBackgroundColorOverride(RefPtr&&) final; ++ CommandResult createUserWorld(const String&) final; ++ CommandResult setBypassCSP(bool) final; ++ CommandResult crash() final; ++ CommandResult updateScrollingState() final; + CommandResult snapshotNode(Protocol::DOM::NodeId) final; +- CommandResult snapshotRect(int x, int y, int width, int height, Protocol::Page::CoordinateSystem) final; ++ CommandResult snapshotRect(int x, int y, int width, int height, Protocol::Page::CoordinateSystem, std::optional&& omitDeviceScaleFactor, std::optional&&, std::optional&& quality) final; + #if ENABLE(WEB_ARCHIVE) && USE(CF) + CommandResult archive() final; + #endif +-#if !PLATFORM(COCOA) + CommandResult setScreenSizeOverride(std::optional&& width, std::optional&& height) final; +-#endif + + private: + // IPC::MessageReceiver diff --git a/Source/WebKit/UIProcess/Inspector/PageInspectorTargetProxy.cpp b/Source/WebKit/UIProcess/Inspector/PageInspectorTargetProxy.cpp index 66e1ddd0ad468d7e9d262442ad0efdbcf7989ea1..28c0a0f7b7edaaf7f30c677594365a436344512d 100644 --- a/Source/WebKit/UIProcess/Inspector/PageInspectorTargetProxy.cpp @@ -10300,10 +10714,10 @@ index 232b5dc1c574e4d4231307fee144aff59b519758..651fc7fe63d80cf093192e4eec1576c7 #include "WebProcessProxyMessages.h" #include diff --git a/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.cpp b/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.cpp -index 13da6142d0889583d399b4ee9ead9a6850b700b2..626f87341d5eb3d7192d4c80621e84bf9181940f 100644 +index 05d99a1b1c4348dc30f72f0c107b61aec9894678..f51d1ad17b748377a8232a3ef3346f2ac4a621d9 100644 --- a/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.cpp +++ b/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.cpp -@@ -26,19 +26,27 @@ +@@ -26,10 +26,14 @@ #include "config.h" #include "WebPageInspectorController.h" @@ -10318,7 +10732,8 @@ index 13da6142d0889583d399b4ee9ead9a6850b700b2..626f87341d5eb3d7192d4c80621e84bf #include "PageInspectorTarget.h" #include "PageInspectorTargetProxy.h" #include "ProvisionalFrameProxy.h" - #include "ProvisionalPageProxy.h" +@@ -38,9 +42,13 @@ + #include "ProxyingPageAgent.h" #include "WebFrameProxy.h" #include "WebPageInspectorAgentBase.h" +#include "WebPageInspectorEmulationAgent.h" @@ -10331,7 +10746,7 @@ index 13da6142d0889583d399b4ee9ead9a6850b700b2..626f87341d5eb3d7192d4c80621e84bf #include #include #include -@@ -69,6 +77,17 @@ static String getTargetID(const ProvisionalFrameProxy& provisionalFrame) +@@ -77,6 +85,17 @@ static String getTargetID(const ProvisionalFrameProxy& provisionalFrame) WTF_MAKE_TZONE_ALLOCATED_IMPL(WebPageInspectorController); @@ -10349,7 +10764,7 @@ index 13da6142d0889583d399b4ee9ead9a6850b700b2..626f87341d5eb3d7192d4c80621e84bf WebPageInspectorController::WebPageInspectorController(WebPageProxy& inspectedPage) : m_frontendRouter(FrontendRouter::create()) , m_backendDispatcher(BackendDispatcher::create(m_frontendRouter.copyRef())) -@@ -82,16 +101,92 @@ WebPageInspectorController::WebPageInspectorController(WebPageProxy& inspectedPa +@@ -90,16 +109,92 @@ WebPageInspectorController::WebPageInspectorController(WebPageProxy& inspectedPa WebPageInspectorController::~WebPageInspectorController() = default; void WebPageInspectorController::init() @@ -10442,7 +10857,7 @@ index 13da6142d0889583d399b4ee9ead9a6850b700b2..626f87341d5eb3d7192d4c80621e84bf } bool WebPageInspectorController::hasLocalFrontend() const -@@ -105,6 +200,14 @@ void WebPageInspectorController::connectFrontend(Inspector::FrontendChannel& fro +@@ -113,6 +208,14 @@ void WebPageInspectorController::connectFrontend(Inspector::FrontendChannel& fro bool connectingFirstFrontend = !m_frontendRouter->hasFrontends(); @@ -10456,20 +10871,16 @@ index 13da6142d0889583d399b4ee9ead9a6850b700b2..626f87341d5eb3d7192d4c80621e84bf + m_frontendRouter->connectFrontend(frontendChannel); - if (connectingFirstFrontend) -@@ -124,8 +227,10 @@ void WebPageInspectorController::disconnectFrontend(FrontendChannel& frontendCha - m_frontendRouter->disconnectFrontend(frontendChannel); - - bool disconnectingLastFrontend = !m_frontendRouter->hasFrontends(); -- if (disconnectingLastFrontend) -+ if (disconnectingLastFrontend) { - m_agents.willDestroyFrontendAndBackend(DisconnectReason::InspectorDestroyed); + if (connectingFirstFrontend) { +@@ -143,6 +246,7 @@ void WebPageInspectorController::disconnectFrontend(FrontendChannel& frontendCha + networkAgent->willDestroyFrontendAndBackend(DisconnectReason::InspectorDestroyed); + if (RefPtr pageAgent = m_pageAgent) + pageAgent->willDestroyFrontendAndBackend(DisconnectReason::InspectorDestroyed); + m_pendingNavigations.clear(); -+ } + } Ref inspectedPage = m_inspectedPage.get(); - inspectedPage->didChangeInspectorFrontendCount(m_frontendRouter->frontendCount()); -@@ -149,6 +254,8 @@ void WebPageInspectorController::disconnectAllFrontends() +@@ -171,6 +275,8 @@ void WebPageInspectorController::disconnectAllFrontends() // Disconnect any remaining remote frontends. m_frontendRouter->disconnectAllFrontends(); @@ -10478,7 +10889,7 @@ index 13da6142d0889583d399b4ee9ead9a6850b700b2..626f87341d5eb3d7192d4c80621e84bf Ref inspectedPage = m_inspectedPage.get(); inspectedPage->didChangeInspectorFrontendCount(m_frontendRouter->frontendCount()); -@@ -177,6 +284,66 @@ void WebPageInspectorController::setIndicating(bool indicating) +@@ -199,6 +305,66 @@ void WebPageInspectorController::setIndicating(bool indicating) } #endif @@ -10545,7 +10956,7 @@ index 13da6142d0889583d399b4ee9ead9a6850b700b2..626f87341d5eb3d7192d4c80621e84bf void WebPageInspectorController::sendMessageToInspectorFrontend(const String& targetId, const String& message) { if (!m_targets.contains(targetId)) { -@@ -191,6 +358,52 @@ void WebPageInspectorController::sendMessageToInspectorFrontend(const String& ta +@@ -213,6 +379,52 @@ void WebPageInspectorController::sendMessageToInspectorFrontend(const String& ta protect(m_targetAgent)->sendMessageFromTargetToFrontend(targetId, message); } @@ -10595,10 +11006,10 @@ index 13da6142d0889583d399b4ee9ead9a6850b700b2..626f87341d5eb3d7192d4c80621e84bf + target->setResumeCallback(WTF::move(callback)); +} + - bool WebPageInspectorController::shouldPauseLoading(const ProvisionalPageProxy& provisionalPage) const + bool WebPageInspectorController::shouldPauseLoadingForPage(const ProvisionalPageProxy& provisionalPage) const { if (!m_frontendRouter->hasFrontends()) -@@ -210,7 +423,7 @@ void WebPageInspectorController::setContinueLoadingCallback(const ProvisionalPag +@@ -267,7 +479,7 @@ void WebPageInspectorController::setContinueLoadingCallbackForFrame(const Provis void WebPageInspectorController::didCreateProvisionalPage(ProvisionalPageProxy& provisionalPage, WebCore::FrameIdentifier mainFrameID, WebProcessProxy& mainFrameProcess) { @@ -10608,7 +11019,7 @@ index 13da6142d0889583d399b4ee9ead9a6850b700b2..626f87341d5eb3d7192d4c80621e84bf if (shouldManageFrameTargets()) { constexpr bool isProvisional = true; diff --git a/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.h b/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.h -index f670f9007a9386bf9933e59c32463f697dbb6597..17fa5c0f2860c9423de3e167616d46fa5d857125 100644 +index d335f13ded0edda8144f158f0944b8bae3b009a7..18c710fe57a85ffe738f0e1fd425f090d91a29e9 100644 --- a/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.h +++ b/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.h @@ -28,9 +28,11 @@ @@ -10623,7 +11034,7 @@ index f670f9007a9386bf9933e59c32463f697dbb6597..17fa5c0f2860c9423de3e167616d46fa #include #include #include -@@ -38,11 +40,29 @@ +@@ -38,6 +40,12 @@ #include #include #include @@ -10636,8 +11047,10 @@ index f670f9007a9386bf9933e59c32463f697dbb6597..17fa5c0f2860c9423de3e167616d46fa namespace Inspector { class BackendDispatcher; - class FrontendChannel; +@@ -45,6 +53,18 @@ class FrontendChannel; class FrontendRouter; + class ProxyingNetworkAgent; + class ProxyingPageAgent; +class InspectorTarget; +} + @@ -10653,7 +11066,7 @@ index f670f9007a9386bf9933e59c32463f697dbb6597..17fa5c0f2860c9423de3e167616d46fa } namespace WebKit { -@@ -51,6 +71,22 @@ class InspectorBrowserAgent; +@@ -53,6 +73,22 @@ class InspectorBrowserAgent; class ProvisionalPageProxy; struct WebPageAgentContext; @@ -10676,7 +11089,7 @@ index f670f9007a9386bf9933e59c32463f697dbb6597..17fa5c0f2860c9423de3e167616d46fa class WebPageInspectorController { WTF_MAKE_TZONE_ALLOCATED(WebPageInspectorController); WTF_MAKE_NONCOPYABLE(WebPageInspectorController); -@@ -59,7 +95,21 @@ public: +@@ -61,7 +97,21 @@ public: ~WebPageInspectorController(); void init(); @@ -10698,7 +11111,7 @@ index f670f9007a9386bf9933e59c32463f697dbb6597..17fa5c0f2860c9423de3e167616d46fa bool hasLocalFrontend() const; -@@ -72,9 +122,25 @@ public: +@@ -74,9 +124,25 @@ public: #if ENABLE(REMOTE_INSPECTOR) void setIndicating(bool); #endif @@ -10721,10 +11134,10 @@ index f670f9007a9386bf9933e59c32463f697dbb6597..17fa5c0f2860c9423de3e167616d46fa + bool shouldPauseInInspectorWhenShown() const; + void setContinueLoadingCallback(WTF::Function&&); + - bool shouldPauseLoading(const ProvisionalPageProxy&) const; - void setContinueLoadingCallback(const ProvisionalPageProxy&, WTF::Function&&); - -@@ -111,9 +177,16 @@ private: + bool shouldPauseLoadingForPage(const ProvisionalPageProxy&) const; + void setContinueLoadingCallbackForPage(const ProvisionalPageProxy&, WTF::Function&&); + bool shouldPauseLoadingForFrame(const ProvisionalFrameProxy&) const; +@@ -117,11 +183,18 @@ private: CheckedPtr m_targetAgent; HashMap> m_targets; @@ -10733,6 +11146,8 @@ index f670f9007a9386bf9933e59c32463f697dbb6597..17fa5c0f2860c9423de3e167616d46fa + InspectorScreencastAgent* m_screecastAgent { nullptr }; + CheckedPtr m_enabledBrowserAgent; + RefPtr m_networkAgent; + RefPtr m_pageAgent; bool m_didCreateLazyAgents { false }; + UncheckedKeyHashMap m_pendingNavigations; @@ -12179,7 +12594,7 @@ index 0000000000000000000000000000000000000000..af71e4077eb0c6f95396de7bfef89a3e + +#endif // ENABLE(REMOTE_INSPECTOR) diff --git a/Source/WebKit/UIProcess/Launcher/glib/ProcessLauncherGLib.cpp b/Source/WebKit/UIProcess/Launcher/glib/ProcessLauncherGLib.cpp -index 9e0f05585ae96f4ec9ab2390cb015b5307fe85e6..048dfad9f9221fc5389de5d7874a0a67ec61499a 100644 +index 4b51695cfad05edf88ec3d50ed49bcdd55411195..e568c845e9801153b1d37a88e4631d0917abba65 100644 --- a/Source/WebKit/UIProcess/Launcher/glib/ProcessLauncherGLib.cpp +++ b/Source/WebKit/UIProcess/Launcher/glib/ProcessLauncherGLib.cpp @@ -160,6 +160,13 @@ void ProcessLauncher::launchProcess() @@ -12235,22 +12650,22 @@ index 6723ee0d9943be07bc8ad09d2b678838aca968df..0d7fb3c7b1a4c877a2ff2f2189d12c7d BOOL result = ::CreateProcess(0, commandLine.mutableSpan().data(), 0, 0, true, 0, 0, 0, &startupInfo, &processInformation); diff --git a/Source/WebKit/UIProcess/Media/RemoteMediaSessionManagerProxy.cpp b/Source/WebKit/UIProcess/Media/RemoteMediaSessionManagerProxy.cpp -index e9bf93632655ddfe5104808d67cb1e550e965098..a62ab1cb298654ea69cc8131f275d2cc7fe75602 100644 +index f82f809cf2552bc1a64920efaf8cdbfbfad680da..a9f787163555d265d5209bd9f9f0cda40f9203ce 100644 --- a/Source/WebKit/UIProcess/Media/RemoteMediaSessionManagerProxy.cpp +++ b/Source/WebKit/UIProcess/Media/RemoteMediaSessionManagerProxy.cpp -@@ -31,6 +31,7 @@ +@@ -30,6 +30,7 @@ + #include "MessageSenderInlines.h" - #include "RemoteMediaSessionClientProxy.h" #include "RemoteMediaSessionManagerMessages.h" +#include "RemoteMediaSessionManager.h" #include "RemoteMediaSessionManagerProxyMessages.h" #include "RemoteMediaSessionProxy.h" #include "RemoteMediaSessionState.h" diff --git a/Source/WebKit/UIProcess/PageClient.h b/Source/WebKit/UIProcess/PageClient.h -index ec8a8accd195844f2ceb5fea0d73bc0ab50ce733..164e60cbc7fbd520d4d43a99021891c770f1fe3e 100644 +index ed60169d3da046ea7e98e402b2af032476c87ac9..d8aa7edba575a3c6e596e6535ec1cebe38da7e87 100644 --- a/Source/WebKit/UIProcess/PageClient.h +++ b/Source/WebKit/UIProcess/PageClient.h -@@ -77,6 +77,11 @@ +@@ -78,6 +78,11 @@ #include #endif @@ -12262,7 +12677,7 @@ index ec8a8accd195844f2ceb5fea0d73bc0ab50ce733..164e60cbc7fbd520d4d43a99021891c7 OBJC_CLASS AVPlayerViewController; OBJC_CLASS CALayer; OBJC_CLASS NSFileWrapper; -@@ -400,7 +405,15 @@ public: +@@ -405,7 +410,15 @@ public: virtual void selectionDidChange() = 0; #endif @@ -12281,10 +12696,10 @@ index ec8a8accd195844f2ceb5fea0d73bc0ab50ce733..164e60cbc7fbd520d4d43a99021891c7 diff --git a/Source/WebKit/UIProcess/PlaywrightFullScreenManagerProxyClient.cpp b/Source/WebKit/UIProcess/PlaywrightFullScreenManagerProxyClient.cpp new file mode 100644 -index 0000000000000000000000000000000000000000..95b682567eba682f927317cd3327a531358dfebc +index 0000000000000000000000000000000000000000..e982e8e129b89e33305bb3dd7616fb7ad9b7e1a9 --- /dev/null +++ b/Source/WebKit/UIProcess/PlaywrightFullScreenManagerProxyClient.cpp -@@ -0,0 +1,64 @@ +@@ -0,0 +1,63 @@ +/* + * Copyright (C) 2023 Microsoft Corporation. + * @@ -12321,8 +12736,7 @@ index 0000000000000000000000000000000000000000..95b682567eba682f927317cd3327a531 +namespace WebKit { +using namespace WebCore; + -+PlaywrightFullScreenManagerProxyClient::PlaywrightFullScreenManagerProxyClient(WebPageProxy& page) -+ : m_pageProxy(page) ++PlaywrightFullScreenManagerProxyClient::PlaywrightFullScreenManagerProxyClient(WebPageProxy&) +{ +} + @@ -12351,10 +12765,10 @@ index 0000000000000000000000000000000000000000..95b682567eba682f927317cd3327a531 +#endif // ENABLE(FULLSCREEN_API) diff --git a/Source/WebKit/UIProcess/PlaywrightFullScreenManagerProxyClient.h b/Source/WebKit/UIProcess/PlaywrightFullScreenManagerProxyClient.h new file mode 100644 -index 0000000000000000000000000000000000000000..f855bb5ff6e91cc3383fb9a96d32392ff7aa5493 +index 0000000000000000000000000000000000000000..e729f8cbd1dd87a489f226611d9657ad2f5a339a --- /dev/null +++ b/Source/WebKit/UIProcess/PlaywrightFullScreenManagerProxyClient.h -@@ -0,0 +1,56 @@ +@@ -0,0 +1,55 @@ +/* + * Copyright (C) 2023 Microsoft Corporation. + * @@ -12404,7 +12818,6 @@ index 0000000000000000000000000000000000000000..f855bb5ff6e91cc3383fb9a96d32392f + void beganEnterFullScreen(const WebCore::IntRect& initialFrame, const WebCore::IntRect& finalFrame, CompletionHandler&&) override; + void beganExitFullScreen(const WebCore::IntRect& initialFrame, const WebCore::IntRect& finalFrame, CompletionHandler&&) override; + -+ WebPageProxy& m_pageProxy; + bool m_isFullScreen { false }; +}; + @@ -12424,7 +12837,7 @@ index 0e8f21982c6499e6886f5db6c193afc43663f29c..43ed4c8837479744a98ef76ceb2911c0 #include "FrameProcess.h" #include "ProvisionalFrameCreationParameters.h" diff --git a/Source/WebKit/UIProcess/ProvisionalPageProxy.h b/Source/WebKit/UIProcess/ProvisionalPageProxy.h -index 90b6b6b10906e9bf9f4229dc413421380be8a01a..0620c78e35e40e5b4997ab3813cac98cfdef7372 100644 +index 619f6cfac2e777136b4cb91773e996c57708e776..2655dfacb8262c80fe23db5a9d4fd43c8e0c10d0 100644 --- a/Source/WebKit/UIProcess/ProvisionalPageProxy.h +++ b/Source/WebKit/UIProcess/ProvisionalPageProxy.h @@ -32,8 +32,10 @@ @@ -12438,7 +12851,7 @@ index 90b6b6b10906e9bf9f4229dc413421380be8a01a..0620c78e35e40e5b4997ab3813cac98c #include #include #include -@@ -74,7 +76,6 @@ class WebBackForwardListItem; +@@ -76,7 +78,6 @@ class WebBackForwardListItem; class WebFrameProxy; class WebPageProxy; class WebProcessProxy; @@ -12765,7 +13178,7 @@ index 7ef986965d3fda34b4f09279c62bdad40712ab12..5e0bc508f72bbbd0bcb4bb1254782028 namespace WebKit { diff --git a/Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteScrollingTreeMac.mm b/Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteScrollingTreeMac.mm -index 07e7aec9d5f53dd4adfb83b6626f469621362663..18d049adb49ab565f60e9e1dded55da1a6aaaf3a 100644 +index 103523006c9f2b5771591082939a14069e12c9b6..0ee29c2c2d14e43c857ec17eec4b312f83b6c2ed 100644 --- a/Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteScrollingTreeMac.mm +++ b/Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteScrollingTreeMac.mm @@ -46,6 +46,7 @@ @@ -12794,18 +13207,18 @@ index 3f6cd845733e2e8f5e25c318e7ab54f77032d4cf..e4399bfd734a28ef5df5ec855b7c78b4 class RemotePagePlaybackSessionManagerProxy : public IPC::MessageReceiver, public RefCounted { diff --git a/Source/WebKit/UIProcess/RemotePageProxy.cpp b/Source/WebKit/UIProcess/RemotePageProxy.cpp -index e4c7157e5f1269e8adebbeb63fed76a1fa78ceaf..ad5012a4be5f114c193c4645c2515d492fdb50f0 100644 +index 7590c1860cf7a13dd5100d2868e7ad2bc3d68679..c09c1ba1993913a31418fec10fb2ba17394e2508 100644 --- a/Source/WebKit/UIProcess/RemotePageProxy.cpp +++ b/Source/WebKit/UIProcess/RemotePageProxy.cpp -@@ -37,6 +37,7 @@ - #include "ProvisionalFrameProxy.h" +@@ -39,6 +39,7 @@ #include "RemotePageDrawingAreaProxy.h" #include "RemotePageFullscreenManagerProxy.h" + #include "RemotePageMediaSessionManagerProxy.h" +#include "RemotePagePlaybackSessionManagerProxy.h" #include "RemotePageScreenOrientationManagerProxy.h" #include "RemotePageVisitedLinkStoreRegistration.h" - #include "RemotePageWebDeviceOrientationUpdateProviderProxy.h" -@@ -56,6 +57,7 @@ + #include "RemotePageWebAuthenticatorCoordinatorProxy.h" +@@ -60,6 +61,7 @@ #include #include @@ -12813,25 +13226,6 @@ index e4c7157e5f1269e8adebbeb63fed76a1fa78ceaf..ad5012a4be5f114c193c4645c2515d49 #if ENABLE(FULLSCREEN_API) #include "WebFullScreenManagerProxy.h" #endif -diff --git a/Source/WebKit/UIProcess/TextExtractionAssertionScope.h b/Source/WebKit/UIProcess/TextExtractionAssertionScope.h -index 986c0812fedd2be938675ef5de41041e9fc76a0b..69da96c1e1ccb3b6d6b142ccb3b337f0bcb14957 100644 ---- a/Source/WebKit/UIProcess/TextExtractionAssertionScope.h -+++ b/Source/WebKit/UIProcess/TextExtractionAssertionScope.h -@@ -25,13 +25,12 @@ - - #pragma once - -+#include "WebPageProxy.h" - #include - #include - - namespace WebKit { - --class WebPageProxy; -- - class TextExtractionAssertionScope { - WTF_MAKE_TZONE_ALLOCATED(TextExtractionAssertionScope); - WTF_MAKE_NONCOPYABLE(TextExtractionAssertionScope); diff --git a/Source/WebKit/UIProcess/WebContextMenuProxy.h b/Source/WebKit/UIProcess/WebContextMenuProxy.h index 364666d82ffd69aef6cb4f8d63b61ae13e163d87..a491699c43502e6feae3b3df73b3558a79bb73e3 100644 --- a/Source/WebKit/UIProcess/WebContextMenuProxy.h @@ -13095,7 +13489,7 @@ index 0000000000000000000000000000000000000000..8c772fb1b67ec7d83cbe2394d8ab0478 +} // namespace WebKit diff --git a/Source/WebKit/UIProcess/WebPageInspectorInputAgent.cpp b/Source/WebKit/UIProcess/WebPageInspectorInputAgent.cpp new file mode 100644 -index 0000000000000000000000000000000000000000..a29ae94cda78928fab928bbdd250f8cd1c8b4cc5 +index 0000000000000000000000000000000000000000..a7de88ca37063e44c74348cdeeb2b7d28692df3d --- /dev/null +++ b/Source/WebKit/UIProcess/WebPageInspectorInputAgent.cpp @@ -0,0 +1,397 @@ @@ -13370,22 +13764,22 @@ index 0000000000000000000000000000000000000000..a29ae94cda78928fab928bbdd250f8cd + + // Convert css coordinates to view coordinates (dip). + double totalScale = m_page.pageScaleFactor() * m_page.viewScaleFactor() * m_page.pageZoomFactor(); -+ x = clampToInteger(roundf(x * totalScale)); -+ y = clampToInteger(roundf(y * totalScale)); -+ eventDeltaX = clampToInteger(roundf(eventDeltaX * totalScale)); -+ eventDeltaY = clampToInteger(roundf(eventDeltaY * totalScale)); ++ x = clampTo(roundf(x * totalScale)); ++ y = clampTo(roundf(y * totalScale)); ++ eventDeltaX = clampTo(roundf(eventDeltaX * totalScale)); ++ eventDeltaY = clampTo(roundf(eventDeltaY * totalScale)); + + // We intercept any drags generated by this mouse event + // to prevent them from creating actual drags in the host + // operating system. This is turned off in the callback. + m_page.setInterceptDrags(true); ++ MonotonicTime timestamp = MonotonicTime::now(); +#if PLATFORM(MAC) + UNUSED_VARIABLE(eventType); + UNUSED_VARIABLE(eventButton); + UNUSED_VARIABLE(eventClickCount); -+ platformDispatchMouseEvent(type, x, y, WTF::move(modifiers), button, WTF::move(clickCount), eventButtons); ++ platformDispatchMouseEvent(type, x, y, WTF::move(modifiers), button, WTF::move(clickCount), eventButtons, timestamp); +#elif PLATFORM(GTK) || PLATFORM(WPE) || PLATFORM(WIN) -+ MonotonicTime timestamp = MonotonicTime::now(); + NativeWebMouseEvent event( + eventType, + eventButton, @@ -13483,8 +13877,8 @@ index 0000000000000000000000000000000000000000..a29ae94cda78928fab928bbdd250f8cd + + // Convert css coordinates to view coordinates (dip). + double totalScale = m_page.pageScaleFactor() * m_page.viewScaleFactor() * m_page.pageZoomFactor(); -+ x = clampToInteger(roundf(x * totalScale)); -+ y = clampToInteger(roundf(y * totalScale)); ++ x = clampTo(roundf(x * totalScale)); ++ y = clampTo(roundf(y * totalScale)); + + MonotonicTime timestamp = MonotonicTime::now(); + WebCore::FloatSize delta = {-eventDeltaX, -eventDeltaY}; @@ -13498,7 +13892,7 @@ index 0000000000000000000000000000000000000000..a29ae94cda78928fab928bbdd250f8cd +} // namespace WebKit diff --git a/Source/WebKit/UIProcess/WebPageInspectorInputAgent.h b/Source/WebKit/UIProcess/WebPageInspectorInputAgent.h new file mode 100644 -index 0000000000000000000000000000000000000000..fb0cd51d362dfd8af2370f43ecb8835c96450f21 +index 0000000000000000000000000000000000000000..d57c86a11d49efb8105a871a4b420e2b9190a587 --- /dev/null +++ b/Source/WebKit/UIProcess/WebPageInspectorInputAgent.h @@ -0,0 +1,87 @@ @@ -13572,7 +13966,7 @@ index 0000000000000000000000000000000000000000..fb0cd51d362dfd8af2370f43ecb8835c +private: + void platformDispatchKeyEvent(WebEventType type, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, OptionSet modifiers, Vector& commands, MonotonicTime timestamp); +#if PLATFORM(MAC) -+ void platformDispatchMouseEvent(const String& type, int x, int y, std::optional&& modifier, const String& button, std::optional&& clickCount, unsigned short buttons); ++ void platformDispatchMouseEvent(const String& type, int x, int y, std::optional&& modifier, const String& button, std::optional&& clickCount, unsigned short buttons, MonotonicTime timestamp); +#endif + + Ref m_backendDispatcher; @@ -13590,10 +13984,10 @@ index 0000000000000000000000000000000000000000..fb0cd51d362dfd8af2370f43ecb8835c + +} // namespace WebKit diff --git a/Source/WebKit/UIProcess/WebPageProxy.cpp b/Source/WebKit/UIProcess/WebPageProxy.cpp -index 6d146def06cd6dc28a77e362d0dcd271571ed165..0d01738ce95c10aaa45922ab954b3fff53bb97bf 100644 +index 5828bd882da8056e3d5dd97b07416ae2f5c0b4e0..96668f979953d797ab8391a0eb89a4109414c22c 100644 --- a/Source/WebKit/UIProcess/WebPageProxy.cpp +++ b/Source/WebKit/UIProcess/WebPageProxy.cpp -@@ -219,6 +219,7 @@ +@@ -220,6 +220,7 @@ #include #include #include @@ -13601,23 +13995,23 @@ index 6d146def06cd6dc28a77e362d0dcd271571ed165..0d01738ce95c10aaa45922ab954b3fff #include #include #include -@@ -232,6 +233,7 @@ +@@ -233,6 +234,7 @@ #include #include #include +#include + #include #include #include - #include -@@ -260,6 +262,7 @@ - #include +@@ -263,6 +265,7 @@ #include #include + #include +#include #include #include #include -@@ -270,10 +273,12 @@ +@@ -273,11 +276,13 @@ #include #include #include @@ -13625,12 +14019,13 @@ index 6d146def06cd6dc28a77e362d0dcd271571ed165..0d01738ce95c10aaa45922ab954b3fff #include #include #include + #include #include +#include #include #include #include -@@ -367,7 +372,7 @@ +@@ -371,7 +376,7 @@ #include "ViewSnapshotStore.h" #endif @@ -13639,7 +14034,7 @@ index 6d146def06cd6dc28a77e362d0dcd271571ed165..0d01738ce95c10aaa45922ab954b3fff #include #endif -@@ -497,6 +502,17 @@ static constexpr Seconds tryCloseTimeoutDelay = 50_ms; +@@ -509,6 +514,17 @@ static constexpr Seconds tryCloseTimeoutDelay = 50_ms; static constexpr Seconds audibleActivityClearDelay = 10_s; #endif @@ -13657,7 +14052,7 @@ index 6d146def06cd6dc28a77e362d0dcd271571ed165..0d01738ce95c10aaa45922ab954b3fff #if PLATFORM(COCOA) static WorkQueue& sharedFileQueueSingleton() { -@@ -1106,6 +1122,10 @@ WebPageProxy::~WebPageProxy() +@@ -1104,6 +1120,10 @@ WebPageProxy::~WebPageProxy() ASSERT(webPageProxyMap().get(m_identifier) == this); webPageProxyMap().remove(m_identifier); @@ -13668,7 +14063,7 @@ index 6d146def06cd6dc28a77e362d0dcd271571ed165..0d01738ce95c10aaa45922ab954b3fff } void WebPageProxy::addAllMessageReceivers() -@@ -1679,7 +1699,7 @@ void WebPageProxy::didAttachToRunningProcess() +@@ -1680,7 +1700,7 @@ void WebPageProxy::didAttachToRunningProcess() #if ENABLE(FULLSCREEN_API) ASSERT(!m_fullScreenManager); @@ -13677,7 +14072,7 @@ index 6d146def06cd6dc28a77e362d0dcd271571ed165..0d01738ce95c10aaa45922ab954b3fff #endif #if ENABLE(VIDEO_PRESENTATION_MODE) ASSERT(!m_playbackSessionManager); -@@ -1711,7 +1731,7 @@ void WebPageProxy::didAttachToRunningProcess() +@@ -1719,7 +1739,7 @@ void WebPageProxy::didAttachToRunningProcess() #endif #if !PLATFORM(IOS_FAMILY) @@ -13686,15 +14081,15 @@ index 6d146def06cd6dc28a77e362d0dcd271571ed165..0d01738ce95c10aaa45922ab954b3fff #else auto currentOrientation = toScreenOrientationType(m_deviceOrientation); #endif -@@ -1851,6 +1871,7 @@ void WebPageProxy::initializeWebPage(const Site& site, WebCore::SandboxFlags eff +@@ -1861,6 +1881,7 @@ void WebPageProxy::initializeWebPage(const Site& site, WebCore::SandboxFlags eff if (preferences->siteIsolationEnabled()) browsingContextGroup->addPage(*this); process->send(Messages::WebProcess::CreateWebPage(m_webPageID, creationParameters(process, *protect(drawingArea()), m_mainFrame->frameID(), std::nullopt)), 0); + m_inspectorController->didInitializeWebPage(); - #if ENABLE(WINDOW_PROXY_PROPERTY_ACCESS_NOTIFICATION) - internals().frameLoadStateObserver = WebPageProxyFrameLoadStateObserver::create(); -@@ -2172,6 +2193,21 @@ WebProcessProxy& WebPageProxy::ensureRunningProcess() + process->addVisitedLinkStoreUser(m_visitedLinkStore, identifier()); + +@@ -2177,6 +2198,21 @@ WebProcessProxy& WebPageProxy::ensureRunningProcess() return m_legacyMainFrameProcess; } @@ -13716,7 +14111,7 @@ index 6d146def06cd6dc28a77e362d0dcd271571ed165..0d01738ce95c10aaa45922ab954b3fff RefPtr WebPageProxy::loadRequest(WebCore::ResourceRequest&& request, ShouldOpenExternalURLsPolicy shouldOpenExternalURLsPolicy, NavigationUpgradeToHTTPSBehavior navigationUpgradeToHTTPSBehavior, std::unique_ptr&& lastNavigationAction, API::Object* userData, bool isRequestFromClientOrUserInput) { if (m_isClosed) -@@ -2297,11 +2333,29 @@ void WebPageProxy::loadRequestWithNavigationShared(Ref&& proces +@@ -2306,11 +2342,29 @@ void WebPageProxy::loadRequestWithNavigationShared(Ref&& proces navigation->setIsLoadedWithNavigationShared(true); protectedProcess->markProcessAsRecentlyUsed(); @@ -13750,7 +14145,7 @@ index 6d146def06cd6dc28a77e362d0dcd271571ed165..0d01738ce95c10aaa45922ab954b3fff }); } -@@ -2897,6 +2951,53 @@ RefPtr WebPageProxy::activeAutomationSession() const +@@ -3019,6 +3073,53 @@ RefPtr WebPageProxy::activeAutomationSession() const return m_configuration->processPool().automationSession(); } @@ -13804,9 +14199,9 @@ index 6d146def06cd6dc28a77e362d0dcd271571ed165..0d01738ce95c10aaa45922ab954b3fff void WebPageProxy::sendMessageToInspectorFrontend(const String& targetId, const String& message) { m_inspectorController->sendMessageToInspectorFrontend(targetId, message); -@@ -3200,6 +3301,24 @@ void WebPageProxy::updateActivityState(OptionSet flagsToUpdate) - bool wasVisible = isViewVisible(); - RefPtr pageClient = this->pageClient(); +@@ -3324,6 +3425,24 @@ void WebPageProxy::updateActivityState(OptionSet flagsToUpdate) + if (!pageClient) + return; internals().activityState.remove(flagsToUpdate); + + if (m_activeForAutomation) { @@ -13829,7 +14224,7 @@ index 6d146def06cd6dc28a77e362d0dcd271571ed165..0d01738ce95c10aaa45922ab954b3fff if (flagsToUpdate & ActivityState::IsFocused && pageClient->isViewFocused()) internals().activityState.add(ActivityState::IsFocused); if (flagsToUpdate & ActivityState::WindowIsActive && pageClient->isViewWindowActive()) -@@ -3994,7 +4113,7 @@ void WebPageProxy::performDragOperation(DragData& dragData, const String& dragSt +@@ -4157,7 +4276,7 @@ void WebPageProxy::performDragOperation(DragData& dragData, const String& dragSt if (!hasRunningProcess()) return; @@ -13838,7 +14233,7 @@ index 6d146def06cd6dc28a77e362d0dcd271571ed165..0d01738ce95c10aaa45922ab954b3fff URL url { dragData.asURL() }; if (url.protocolIsFile()) protect(legacyMainFrameProcess())->assumeReadAccessToBaseURL(*this, url.string(), [] { }); -@@ -4037,6 +4156,8 @@ void WebPageProxy::performDragControllerAction(DragControllerAction action, Drag +@@ -4200,6 +4319,8 @@ void WebPageProxy::performDragControllerAction(DragControllerAction action, Drag if (!hasRunningProcess()) return; @@ -13847,7 +14242,7 @@ index 6d146def06cd6dc28a77e362d0dcd271571ed165..0d01738ce95c10aaa45922ab954b3fff auto completionHandler = [this, protectedThis = Ref { *this }, action, dragData] (std::optional dragOperation, WebCore::DragHandlingMethod dragHandlingMethod, bool mouseIsOverFileInput, unsigned numberOfItemsToBeAccepted, const IntRect& insertionRect, const IntRect& editableElementRect, std::optional remoteUserInputEventData) mutable { if (!m_pageClient) return; -@@ -4048,7 +4169,7 @@ void WebPageProxy::performDragControllerAction(DragControllerAction action, Drag +@@ -4211,7 +4332,7 @@ void WebPageProxy::performDragControllerAction(DragControllerAction action, Drag dragData.setClientPosition(roundedIntPoint(remoteUserInputEventData->transformedPoint)); performDragControllerAction(action, dragData, remoteUserInputEventData->targetFrameID); }; @@ -13856,7 +14251,7 @@ index 6d146def06cd6dc28a77e362d0dcd271571ed165..0d01738ce95c10aaa45922ab954b3fff ASSERT(dragData.platformData()); sendWithAsyncReplyToProcessContainingFrame(frameID, Messages::WebPage::PerformDragControllerAction(action, dragData.clientPosition(), dragData.globalPosition(), dragData.draggingSourceOperationMask(), *dragData.platformData(), dragData.flags()), WTF::move(completionHandler)); #else -@@ -4083,17 +4204,36 @@ void WebPageProxy::didPerformDragControllerAction(std::optionalpageClient()) pageClient->didPerformDragControllerAction(); @@ -13896,7 +14291,7 @@ index 6d146def06cd6dc28a77e362d0dcd271571ed165..0d01738ce95c10aaa45922ab954b3fff didStartDrag(); } #endif -@@ -4114,6 +4254,24 @@ void WebPageProxy::dragEnded(const IntPoint& clientPosition, const IntPoint& glo +@@ -4277,6 +4417,24 @@ void WebPageProxy::dragEnded(const IntPoint& clientPosition, const IntPoint& glo setDragCaretRect({ }); } @@ -13921,7 +14316,7 @@ index 6d146def06cd6dc28a77e362d0dcd271571ed165..0d01738ce95c10aaa45922ab954b3fff void WebPageProxy::didStartDrag(const std::optional& targetFrameID) { if (!hasRunningProcess()) -@@ -4122,6 +4280,25 @@ void WebPageProxy::didStartDrag(const std::optional& targetFram +@@ -4285,6 +4443,25 @@ void WebPageProxy::didStartDrag(const std::optional& targetFram discardQueuedMouseEvents(); sendToProcessContainingFrame(targetFrameID, Messages::WebPage::DidStartDrag(targetFrameID)); @@ -13947,7 +14342,7 @@ index 6d146def06cd6dc28a77e362d0dcd271571ed165..0d01738ce95c10aaa45922ab954b3fff } void WebPageProxy::dragCancelled() -@@ -4306,26 +4483,47 @@ void WebPageProxy::processNextQueuedMouseEvent() +@@ -4469,26 +4646,47 @@ void WebPageProxy::processNextQueuedMouseEvent() auto eventType = event->type(); startResponsivenessTimerForMouseEvent(*targetFrame, eventType); @@ -14007,7 +14402,7 @@ index 6d146def06cd6dc28a77e362d0dcd271571ed165..0d01738ce95c10aaa45922ab954b3fff } #if ENABLE(MAC_GESTURE_EVENTS) -@@ -4592,6 +4790,8 @@ void WebPageProxy::wheelEventHandlingCompleted(bool wasHandled) +@@ -4751,6 +4949,8 @@ void WebPageProxy::wheelEventHandlingCompleted(bool wasHandled) if (RefPtr automationSession = m_configuration->processPool().automationSession()) automationSession->wheelEventsFlushedForPage(*this); @@ -14016,7 +14411,7 @@ index 6d146def06cd6dc28a77e362d0dcd271571ed165..0d01738ce95c10aaa45922ab954b3fff } void WebPageProxy::cacheWheelEventScrollingAccelerationCurve(const NativeWebWheelEvent& nativeWheelEvent) -@@ -4735,7 +4935,7 @@ static TrackingType mergeTrackingTypes(TrackingType a, TrackingType b) +@@ -4894,7 +5094,7 @@ static TrackingType mergeTrackingTypes(TrackingType a, TrackingType b) void WebPageProxy::updateTouchEventTracking(const WebTouchEvent& touchStartEvent) { @@ -14025,7 +14420,7 @@ index 6d146def06cd6dc28a77e362d0dcd271571ed165..0d01738ce95c10aaa45922ab954b3fff for (auto& touchPoint : touchStartEvent.touchPoints()) { auto location = touchPoint.locationInRootView(); auto update = [this, location](TrackingType& trackingType, EventTrackingRegions::EventType eventType) { -@@ -5577,6 +5777,7 @@ Ref WebPageProxy::navigationOriginatingPage(const FrameInfoData& f +@@ -5759,6 +5959,7 @@ Ref WebPageProxy::navigationOriginatingPage(const FrameInfoData& f void WebPageProxy::receivedPolicyDecision(PolicyAction action, API::Navigation* navigation, std::optional, Ref>>&& websitePoliciesAndProcess, Ref&& navigationAction, WillContinueLoadInNewProcess willContinueLoadInNewProcess, std::optional sandboxExtensionHandle, std::optional&& consoleMessage, CompletionHandler&& completionHandler) { @@ -14033,15 +14428,7 @@ index 6d146def06cd6dc28a77e362d0dcd271571ed165..0d01738ce95c10aaa45922ab954b3fff if (!hasRunningProcess()) return completionHandler(PolicyDecision { }); -@@ -6677,6 +6878,7 @@ void WebPageProxy::viewScaleFactorDidChange(IPC::Connection& connection, double - MESSAGE_CHECK_BASE(scaleFactorIsValid(scaleFactor), connection); - if (!legacyMainFrameProcess().hasConnection(connection)) - return; -+ m_viewScaleFactor = scaleFactor; - - forEachWebContentProcess([&] (auto& process, auto pageID) { - if (&process == &legacyMainFrameProcess()) -@@ -7530,6 +7732,7 @@ void WebPageProxy::didDestroyNavigationShared(Ref&& process, We +@@ -7816,6 +8017,7 @@ void WebPageProxy::didDestroyNavigationShared(Ref&& process, We RefPtr protectedPageClient { pageClient() }; m_navigationState->didDestroyNavigation(process->coreProcessIdentifier(), navigationID); @@ -14049,7 +14436,7 @@ index 6d146def06cd6dc28a77e362d0dcd271571ed165..0d01738ce95c10aaa45922ab954b3fff } void WebPageProxy::didStartProvisionalLoadForFrame(IPC::Connection& connection, FrameIdentifier frameID, FrameInfoData&& frameInfo, ResourceRequest&& request, std::optional navigationID, URL&& url, URL&& unreachableURL, const UserData& userData, WallTime timestamp) -@@ -7924,6 +8127,8 @@ void WebPageProxy::didFailProvisionalLoadForFrameShared(Ref&& p +@@ -8209,6 +8411,8 @@ void WebPageProxy::didFailProvisionalLoadForFrameShared(Ref&& p m_failingProvisionalLoadURL = { }; m_allowsLoadingAlternateHTMLForFailingProvisionalLoadURL = true; @@ -14058,7 +14445,7 @@ index 6d146def06cd6dc28a77e362d0dcd271571ed165..0d01738ce95c10aaa45922ab954b3fff // 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; -@@ -9693,6 +9898,8 @@ void WebPageProxy::createNewPage(IPC::Connection& connection, WindowFeatures&& w +@@ -10212,6 +10416,8 @@ void WebPageProxy::createNewPage(IPC::Connection& connection, WindowFeatures&& w if (RefPtr page = originatingFrameInfo->page()) openerAppInitiatedState = page->lastNavigationWasAppInitiated(); @@ -14067,7 +14454,7 @@ index 6d146def06cd6dc28a77e362d0dcd271571ed165..0d01738ce95c10aaa45922ab954b3fff auto completionHandler = [ this, protectedThis = Ref { *this }, -@@ -9780,6 +9987,7 @@ void WebPageProxy::createNewPage(IPC::Connection& connection, WindowFeatures&& w +@@ -10305,6 +10511,7 @@ void WebPageProxy::createNewPage(IPC::Connection& connection, WindowFeatures&& w configuration->setInitialReferrerPolicy(effectiveReferrerPolicy); configuration->setWindowFeatures(WTF::move(windowFeatures)); configuration->setOpenedMainFrameName(openedMainFrameName); @@ -14075,7 +14462,7 @@ index 6d146def06cd6dc28a77e362d0dcd271571ed165..0d01738ce95c10aaa45922ab954b3fff if (RefPtr openerFrame = WebFrameProxy::webFrame(originatingFrameInfoData.frameID); navigationActionData.hasOpener && openerFrame) { configuration->setRelatedPage(*this); -@@ -9815,6 +10023,7 @@ void WebPageProxy::createNewPage(IPC::Connection& connection, WindowFeatures&& w +@@ -10340,6 +10547,7 @@ void WebPageProxy::createNewPage(IPC::Connection& connection, WindowFeatures&& w void WebPageProxy::showPage() { m_uiClient->showPage(this); @@ -14083,7 +14470,7 @@ index 6d146def06cd6dc28a77e362d0dcd271571ed165..0d01738ce95c10aaa45922ab954b3fff } bool WebPageProxy::hasOpenedPage() const -@@ -9958,6 +10167,10 @@ void WebPageProxy::closePage() +@@ -10483,6 +10691,10 @@ void WebPageProxy::closePage() if (isClosed()) return; @@ -14094,7 +14481,7 @@ index 6d146def06cd6dc28a77e362d0dcd271571ed165..0d01738ce95c10aaa45922ab954b3fff WEBPAGEPROXY_RELEASE_LOG(Process, "closePage:"); if (RefPtr pageClient = this->pageClient()) pageClient->clearAllEditCommands(); -@@ -9997,6 +10210,8 @@ void WebPageProxy::runJavaScriptAlert(IPC::Connection& connection, FrameIdentifi +@@ -10522,6 +10734,8 @@ void WebPageProxy::runJavaScriptAlert(IPC::Connection& connection, FrameIdentifi auto showModal = [protectedThis = Ref { *this }](RefPtr&& frame, FrameInfoData&& frameInfo, String&& message, CompletionHandler&& reply) mutable { protectedThis->runModalJavaScriptDialog(WTF::move(frame), WTF::move(frameInfo), WTF::move(message), [reply = WTF::move(reply)](WebPageProxy& page, WebFrameProxy* frame, FrameInfoData&& frameInfo, String&& message, CompletionHandler&& completion) mutable { @@ -14103,7 +14490,7 @@ index 6d146def06cd6dc28a77e362d0dcd271571ed165..0d01738ce95c10aaa45922ab954b3fff page.m_uiClient->runJavaScriptAlert(page, WTF::move(message), frame, WTF::move(frameInfo), [reply = WTF::move(reply), completion = WTF::move(completion)]() mutable { reply(); completion(); -@@ -10030,6 +10245,8 @@ void WebPageProxy::runJavaScriptConfirm(IPC::Connection& connection, FrameIdenti +@@ -10555,6 +10769,8 @@ void WebPageProxy::runJavaScriptConfirm(IPC::Connection& connection, FrameIdenti if (RefPtr automationSession = configuration().processPool().automationSession()) automationSession->willShowJavaScriptDialog(*this, message, std::nullopt); } @@ -14112,7 +14499,7 @@ index 6d146def06cd6dc28a77e362d0dcd271571ed165..0d01738ce95c10aaa45922ab954b3fff auto showModal = [protectedThis = Ref { *this }](RefPtr&& frame, FrameInfoData&& frameInfo, String&& message, CompletionHandler&& reply) mutable { protectedThis->runModalJavaScriptDialog(WTF::move(frame), WTF::move(frameInfo), WTF::move(message), [reply = WTF::move(reply)](WebPageProxy& page, WebFrameProxy* frame, FrameInfoData&& frameInfo, String&& message, CompletionHandler&& completion) mutable { -@@ -10066,6 +10283,8 @@ void WebPageProxy::runJavaScriptPrompt(IPC::Connection& connection, FrameIdentif +@@ -10591,6 +10807,8 @@ void WebPageProxy::runJavaScriptPrompt(IPC::Connection& connection, FrameIdentif if (RefPtr automationSession = configuration().processPool().automationSession()) automationSession->willShowJavaScriptDialog(*this, message, defaultValue); } @@ -14121,7 +14508,7 @@ index 6d146def06cd6dc28a77e362d0dcd271571ed165..0d01738ce95c10aaa45922ab954b3fff auto showModal = [protectedThis = Ref { *this }](RefPtr&& frame, FrameInfoData&& frameInfo, String&& message, String&& defaultValue, CompletionHandler&& reply) mutable { protectedThis->runModalJavaScriptDialog(WTF::move(frame), WTF::move(frameInfo), WTF::move(message), [reply = WTF::move(reply), defaultValue = WTF::move(defaultValue)](WebPageProxy& page, WebFrameProxy* frame, FrameInfoData&& frameInfo, String&& message, CompletionHandler&& completion) mutable { -@@ -10280,6 +10499,8 @@ void WebPageProxy::runBeforeUnloadConfirmPanel(IPC::Connection& connection, Fram +@@ -10805,6 +11023,8 @@ void WebPageProxy::runBeforeUnloadConfirmPanel(IPC::Connection& connection, Fram return; } } @@ -14130,7 +14517,7 @@ index 6d146def06cd6dc28a77e362d0dcd271571ed165..0d01738ce95c10aaa45922ab954b3fff // Since runBeforeUnloadConfirmPanel() can spin a nested run loop we need to turn off the responsiveness timer and the tryClose timer. webProcess->stopResponsivenessTimer(); -@@ -10969,6 +11190,11 @@ void WebPageProxy::resourceLoadDidCompleteWithError(ResourceLoadInfo&& loadInfo, +@@ -11494,6 +11714,11 @@ void WebPageProxy::resourceLoadDidCompleteWithError(ResourceLoadInfo&& loadInfo, } #if ENABLE(FULLSCREEN_API) @@ -14142,7 +14529,7 @@ index 6d146def06cd6dc28a77e362d0dcd271571ed165..0d01738ce95c10aaa45922ab954b3fff WebFullScreenManagerProxy* WebPageProxy::fullScreenManager() { return m_fullScreenManager.get(); -@@ -11098,6 +11324,17 @@ void WebPageProxy::requestDOMPasteAccess(IPC::Connection& connection, DOMPasteAc +@@ -11606,6 +11831,17 @@ void WebPageProxy::requestDOMPasteAccess(IPC::Connection& connection, DOMPasteAc } } @@ -14160,7 +14547,7 @@ index 6d146def06cd6dc28a77e362d0dcd271571ed165..0d01738ce95c10aaa45922ab954b3fff protect(pageClient())->requestDOMPasteAccess(pasteAccessCategory, requiresInteraction, elementRect, originIdentifier, WTF::move(completionHandler)); } -@@ -12080,6 +12317,8 @@ void WebPageProxy::mouseEventHandlingCompleted(std::optional event +@@ -12595,6 +12831,8 @@ void WebPageProxy::mouseEventHandlingCompleted(std::optional event if (RefPtr automationSession = configuration().processPool().automationSession()) automationSession->mouseEventsFlushedForPage(*this); didFinishProcessingAllPendingMouseEvents(); @@ -14169,7 +14556,7 @@ index 6d146def06cd6dc28a77e362d0dcd271571ed165..0d01738ce95c10aaa45922ab954b3fff } } -@@ -12138,6 +12377,7 @@ void WebPageProxy::keyEventHandlingCompleted(std::optional eventTy +@@ -12653,6 +12891,7 @@ void WebPageProxy::keyEventHandlingCompleted(std::optional eventTy if (RefPtr automationSession = configuration().processPool().automationSession()) automationSession->keyboardEventsFlushedForPage(*this); didFinishProcessingAllPendingKeyEvents(); @@ -14177,7 +14564,7 @@ index 6d146def06cd6dc28a77e362d0dcd271571ed165..0d01738ce95c10aaa45922ab954b3fff } } -@@ -12589,7 +12829,10 @@ void WebPageProxy::dispatchProcessDidTerminate(WebProcessProxy& process, Process +@@ -13104,7 +13343,10 @@ void WebPageProxy::dispatchProcessDidTerminate(WebProcessProxy& process, Process protect(browsingContextGroup())->processDidTerminate(*this, process); } @@ -14189,7 +14576,7 @@ index 6d146def06cd6dc28a77e362d0dcd271571ed165..0d01738ce95c10aaa45922ab954b3fff if (m_loaderClient) handledByClient = reason != ProcessTerminationReason::RequestedByClient && m_loaderClient->processDidCrash(*this); else -@@ -13264,6 +13507,9 @@ WebPageCreationParameters WebPageProxy::creationParameters(WebProcessProxy& proc +@@ -13785,6 +14027,9 @@ WebPageCreationParameters WebPageProxy::creationParameters(WebProcessProxy& proc parameters.allowPostingLegacySynchronousMessages = m_configuration->allowPostingLegacySynchronousMessages(); parameters.backgroundTextExtractionEnabled = m_configuration->backgroundTextExtractionEnabled(); @@ -14199,7 +14586,7 @@ index 6d146def06cd6dc28a77e362d0dcd271571ed165..0d01738ce95c10aaa45922ab954b3fff #if ENABLE(APP_HIGHLIGHTS) parameters.appHighlightsVisible = appHighlightsVisibility() ? HighlightVisibility::Visible : HighlightVisibility::Hidden; #endif -@@ -13442,8 +13688,47 @@ void WebPageProxy::allowGamepadAccess() +@@ -13964,8 +14209,47 @@ void WebPageProxy::allowGamepadAccess() #endif // ENABLE(GAMEPAD) @@ -14247,7 +14634,7 @@ index 6d146def06cd6dc28a77e362d0dcd271571ed165..0d01738ce95c10aaa45922ab954b3fff if (negotiatedLegacyTLS == NegotiatedLegacyTLS::Yes) { m_navigationClient->shouldAllowLegacyTLS(*this, authenticationChallenge.get(), [this, protectedThis = Ref { *this }, authenticationChallenge] (bool shouldAllowLegacyTLS) { if (shouldAllowLegacyTLS) -@@ -13539,6 +13824,12 @@ void WebPageProxy::requestGeolocationPermissionForFrame(IPC::Connection& connect +@@ -14061,6 +14345,12 @@ void WebPageProxy::requestGeolocationPermissionForFrame(IPC::Connection& connect request->deny(); }; @@ -14260,7 +14647,7 @@ index 6d146def06cd6dc28a77e362d0dcd271571ed165..0d01738ce95c10aaa45922ab954b3fff // FIXME: Once iOS migrates to the new WKUIDelegate SPI, clean this up // and make it one UIClient call that calls the completionHandler with false // if there is no delegate instead of returning the completionHandler -@@ -13647,6 +13938,12 @@ void WebPageProxy::queryPermission(const ClientOrigin& clientOrigin, const Permi +@@ -14169,6 +14459,12 @@ void WebPageProxy::queryPermission(const ClientOrigin& clientOrigin, const Permi shouldChangeDeniedToPrompt = false; if (sessionID().isEphemeral()) { @@ -14273,7 +14660,7 @@ index 6d146def06cd6dc28a77e362d0dcd271571ed165..0d01738ce95c10aaa45922ab954b3fff completionHandler(shouldChangeDeniedToPrompt ? PermissionState::Prompt : PermissionState::Denied); return; } -@@ -13661,6 +13958,12 @@ void WebPageProxy::queryPermission(const ClientOrigin& clientOrigin, const Permi +@@ -14183,6 +14479,12 @@ void WebPageProxy::queryPermission(const ClientOrigin& clientOrigin, const Permi return; } @@ -14287,7 +14674,7 @@ index 6d146def06cd6dc28a77e362d0dcd271571ed165..0d01738ce95c10aaa45922ab954b3fff completionHandler(shouldChangeDeniedToPrompt ? PermissionState::Prompt : PermissionState::Denied); return; diff --git a/Source/WebKit/UIProcess/WebPageProxy.h b/Source/WebKit/UIProcess/WebPageProxy.h -index 7986a8110cb475c181cde5446e230bbc58b3408c..cb5f630fc1d420c4ff045ec20f9bb0e6fae6a816 100644 +index fc916a39ed7e220e7dc715609ce30d8c0d0ce729..747653a1589a83cbf0aaa4c2b2c912e879970c05 100644 --- a/Source/WebKit/UIProcess/WebPageProxy.h +++ b/Source/WebKit/UIProcess/WebPageProxy.h @@ -28,6 +28,7 @@ @@ -14296,9 +14683,9 @@ index 7986a8110cb475c181cde5446e230bbc58b3408c..cb5f630fc1d420c4ff045ec20f9bb0e6 #include "APIObject.h" +#include "APIWebsitePolicies.h" #include "MessageReceiver.h" + #include "TextExtractionAssertionScope.h" #include - #include -@@ -40,6 +41,20 @@ +@@ -41,6 +42,20 @@ #include #include #include @@ -14319,7 +14706,7 @@ index 7986a8110cb475c181cde5446e230bbc58b3408c..cb5f630fc1d420c4ff045ec20f9bb0e6 #if USE(COORDINATED_GRAPHICS) && HAVE(DISPLAY_LINK) #include "DisplayLinkObserverID.h" -@@ -127,6 +142,7 @@ class DragData; +@@ -132,6 +147,7 @@ class DragData; class Exception; class FloatPoint; class FloatQuad; @@ -14327,7 +14714,7 @@ index 7986a8110cb475c181cde5446e230bbc58b3408c..cb5f630fc1d420c4ff045ec20f9bb0e6 class FloatRect; class FloatSize; class FontAttributeChanges; -@@ -841,6 +857,8 @@ public: +@@ -847,6 +863,8 @@ public: RefPtr activeAutomationSession() const; @@ -14336,7 +14723,7 @@ index 7986a8110cb475c181cde5446e230bbc58b3408c..cb5f630fc1d420c4ff045ec20f9bb0e6 WebPageInspectorController& inspectorController() LIFETIME_BOUND { return m_inspectorController.get(); } #if PLATFORM(IOS_FAMILY) -@@ -874,6 +892,7 @@ public: +@@ -881,6 +899,7 @@ public: bool NODELETE hasSleepDisabler() const; #if ENABLE(FULLSCREEN_API) @@ -14344,7 +14731,7 @@ index 7986a8110cb475c181cde5446e230bbc58b3408c..cb5f630fc1d420c4ff045ec20f9bb0e6 WebFullScreenManagerProxy* NODELETE fullScreenManager(); void setFullScreenClientForTesting(std::unique_ptr&&); -@@ -942,6 +961,12 @@ public: +@@ -944,6 +963,12 @@ public: void setPageLoadStateObserver(RefPtr&&); @@ -14357,7 +14744,7 @@ index 7986a8110cb475c181cde5446e230bbc58b3408c..cb5f630fc1d420c4ff045ec20f9bb0e6 void initializeWebPage(const WebCore::Site&, WebCore::SandboxFlags, WebCore::ReferrerPolicy); void setDrawingArea(RefPtr&&); -@@ -973,6 +998,8 @@ public: +@@ -975,6 +1000,8 @@ public: RefPtr loadRequest(WebCore::ResourceRequest&&, WebCore::ShouldOpenExternalURLsPolicy, WebCore::NavigationUpgradeToHTTPSBehavior); RefPtr loadRequest(WebCore::ResourceRequest&&, WebCore::ShouldOpenExternalURLsPolicy, WebCore::NavigationUpgradeToHTTPSBehavior, std::unique_ptr&&, API::Object* userData = nullptr, bool isRequestFromClientOrUserInput = true); @@ -14366,7 +14753,7 @@ index 7986a8110cb475c181cde5446e230bbc58b3408c..cb5f630fc1d420c4ff045ec20f9bb0e6 RefPtr loadFile(const String& fileURL, const String& resourceDirectoryURL, bool isAppInitiated = true, API::Object* userData = nullptr); RefPtr loadData(Ref&&, const String& MIMEType, const String& encoding, const String& baseURL, API::Object* userData = nullptr); RefPtr loadData(Ref&&, const String& MIMEType, const String& encoding, const String& baseURL, API::Object* userData, WebCore::ShouldOpenExternalURLsPolicy); -@@ -1074,6 +1101,7 @@ public: +@@ -1076,6 +1103,7 @@ public: void restoreSelectionInFocusedEditableElement(); PageClient* NODELETE pageClient() const; @@ -14374,7 +14761,7 @@ index 7986a8110cb475c181cde5446e230bbc58b3408c..cb5f630fc1d420c4ff045ec20f9bb0e6 void setViewNeedsDisplay(const WebCore::Region&); void requestScroll(const WebCore::FloatPoint& scrollPosition, const WebCore::IntPoint& scrollOrigin, WebCore::ScrollIsAnimated, WebCore::InterruptScrollAnimation); -@@ -1757,11 +1785,14 @@ public: +@@ -1761,11 +1789,14 @@ public: void didStartDrag(const std::optional& = std::nullopt); void dragCancelled(); void setDragCaretRect(const WebCore::IntRect&); @@ -14389,7 +14776,7 @@ index 7986a8110cb475c181cde5446e230bbc58b3408c..cb5f630fc1d420c4ff045ec20f9bb0e6 #endif #if PLATFORM(GTK) || PLATFORM(WPE) void startDrag(WebCore::SelectionData&&, OptionSet, std::optional&& dragImage, WebCore::IntPoint&& dragImageHotspot); -@@ -1769,6 +1800,9 @@ public: +@@ -1773,6 +1804,9 @@ public: #if ENABLE(MODEL_PROCESS) void modelDragEnded(const WebCore::NodeIdentifier); #endif @@ -14399,7 +14786,7 @@ index 7986a8110cb475c181cde5446e230bbc58b3408c..cb5f630fc1d420c4ff045ec20f9bb0e6 #endif void processDidBecomeUnresponsive(WebProcessProxy&); -@@ -2032,6 +2066,7 @@ public: +@@ -2036,6 +2070,7 @@ public: void setViewportSizeForCSSViewportUnits(const WebCore::FloatSize&); WebCore::FloatSize NODELETE viewportSizeForCSSViewportUnits() const; @@ -14407,7 +14794,7 @@ index 7986a8110cb475c181cde5446e230bbc58b3408c..cb5f630fc1d420c4ff045ec20f9bb0e6 void didReceiveAuthenticationChallengeProxy(Ref&&, NegotiatedLegacyTLS); void negotiatedLegacyTLS(); void didNegotiateModernTLS(const URL&); -@@ -2065,6 +2100,8 @@ public: +@@ -2069,6 +2104,8 @@ public: // TODO Replace RefPtr with Expected for error reporting https://webkit.org/b/300271 RefPtr takeViewSnapshot(std::optional&&); RefPtr takeViewSnapshot(std::optional&&, ForceSoftwareCapturingViewportSnapshot); @@ -14416,7 +14803,7 @@ index 7986a8110cb475c181cde5446e230bbc58b3408c..cb5f630fc1d420c4ff045ec20f9bb0e6 #endif void serializeAndWrapCryptoKey(IPC::Connection&, WebCore::CryptoKeyData&&, CompletionHandler>&&)>&&); -@@ -3205,6 +3242,7 @@ private: +@@ -3226,6 +3263,7 @@ private: RefPtr launchProcessForReload(); void requestNotificationPermission(const String& originString, CompletionHandler&&); @@ -14424,7 +14811,7 @@ index 7986a8110cb475c181cde5446e230bbc58b3408c..cb5f630fc1d420c4ff045ec20f9bb0e6 #if ENABLE(WEB_ARCHIVE) bool NODELETE shouldAlwaysPromptForPermission(WebCore::PermissionName) const; -@@ -3755,11 +3793,13 @@ private: +@@ -3789,11 +3827,13 @@ private: String m_openedMainFrameName; RefPtr m_inspector; @@ -14438,7 +14825,7 @@ index 7986a8110cb475c181cde5446e230bbc58b3408c..cb5f630fc1d420c4ff045ec20f9bb0e6 RefPtr m_fullScreenManager; std::unique_ptr m_fullscreenClient; #endif -@@ -3965,6 +4005,22 @@ private: +@@ -4000,6 +4040,22 @@ private: std::optional m_currentDragOperation; bool m_currentDragIsOverFileInput { false }; unsigned m_currentDragNumberOfFilesToBeAccepted { 0 }; @@ -14461,7 +14848,7 @@ index 7986a8110cb475c181cde5446e230bbc58b3408c..cb5f630fc1d420c4ff045ec20f9bb0e6 #endif bool m_mainFrameHasHorizontalScrollbar { false }; -@@ -4136,6 +4192,11 @@ private: +@@ -4167,6 +4223,11 @@ private: RefPtr messageBody; }; Vector m_pendingInjectedBundleMessages; @@ -14474,7 +14861,7 @@ index 7986a8110cb475c181cde5446e230bbc58b3408c..cb5f630fc1d420c4ff045ec20f9bb0e6 #if PLATFORM(IOS_FAMILY) && ENABLE(DEVICE_ORIENTATION) RefPtr m_webDeviceOrientationUpdateProviderProxy; diff --git a/Source/WebKit/UIProcess/WebPageProxy.messages.in b/Source/WebKit/UIProcess/WebPageProxy.messages.in -index 155543cbd71b814586ab391daaa2efa2d11c22ea..b39e2260133f4aa7fe9580496bd4237b3fd52629 100644 +index 98ac446552a0ba482be6f18ea8c5d1d4cab62d24..52ea072824d6b97bfe58e311b93a0237d03cf566 100644 --- a/Source/WebKit/UIProcess/WebPageProxy.messages.in +++ b/Source/WebKit/UIProcess/WebPageProxy.messages.in @@ -35,6 +35,7 @@ messages -> WebPageProxy { @@ -14497,7 +14884,7 @@ index 155543cbd71b814586ab391daaa2efa2d11c22ea..b39e2260133f4aa7fe9580496bd4237b WillReceiveEditDragSnapshot() DidReceiveEditDragSnapshot(RefPtr textIndicator) diff --git a/Source/WebKit/UIProcess/WebProcessCache.cpp b/Source/WebKit/UIProcess/WebProcessCache.cpp -index 1593c4e060fb5fbf399c7d53cb7a81896b945556..c10a4b847f118012380a8d8f35984c81c841d697 100644 +index 81a690dd2023557c4b2f26a367c0dd8c86a795bd..c18c6cba370f510a44a2bee0876188f7480b1b47 100644 --- a/Source/WebKit/UIProcess/WebProcessCache.cpp +++ b/Source/WebKit/UIProcess/WebProcessCache.cpp @@ -125,6 +125,10 @@ bool WebProcessCache::canCacheProcess(WebProcessProxy& process) const @@ -14512,10 +14899,10 @@ index 1593c4e060fb5fbf399c7d53cb7a81896b945556..c10a4b847f118012380a8d8f35984c81 } diff --git a/Source/WebKit/UIProcess/WebProcessPool.cpp b/Source/WebKit/UIProcess/WebProcessPool.cpp -index c9e5f1f1a7dfed59616429838f635538c34124f9..af87d3e1c00f0513658180c5fb397621c1b5505a 100644 +index 7eb5a50ca22231a40f554b4ed88b063e18777654..18eaefd6ae145dd3918e9cc00c1b8131be23095a 100644 --- a/Source/WebKit/UIProcess/WebProcessPool.cpp +++ b/Source/WebKit/UIProcess/WebProcessPool.cpp -@@ -423,10 +423,10 @@ void WebProcessPool::setAutomationClient(std::unique_ptr& +@@ -428,10 +428,10 @@ void WebProcessPool::setAutomationClient(std::unique_ptr& void WebProcessPool::setOverrideLanguages(Vector&& languages) { @@ -14528,7 +14915,7 @@ index c9e5f1f1a7dfed59616429838f635538c34124f9..af87d3e1c00f0513658180c5fb397621 #if ENABLE(GPU_PROCESS) if (RefPtr gpuProcess = GPUProcessProxy::singletonIfCreated()) -@@ -434,9 +434,10 @@ void WebProcessPool::setOverrideLanguages(Vector&& languages) +@@ -439,9 +439,10 @@ void WebProcessPool::setOverrideLanguages(Vector&& languages) #endif #if USE(SOUP) for (Ref networkProcess : NetworkProcessProxy::allNetworkProcesses()) @@ -14540,7 +14927,7 @@ index c9e5f1f1a7dfed59616429838f635538c34124f9..af87d3e1c00f0513658180c5fb397621 void WebProcessPool::fullKeyboardAccessModeChanged(bool fullKeyboardAccessEnabled) { -@@ -977,7 +978,7 @@ void WebProcessPool::initializeNewWebProcess(WebProcessProxy& process, WebsiteDa +@@ -987,7 +988,7 @@ void WebProcessPool::initializeNewWebProcess(WebProcessProxy& process, WebsiteDa #endif parameters.cacheModel = LegacyGlobalSettings::singleton().cacheModel(); @@ -14549,7 +14936,7 @@ index c9e5f1f1a7dfed59616429838f635538c34124f9..af87d3e1c00f0513658180c5fb397621 LOG_WITH_STREAM(Language, stream << "WebProcessPool is initializing a new web process with overrideLanguages: " << parameters.overrideLanguages); parameters.urlSchemesRegisteredAsSecure = copyToVector(LegacyGlobalSettings::singleton().schemesToRegisterAsSecure()); -@@ -1056,7 +1057,7 @@ void WebProcessPool::initializeNewWebProcess(WebProcessProxy& process, WebsiteDa +@@ -1069,7 +1070,7 @@ void WebProcessPool::initializeNewWebProcess(WebProcessProxy& process, WebsiteDa if (!injectedBundleInitializationUserData) injectedBundleInitializationUserData = m_injectedBundleInitializationUserData; parameters.initializationUserData = UserData(process.transformObjectsToHandles(injectedBundleInitializationUserData.get())); @@ -14558,7 +14945,7 @@ index c9e5f1f1a7dfed59616429838f635538c34124f9..af87d3e1c00f0513658180c5fb397621 if (websiteDataStore) parameters.websiteDataStoreParameters = webProcessDataStoreParameters(process, *websiteDataStore); -@@ -1150,14 +1151,14 @@ void WebProcessPool::processDidFinishLaunching(WebProcessProxy& process) +@@ -1163,14 +1164,14 @@ void WebProcessPool::processDidFinishLaunching(WebProcessProxy& process) // Sometimes the memorySampler gets initialized after process initialization has happened but before the process has finished launching // so check if it needs to be started here if (m_memorySamplerEnabled) { @@ -14575,7 +14962,7 @@ index c9e5f1f1a7dfed59616429838f635538c34124f9..af87d3e1c00f0513658180c5fb397621 process.send(Messages::WebProcess::StartMemorySampler(WTF::move(sampleLogSandboxHandle), sampleLogFilePath, m_memorySamplerInterval), 0); } -@@ -1327,6 +1328,12 @@ Ref WebProcessPool::createWebPage(PageClient& pageClient, Ref WebProcessPool::createWebPage(PageClient& pageClient, Refpreferences())->forceEnhancedSecurity() || pageConfiguration->isEnhancedSecurityEnabled() || useEnhancedSecurityFallback) ? EnhancedSecurity::EnabledPolicy : EnhancedSecurity::Disabled; RefPtr relatedPage = pageConfiguration->relatedPage(); @@ -14586,9 +14973,9 @@ index c9e5f1f1a7dfed59616429838f635538c34124f9..af87d3e1c00f0513658180c5fb397621 + pageConfiguration->preferences().setStorageBlockingPolicy(relatedPage->preferences().storageBlockingPolicy()); + bool siteIsolationEnabled = protect(pageConfiguration->preferences())->siteIsolationEnabled(); - if (siteIsolationEnabled) - protect(pageConfiguration->preferences())->setUseUIProcessForBackForwardItemLoading(true); -@@ -1358,9 +1365,9 @@ Ref WebProcessPool::createWebPage(PageClient& pageClient, Ref preferences = pageConfiguration->preferences(); +@@ -1379,9 +1386,9 @@ Ref WebProcessPool::createWebPage(PageClient& pageClient, RefuserContentController(); @@ -14600,7 +14987,7 @@ index c9e5f1f1a7dfed59616429838f635538c34124f9..af87d3e1c00f0513658180c5fb397621 process->setAllowTestOnlyIPC(pageConfiguration->allowTestOnlyIPC()); auto page = process->createWebPage(pageClient, WTF::move(pageConfiguration)); -@@ -1745,18 +1752,18 @@ void WebProcessPool::setEnhancedAccessibility(bool flag) +@@ -1762,18 +1769,18 @@ void WebProcessPool::setEnhancedAccessibility(bool flag) { sendToAllProcesses(Messages::WebProcess::SetEnhancedAccessibility(flag)); } @@ -14623,7 +15010,7 @@ index c9e5f1f1a7dfed59616429838f635538c34124f9..af87d3e1c00f0513658180c5fb397621 for (auto& process : m_processes) { if (!process->canSendMessage()) continue; -@@ -1775,10 +1782,10 @@ void WebProcessPool::startMemorySampler(const double interval) +@@ -1792,10 +1799,10 @@ void WebProcessPool::startMemorySampler(const double interval) } void WebProcessPool::stopMemorySampler() @@ -14636,7 +15023,7 @@ index c9e5f1f1a7dfed59616429838f635538c34124f9..af87d3e1c00f0513658180c5fb397621 // For UIProcess #if ENABLE(MEMORY_SAMPLER) WebMemorySampler::singleton()->stop(); -@@ -1830,7 +1837,7 @@ void WebProcessPool::setAutomationSession(RefPtr&& automat +@@ -1847,7 +1854,7 @@ void WebProcessPool::setAutomationSession(RefPtr&& automat { if (RefPtr previousSession = m_automationSession) previousSession->setProcessPool(nullptr); @@ -14645,7 +15032,7 @@ index c9e5f1f1a7dfed59616429838f635538c34124f9..af87d3e1c00f0513658180c5fb397621 m_automationSession = WTF::move(automationSession); #if ENABLE(REMOTE_INSPECTOR) -@@ -2403,7 +2410,7 @@ std::tuple, RefPtr, ASCIILiteral> WebPr +@@ -2438,7 +2445,7 @@ std::tuple, RefPtr, ASCIILiteral> WebPr } auto reason = "Navigation is cross-site"_s; @@ -14654,7 +15041,7 @@ index c9e5f1f1a7dfed59616429838f635538c34124f9..af87d3e1c00f0513658180c5fb397621 if (m_configuration->alwaysKeepAndReuseSwappedProcesses()) { LOG(ProcessSwapping, "(ProcessSwapping) Considering re-use of a previously cached process for domain %s", targetSite.domain().string().utf8().data()); -@@ -2508,7 +2515,7 @@ void WebProcessPool::setDomainsWithUserInteraction(HashSet>&& domains, CompletionHandler&& completionHandler) @@ -14664,10 +15051,10 @@ index c9e5f1f1a7dfed59616429838f635538c34124f9..af87d3e1c00f0513658180c5fb397621 for (Ref process : borrow(this->processes()).get()) diff --git a/Source/WebKit/UIProcess/WebProcessProxy.cpp b/Source/WebKit/UIProcess/WebProcessProxy.cpp -index fe73856c57fa63cb42aa87d8fbdbf9213b60d903..5a5bf311a3e8c8f7630308d645076d518102f933 100644 +index 4cb137d51b39aeb46c2b61218f5df9d73f920dac..237b21ea3cb10b0f36898080439a374dc4f0256b 100644 --- a/Source/WebKit/UIProcess/WebProcessProxy.cpp +++ b/Source/WebKit/UIProcess/WebProcessProxy.cpp -@@ -215,6 +215,11 @@ Vector> WebProcessProxy::allProcesses() +@@ -216,6 +216,11 @@ Vector> WebProcessProxy::allProcesses() }); } @@ -14679,7 +15066,7 @@ index fe73856c57fa63cb42aa87d8fbdbf9213b60d903..5a5bf311a3e8c8f7630308d645076d51 RefPtr WebProcessProxy::processForIdentifier(ProcessIdentifier identifier) { return allProcessMap().get(identifier); -@@ -583,6 +588,26 @@ void WebProcessProxy::getLaunchOptions(ProcessLauncher::LaunchOptions& launchOpt +@@ -595,6 +600,26 @@ void WebProcessProxy::getLaunchOptions(ProcessLauncher::LaunchOptions& launchOpt if (WebKit::isInspectorProcessPool(processPool())) launchOptions.extraInitializationData.add("inspector-process"_s, "1"_s); @@ -14707,22 +15094,23 @@ index fe73856c57fa63cb42aa87d8fbdbf9213b60d903..5a5bf311a3e8c8f7630308d645076d51 if (isPrewarmed()) diff --git a/Source/WebKit/UIProcess/WebProcessProxy.h b/Source/WebKit/UIProcess/WebProcessProxy.h -index de24d98d450c11eeb1125b037c11c7487f8b2a64..430d84091fc6edda4b7c83ba97002755cbcd5802 100644 +index df560e2b0fd58e4a58d709d9bbc77b3240c3a10e..8cc41f2747d229fffc6c1d566b0086e294c73735 100644 --- a/Source/WebKit/UIProcess/WebProcessProxy.h +++ b/Source/WebKit/UIProcess/WebProcessProxy.h -@@ -208,6 +208,7 @@ public: +@@ -212,6 +212,8 @@ public: + void addAllowedFirstPartyForCookies(const WebCore::RegistrableDomain&, LoadedWebArchive); + const std::pair>& allowedFirstPartiesForCookiesData() const { return m_allowedFirstPartiesForCookies; } - static void forWebPagesWithOrigin(PAL::SessionID, const WebCore::SecurityOriginData&, NOESCAPE const Function&); - static Vector> allowedFirstPartiesForCookies(); + static Vector> allProcessesForInspector(); - ++ void initializeWebProcess(WebProcessCreationParameters&&); + unsigned suspendedPageCount() const; diff --git a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp -index 30393ff0101f487d3e88ad21d83d3a4b54f5af1c..db7fc92889f792a386437837e2a875639d6439a7 100644 +index 4cbf31a5842ab9fdda6c95d9eb929153c6d49dc7..ec8d77c5306a079bd30b51d538f154b25e73e4a2 100644 --- a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp +++ b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp -@@ -315,15 +315,10 @@ SOAuthorizationCoordinator& WebsiteDataStore::soAuthorizationCoordinator(const W +@@ -316,15 +316,10 @@ SOAuthorizationCoordinator& WebsiteDataStore::soAuthorizationCoordinator(const W static Ref networkProcessForSession(PAL::SessionID sessionID) { @@ -14741,7 +15129,7 @@ index 30393ff0101f487d3e88ad21d83d3a4b54f5af1c..db7fc92889f792a386437837e2a87563 #else UNUSED_PARAM(sessionID); return NetworkProcessProxy::ensureDefaultNetworkProcess(); -@@ -2105,6 +2100,15 @@ void WebsiteDataStore::setCacheModelSynchronouslyForTesting(CacheModel cacheMode +@@ -2119,6 +2114,15 @@ void WebsiteDataStore::setCacheModelSynchronouslyForTesting(CacheModel cacheMode processPool->setCacheModelSynchronouslyForTesting(cacheModel); } @@ -14757,7 +15145,7 @@ index 30393ff0101f487d3e88ad21d83d3a4b54f5af1c..db7fc92889f792a386437837e2a87563 Vector WebsiteDataStore::parametersFromEachWebsiteDataStore() { return WTF::map(allDataStores(), [](auto& entry) { -@@ -2529,6 +2533,12 @@ void WebsiteDataStore::lastPageLoadNetworkActivityCompletionCodeForTesting(WebCo +@@ -2550,6 +2554,12 @@ void WebsiteDataStore::lastPageLoadNetworkActivityCompletionCodeForTesting(WebCo protect(networkProcess())->lastPageLoadNetworkActivityCompletionCodeForTesting(m_sessionID, pageID, WTF::move(completionHandler)); } @@ -14771,7 +15159,7 @@ index 30393ff0101f487d3e88ad21d83d3a4b54f5af1c..db7fc92889f792a386437837e2a87563 void WebsiteDataStore::hasAppBoundSession(CompletionHandler&& completionHandler) const { diff --git a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h -index 5638384abdaa629b6b41ecfea4a3314cdce4a28f..cefc3c54d4ff37c0cbe09761ffbbadcbc12b815a 100644 +index 948c89fc30236146c2faea29f2ea8b2842963406..bc667cd080b1ba3f6710a7d40d0bbc497fdd02c4 100644 --- a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h +++ b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h @@ -103,6 +103,7 @@ class DeviceIdHashSaltStorage; @@ -14782,7 +15170,7 @@ index 5638384abdaa629b6b41ecfea4a3314cdce4a28f..cefc3c54d4ff37c0cbe09761ffbbadcb class VirtualAuthenticatorManager; class WebPageProxy; class WebProcessPool; -@@ -118,6 +119,7 @@ enum class UnifiedOriginStorageLevel : uint8_t; +@@ -119,6 +120,7 @@ enum class UnifiedOriginStorageLevel : uint8_t; enum class WebsiteDataFetchOption : uint8_t; enum class WebsiteDataType : uint32_t; @@ -14790,7 +15178,7 @@ index 5638384abdaa629b6b41ecfea4a3314cdce4a28f..cefc3c54d4ff37c0cbe09761ffbbadcb struct ITPThirdPartyData; struct NetworkProcessConnectionInfo; struct WebPushMessage; -@@ -127,6 +129,14 @@ struct WebsiteDataStoreParameters; +@@ -128,6 +130,14 @@ struct WebsiteDataStoreParameters; enum RemoveDataTaskCounterType { }; using RemoveDataTaskCounter = RefCounter; @@ -14805,7 +15193,7 @@ index 5638384abdaa629b6b41ecfea4a3314cdce4a28f..cefc3c54d4ff37c0cbe09761ffbbadcb class WebsiteDataStore : public API::ObjectImpl, public CanMakeWeakPtr { public: static WebsiteDataStore& defaultDataStore(); -@@ -331,8 +341,10 @@ public: +@@ -334,8 +344,10 @@ public: #if USE(SOUP) void setPersistentCredentialStorageEnabled(bool); bool persistentCredentialStorageEnabled() const { return m_persistentCredentialStorageEnabled && isPersistent(); } @@ -14816,7 +15204,7 @@ index 5638384abdaa629b6b41ecfea4a3314cdce4a28f..cefc3c54d4ff37c0cbe09761ffbbadcb void setNetworkProxySettings(WebCore::SoupNetworkProxySettings&&); const WebCore::SoupNetworkProxySettings& networkProxySettings() const LIFETIME_BOUND { return m_networkProxySettings; } void setCookiePersistentStorage(const String&, SoupCookiePersistentStorageType); -@@ -423,6 +435,12 @@ public: +@@ -426,6 +438,12 @@ public: static const String& defaultBaseDataDirectory(); #endif @@ -14829,7 +15217,7 @@ index 5638384abdaa629b6b41ecfea4a3314cdce4a28f..cefc3c54d4ff37c0cbe09761ffbbadcb void resetQuota(CompletionHandler&&); void resetStoragePersistedState(CompletionHandler&&); #if PLATFORM(IOS_FAMILY) -@@ -643,7 +661,9 @@ private: +@@ -644,7 +662,9 @@ private: #if USE(SOUP) bool m_persistentCredentialStorageEnabled { true }; @@ -14840,7 +15228,7 @@ index 5638384abdaa629b6b41ecfea4a3314cdce4a28f..cefc3c54d4ff37c0cbe09761ffbbadcb WebCore::SoupNetworkProxySettings m_networkProxySettings; String m_cookiePersistentStoragePath; SoupCookiePersistentStorageType m_cookiePersistentStorageType { SoupCookiePersistentStorageType::SQLite }; -@@ -670,6 +690,10 @@ private: +@@ -671,6 +691,10 @@ private: const RefPtr m_cookieStore; RefPtr m_networkProcess; @@ -14907,10 +15295,10 @@ index 96bf77411e2e1f4c835f56b409dc179977d197ee..512af5ffce511711b502248e34e49e45 RunLoop::Timer m_destroyLaterTimer; diff --git a/Source/WebKit/UIProcess/glib/BrowserInspectorWebSocketServer.cpp b/Source/WebKit/UIProcess/glib/BrowserInspectorWebSocketServer.cpp new file mode 100644 -index 0000000000000000000000000000000000000000..00483c4a7fdd24c93702c773687643ad045e7127 +index 0000000000000000000000000000000000000000..0a90ebf6104f4f2eb8e8538396fe3fc15c769274 --- /dev/null +++ b/Source/WebKit/UIProcess/glib/BrowserInspectorWebSocketServer.cpp -@@ -0,0 +1,172 @@ +@@ -0,0 +1,171 @@ +/* + * Copyright (C) 2026 Microsoft Corporation. + * @@ -15026,7 +15414,6 @@ index 0000000000000000000000000000000000000000..00483c4a7fdd24c93702c773687643ad + gsize messageSize; + gconstpointer messageData = g_bytes_get_data(message, &messageSize); + String messageString = String::fromUTF8(std::span(static_cast(messageData), messageSize)); -+ fprintf(stderr, "WebSocket message received: %s\n", messageString.utf8().data()); + m_playwrightAgent.dispatchMessageFromFrontend(messageString); + } + @@ -15379,43 +15766,8 @@ index e69e33b4359e24075e9054f014f5e5ab488b78c7..f395398acf790cc4fa80122dd4f59381 #if ENABLE(TOUCH_EVENTS) return AvailableInputDevices::Touchscreen; #else -diff --git a/Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.cpp b/Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.cpp -index 3dd2a77a24c59cb7fb1f01d3a74d75267a0f36bf..a020ccc929af8c9130ecca0125e5229ee8670e54 100644 ---- a/Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.cpp -+++ b/Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.cpp -@@ -864,4 +864,30 @@ RefPtr AcceleratedBackingStore::bufferAsNativeImageForTesting() con - return m_committedBuffer->asNativeImageForTesting(); - } - -+// Playwright begin -+cairo_surface_t* AcceleratedBackingStore::surface() -+{ -+ RefPtr buffer = m_committedBuffer.get(); -+ if (!buffer) -+ return nullptr; -+ -+ RefPtr surface = buffer->surface(); -+ if (!surface) -+ return nullptr; -+ -+ // The original surface is upside down, so we flip it to match orientation in other accelerated backing stores. -+ m_flippedSurface = adoptRef(cairo_image_surface_create(CAIRO_FORMAT_ARGB32, cairo_image_surface_get_width(surface.get()), cairo_image_surface_get_height(surface.get()))); -+ { -+ RefPtr cr = adoptRef(cairo_create(m_flippedSurface.get())); -+ cairo_matrix_t transform; -+ cairo_matrix_init(&transform, 1, 0, 0, -1, 0, cairo_image_surface_get_height(surface.get()) / buffer->deviceScaleFactor()); -+ cairo_transform(cr.get(), &transform); -+ cairo_set_source_surface(cr.get(), surface.get(), 0, 0); -+ cairo_paint(cr.get()); -+ } -+ cairo_surface_flush(m_flippedSurface.get()); -+ return m_flippedSurface.get(); -+} -+// Playwright end -+ - } // namespace WebKit diff --git a/Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.h b/Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.h -index 2a15a005441f41bcc3a44ce666dabeab7ab671f2..cc802e0634696b9455cd650527886c35a14a3ea3 100644 +index be0abb4d9e173bc4a4971537cd6abfc38eaee8bd..c3b720d440395df99d44d31b1e815b50020f8d9a 100644 --- a/Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.h +++ b/Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.h @@ -42,6 +42,7 @@ @@ -15425,26 +15777,7 @@ index 2a15a005441f41bcc3a44ce666dabeab7ab671f2..cc802e0634696b9455cd650527886c35 +typedef struct _cairo_surface cairo_surface_t; #if USE(GBM) - #include -@@ -86,6 +87,7 @@ public: - void unrealize(); - RendererBufferDescription bufferDescription() const; - RefPtr bufferAsNativeImageForTesting() const; -+ cairo_surface_t* surface(); - - private: - explicit AcceleratedBackingStore(WebPageProxy&); -@@ -268,6 +270,10 @@ private: - RefPtr m_committedBuffer; - Rects m_pendingDamageRects; - HashMap> m_buffers; -+// Playwright begin -+ RefPtr m_flippedSurface; -+// Playwright end -+ - }; - - } // namespace WebKit + struct gbm_bo; diff --git a/Source/WebKit/UIProcess/gtk/InspectorTargetProxyGtk.cpp b/Source/WebKit/UIProcess/gtk/InspectorTargetProxyGtk.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8f661f8c62dc091670f9474db037e7eee0ec37ce @@ -15998,7 +16331,7 @@ index 0000000000000000000000000000000000000000..8adbd51bfecad2a273117588bf50f8f7 + +#endif diff --git a/Source/WebKit/UIProcess/mac/PageClientImplMac.h b/Source/WebKit/UIProcess/mac/PageClientImplMac.h -index a621f334b3f1a1d2ea1c4bba63d73fa0757fe2bd..3d6b14a3a2a8a6f42f8da31b535e76715b6fe20a 100644 +index 8470a55dcac2775b9218e118fa11df2bdbfbf682..6a85bdc22713dc724d92f2ae901e04d12f151e46 100644 --- a/Source/WebKit/UIProcess/mac/PageClientImplMac.h +++ b/Source/WebKit/UIProcess/mac/PageClientImplMac.h @@ -31,9 +31,11 @@ @@ -16044,10 +16377,10 @@ index a621f334b3f1a1d2ea1c4bba63d73fa0757fe2bd..3d6b14a3a2a8a6f42f8da31b535e7671 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 23ae9a262af01284fadc90a18436b77af5752c24..730af4dee8db0f9a5dcf34623d499f4619e0d83d 100644 +index 27838ea2c98739c73f4f87057e45d33eee6704fe..95a7b9edbfc95f075600abc32b7ae054b0fd416e 100644 --- a/Source/WebKit/UIProcess/mac/PageClientImplMac.mm +++ b/Source/WebKit/UIProcess/mac/PageClientImplMac.mm -@@ -113,6 +113,13 @@ using namespace WebCore; +@@ -115,6 +115,13 @@ using namespace WebCore; WTF_MAKE_TZONE_ALLOCATED_IMPL(PageClientImpl); @@ -16061,7 +16394,7 @@ index 23ae9a262af01284fadc90a18436b77af5752c24..730af4dee8db0f9a5dcf34623d499f46 PageClientImpl::PageClientImpl(NSView *view, WKWebView *webView) : PageClientImplCocoa(webView) , m_view(view) -@@ -172,6 +179,9 @@ NSWindow *PageClientImpl::activeWindow() const +@@ -174,6 +181,9 @@ NSWindow *PageClientImpl::activeWindow() const bool PageClientImpl::isViewWindowActive() { @@ -16071,7 +16404,7 @@ index 23ae9a262af01284fadc90a18436b77af5752c24..730af4dee8db0f9a5dcf34623d499f46 ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer)); RetainPtr activeViewWindow = activeWindow(); return activeViewWindow.get().isKeyWindow || (activeViewWindow && [NSApp keyWindow] == activeViewWindow.get()); -@@ -179,6 +189,9 @@ bool PageClientImpl::isViewWindowActive() +@@ -181,6 +191,9 @@ bool PageClientImpl::isViewWindowActive() bool PageClientImpl::isViewFocused() { @@ -16081,7 +16414,7 @@ index 23ae9a262af01284fadc90a18436b77af5752c24..730af4dee8db0f9a5dcf34623d499f46 // 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 (CheckedPtr impl = m_impl.get()) -@@ -202,6 +215,9 @@ void PageClientImpl::makeFirstResponder() +@@ -204,6 +217,9 @@ void PageClientImpl::makeFirstResponder() bool PageClientImpl::isViewVisible(NSView *view, NSWindow *viewWindow) const { @@ -16091,7 +16424,7 @@ index 23ae9a262af01284fadc90a18436b77af5752c24..730af4dee8db0f9a5dcf34623d499f46 auto windowIsOccluded = [&]()->bool { return m_impl && m_impl->windowOcclusionDetectionEnabled() && (viewWindow.occlusionState & NSWindowOcclusionStateVisible) != NSWindowOcclusionStateVisible; }; -@@ -300,7 +316,8 @@ void PageClientImpl::didRelaunchProcess() +@@ -302,7 +318,8 @@ void PageClientImpl::didRelaunchProcess() void PageClientImpl::preferencesDidChange() { @@ -16101,7 +16434,7 @@ index 23ae9a262af01284fadc90a18436b77af5752c24..730af4dee8db0f9a5dcf34623d499f46 } void PageClientImpl::toolTipChanged(const String& oldToolTip, const String& newToolTip) -@@ -533,6 +550,8 @@ IntRect PageClientImpl::rootViewToAccessibilityScreen(const IntRect& rect) +@@ -547,6 +564,8 @@ IntRect PageClientImpl::rootViewToAccessibilityScreen(const IntRect& rect) void PageClientImpl::doneWithKeyEvent(const NativeWebKeyboardEvent& event, bool eventWasHandled) { @@ -16110,7 +16443,7 @@ index 23ae9a262af01284fadc90a18436b77af5752c24..730af4dee8db0f9a5dcf34623d499f46 protect(m_impl)->doneWithKeyEvent(RetainPtr { event.nativeEvent() }.get(), eventWasHandled); } -@@ -552,6 +571,8 @@ void PageClientImpl::computeHasVisualSearchResults(const URL& imageURL, Shareabl +@@ -566,6 +585,8 @@ void PageClientImpl::computeHasVisualSearchResults(const URL& imageURL, Shareabl RefPtr PageClientImpl::createPopupMenuProxy(WebPageProxy& page) { @@ -16119,7 +16452,7 @@ index 23ae9a262af01284fadc90a18436b77af5752c24..730af4dee8db0f9a5dcf34623d499f46 return WebPopupMenuProxyMac::create(m_view.get().get(), protect(page.popupMenuClient())); } -@@ -677,6 +698,12 @@ CALayer *PageClientImpl::footerBannerLayer() const +@@ -691,6 +712,12 @@ CALayer *PageClientImpl::footerBannerLayer() const return m_impl->footerBannerLayer(); } @@ -16132,7 +16465,7 @@ index 23ae9a262af01284fadc90a18436b77af5752c24..730af4dee8db0f9a5dcf34623d499f46 RefPtr PageClientImpl::takeViewSnapshot(std::optional&&) { return protect(m_impl)->takeViewSnapshot(); -@@ -898,6 +925,13 @@ void PageClientImpl::beganExitFullScreen(const IntRect& initialFrame, const IntR +@@ -912,6 +939,13 @@ void PageClientImpl::beganExitFullScreen(const IntRect& initialFrame, const IntR #endif // ENABLE(FULLSCREEN_API) @@ -16146,7 +16479,7 @@ index 23ae9a262af01284fadc90a18436b77af5752c24..730af4dee8db0f9a5dcf34623d499f46 void PageClientImpl::navigationGestureDidBegin() { protect(m_impl)->dismissContentRelativeChildWindowsWithAnimation(true); -@@ -1078,6 +1112,9 @@ void PageClientImpl::requestScrollToRect(const WebCore::FloatRect& targetRect, c +@@ -1099,6 +1133,9 @@ void PageClientImpl::requestScrollToRect(const WebCore::FloatRect& targetRect, c bool PageClientImpl::windowIsFrontWindowUnderMouse(const NativeWebMouseEvent& event) { @@ -16252,10 +16585,10 @@ index d063c571127353548110ca306fabf076cae2c966..015f0932a0b9da6888365eb072f7c6d5 bool showAfterPostProcessingContextData(); diff --git a/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm b/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm -index 960f2529fe031dd6799c5d0d16ebf899089620e6..0a9e4684a6a149cffc4addc64b3b79bffc07211b 100644 +index b80415eadff1728127f4d2a97efb45b1f845649d..0ad28207442c018b740f0ded3f72c8620b33e2db 100644 --- a/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm +++ b/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm -@@ -543,6 +543,12 @@ RetainPtr WebContextMenuProxyMac::createShareMenuItem(ShareMenuItemT +@@ -544,6 +544,12 @@ RetainPtr WebContextMenuProxyMac::createShareMenuItem(ShareMenuItemT } #endif @@ -16320,10 +16653,10 @@ 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..e6d3a8764ef084790a4ca4e9891b09ddcbb70781 +index 0000000000000000000000000000000000000000..c0dbaec1d6a595896498239c0cdd7dcb4e99492f --- /dev/null +++ b/Source/WebKit/UIProcess/mac/WebPageInspectorInputAgentMac.mm -@@ -0,0 +1,141 @@ +@@ -0,0 +1,144 @@ +/* + * Copyright (C) 2019 Microsoft Corporation. + * @@ -16365,7 +16698,7 @@ index 0000000000000000000000000000000000000000..e6d3a8764ef084790a4ca4e9891b09dd + +using namespace WebCore; + -+void WebPageInspectorInputAgent::platformDispatchMouseEvent(const String& type, int x, int y, std::optional&& optionalModifiers, const String& button, std::optional&& optionalClickCount, unsigned short buttons) { ++void WebPageInspectorInputAgent::platformDispatchMouseEvent(const String& type, int x, int y, std::optional&& optionalModifiers, const String& button, std::optional&& optionalClickCount, unsigned short buttons, MonotonicTime monotonicTimestamp) { + IntPoint locationInWindow(x, y); + + NSEventModifierFlags modifiers = 0; @@ -16382,7 +16715,10 @@ index 0000000000000000000000000000000000000000..e6d3a8764ef084790a4ca4e9891b09dd + } + int clickCount = optionalClickCount ? *optionalClickCount : 0; + -+ NSTimeInterval timestamp = [NSDate timeIntervalSinceReferenceDate]; ++ // NSEvent.timestamp must be raw seconds matching MonotonicTime so that ++ // WebEventFactory::createWebMouseEvent's MonotonicTime::fromRawSeconds round-trips ++ // and DOM event.timeStamp comes out as a sensible DOMHighResTimeStamp. ++ NSTimeInterval timestamp = monotonicTimestamp.secondsSinceEpoch().value(); + NSWindow *window = m_page.platformWindow(); + NSInteger windowNumber = window.windowNumber; + @@ -16466,10 +16802,10 @@ index 0000000000000000000000000000000000000000..e6d3a8764ef084790a4ca4e9891b09dd + +} // namespace WebKit diff --git a/Source/WebKit/UIProcess/mac/WebViewImpl.h b/Source/WebKit/UIProcess/mac/WebViewImpl.h -index e16a2dc21d968512a9753336bbc26912225e7551..f33dce2233b9c9fae2e350101f7c598ba409c8cc 100644 +index 745b88f688d8901a7a140d8414469e12df69e041..b28ceb988248a4528213c972ded84567480e1e16 100644 --- a/Source/WebKit/UIProcess/mac/WebViewImpl.h +++ b/Source/WebKit/UIProcess/mac/WebViewImpl.h -@@ -39,6 +39,7 @@ +@@ -40,6 +40,7 @@ #include "WKLayoutMode.h" #include "WebMouseEvent.h" #include @@ -16477,7 +16813,7 @@ index e16a2dc21d968512a9753336bbc26912225e7551..f33dce2233b9c9fae2e350101f7c598b #include #include #include -@@ -615,6 +616,9 @@ public: +@@ -617,6 +618,9 @@ public: void provideDataForPasteboard(NSPasteboard *, NSString *type); NSArray *namesOfPromisedFilesDroppedAtDestination(NSURL *dropDestination); @@ -16488,10 +16824,10 @@ index e16a2dc21d968512a9753336bbc26912225e7551..f33dce2233b9c9fae2e350101f7c598b RefPtr takeViewSnapshot(ForceSoftwareCapturingViewportSnapshot); void saveBackForwardSnapshotForCurrentItem(); diff --git a/Source/WebKit/UIProcess/mac/WebViewImpl.mm b/Source/WebKit/UIProcess/mac/WebViewImpl.mm -index c9c3ac7055aa857b5f0a6c9baeabbc7194b479d2..f3f09912076b3c9d74d848098273b4c7662d94b0 100644 +index 0d8681f20caeee8027af28e5f69ed361601f26a4..a2e410e256779120ba09438dac9065e26c85f765 100644 --- a/Source/WebKit/UIProcess/mac/WebViewImpl.mm +++ b/Source/WebKit/UIProcess/mac/WebViewImpl.mm -@@ -2608,6 +2608,11 @@ WebCore::DestinationColorSpace WebViewImpl::colorSpace() +@@ -2649,6 +2649,11 @@ WebCore::DestinationColorSpace WebViewImpl::colorSpace() if (!m_colorSpace) m_colorSpace = [NSColorSpace sRGBColorSpace]; } @@ -16503,7 +16839,7 @@ index c9c3ac7055aa857b5f0a6c9baeabbc7194b479d2..f3f09912076b3c9d74d848098273b4c7 ASSERT(m_colorSpace); return WebCore::DestinationColorSpace { [m_colorSpace CGColorSpace] }; -@@ -5092,6 +5097,17 @@ static RetainPtr takeWindowSnapshot(CGSWindowID windowID, bool captu +@@ -5158,6 +5163,17 @@ static RetainPtr takeWindowSnapshot(CGSWindowID windowID, bool captu return WebCore::cgWindowListCreateImage(CGRectNull, kCGWindowListOptionIncludingWindow, windowID, imageOptions); } @@ -16965,7 +17301,7 @@ index 0000000000000000000000000000000000000000..36fc7af8eb98b3f70d255ee858dccf58 + +} // namespace WebKit diff --git a/Source/WebKit/UIProcess/win/WebView.cpp b/Source/WebKit/UIProcess/win/WebView.cpp -index 30fcc5c80d118dc6389c12a43f03aede984856ab..af8b868d88c998d9105cc8a5c0f3db5158ba2a47 100644 +index f3beb2f8390b050913bcb8111c50ced57194c98f..7011eae4d384e0d459bef82bf92099bcca20f2c9 100644 --- a/Source/WebKit/UIProcess/win/WebView.cpp +++ b/Source/WebKit/UIProcess/win/WebView.cpp @@ -571,7 +571,7 @@ LRESULT WebView::onSizeEvent(HWND hwnd, UINT, WPARAM, LPARAM lParam, bool& handl @@ -16978,7 +17314,7 @@ index 30fcc5c80d118dc6389c12a43f03aede984856ab..af8b868d88c998d9105cc8a5c0f3db51 if (m_page && m_page->drawingArea()) { // FIXME specify correctly layerPosition. diff --git a/Source/WebKit/UIProcess/wpe/AcceleratedBackingStore.cpp b/Source/WebKit/UIProcess/wpe/AcceleratedBackingStore.cpp -index 0705d7a9536a44a09c410d9e0e14b99c7ce5623e..7c9d8a156147707740cd984c170271593dcdacbd 100644 +index 9c642983d668120d8ac35ff9961848c05b6c7d04..0963431a137e83040b42b7aa1cf7d677614bfd1b 100644 --- a/Source/WebKit/UIProcess/wpe/AcceleratedBackingStore.cpp +++ b/Source/WebKit/UIProcess/wpe/AcceleratedBackingStore.cpp @@ -231,7 +231,7 @@ static Expected getImageInfoFromBuffer(const GRefPtr m_frame; std::unique_ptr m_channel; diff --git a/Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp b/Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp -index ef050f1bf94dc201a89055164a5c0c9f33b9bbad..2e228513e686dd67e3e8129670b0ad374a5f54d2 100644 +index f9e0b62dc43d4de454a3eaa517a18577883aeb42..4d1c184367fa8e97e1a67b8afe4470bbc466d4c0 100644 --- a/Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp +++ b/Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp @@ -273,6 +273,11 @@ void WebLoaderStrategy::scheduleLoad(ResourceLoader& resourceLoader, CachedResou @@ -17933,7 +18270,7 @@ index ef050f1bf94dc201a89055164a5c0c9f33b9bbad..2e228513e686dd67e3e8129670b0ad37 } WEBLOADERSTRATEGY_RELEASE_LOG_FORWARDABLE(WebLoaderStrategyScheduleLoad); -@@ -431,7 +440,7 @@ static void addParametersShared(const LocalFrame* frame, NetworkResourceLoadPara +@@ -439,7 +448,7 @@ static void addParametersShared(const LocalFrame* frame, NetworkResourceLoadPara parameters.linkPreconnectEarlyHintsEnabled = mainFrame->settings().linkPreconnectEarlyHintsEnabled(); } @@ -17942,7 +18279,7 @@ index ef050f1bf94dc201a89055164a5c0c9f33b9bbad..2e228513e686dd67e3e8129670b0ad37 { auto identifier = *resourceLoader.identifier(); -@@ -443,10 +452,10 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceL +@@ -451,10 +460,10 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceL && resourceLoader.frameLoader()->notifier().isInitialRequestIdentifier(identifier) ? MainFrameMainResource::Yes : MainFrameMainResource::No; if (!page->allowsLoadFromURL(request.url(), mainFrameMainResource)) { @@ -17955,7 +18292,7 @@ index ef050f1bf94dc201a89055164a5c0c9f33b9bbad..2e228513e686dd67e3e8129670b0ad37 } } -@@ -456,19 +465,6 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceL +@@ -464,19 +473,6 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceL LOG(NetworkScheduling, "(WebProcess) WebLoaderStrategy::scheduleLoad, url '%s' will be scheduled with the NetworkProcess with priority %d, storedCredentialsPolicy %i", resourceLoader.url().string().latin1().data(), static_cast(resourceLoader.request().priority()), (int)storedCredentialsPolicy); @@ -17975,7 +18312,7 @@ index ef050f1bf94dc201a89055164a5c0c9f33b9bbad..2e228513e686dd67e3e8129670b0ad37 loadParameters.identifier = identifier; loadParameters.parentPID = legacyPresentingApplicationPID(); loadParameters.contentSniffingPolicy = contentSniffingPolicy; -@@ -563,14 +559,11 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceL +@@ -571,14 +567,11 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceL if (loadParameters.options.mode != FetchOptions::Mode::Navigate) { ASSERT(loadParameters.sourceOrigin); @@ -17993,7 +18330,7 @@ index ef050f1bf94dc201a89055164a5c0c9f33b9bbad..2e228513e686dd67e3e8129670b0ad37 loadParameters.isMainFrameNavigation = isMainFrameNavigation; if (loadParameters.isMainFrameNavigation && document) { -@@ -635,6 +628,30 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceL +@@ -651,6 +644,30 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceL if (RefPtr handle = resourceLoader.cachedResource()) loadParameters.isInitiatorPrefetch = handle->type() == CachedResource::Type::LinkPrefetch; @@ -18024,7 +18361,7 @@ index ef050f1bf94dc201a89055164a5c0c9f33b9bbad..2e228513e686dd67e3e8129670b0ad37 std::optional existingNetworkResourceLoadIdentifierToResume; if (loadParameters.isMainFrameNavigation) existingNetworkResourceLoadIdentifierToResume = std::exchange(m_existingNetworkResourceLoadIdentifierToResume, std::nullopt); -@@ -650,7 +667,7 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceL +@@ -666,7 +683,7 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceL } auto loader = WebResourceLoader::create(resourceLoader, trackingParameters); @@ -18033,7 +18370,7 @@ index ef050f1bf94dc201a89055164a5c0c9f33b9bbad..2e228513e686dd67e3e8129670b0ad37 } void WebLoaderStrategy::scheduleInternallyFailedLoad(WebCore::ResourceLoader& resourceLoader) -@@ -1070,7 +1087,7 @@ void WebLoaderStrategy::didFinishPreconnection(WebCore::ResourceLoaderIdentifier +@@ -1086,7 +1103,7 @@ void WebLoaderStrategy::didFinishPreconnection(WebCore::ResourceLoaderIdentifier bool WebLoaderStrategy::isOnLine() const { @@ -18042,7 +18379,7 @@ index ef050f1bf94dc201a89055164a5c0c9f33b9bbad..2e228513e686dd67e3e8129670b0ad37 } void WebLoaderStrategy::addOnlineStateChangeListener(Function&& listener) -@@ -1096,6 +1113,11 @@ void WebLoaderStrategy::isResourceLoadFinished(CachedResource& resource, Complet +@@ -1112,6 +1129,11 @@ void WebLoaderStrategy::isResourceLoadFinished(CachedResource& resource, Complet void WebLoaderStrategy::setOnLineState(bool isOnLine) { @@ -18054,7 +18391,7 @@ index ef050f1bf94dc201a89055164a5c0c9f33b9bbad..2e228513e686dd67e3e8129670b0ad37 if (m_isOnLine == isOnLine) return; -@@ -1104,6 +1126,12 @@ void WebLoaderStrategy::setOnLineState(bool isOnLine) +@@ -1120,6 +1142,12 @@ void WebLoaderStrategy::setOnLineState(bool isOnLine) listener(isOnLine); } @@ -18098,10 +18435,10 @@ index ab7f322fc4e1b340bb0acdc84d4f7ba39a6e0df0..d79aea95dc4e2ead71a161b24c0e1f08 } // namespace WebKit diff --git a/Source/WebKit/WebProcess/Network/WebResourceLoader.cpp b/Source/WebKit/WebProcess/Network/WebResourceLoader.cpp -index 24c2649b31ce74a91911c8d8ff9be630dc29d576..11e1b09f7fe0573374f887bcbe57e25e4a8f6b87 100644 +index 92c407cd8349da4fa94d46a31c39b3935240af61..86e7de852319d854cb3f63b26e90fbcbc984ee0f 100644 --- a/Source/WebKit/WebProcess/Network/WebResourceLoader.cpp +++ b/Source/WebKit/WebProcess/Network/WebResourceLoader.cpp -@@ -236,9 +236,6 @@ void WebResourceLoader::didReceiveResponse(ResourceResponse&& response, PrivateR +@@ -237,9 +237,6 @@ void WebResourceLoader::didReceiveResponse(ResourceResponse&& response, PrivateR coreLoader->didReceiveResponse(ResourceResponse { inspectorResponse }, [this, protectedThis = Ref { *this }, interceptedRequestIdentifier, policyDecisionCompletionHandler = WTF::move(policyDecisionCompletionHandler), overrideData = WTF::move(overrideData)]() mutable { RefPtr coreLoader = m_coreLoader; @@ -18111,7 +18448,7 @@ index 24c2649b31ce74a91911c8d8ff9be630dc29d576..11e1b09f7fe0573374f887bcbe57e25e if (!m_coreLoader || !coreLoader->identifier()) { m_interceptController.continueResponse(interceptedRequestIdentifier); return; -@@ -255,6 +252,8 @@ void WebResourceLoader::didReceiveResponse(ResourceResponse&& response, PrivateR +@@ -256,6 +253,8 @@ void WebResourceLoader::didReceiveResponse(ResourceResponse&& response, PrivateR } }); }); @@ -18121,10 +18458,10 @@ index 24c2649b31ce74a91911c8d8ff9be630dc29d576..11e1b09f7fe0573374f887bcbe57e25e } diff --git a/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp b/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp -index 83519d3b8b16ad84a162f99ec6e3c9f9a0525e73..5cb5b17e983ef538c12bcaa81fe9e425cd622f06 100644 +index 2007a79dda001fd64c35715e4f1e7bf125d68679..3ca9f5a101b13fd85ce4a77bde92caf4ef0c1bf8 100644 --- a/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp +++ b/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp -@@ -503,6 +503,9 @@ void WebChromeClient::addMessageToConsole(MessageSource source, MessageLevel lev +@@ -504,6 +504,9 @@ void WebChromeClient::addMessageToConsole(MessageSource source, MessageLevel lev if (!page) return; @@ -18250,7 +18587,7 @@ index 5ac78eb5880335f49a9a6f2690626e46fbcac7f4..aa12d9c96279054e01cc9e82e78547a7 #include "WebPage.h" #include "WebPageCreationParameters.h" diff --git a/Source/WebKit/WebProcess/WebPage/WebCookieJar.cpp b/Source/WebKit/WebProcess/WebPage/WebCookieJar.cpp -index 42644873c3a43e84452298c131d1d356eed6b36c..9718fb79e8918809099bc3eedd1cdfc7d751a575 100644 +index d2a69a979ac3f6f3507ef71b9f23c105d110ec52..7702064e4428a32ab5c613b8bc6aff2d064fc69b 100644 --- a/Source/WebKit/WebProcess/WebPage/WebCookieJar.cpp +++ b/Source/WebKit/WebProcess/WebPage/WebCookieJar.cpp @@ -43,6 +43,7 @@ @@ -18288,12 +18625,12 @@ index a7ad18fc1201e5de2cc1528539a765599ecfc41e..ebea233bc54ab6e56fb7093ff63e2368 WebCookieJar(); diff --git a/Source/WebKit/WebProcess/WebPage/WebFrame.cpp b/Source/WebKit/WebProcess/WebPage/WebFrame.cpp -index 2a3aa30f08da8e00e790dbdbac574c986a3a4f0a..9b70be2682defadef10da8b69af50ca115878cf6 100644 +index c0fec67356b0c5c39b6c3c81a693029b0ef75723..220a2eaa4a8574a0dbb3d7166bd3cd318b0f50f6 100644 --- a/Source/WebKit/WebProcess/WebPage/WebFrame.cpp +++ b/Source/WebKit/WebProcess/WebPage/WebFrame.cpp -@@ -181,6 +181,9 @@ Ref WebFrame::createSubframe(WebPage& page, WebFrame& parent, const At - ASSERT(ownerElement.document().frame()); - coreFrame->init(); +@@ -184,6 +184,9 @@ Ref WebFrame::createSubframe(WebPage& page, WebFrame& parent, const At + if (RefPtr backend = Ref { page }->inspector(WebPage::LazyCreationPolicy::UseExistingOnly)) + backend->ensureInstrumentationForFrame(coreFrame.get()); + if (parent.m_inspectorTarget) + parent.m_inspectorTarget->didCreateSubframe(frame); @@ -18302,10 +18639,10 @@ index 2a3aa30f08da8e00e790dbdbac574c986a3a4f0a..9b70be2682defadef10da8b69af50ca1 } diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.cpp b/Source/WebKit/WebProcess/WebPage/WebPage.cpp -index 423d720a28e28a0fa83d0abf226f1bca2a0a27ee..0c46b23f4aec72f73f9bf39119b3ce1ac3ff72ba 100644 +index 5a600c0a20459f0b90bc5235d81958927ab635f2..5f4da25bd0cd308c0952ff19b55ae0ca1d94ad82 100644 --- a/Source/WebKit/WebProcess/WebPage/WebPage.cpp +++ b/Source/WebKit/WebProcess/WebPage/WebPage.cpp -@@ -264,6 +264,7 @@ +@@ -267,6 +267,7 @@ #include #include #include @@ -18313,7 +18650,7 @@ index 423d720a28e28a0fa83d0abf226f1bca2a0a27ee..0c46b23f4aec72f73f9bf39119b3ce1a #include #include #include -@@ -1227,6 +1228,14 @@ WebPage::WebPage(PageIdentifier pageID, WebPageCreationParameters&& parameters) +@@ -1261,6 +1262,14 @@ WebPage::WebPage(PageIdentifier pageID, WebPageCreationParameters&& parameters) setLinkDecorationFilteringData(WTF::move(parameters.linkDecorationFilteringData)); setAllowedQueryParametersForAdvancedPrivacyProtections(WTF::move(parameters.allowedQueryParametersForAdvancedPrivacyProtections)); #endif @@ -18328,7 +18665,7 @@ index 423d720a28e28a0fa83d0abf226f1bca2a0a27ee..0c46b23f4aec72f73f9bf39119b3ce1a if (parameters.windowFeatures) { page->applyWindowFeatures(*parameters.windowFeatures); page->chrome().show(); -@@ -2222,6 +2231,22 @@ void WebPage::loadDidCommitInAnotherProcess(WebCore::FrameIdentifier frameID, st +@@ -2384,6 +2393,22 @@ void WebPage::loadDidCommitInAnotherProcess(WebCore::FrameIdentifier frameID, st } } @@ -18351,7 +18688,7 @@ index 423d720a28e28a0fa83d0abf226f1bca2a0a27ee..0c46b23f4aec72f73f9bf39119b3ce1a void WebPage::loadRequest(LoadParameters&& loadParameters) { WEBPAGE_RELEASE_LOG_FORWARDABLE(Loading, WebPageLoadRequest, loadParameters.navigationID ? loadParameters.navigationID->toUInt64() : 0, static_cast(loadParameters.shouldTreatAsContinuingLoad), loadParameters.request.isAppInitiated(), loadParameters.existingNetworkResourceLoadIdentifierToResume ? loadParameters.existingNetworkResourceLoadIdentifierToResume->toUInt64() : 0); -@@ -2413,7 +2438,9 @@ void WebPage::stopLoading() +@@ -2578,7 +2603,9 @@ void WebPage::stopLoading() void WebPage::stopLoadingDueToProcessSwap() { SetForScope isStoppingLoadingDueToProcessSwap(m_isStoppingLoadingDueToProcessSwap, true); @@ -18360,8 +18697,8 @@ index 423d720a28e28a0fa83d0abf226f1bca2a0a27ee..0c46b23f4aec72f73f9bf39119b3ce1a + InspectorInstrumentationWebKit::setStoppingLoadingDueToProcessSwap(m_page.get(), false); } - bool WebPage::defersLoading() const -@@ -3002,7 +3029,7 @@ void WebPage::viewportPropertiesDidChange(const ViewportArguments& viewportArgum + void WebPage::keepBlobURLAliveForNewWindowNavigation(URL&& blobURL, std::optional&& topOrigin) +@@ -3180,7 +3207,7 @@ void WebPage::viewportPropertiesDidChange(const ViewportArguments& viewportArgum #if PLATFORM(IOS_FAMILY) if (m_viewportConfiguration.setViewportArguments(viewportArguments)) viewportConfigurationChanged(); @@ -18370,7 +18707,7 @@ index 423d720a28e28a0fa83d0abf226f1bca2a0a27ee..0c46b23f4aec72f73f9bf39119b3ce1a // Adjust view dimensions when using fixed layout. RefPtr localMainFrame = this->localMainFrame(); RefPtr view = localMainFrame ? localMainFrame->view() : nullptr; -@@ -3863,6 +3890,13 @@ void WebPage::flushDeferredIntersectionObservations() +@@ -4041,6 +4068,13 @@ void WebPage::flushDeferredIntersectionObservations() protect(corePage())->flushDeferredIntersectionObservations(); } @@ -18384,7 +18721,7 @@ index 423d720a28e28a0fa83d0abf226f1bca2a0a27ee..0c46b23f4aec72f73f9bf39119b3ce1a void WebPage::flushDeferredDidReceiveMouseEvent() { if (auto info = std::exchange(m_deferredDidReceiveMouseEvent, std::nullopt)) -@@ -4152,6 +4186,100 @@ void WebPage::touchEvent(const WebTouchEvent& touchEvent, CompletionHandlersendMessageToTargetBackend(message); } @@ -18502,7 +18839,7 @@ index 423d720a28e28a0fa83d0abf226f1bca2a0a27ee..0c46b23f4aec72f73f9bf39119b3ce1a void WebPage::insertNewlineInQuotedContent() { RefPtr frame = corePage()->focusController().focusedOrMainFrame(); -@@ -4494,6 +4632,7 @@ void WebPage::setMainFrameDocumentVisualUpdatesAllowed(bool allowed) +@@ -4654,6 +4792,7 @@ void WebPage::setMainFrameDocumentVisualUpdatesAllowed(bool allowed) void WebPage::show() { send(Messages::WebPageProxy::ShowPage()); @@ -18510,7 +18847,7 @@ index 423d720a28e28a0fa83d0abf226f1bca2a0a27ee..0c46b23f4aec72f73f9bf39119b3ce1a } void WebPage::setIsTakingSnapshotsForApplicationSuspension(bool isTakingSnapshotsForApplicationSuspension) -@@ -5583,7 +5722,7 @@ NotificationPermissionRequestManager* WebPage::notificationPermissionRequestMana +@@ -5761,7 +5900,7 @@ NotificationPermissionRequestManager* WebPage::notificationPermissionRequestMana #if ENABLE(DRAG_SUPPORT) @@ -18519,7 +18856,7 @@ index 423d720a28e28a0fa83d0abf226f1bca2a0a27ee..0c46b23f4aec72f73f9bf39119b3ce1a void WebPage::performDragControllerAction(DragControllerAction action, const IntPoint& clientPosition, const IntPoint& globalPosition, OptionSet draggingSourceOperationMask, SelectionData&& selectionData, OptionSet flags, CompletionHandler, DragHandlingMethod, bool, unsigned, IntRect, IntRect, std::optional)>&& completionHandler) { if (!m_page) -@@ -7958,6 +8097,10 @@ void WebPage::didCommitLoad(WebFrame* frame) +@@ -8150,6 +8289,10 @@ void WebPage::didCommitLoad(WebFrame* frame) if (frame && frame->isMainFrame()) m_networkResourceRequestIdentifiersForPageLoadTiming.clear(); @@ -18530,7 +18867,7 @@ index 423d720a28e28a0fa83d0abf226f1bca2a0a27ee..0c46b23f4aec72f73f9bf39119b3ce1a } void WebPage::didFinishDocumentLoad(WebFrame& frame) -@@ -8260,6 +8403,9 @@ Ref WebPage::createDocumentLoader(LocalFrame& frame, ResourceReq +@@ -8453,6 +8596,9 @@ Ref WebPage::createDocumentLoader(LocalFrame& frame, ResourceReq m_allowsContentJavaScriptFromMostRecentNavigation = m_internals->pendingWebsitePolicies->allowsContentJavaScript; WebsitePoliciesData::applyToDocumentLoader(*std::exchange(m_internals->pendingWebsitePolicies, std::nullopt), documentLoader); } @@ -18541,7 +18878,7 @@ index 423d720a28e28a0fa83d0abf226f1bca2a0a27ee..0c46b23f4aec72f73f9bf39119b3ce1a return documentLoader; diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.h b/Source/WebKit/WebProcess/WebPage/WebPage.h -index 811658f19c79994e1b624ee5c0fe285ee563e7a7..87a666dc8953b5ca530f87cfb86f055949100612 100644 +index 28cfe18e24fd74cf652b7fcc417d46ec13017c49..abdb3f70b0cde7217a398b58eb29494571290ff2 100644 --- a/Source/WebKit/WebProcess/WebPage/WebPage.h +++ b/Source/WebKit/WebProcess/WebPage/WebPage.h @@ -49,6 +49,7 @@ @@ -18552,7 +18889,7 @@ index 811658f19c79994e1b624ee5c0fe285ee563e7a7..87a666dc8953b5ca530f87cfb86f0559 #include #include #include -@@ -1403,11 +1404,11 @@ public: +@@ -1414,11 +1415,11 @@ public: void clearSelection(); void restoreSelectionInFocusedEditableElement(); @@ -18566,7 +18903,7 @@ index 811658f19c79994e1b624ee5c0fe285ee563e7a7..87a666dc8953b5ca530f87cfb86f0559 void performDragControllerAction(std::optional, DragControllerAction, WebCore::DragData&&, CompletionHandler, WebCore::DragHandlingMethod, bool, unsigned, WebCore::IntRect, WebCore::IntRect, std::optional)>&&); void performDragOperation(std::optional, WebCore::DragData&&, SandboxExtension::Handle&&, Vector&&, CompletionHandler&&); #endif -@@ -1425,6 +1426,9 @@ public: +@@ -1436,6 +1437,9 @@ public: #if ENABLE(MODEL_PROCESS) void modelDragEnded(WebCore::NodeIdentifier); #endif @@ -18576,7 +18913,7 @@ index 811658f19c79994e1b624ee5c0fe285ee563e7a7..87a666dc8953b5ca530f87cfb86f0559 #endif #if ENABLE(MODEL_PROCESS) -@@ -1527,8 +1531,11 @@ public: +@@ -1538,8 +1542,11 @@ public: void gestureEvent(WebCore::FrameIdentifier, const WebGestureEvent&, CompletionHandler, bool, std::optional)>&&); #endif @@ -18589,7 +18926,7 @@ index 811658f19c79994e1b624ee5c0fe285ee563e7a7..87a666dc8953b5ca530f87cfb86f0559 void dynamicViewportSizeUpdate(const DynamicViewportSizeUpdate&); bool scaleWasSetByUIProcess() const { return m_scaleWasSetByUIProcess; } void willStartUserTriggeredZooming(); -@@ -1689,6 +1696,8 @@ public: +@@ -1700,6 +1707,8 @@ public: void connectInspector(Inspector::FrontendChannel::ConnectionType); void disconnectInspector(); void sendMessageToTargetBackend(const String& message); @@ -18598,7 +18935,7 @@ index 811658f19c79994e1b624ee5c0fe285ee563e7a7..87a666dc8953b5ca530f87cfb86f0559 void insertNewlineInQuotedContent(); -@@ -2127,6 +2136,7 @@ public: +@@ -2141,6 +2150,7 @@ public: void showContextMenuFromFrame(const FrameInfoData&, const ContextMenuContextData&, const UserData&); #endif void loadRequest(LoadParameters&&); @@ -18606,7 +18943,7 @@ index 811658f19c79994e1b624ee5c0fe285ee563e7a7..87a666dc8953b5ca530f87cfb86f0559 void setObscuredContentInsets(const WebCore::FloatBoxExtent&); -@@ -2349,6 +2359,7 @@ private: +@@ -2365,6 +2375,7 @@ private: void updatePotentialTapSecurityOrigin(const WebTouchEvent&, bool wasHandled); #elif ENABLE(TOUCH_EVENTS) void touchEvent(const WebTouchEvent&, CompletionHandler, bool)>&&); @@ -18614,7 +18951,7 @@ index 811658f19c79994e1b624ee5c0fe285ee563e7a7..87a666dc8953b5ca530f87cfb86f0559 #endif void cancelPointer(WebCore::PointerID, const WebCore::IntPoint&); -@@ -3176,6 +3187,7 @@ private: +@@ -3201,6 +3212,7 @@ private: bool m_isAppNapEnabled { true }; Markable m_pendingNavigationID; @@ -18623,7 +18960,7 @@ index 811658f19c79994e1b624ee5c0fe285ee563e7a7..87a666dc8953b5ca530f87cfb86f0559 bool m_mainFrameProgressCompleted { false }; bool m_shouldDispatchFakeMouseMoveEvents { true }; diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.messages.in b/Source/WebKit/WebProcess/WebPage/WebPage.messages.in -index 5ab12f0d119cd46d4b327b1332add5b4a7e27ec0..291e354bcfcf428ef4410ec757d4d8dc8745dce3 100644 +index 0803df95c4b72349235f0f1acdba5f2eda6fa164..20a6e43ecdfa1246f47edc1edd2cf1ef07265d25 100644 --- a/Source/WebKit/WebProcess/WebPage/WebPage.messages.in +++ b/Source/WebKit/WebProcess/WebPage/WebPage.messages.in @@ -84,10 +84,13 @@ messages -> WebPage WantsAsyncDispatchMessage { @@ -18657,15 +18994,15 @@ index 5ab12f0d119cd46d4b327b1332add5b4a7e27ec0..291e354bcfcf428ef4410ec757d4d8dc #endif CancelPointer(WebCore::PointerID pointerId, WebCore::IntPoint documentPoint) -@@ -210,6 +215,7 @@ messages -> WebPage WantsAsyncDispatchMessage { - LoadDataInFrame(std::span data, String MIMEType, String encodingName, URL baseURL, WebCore::FrameIdentifier frameID) +@@ -213,6 +218,7 @@ messages -> WebPage WantsAsyncDispatchMessage { + LoadRequest(struct WebKit::LoadParameters loadParameters) - LoadDidCommitInAnotherProcess(WebCore::FrameIdentifier frameID, std::optional layerHostingContextIdentifier, std::optional mainFrameDocumentURL) + LoadDidCommitInAnotherProcess(WebCore::FrameIdentifier frameID, std::optional layerHostingContextIdentifier, RefPtr topDocumentSyncData) + LoadRequestInFrameForInspector(struct WebKit::LoadParameters loadParameters, WebCore::FrameIdentifier frameID) LoadRequestWaitingForProcessLaunch(struct WebKit::LoadParameters loadParameters, URL resourceDirectoryURL, WebKit::WebPageProxyIdentifier pageID, bool checkAssumedReadAccessToResourceURL) LoadData(struct WebKit::LoadParameters loadParameters) LoadSimulatedRequestAndResponse(struct WebKit::LoadParameters loadParameters, WebCore::ResourceResponse simulatedResponse) -@@ -376,10 +382,10 @@ messages -> WebPage WantsAsyncDispatchMessage { +@@ -391,10 +397,10 @@ messages -> WebPage WantsAsyncDispatchMessage { RemoveLayerForFindOverlay() -> () # Drag and drop. @@ -18678,7 +19015,7 @@ index 5ab12f0d119cd46d4b327b1332add5b4a7e27ec0..291e354bcfcf428ef4410ec757d4d8dc PerformDragControllerAction(std::optional frameID, enum:uint8_t WebKit::DragControllerAction action, WebCore::DragData dragData) -> (enum:uint8_t std::optional dragOperation, enum:uint8_t WebCore::DragHandlingMethod dragHandlingMethod, bool mouseIsOverFileInput, unsigned numberOfItemsToBeAccepted, WebCore::IntRect insertionRect, WebCore::IntRect editableElementRect, struct std::optional remoteUserInputEventData) PerformDragOperation(std::optional frameID, WebCore::DragData dragData, WebKit::SandboxExtensionHandle sandboxExtensionHandle, Vector sandboxExtensionsForUpload) -> (WebKit::DragOperationResult dragOperationResult) #endif -@@ -399,6 +405,10 @@ messages -> WebPage WantsAsyncDispatchMessage { +@@ -414,6 +420,10 @@ messages -> WebPage WantsAsyncDispatchMessage { ModelDragEnded(WebCore::NodeIdentifier nodeID) #endif @@ -18728,10 +19065,10 @@ index 081c8dd9bc9402d909fba5359f90c686deb9987a..b9e548e8886861fa8013f5d8af1c893f const auto& availableInputs = WebProcess::singleton().availableInputDevices(); if (availableInputs.contains(AvailableInputDevices::Mouse)) diff --git a/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm b/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm -index ffa97bb7530ddcda26e9680d352026d01301f10d..a4de9c29209e2ed2ce8aced5008211c33d8178d2 100644 +index da7ee3f33f1f158f1c7d57647be27aacf66c0941..f6b4252e20fcfac11aa22a74d5e4bb2156e80c01 100644 --- a/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm +++ b/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm -@@ -732,21 +732,37 @@ String WebPage::platformUserAgent(const URL&) const +@@ -755,21 +755,37 @@ String WebPage::platformUserAgent(const URL&) const bool WebPage::hoverSupportedByPrimaryPointingDevice() const { @@ -18770,7 +19107,7 @@ index ffa97bb7530ddcda26e9680d352026d01301f10d..a4de9c29209e2ed2ce8aced5008211c3 } diff --git a/Source/WebKit/WebProcess/WebPage/win/WebPageWin.cpp b/Source/WebKit/WebProcess/WebPage/win/WebPageWin.cpp -index c177e632d86f01cd59c3a8c6d922da5ddbaf6e55..516472f97a378ebe3cd8bd9fd30700a26d4a6085 100644 +index 506ae38c6c54a2866ce44271575d8731ba1fea2c..52791bcd240e5eeb68c739de361fb62b4a424e43 100644 --- a/Source/WebKit/WebProcess/WebPage/win/WebPageWin.cpp +++ b/Source/WebKit/WebProcess/WebPage/win/WebPageWin.cpp @@ -45,6 +45,7 @@ @@ -18820,10 +19157,10 @@ index c177e632d86f01cd59c3a8c6d922da5ddbaf6e55..516472f97a378ebe3cd8bd9fd30700a2 } diff --git a/Source/WebKit/WebProcess/WebProcess.cpp b/Source/WebKit/WebProcess/WebProcess.cpp -index 09651c68a3694eda504e88f3dda0cad5cd97a3c6..f4a0d15d58a30b4fa059659ba99bd4aa91ed327d 100644 +index fb4336ddab5501feecd6f5e555f5fbe23e3db309..77b6e8e0cad2d610fb39c40f50c355ccdb898773 100644 --- a/Source/WebKit/WebProcess/WebProcess.cpp +++ b/Source/WebKit/WebProcess/WebProcess.cpp -@@ -95,6 +95,7 @@ +@@ -96,6 +96,7 @@ #include "WebsiteData.h" #include "WebsiteDataStoreParameters.h" #include "WebsiteDataType.h" @@ -18831,7 +19168,7 @@ index 09651c68a3694eda504e88f3dda0cad5cd97a3c6..f4a0d15d58a30b4fa059659ba99bd4aa #include #include #include -@@ -427,6 +428,14 @@ void WebProcess::initializeProcess(const AuxiliaryProcessInitializationParameter +@@ -429,6 +430,14 @@ void WebProcess::initializeProcess(const AuxiliaryProcessInitializationParameter { JSC::Options::AllowUnfinalizedAccessScope scope; JSC::Options::allowNonSPTagging() = false; @@ -18846,7 +19183,7 @@ index 09651c68a3694eda504e88f3dda0cad5cd97a3c6..f4a0d15d58a30b4fa059659ba99bd4aa JSC::Options::notifyOptionsChanged(); } -@@ -434,6 +443,8 @@ void WebProcess::initializeProcess(const AuxiliaryProcessInitializationParameter +@@ -436,6 +445,8 @@ void WebProcess::initializeProcess(const AuxiliaryProcessInitializationParameter platformInitializeProcess(parameters); updateCPULimit(); @@ -18855,7 +19192,7 @@ index 09651c68a3694eda504e88f3dda0cad5cd97a3c6..f4a0d15d58a30b4fa059659ba99bd4aa } void WebProcess::initializeConnection(IPC::Connection* connection) -@@ -1058,6 +1069,7 @@ void WebProcess::createWebPage(PageIdentifier pageID, WebPageCreationParameters& +@@ -1067,6 +1078,7 @@ void WebProcess::createWebPage(PageIdentifier pageID, WebPageCreationParameters& m_hasPendingAccessibilityUnsuspension = false; accessibilityRelayProcessSuspended(false); } @@ -18864,7 +19201,7 @@ index 09651c68a3694eda504e88f3dda0cad5cd97a3c6..f4a0d15d58a30b4fa059659ba99bd4aa Awaitable WebProcess::countWebPagesForTesting() diff --git a/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm b/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm -index ba7911b2efe2ffdde8ab90f3c81817f65a43b2f0..259418a4eca2bb6ed9af2a62fbda155849c2f349 100644 +index 18cb263c7e49a6ad8735ac0318692f15e3548bf3..84bb31229c2baf7c34b7ccbf43ac974ef32e5736 100644 --- a/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm +++ b/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm @@ -4207,7 +4207,7 @@ ALLOW_DEPRECATED_DECLARATIONS_END @@ -18877,10 +19214,10 @@ index ba7911b2efe2ffdde8ab90f3c81817f65a43b2f0..259418a4eca2bb6ed9af2a62fbda1558 - (void)touch:(WebEvent *)event { diff --git a/Source/WebKitLegacy/mac/WebView/WebView.mm b/Source/WebKitLegacy/mac/WebView/WebView.mm -index bec7313812c922a7175d0f9aca27818066d54df8..8af7c061efe469493d5e2f38679b7038fb483c34 100644 +index d78a0df60635c236f5f58c9166551230af89c6ca..b1c01c4a741f53b4870a5cf36faf441c12d1771e 100644 --- a/Source/WebKitLegacy/mac/WebView/WebView.mm +++ b/Source/WebKitLegacy/mac/WebView/WebView.mm -@@ -3976,7 +3976,7 @@ + (void)_doNotStartObservingNetworkReachability +@@ -3974,7 +3974,7 @@ + (void)_doNotStartObservingNetworkReachability } #endif // PLATFORM(IOS_FAMILY) @@ -18889,7 +19226,7 @@ index bec7313812c922a7175d0f9aca27818066d54df8..8af7c061efe469493d5e2f38679b7038 - (NSArray *)_touchEventRegions { -@@ -4018,7 +4018,7 @@ - (NSArray *)_touchEventRegions +@@ -4016,7 +4016,7 @@ - (NSArray *)_touchEventRegions }).autorelease(); } @@ -18899,10 +19236,10 @@ index bec7313812c922a7175d0f9aca27818066d54df8..8af7c061efe469493d5e2f38679b7038 // For backwards compatibility with the WebBackForwardList API, we honor both // a per-WebView and a per-preferences setting for whether to use the back/forward cache. diff --git a/Source/cmake/OptionsGTK.cmake b/Source/cmake/OptionsGTK.cmake -index 1f1b576f84c8ad254868d8e2b2f4f0429ea59d06..11e5f0d982166f5f5c6e44984d48b912409cfff4 100644 +index 98b94f2d211c6546087f8aff57798ff6caadde56..5d32fffbdce8568e320dc4a864b81808f3ec6638 100644 --- a/Source/cmake/OptionsGTK.cmake +++ b/Source/cmake/OptionsGTK.cmake -@@ -9,6 +9,10 @@ set(USER_AGENT_BRANDING "" CACHE STRING "Branding to add to user agent string") +@@ -12,6 +12,10 @@ list(APPEND WEBKIT_UNSAFE_BUFFER_WARNING_FLAGS -Wno-unsafe-buffer-usage-in-forma # Update Source/WTF/wtf/Platform.h to match required GLib versions. find_package(GLib 2.70.0 REQUIRED COMPONENTS GioUnix Thread Module) @@ -18913,7 +19250,7 @@ index 1f1b576f84c8ad254868d8e2b2f4f0429ea59d06..11e5f0d982166f5f5c6e44984d48b912 find_package(Cairo 1.16.0 REQUIRED) find_package(LibGcrypt 1.7.0 REQUIRED) find_package(Soup3 3.0.0 REQUIRED) -@@ -72,6 +76,10 @@ WEBKIT_OPTION_DEFINE(USE_SYSTEM_UNIFDEF "Whether to use a system-provided unifde +@@ -76,6 +80,10 @@ WEBKIT_OPTION_DEFINE(USE_SYSTEM_UNIFDEF "Whether to use a system-provided unifde WEBKIT_OPTION_DEPEND(USE_SYSTEM_SYSPROF_CAPTURE USE_SYSPROF_CAPTURE) @@ -18924,7 +19261,7 @@ index 1f1b576f84c8ad254868d8e2b2f4f0429ea59d06..11e5f0d982166f5f5c6e44984d48b912 SET_AND_EXPOSE_TO_BUILD(ENABLE_DEVELOPER_MODE ${DEVELOPER_MODE}) if (DEVELOPER_MODE) WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_API_TESTS PRIVATE ON) -@@ -150,6 +158,21 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(USE_SKIA PRIVATE ON) +@@ -154,6 +162,21 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(USE_SKIA PRIVATE ON) WEBKIT_OPTION_DEPEND(ENABLE_GPU_PROCESS USE_GBM) @@ -18947,10 +19284,10 @@ index 1f1b576f84c8ad254868d8e2b2f4f0429ea59d06..11e5f0d982166f5f5c6e44984d48b912 WEBKIT_OPTION_DEPEND(ENABLE_WEBXR ENABLE_GAMEPAD) diff --git a/Source/cmake/OptionsWPE.cmake b/Source/cmake/OptionsWPE.cmake -index 1c76c10e05d9af72dd9e82ced3e045c5ab9634f3..ec3dfda6e819846cab8c51600214789c27cc47a7 100644 +index 6300268001d84bd43fb337d6aeabc4a2dba837ca..0afd7bfcbb4016cd4b544294d9e9c42858301836 100644 --- a/Source/cmake/OptionsWPE.cmake +++ b/Source/cmake/OptionsWPE.cmake -@@ -37,6 +37,9 @@ else () +@@ -40,6 +40,9 @@ else () set(ENABLE_MEDIA_SESSION_DEFAULT ON) endif () @@ -18960,7 +19297,7 @@ index 1c76c10e05d9af72dd9e82ced3e045c5ab9634f3..ec3dfda6e819846cab8c51600214789c WEBKIT_OPTION_BEGIN() SET_AND_EXPOSE_TO_BUILD(ENABLE_DEVELOPER_MODE ${DEVELOPER_MODE}) -@@ -94,6 +97,22 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEBXR PRIVATE ${ENABLE_EXPERIMENTAL_FEAT +@@ -98,6 +101,22 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEBXR PRIVATE ${ENABLE_EXPERIMENTAL_FEAT WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEBXR_HIT_TEST PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES}) WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEBXR_LAYERS PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES}) @@ -18983,7 +19320,7 @@ index 1c76c10e05d9af72dd9e82ced3e045c5ab9634f3..ec3dfda6e819846cab8c51600214789c # Public options specific to the WPE port. Do not add any options here unless # there is a strong reason we should support changing the value of the option, # and the option is not relevant to other WebKit ports. -@@ -131,6 +150,11 @@ WEBKIT_OPTION_DEPEND(ENABLE_DOCUMENTATION ENABLE_INTROSPECTION) +@@ -136,6 +155,11 @@ WEBKIT_OPTION_DEPEND(ENABLE_DOCUMENTATION ENABLE_INTROSPECTION) WEBKIT_OPTION_DEPEND(ENABLE_WPE_QT_API ENABLE_WPE_PLATFORM) WEBKIT_OPTION_DEPEND(USE_SYSTEM_SYSPROF_CAPTURE USE_SYSPROF_CAPTURE) @@ -18996,10 +19333,10 @@ index 1c76c10e05d9af72dd9e82ced3e045c5ab9634f3..ec3dfda6e819846cab8c51600214789c WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_BUBBLEWRAP_SANDBOX PUBLIC ON) WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MEMORY_SAMPLER PRIVATE ON) diff --git a/Source/cmake/OptionsWin.cmake b/Source/cmake/OptionsWin.cmake -index da6c3b5fd4901b64c616d2b38cb1d9b70c810e71..99380f834b6b3ac5b4afdf68dfa002c0cdf606d3 100644 +index 49734f2d6e59d7410951f9aa2eaa2684fb88c849..2194af76de8cc2cfcb0f3d8fffa9acc5660ffccd 100644 --- a/Source/cmake/OptionsWin.cmake +++ b/Source/cmake/OptionsWin.cmake -@@ -113,6 +113,14 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_FTPDIR PRIVATE OFF) +@@ -115,6 +115,14 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_FTPDIR PRIVATE OFF) SET_AND_EXPOSE_TO_BUILD(ENABLE_WEBDRIVER_KEYBOARD_INTERACTIONS ON) SET_AND_EXPOSE_TO_BUILD(ENABLE_WEBDRIVER_MOUSE_INTERACTIONS ON) @@ -19015,12 +19352,12 @@ index da6c3b5fd4901b64c616d2b38cb1d9b70c810e71..99380f834b6b3ac5b4afdf68dfa002c0 set(USE_ANGLE_EGL ON) diff --git a/Source/cmake/WebKitCompilerFlags.cmake b/Source/cmake/WebKitCompilerFlags.cmake -index 1f63435d0bf53312c627b9a8dab590613fbb93ff..cb1442264f62338a7b8a681527098348103794e8 100644 +index 6c0a4215df55df968e78769b425de7163c08b735..23d83d88fee4fa14bf710c0f6720ad7d1b32cb3f 100644 --- a/Source/cmake/WebKitCompilerFlags.cmake +++ b/Source/cmake/WebKitCompilerFlags.cmake -@@ -152,7 +152,7 @@ macro(WEBKIT_ADD_TARGET_CXX_FLAGS _target) - endmacro() - +@@ -161,7 +161,7 @@ set(WEBKIT_UNSAFE_BUFFER_WARNING_FLAGS + ) + option(ENABLE_UNSAFE_BUFFER_USAGE_WARNING "Build with -Wunsafe-buffer-usage" OFF) -option(DEVELOPER_MODE_FATAL_WARNINGS "Build with warnings as errors if DEVELOPER_MODE is also enabled" ON) +option(DEVELOPER_MODE_FATAL_WARNINGS "Build with warnings as errors if DEVELOPER_MODE is also enabled" OFF) @@ -19119,7 +19456,7 @@ index 0e7f9c7bb7ccb52ccb579ff464a5904aaab2baed..65999b8d7c2dfd1aecc58fe93504aa9c } diff --git a/Tools/MiniBrowser/gtk/BrowserWindow.c b/Tools/MiniBrowser/gtk/BrowserWindow.c -index d39b809a879babcdbbf4b5f7687204df5ccc43f3..a784ea4e693332aee731c4b8949ddb33af7dff9f 100644 +index e5c3084cb308dc236bb9f74d1ed792decbeab908..6b47ca77354bba7859ed3820a4c5cae68b764906 100644 --- a/Tools/MiniBrowser/gtk/BrowserWindow.c +++ b/Tools/MiniBrowser/gtk/BrowserWindow.c @@ -73,7 +73,7 @@ struct _BrowserWindowClass { @@ -19152,7 +19489,7 @@ index d39b809a879babcdbbf4b5f7687204df5ccc43f3..a784ea4e693332aee731c4b8949ddb33 gtk_window_set_title(GTK_WINDOW(window), privateTitle ? privateTitle : title); g_free(privateTitle); } -@@ -524,8 +518,12 @@ static gboolean webViewDecidePolicy(WebKitWebView *webView, WebKitPolicyDecision +@@ -527,8 +521,12 @@ static gboolean webViewDecidePolicy(WebKitWebView *webView, WebKitPolicyDecision return FALSE; WebKitNavigationAction *navigationAction = webkit_navigation_policy_decision_get_navigation_action(WEBKIT_NAVIGATION_POLICY_DECISION(decision)); @@ -19167,7 +19504,7 @@ index d39b809a879babcdbbf4b5f7687204df5ccc43f3..a784ea4e693332aee731c4b8949ddb33 return FALSE; /* Multiple tabs are not allowed in editor mode. */ -@@ -1502,6 +1500,20 @@ static gboolean browserWindowDeleteEvent(GtkWidget *widget, GdkEventAny* event) +@@ -1505,6 +1503,20 @@ static gboolean browserWindowDeleteEvent(GtkWidget *widget, GdkEventAny* event) } #endif @@ -19188,7 +19525,7 @@ index d39b809a879babcdbbf4b5f7687204df5ccc43f3..a784ea4e693332aee731c4b8949ddb33 static void browser_window_class_init(BrowserWindowClass *klass) { GObjectClass *gobjectClass = G_OBJECT_CLASS(klass); -@@ -1515,6 +1527,13 @@ static void browser_window_class_init(BrowserWindowClass *klass) +@@ -1518,6 +1530,13 @@ static void browser_window_class_init(BrowserWindowClass *klass) GtkWidgetClass *widgetClass = GTK_WIDGET_CLASS(klass); widgetClass->delete_event = browserWindowDeleteEvent; #endif @@ -19216,10 +19553,10 @@ index 1fd07efb828b85b6d8def6c6cd92a0c11debfe1b..da9fac7975d477857ead2adb1d67108d typedef struct _BrowserWindow BrowserWindow; diff --git a/Tools/MiniBrowser/gtk/main.c b/Tools/MiniBrowser/gtk/main.c -index dc20509081346978e0da4a7833f6d4ce733717ac..817bd32756f0c8279beb4c23bee4b1e6f2ded960 100644 +index 8722194f5a3007d7eeb90e5517c129afcfbef45e..068d50bdd954578b9cd7dc091059976dd1f9f216 100644 --- a/Tools/MiniBrowser/gtk/main.c +++ b/Tools/MiniBrowser/gtk/main.c -@@ -66,9 +66,15 @@ static char* timeZone; +@@ -68,9 +68,15 @@ static char* timeZone; static gboolean enableITP; static gboolean exitAfterLoad; static gboolean webProcessCrashed; @@ -19235,7 +19572,7 @@ index dc20509081346978e0da4a7833f6d4ce733717ac..817bd32756f0c8279beb4c23bee4b1e6 #if !GTK_CHECK_VERSION(3, 98, 0) static gboolean enableSandbox; -@@ -174,6 +180,11 @@ static const GOptionEntry commandLineOptions[] = +@@ -178,6 +184,11 @@ static const GOptionEntry commandLineOptions[] = { "time-zone", 't', 0, G_OPTION_ARG_STRING, &timeZone, "Set time zone", "TIMEZONE" }, { "version", 'v', 0, G_OPTION_ARG_NONE, &printVersion, "Print the WebKitGTK version", NULL }, { "config", 'C', 0, G_OPTION_ARG_FILENAME, &configFile, "Path to a configuration file", "PATH" }, @@ -19247,7 +19584,7 @@ index dc20509081346978e0da4a7833f6d4ce733717ac..817bd32756f0c8279beb4c23bee4b1e6 { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &uriArguments, 0, "[URL…]" }, { 0, 0, 0, 0, 0, 0, 0 } }; -@@ -730,6 +741,64 @@ static void filterSavedCallback(WebKitUserContentFilterStore *store, GAsyncResul +@@ -734,6 +745,64 @@ static void filterSavedCallback(WebKitUserContentFilterStore *store, GAsyncResul g_main_loop_quit(data->mainLoop); } @@ -19312,7 +19649,7 @@ index dc20509081346978e0da4a7833f6d4ce733717ac..817bd32756f0c8279beb4c23bee4b1e6 static void startup(GApplication *application) { const char *actionAccels[] = { -@@ -788,22 +857,39 @@ static void setupDarkMode(GtkSettings *settings) +@@ -805,22 +874,39 @@ static void addUserScript(WebKitUserContentManager *userContentManager, const gc static void activate(GApplication *application, WebKitSettings *webkitSettings) { @@ -19356,7 +19693,7 @@ index dc20509081346978e0da4a7833f6d4ce733717ac..817bd32756f0c8279beb4c23bee4b1e6 webkit_network_session_set_itp_enabled(networkSession, enableITP); if (!automationMode) { -@@ -838,9 +924,12 @@ static void activate(GApplication *application, WebKitSettings *webkitSettings) +@@ -855,9 +941,12 @@ static void activate(GApplication *application, WebKitSettings *webkitSettings) } #else WebKitWebsiteDataManager *manager; @@ -19371,7 +19708,7 @@ index dc20509081346978e0da4a7833f6d4ce733717ac..817bd32756f0c8279beb4c23bee4b1e6 g_autofree char *dataDirectory = profileDirectory ? g_build_filename(profileDirectory, "data", NULL) : g_build_filename(g_get_user_data_dir(), "webkitgtk-" WEBKITGTK_API_VERSION, "MiniBrowser", NULL); g_autofree char *cacheDirectory = profileDirectory ? g_build_filename(profileDirectory, "cache", NULL) : g_build_filename(g_get_user_cache_dir(), "webkitgtk-" WEBKITGTK_API_VERSION, "MiniBrowser", NULL); manager = webkit_website_data_manager_new("base-data-directory", dataDirectory, "base-cache-directory", cacheDirectory, NULL); -@@ -888,6 +977,7 @@ static void activate(GApplication *application, WebKitSettings *webkitSettings) +@@ -905,6 +994,7 @@ static void activate(GApplication *application, WebKitSettings *webkitSettings) // Enable the favicon database. webkit_web_context_set_favicon_database_directory(webContext, NULL); #endif @@ -19379,7 +19716,7 @@ index dc20509081346978e0da4a7833f6d4ce733717ac..817bd32756f0c8279beb4c23bee4b1e6 webkit_web_context_register_uri_scheme(webContext, BROWSER_ABOUT_SCHEME, (WebKitURISchemeRequestCallback)aboutURISchemeRequestCallback, NULL, NULL); -@@ -952,9 +1042,7 @@ static void activate(GApplication *application, WebKitSettings *webkitSettings) +@@ -978,9 +1068,7 @@ static void activate(GApplication *application, WebKitSettings *webkitSettings) if (exitAfterLoad) exitAfterWebViewLoadFinishes(webView, application); } @@ -19390,7 +19727,7 @@ index dc20509081346978e0da4a7833f6d4ce733717ac..817bd32756f0c8279beb4c23bee4b1e6 } } else { WebKitWebView *webView = createBrowserTab(mainWindow, webkitSettings, userContentManager, defaultWebsitePolicies); -@@ -1004,7 +1092,7 @@ int main(int argc, char *argv[]) +@@ -1030,7 +1118,7 @@ int main(int argc, char *argv[]) g_option_context_add_group(context, gst_init_get_option_group()); #endif @@ -19399,7 +19736,7 @@ index dc20509081346978e0da4a7833f6d4ce733717ac..817bd32756f0c8279beb4c23bee4b1e6 webkit_settings_set_enable_developer_extras(webkitSettings, TRUE); webkit_settings_set_enable_webgl(webkitSettings, TRUE); webkit_settings_set_enable_media_stream(webkitSettings, TRUE); -@@ -1056,9 +1144,11 @@ int main(int argc, char *argv[]) +@@ -1082,9 +1170,11 @@ int main(int argc, char *argv[]) } GtkApplication *application = gtk_application_new("org.webkitgtk.MiniBrowser", G_APPLICATION_NON_UNIQUE); @@ -19412,30 +19749,32 @@ index dc20509081346978e0da4a7833f6d4ce733717ac..817bd32756f0c8279beb4c23bee4b1e6 g_clear_object(&interfaceSettings); diff --git a/Tools/MiniBrowser/wpe/main.cpp b/Tools/MiniBrowser/wpe/main.cpp -index c8cd8719368bc3be7b97b315c64162ced5b7c351..7a7b2d3b0ebc31690f5877694118ddfc311ee5cf 100644 +index c8cd8719368bc3be7b97b315c64162ced5b7c351..69d25479b7a0a1afcffcdad6a62f4f3857c92cac 100644 --- a/Tools/MiniBrowser/wpe/main.cpp +++ b/Tools/MiniBrowser/wpe/main.cpp -@@ -56,6 +56,9 @@ static gboolean privateMode; +@@ -56,6 +56,10 @@ static gboolean privateMode; static const char* profileDirectory; static gboolean automationMode; static gboolean ignoreTLSErrors; +static gboolean inspectorPipe; ++static gint remoteDebuggingPort = -1; +static gboolean noStartupWindow; +static const char* userDataDir; static const char* contentFilter; static const char* cookiesFile; static const char* cookiesPolicy; -@@ -141,6 +144,9 @@ static const GOptionEntry commandLineOptions[] = +@@ -141,6 +145,10 @@ static const GOptionEntry commandLineOptions[] = { "config-file", 0, 0, G_OPTION_ARG_FILENAME, &configFile, "Config file to load for settings", "FILE" }, { "size", 's', 0, G_OPTION_ARG_CALLBACK, reinterpret_cast(parseWindowSize), "Specify the window size to use, e.g. --size=\"800x600\"", nullptr }, { "version", 'v', 0, G_OPTION_ARG_NONE, &printVersion, "Print the WPE version", nullptr }, + { "inspector-pipe", 'v', 0, G_OPTION_ARG_NONE, &inspectorPipe, "Expose remote debugging protocol over pipe", nullptr }, ++ { "remote-debugging-port", 0, 0, G_OPTION_ARG_INT, &remoteDebuggingPort, "Start remote debugging server on the specified port", NULL }, + { "user-data-dir", 0, 0, G_OPTION_ARG_STRING, &userDataDir, "Default profile persistence folder location", "FILE" }, + { "no-startup-window", 0, 0, G_OPTION_ARG_NONE, &noStartupWindow, "Do not open default page", nullptr }, { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &uriArguments, nullptr, "[URL]" }, { nullptr, 0, 0, G_OPTION_ARG_NONE, nullptr, nullptr, nullptr } }; -@@ -331,15 +337,38 @@ static void filterSavedCallback(WebKitUserContentFilterStore *store, GAsyncResul +@@ -331,15 +339,38 @@ static void filterSavedCallback(WebKitUserContentFilterStore *store, GAsyncResul g_main_loop_quit(data->mainLoop); } @@ -19476,7 +19815,7 @@ index c8cd8719368bc3be7b97b315c64162ced5b7c351..7a7b2d3b0ebc31690f5877694118ddfc { #if defined(USE_LIBWPE) && USE_LIBWPE auto backend = createViewBackend(defaultWindowWidthLegacyAPI, defaultWindowHeightLegacyAPI); -@@ -356,14 +385,31 @@ static WebKitWebView* createWebView(WebKitWebView* webView, WebKitNavigationActi +@@ -356,14 +387,31 @@ static WebKitWebView* createWebView(WebKitWebView* webView, WebKitNavigationActi } #endif @@ -19514,7 +19853,7 @@ index c8cd8719368bc3be7b97b315c64162ced5b7c351..7a7b2d3b0ebc31690f5877694118ddfc #if ENABLE_WPE_PLATFORM if (auto* wpeView = webkit_web_view_get_wpe_view(newWebView)) { -@@ -375,9 +421,13 @@ static WebKitWebView* createWebView(WebKitWebView* webView, WebKitNavigationActi +@@ -375,9 +423,13 @@ static WebKitWebView* createWebView(WebKitWebView* webView, WebKitNavigationActi g_signal_connect(newWebView, "create", G_CALLBACK(createWebView), user_data); g_signal_connect(newWebView, "close", G_CALLBACK(webViewClose), user_data); @@ -19530,7 +19869,7 @@ index c8cd8719368bc3be7b97b315c64162ced5b7c351..7a7b2d3b0ebc31690f5877694118ddfc return newWebView; } -@@ -468,24 +518,112 @@ static void loadConfigFile(WebKitSettings* webkitSettings +@@ -468,24 +520,120 @@ static void loadConfigFile(WebKitSettings* webkitSettings } #if defined(USE_LIBWPE) && USE_LIBWPE @@ -19616,6 +19955,14 @@ index c8cd8719368bc3be7b97b315c64162ced5b7c351..7a7b2d3b0ebc31690f5877694118ddfc + g_signal_connect(browserInspector, "quit-application", G_CALLBACK(quitBroserApplication), application); + webkit_browser_inspector_initialize_pipe(proxy, ignoreHosts); +} ++ ++static void configureBrowserInspectorPort(GApplication* application) ++{ ++ WebKitBrowserInspector* browserInspector = webkit_browser_inspector_get_default(); ++ g_signal_connect(browserInspector, "create-new-page", G_CALLBACK(createNewPage), NULL); ++ g_signal_connect(browserInspector, "quit-application", G_CALLBACK(quitBroserApplication), application); ++ webkit_browser_inspector_initialize_web_socket(remoteDebuggingPort, proxy, ignoreHosts); ++} + static void activate(GApplication* application, WPEToolingBackends::ViewBackend* backend) #else @@ -19632,7 +19979,7 @@ index c8cd8719368bc3be7b97b315c64162ced5b7c351..7a7b2d3b0ebc31690f5877694118ddfc + if (userDataDir) { + networkSession = webkit_network_session_new(userDataDir, userDataDir); + cookiesFile = g_build_filename(userDataDir, "cookies.txt", nullptr); -+ } else if (inspectorPipe || privateMode || automationMode) { ++ } else if (inspectorPipe || remoteDebuggingPort != -1 || privateMode || automationMode) { networkSession = webkit_network_session_new_ephemeral(); - else if (profileDirectory) { + } else if (profileDirectory) { @@ -19647,7 +19994,7 @@ index c8cd8719368bc3be7b97b315c64162ced5b7c351..7a7b2d3b0ebc31690f5877694118ddfc webkit_network_session_set_itp_enabled(networkSession, enableITP); if (proxy) { -@@ -512,19 +650,22 @@ static void activate(GApplication* application, gpointer) +@@ -512,19 +660,22 @@ static void activate(GApplication* application, gpointer) webkit_cookie_manager_set_persistent_storage(cookieManager, cookiesFile, storageType); } } @@ -19661,7 +20008,7 @@ index c8cd8719368bc3be7b97b315c64162ced5b7c351..7a7b2d3b0ebc31690f5877694118ddfc + if (userDataDir) { + manager = webkit_website_data_manager_new("base-data-directory", userDataDir, "base-cache-directory", userDataDir, NULL); + cookiesFile = g_build_filename(userDataDir, "cookies.txt", NULL); -+ } else if (inspectorPipe || privateMode || automationMode) { ++ } else if (inspectorPipe || remoteDebuggingPort != -1 || privateMode || automationMode) { manager = webkit_website_data_manager_new_ephemeral(); - else if (profileDirectory) { + } else if (profileDirectory) { @@ -19677,7 +20024,7 @@ index c8cd8719368bc3be7b97b315c64162ced5b7c351..7a7b2d3b0ebc31690f5877694118ddfc webkit_website_data_manager_set_itp_enabled(manager, enableITP); if (proxy) { -@@ -555,6 +696,7 @@ static void activate(GApplication* application, gpointer) +@@ -555,6 +706,7 @@ static void activate(GApplication* application, gpointer) } #endif @@ -19685,7 +20032,7 @@ index c8cd8719368bc3be7b97b315c64162ced5b7c351..7a7b2d3b0ebc31690f5877694118ddfc g_autoptr(WebKitUserContentManager) userContentManager = nullptr; if (contentFilter) { g_autoptr(GFile) contentFilterFile = g_file_new_for_commandline_arg(contentFilter); -@@ -637,6 +779,15 @@ static void activate(GApplication* application, gpointer) +@@ -637,6 +789,15 @@ static void activate(GApplication* application, gpointer) "autoplay", WEBKIT_AUTOPLAY_ALLOW, nullptr); @@ -19701,7 +20048,7 @@ index c8cd8719368bc3be7b97b315c64162ced5b7c351..7a7b2d3b0ebc31690f5877694118ddfc auto* webView = WEBKIT_WEB_VIEW(g_object_new(WEBKIT_TYPE_WEB_VIEW, #if defined(USE_LIBWPE) && USE_LIBWPE "backend", viewBackend, -@@ -699,12 +850,16 @@ static void activate(GApplication* application, gpointer) +@@ -699,12 +860,16 @@ static void activate(GApplication* application, gpointer) #endif } @@ -19720,7 +20067,7 @@ index c8cd8719368bc3be7b97b315c64162ced5b7c351..7a7b2d3b0ebc31690f5877694118ddfc g_hash_table_add(openViews, webView); WebKitColor color; -@@ -712,16 +867,11 @@ static void activate(GApplication* application, gpointer) +@@ -712,16 +877,11 @@ static void activate(GApplication* application, gpointer) webkit_web_view_set_background_color(webView, &color); if (uriArguments) { @@ -19742,7 +20089,7 @@ index c8cd8719368bc3be7b97b315c64162ced5b7c351..7a7b2d3b0ebc31690f5877694118ddfc webkit_web_view_load_uri(webView, "https://wpewebkit.org"); g_object_unref(webContext); -@@ -816,12 +966,18 @@ int main(int argc, char *argv[]) +@@ -816,12 +976,20 @@ int main(int argc, char *argv[]) } #endif @@ -19757,6 +20104,8 @@ index c8cd8719368bc3be7b97b315c64162ced5b7c351..7a7b2d3b0ebc31690f5877694118ddfc + + if (inspectorPipe) + configureBrowserInspector(application); ++ else if (remoteDebuggingPort != -1) ++ configureBrowserInspectorPort(application); + g_application_run(application, 0, nullptr); g_object_unref(application); @@ -19773,40 +20122,8 @@ index 1067b31bc989748dfcc5502209d36d001b9b239e..7629263fb8bc93dca6dfc01c75eed8d2 +if (ENABLE_WEBKIT) + add_subdirectory(Playwright/win) +endif () -diff --git a/Tools/Scripts/generate-bundle b/Tools/Scripts/generate-bundle -index 2050bc1c4e2f94461cfe25dbc53762afdc6b9f53..cd43f62318d661bf2558a1b8005f37de19eb0f15 100755 ---- a/Tools/Scripts/generate-bundle -+++ b/Tools/Scripts/generate-bundle -@@ -41,7 +41,6 @@ sys.path.insert(0, os.path.join(top_level_directory, 'Tools', 'flatpak')) - sys.path.insert(0, os.path.join(top_level_directory, 'Tools', 'jhbuild')) - sys.path.insert(0, os.path.join(top_level_directory, 'Tools', 'Scripts', 'webkitpy')) - import jhbuildutils --import flatpakutils - from binary_bundling.ldd import SharedObjectResolver - from binary_bundling.bundle import BinaryBundler - -@@ -896,7 +895,7 @@ class BundleCreator(object): - _log.info('Copy basic GTK icons.') - icons_target_dir = os.path.join(target_sys_share_dir, 'icons') - os.makedirs(icons_target_dir) -- gtk_icon_basedir = '/run/host/share/icons' if flatpakutils.is_sandboxed() else '/usr/share/icons' -+ gtk_icon_basedir = '/usr/share/icons' - gtk_target_icon_dir = os.path.join(icons_target_dir, 'hicolor') - gtk_icon_dirs_copied = 0 - for gtk_icon_theme in ['Adwaita', 'hicolor', 'gnome']: -@@ -975,9 +974,7 @@ def main(): - parser.add_argument('--builder-name', action='store', dest='builder_name') - options = parser.parse_args() - -- flatpakutils.run_in_sandbox_if_available([sys.argv[0], '--flatpak-' + options.platform] + sys.argv[1:]) -- if not flatpakutils.is_sandboxed(): -- jhbuildutils.enter_jhbuild_environment_if_available(options.platform) -+ jhbuildutils.enter_jhbuild_environment_if_available(options.platform) - - configure_logging(options.log_level) - bundle_creator = BundleCreator(options.configuration, options.platform, options.bundle_binary, options.syslibs, options.ldd, diff --git a/Tools/WebKitTestRunner/CMakeLists.txt b/Tools/WebKitTestRunner/CMakeLists.txt -index ba703658cf8c56ad1768333b70938e67e8b36777..804487a7082024733d5012dcc62b9784c268bb55 100644 +index a2c72d2d46f90d1851dfd64b718b55580321adaf..4877227f61591a1bc437cacaa5e792ebdb014af8 100644 --- a/Tools/WebKitTestRunner/CMakeLists.txt +++ b/Tools/WebKitTestRunner/CMakeLists.txt @@ -99,6 +99,10 @@ set(TestRunnerInjectedBundle_PRIVATE_LIBRARIES @@ -19821,10 +20138,10 @@ index ba703658cf8c56ad1768333b70938e67e8b36777..804487a7082024733d5012dcc62b9784 "${WebKitTestRunner_DIR}/InjectedBundle/Bindings/AccessibilityController.idl" "${WebKitTestRunner_DIR}/InjectedBundle/Bindings/AccessibilityTextMarker.idl" diff --git a/Tools/WebKitTestRunner/TestController.cpp b/Tools/WebKitTestRunner/TestController.cpp -index 949b6db7d5946a3981d87ef808c83592532b6a69..fb72fabc3e1b485b2479bfbb2ecb05c909427aa6 100644 +index a77f218b68b637c92571a1b5c5b39cbb0631f5a1..db2ebbf139c827855c215144e18fef3d222047c7 100644 --- a/Tools/WebKitTestRunner/TestController.cpp +++ b/Tools/WebKitTestRunner/TestController.cpp -@@ -792,6 +792,7 @@ PlatformWebView* TestController::createOtherPlatformWebView(PlatformWebView* par +@@ -810,6 +810,7 @@ PlatformWebView* TestController::createOtherPlatformWebView(PlatformWebView* par nullptr, // requestStorageAccessConfirm nullptr, // shouldAllowDeviceOrientationAndMotionAccess nullptr, // runWebAuthenticationPanel @@ -19832,7 +20149,7 @@ index 949b6db7d5946a3981d87ef808c83592532b6a69..fb72fabc3e1b485b2479bfbb2ecb05c9 nullptr, // decidePolicyForSpeechRecognitionPermissionRequest nullptr, // decidePolicyForMediaKeySystemPermissionRequest nullptr, // queryPermission -@@ -1272,6 +1273,7 @@ void TestController::createWebViewWithOptions(const TestOptions& options) +@@ -1298,6 +1299,7 @@ void TestController::createWebViewWithOptions(const TestOptions& options) nullptr, // requestStorageAccessConfirm shouldAllowDeviceOrientationAndMotionAccess, runWebAuthenticationPanel, @@ -19841,7 +20158,7 @@ index 949b6db7d5946a3981d87ef808c83592532b6a69..fb72fabc3e1b485b2479bfbb2ecb05c9 decidePolicyForMediaKeySystemPermissionRequest, queryPermission, diff --git a/Tools/WebKitTestRunner/mac/EventSenderProxy.mm b/Tools/WebKitTestRunner/mac/EventSenderProxy.mm -index 12a89be783e49c44edfca8d27f1fc3ddd24255e9..2ba827c958fa3558b0cd36f9e5b7537493fef362 100644 +index 13a94ad7d71f65b38408e0cf52558fbc4610a649..e2a69c365de4cd4aaabfdd19fb3893317b8d7269 100644 --- a/Tools/WebKitTestRunner/mac/EventSenderProxy.mm +++ b/Tools/WebKitTestRunner/mac/EventSenderProxy.mm @@ -1031,4 +1031,51 @@ void EventSenderProxy::scaleGestureEnd(double scale) @@ -19897,11 +20214,11 @@ index 12a89be783e49c44edfca8d27f1fc3ddd24255e9..2ba827c958fa3558b0cd36f9e5b75374 + } // namespace WTR diff --git a/Tools/jhbuild/jhbuild-minimal.modules b/Tools/jhbuild/jhbuild-minimal.modules -index d526231f288ca82f4928d75ee9847b919b72bbfb..c904fac94196a8eb9888abf83b0db5ab69b3a993 100644 +index 8e1df1545699ccf902471cd7e35c0945da9144d7..519fdf07d9c55ed4c2b940e392d1f559cc5c01b2 100644 --- a/Tools/jhbuild/jhbuild-minimal.modules +++ b/Tools/jhbuild/jhbuild-minimal.modules @@ -69,8 +69,8 @@ - + Date: Fri, 24 Jul 2026 14:56:25 -0600 Subject: [PATCH 2/5] chore: roll stable test runner to 1.62.0-beta-1784842988000 (#41980) --- .../stable-test-runner/package-lock.json | 24 +++++++++---------- .../stable-test-runner/package.json | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/tests/playwright-test/stable-test-runner/package-lock.json b/tests/playwright-test/stable-test-runner/package-lock.json index b234a13dbbfad..7006055ac2839 100644 --- a/tests/playwright-test/stable-test-runner/package-lock.json +++ b/tests/playwright-test/stable-test-runner/package-lock.json @@ -5,16 +5,16 @@ "packages": { "": { "dependencies": { - "@playwright/test": "^1.62.0-alpha-2026-07-20" + "@playwright/test": "^1.62.0-beta-1784842988000" } }, "node_modules/@playwright/test": { - "version": "1.62.0-alpha-2026-07-20", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.62.0-alpha-2026-07-20.tgz", - "integrity": "sha512-Lb218lZdfhxIJpDF3QRaVqDjNyruDfN7gKIYbMRCHRfTsgQqz6cp2xJznDrc80k3gLC6Wby/twFkbfaKWUd/rg==", + "version": "1.62.0-beta-1784842988000", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.62.0-beta-1784842988000.tgz", + "integrity": "sha512-FKW+1h6h+ywZJLAXRSGyu41Dt5AHkZNvF37Ii18e06blu7aky+sIBMtIKBW4KwxD5BK1Lb5WOPtHo1MJuSk5cg==", "license": "Apache-2.0", "dependencies": { - "playwright": "1.62.0-alpha-2026-07-20" + "playwright": "1.62.0-beta-1784842988000" }, "bin": { "playwright": "cli.js" @@ -38,12 +38,12 @@ } }, "node_modules/playwright": { - "version": "1.62.0-alpha-2026-07-20", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.62.0-alpha-2026-07-20.tgz", - "integrity": "sha512-/h5GCcC7LUQOUS+XpGhY5B+UWsyU7PC2oEVzSjqn6dBf2FQBohD+JV0FDrmQkhcTqn5AoWNTbEEPswu9WZvtZg==", + "version": "1.62.0-beta-1784842988000", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.62.0-beta-1784842988000.tgz", + "integrity": "sha512-Ok6v7QCqCfU35n9sMEPKQgl5/IF39BXCWPDqpthUyTzPNLTy1bMcTRymHDlfbVhShBUp2IbhIhU/ymEylL0FmA==", "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.62.0-alpha-2026-07-20" + "playwright-core": "1.62.0-beta-1784842988000" }, "bin": { "playwright": "cli.js" @@ -56,9 +56,9 @@ } }, "node_modules/playwright-core": { - "version": "1.62.0-alpha-2026-07-20", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.62.0-alpha-2026-07-20.tgz", - "integrity": "sha512-JCPvar5AJouLPK5dce8+M/tC3f0gfSt564h1pdL5aHSW5SAaTyPPKdZ01DnGeuftrCzXQIExEc5SDKBV109JHA==", + "version": "1.62.0-beta-1784842988000", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.62.0-beta-1784842988000.tgz", + "integrity": "sha512-mvQLcJx/E3k2NSNc0ylLd+EC7faJtljlsoovol5nyhN4VWSADKTIcrp3ZFm1uMQSIoQNCK/KMI9rbvIhpQI7uQ==", "license": "Apache-2.0", "bin": { "playwright-core": "cli.js" diff --git a/tests/playwright-test/stable-test-runner/package.json b/tests/playwright-test/stable-test-runner/package.json index 009d78eecef81..d7d1d5653f7e3 100644 --- a/tests/playwright-test/stable-test-runner/package.json +++ b/tests/playwright-test/stable-test-runner/package.json @@ -1,6 +1,6 @@ { "private": true, "dependencies": { - "@playwright/test": "^1.62.0-alpha-2026-07-20" + "@playwright/test": "^1.62.0-beta-1784842988000" } } From 9cafa748a27597ec7a368440c60b8d6847508bc2 Mon Sep 17 00:00:00 2001 From: Dmitry Gozman Date: Fri, 24 Jul 2026 22:36:05 +0100 Subject: [PATCH 3/5] feat: support multiple HTTP credentials (#41979) --- docs/src/api/class-browsercontext.md | 5 +- docs/src/api/params.md | 4 +- packages/playwright-client/types/types.d.ts | 139 +++++++++++++++++- .../src/client/browserContext.ts | 13 +- .../playwright-core/src/client/channels.d.ts | 105 +++---------- .../playwright-core/src/client/electron.ts | 3 +- packages/playwright-core/src/client/fetch.ts | 7 +- packages/playwright-core/src/client/types.ts | 4 +- .../src/server/bidi/bidiBrowser.ts | 3 +- .../src/server/bidi/bidiNetworkManager.ts | 12 +- .../src/server/browserContext.ts | 16 +- .../playwright-core/src/server/channels.d.ts | 105 +++---------- .../src/server/chromium/crBrowser.ts | 3 +- .../src/server/chromium/crNetworkManager.ts | 20 +-- packages/playwright-core/src/server/fetch.ts | 12 +- .../src/server/firefox/ffBrowser.ts | 9 +- packages/playwright-core/src/server/types.ts | 7 - .../src/server/webkit/webview/wvBrowser.ts | 3 +- .../src/server/webkit/wkBrowser.ts | 3 +- .../src/server/webkit/wkPage.ts | 4 +- packages/playwright-core/types/types.d.ts | 139 +++++++++++++++++- packages/playwright/types/test.d.ts | 5 +- packages/protocol/spec/browserContext.yml | 7 +- packages/protocol/spec/electron.yml | 7 +- packages/protocol/spec/mixins.yml | 24 +-- packages/protocol/spec/playwright.yml | 12 +- packages/protocol/src/structs.d.ts | 7 + packages/protocol/src/validator.ts | 60 ++------ .../browsercontext-credentials.spec.ts | 75 ++++++++++ tests/library/browsercontext-fetch.spec.ts | 15 ++ tests/library/global-fetch.spec.ts | 43 ++++++ utils/doclint/documentation.js | 3 + utils/generate_types/overrides-test.d.ts | 2 +- 33 files changed, 550 insertions(+), 326 deletions(-) diff --git a/docs/src/api/class-browsercontext.md b/docs/src/api/class-browsercontext.md index f5c2cbc95ef12..68f0c531b3e3c 100644 --- a/docs/src/api/class-browsercontext.md +++ b/docs/src/api/class-browsercontext.md @@ -1520,9 +1520,12 @@ its geolocation. ### param: BrowserContext.setHTTPCredentials.httpCredentials * since: v1.8 -- `httpCredentials` <[null]|[Object]> +- `httpCredentials` <[null]|[Object]|[Array]<[Object]>> - `username` <[string]> - `password` <[string]> + - `origin` ?<[string]> Restrain sending http credentials on specific origin (scheme://host:port). + +Pass an array to use different credentials for different origins. The first entry that matches the request origin is used, and entries with no origin match any request. ## async method: BrowserContext.setOffline * since: v1.8 diff --git a/docs/src/api/params.md b/docs/src/api/params.md index 47fe73082ada9..bf7a70b9074db 100644 --- a/docs/src/api/params.md +++ b/docs/src/api/params.md @@ -718,7 +718,7 @@ An object containing additional HTTP headers to be sent with every request. Defa Whether to emulate network being offline. Defaults to `false`. Learn more about [network emulation](../emulation.md#offline). ## context-option-httpcredentials -- `httpCredentials` <[Object]> +- `httpCredentials` <[Object]|[Array]<[Object]>> * alias: HttpCredentials - `username` <[string]> - `password` <[string]> @@ -728,6 +728,8 @@ Whether to emulate network being offline. Defaults to `false`. Learn more about Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication). If no origin is specified, the username and password are sent to any servers upon unauthorized responses. +Pass an array to use different credentials for different origins. The first entry that matches the request origin is used, and entries with no origin match any request. + ## context-option-colorscheme * langs: js, java - `colorScheme` > diff --git a/packages/playwright-client/types/types.d.ts b/packages/playwright-client/types/types.d.ts index eaa024a641d57..baa5f1d759c4a 100644 --- a/packages/playwright-client/types/types.d.ts +++ b/packages/playwright-client/types/types.d.ts @@ -10453,13 +10453,28 @@ export interface BrowserContext { /** * @deprecated Browsers may cache credentials after successful authentication. Create a new browser context instead. - * @param httpCredentials + * @param httpCredentials Pass an array to use different credentials for different origins. The first entry that matches the request origin + * is used, and entries with no origin match any request. */ setHTTPCredentials(httpCredentials: null|{ username: string; password: string; - }): Promise; + + /** + * Restrain sending http credentials on specific origin (scheme://host:port). + */ + origin?: string; + }|ReadonlyArray<{ + username: string; + + password: string; + + /** + * Restrain sending http credentials on specific origin (scheme://host:port). + */ + origin?: string; + }>): Promise; /** * @param offline Whether to emulate network being offline for the browser context. @@ -11229,6 +11244,9 @@ export interface Browser { /** * Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication). If no * origin is specified, the username and password are sent to any servers upon unauthorized responses. + * + * Pass an array to use different credentials for different origins. The first entry that matches the request origin + * is used, and entries with no origin match any request. */ httpCredentials?: { username: string; @@ -11248,7 +11266,25 @@ export interface Browser { * `WWW-Authenticate` header is received. Defaults to `'unauthorized'`. */ send?: "unauthorized"|"always"; - }; + }|Array<{ + username: string; + + password: string; + + /** + * Restrain sending http credentials on specific origin (scheme://host:port). + */ + origin?: string; + + /** + * This option only applies to the requests sent from corresponding + * [APIRequestContext](https://playwright.dev/docs/api/class-apirequestcontext) and does not affect requests sent from + * the browser. `'always'` - `Authorization` header with basic authentication credentials will be sent with the each + * API request. `'unauthorized` - the credentials are only sent when 401 (Unauthorized) response with + * `WWW-Authenticate` header is received. Defaults to `'unauthorized'`. + */ + send?: "unauthorized"|"always"; + }>; /** * Whether to ignore HTTPS errors when sending network requests. Defaults to `false`. @@ -17270,6 +17306,9 @@ export interface BrowserType { /** * Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication). If no * origin is specified, the username and password are sent to any servers upon unauthorized responses. + * + * Pass an array to use different credentials for different origins. The first entry that matches the request origin + * is used, and entries with no origin match any request. */ httpCredentials?: { username: string; @@ -17289,7 +17328,25 @@ export interface BrowserType { * `WWW-Authenticate` header is received. Defaults to `'unauthorized'`. */ send?: "unauthorized"|"always"; - }; + }|Array<{ + username: string; + + password: string; + + /** + * Restrain sending http credentials on specific origin (scheme://host:port). + */ + origin?: string; + + /** + * This option only applies to the requests sent from corresponding + * [APIRequestContext](https://playwright.dev/docs/api/class-apirequestcontext) and does not affect requests sent from + * the browser. `'always'` - `Authorization` header with basic authentication credentials will be sent with the each + * API request. `'unauthorized` - the credentials are only sent when 401 (Unauthorized) response with + * `WWW-Authenticate` header is received. Defaults to `'unauthorized'`. + */ + send?: "unauthorized"|"always"; + }>; /** * If `true`, Playwright does not pass its own configurations args and only uses the ones from @@ -18885,6 +18942,9 @@ export interface APIRequest { /** * Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication). If no * origin is specified, the username and password are sent to any servers upon unauthorized responses. + * + * Pass an array to use different credentials for different origins. The first entry that matches the request origin + * is used, and entries with no origin match any request. */ httpCredentials?: { username: string; @@ -18904,7 +18964,25 @@ export interface APIRequest { * `WWW-Authenticate` header is received. Defaults to `'unauthorized'`. */ send?: "unauthorized"|"always"; - }; + }|Array<{ + username: string; + + password: string; + + /** + * Restrain sending http credentials on specific origin (scheme://host:port). + */ + origin?: string; + + /** + * This option only applies to the requests sent from corresponding + * [APIRequestContext](https://playwright.dev/docs/api/class-apirequestcontext) and does not affect requests sent from + * the browser. `'always'` - `Authorization` header with basic authentication credentials will be sent with the each + * API request. `'unauthorized` - the credentials are only sent when 401 (Unauthorized) response with + * `WWW-Authenticate` header is received. Defaults to `'unauthorized'`. + */ + send?: "unauthorized"|"always"; + }>; /** * Whether to ignore HTTPS errors when sending network requests. Defaults to `false`. @@ -23588,6 +23666,9 @@ export interface Electron { /** * Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication). If no * origin is specified, the username and password are sent to any servers upon unauthorized responses. + * + * Pass an array to use different credentials for different origins. The first entry that matches the request origin + * is used, and entries with no origin match any request. */ httpCredentials?: { username: string; @@ -23607,7 +23688,25 @@ export interface Electron { * `WWW-Authenticate` header is received. Defaults to `'unauthorized'`. */ send?: "unauthorized"|"always"; - }; + }|Array<{ + username: string; + + password: string; + + /** + * Restrain sending http credentials on specific origin (scheme://host:port). + */ + origin?: string; + + /** + * This option only applies to the requests sent from corresponding + * [APIRequestContext](https://playwright.dev/docs/api/class-apirequestcontext) and does not affect requests sent from + * the browser. `'always'` - `Authorization` header with basic authentication credentials will be sent with the each + * API request. `'unauthorized` - the credentials are only sent when 401 (Unauthorized) response with + * `WWW-Authenticate` header is received. Defaults to `'unauthorized'`. + */ + send?: "unauthorized"|"always"; + }>; /** * Whether to ignore HTTPS errors when sending network requests. Defaults to `false`. @@ -24225,6 +24324,9 @@ export interface AndroidDevice { /** * Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication). If no * origin is specified, the username and password are sent to any servers upon unauthorized responses. + * + * Pass an array to use different credentials for different origins. The first entry that matches the request origin + * is used, and entries with no origin match any request. */ httpCredentials?: { username: string; @@ -24244,7 +24346,25 @@ export interface AndroidDevice { * `WWW-Authenticate` header is received. Defaults to `'unauthorized'`. */ send?: "unauthorized"|"always"; - }; + }|Array<{ + username: string; + + password: string; + + /** + * Restrain sending http credentials on specific origin (scheme://host:port). + */ + origin?: string; + + /** + * This option only applies to the requests sent from corresponding + * [APIRequestContext](https://playwright.dev/docs/api/class-apirequestcontext) and does not affect requests sent from + * the browser. `'always'` - `Authorization` header with basic authentication credentials will be sent with the each + * API request. `'unauthorized` - the credentials are only sent when 401 (Unauthorized) response with + * `WWW-Authenticate` header is received. Defaults to `'unauthorized'`. + */ + send?: "unauthorized"|"always"; + }>; /** * Whether to ignore HTTPS errors when sending network requests. Defaults to `false`. @@ -25457,8 +25577,11 @@ export interface BrowserContextOptions { /** * Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication). If no * origin is specified, the username and password are sent to any servers upon unauthorized responses. + * + * Pass an array to use different credentials for different origins. The first entry that matches the request origin + * is used, and entries with no origin match any request. */ - httpCredentials?: HTTPCredentials; + httpCredentials?: HTTPCredentials|Array; /** * Whether to ignore HTTPS errors when sending network requests. Defaults to `false`. diff --git a/packages/playwright-core/src/client/browserContext.ts b/packages/playwright-core/src/client/browserContext.ts index 3f1ce5e3d63b5..c971f0739048f 100644 --- a/packages/playwright-core/src/client/browserContext.ts +++ b/packages/playwright-core/src/client/browserContext.ts @@ -49,6 +49,7 @@ import { mkdirIfNeeded } from './fileUtils'; import type { EvaluateOptions } from './jsHandle'; import type { BrowserContextOptions, Headers, SetStorageState, StorageState, WaitForEventOptions } from './types'; +import type { HttpCredentials } from '@protocol/structs'; import type * as structs from '../../types/structs'; import type * as api from '../../types/types'; import type { URLMatch } from '@isomorphic/urlMatch'; @@ -353,8 +354,8 @@ export class BrowserContext extends ChannelOwner await this._channel.setOffline({ offline }, kNoTimeout); } - async setHTTPCredentials(httpCredentials: { username: string, password: string } | null): Promise { - await this._channel.setHTTPCredentials({ httpCredentials: httpCredentials || undefined }, kNoTimeout); + async setHTTPCredentials(httpCredentials: HttpCredentials | HttpCredentials[] | null): Promise { + await this._channel.setHTTPCredentials({ httpCredentials: toHttpCredentialsProtocol(httpCredentials || undefined) }, kNoTimeout); } async addInitScript(script: Function | string | { path?: string, content?: string }, arg?: any, options?: EvaluateOptions) { @@ -567,12 +568,20 @@ export async function prepareBrowserContextParams(options: BrowserContextOptions contrast: options.contrast === null ? 'no-override' : options.contrast, acceptDownloads: toAcceptDownloadsProtocol(options.acceptDownloads), clientCertificates: await toClientCertificatesProtocol(options.clientCertificates), + httpCredentials: toHttpCredentialsProtocol(options.httpCredentials), }; if (contextParams.recordVideo && contextParams.recordVideo.dir) contextParams.recordVideo.dir = path.resolve(contextParams.recordVideo.dir); return contextParams; } +export function toHttpCredentialsProtocol(credentials?: HttpCredentials | HttpCredentials[]): HttpCredentials[] | undefined { + if (!credentials) + return undefined; + const list = Array.isArray(credentials) ? credentials : [credentials]; + return list.length ? list : undefined; +} + function toAcceptDownloadsProtocol(acceptDownloads?: boolean) { if (acceptDownloads === undefined) return undefined; diff --git a/packages/playwright-core/src/client/channels.d.ts b/packages/playwright-core/src/client/channels.d.ts index d62e20c022afd..be860f3deb3ec 100644 --- a/packages/playwright-core/src/client/channels.d.ts +++ b/packages/playwright-core/src/client/channels.d.ts @@ -15,8 +15,8 @@ */ // This file is generated by generate_channels.js, do not edit manually. -import type { Binary, Channel, AndroidWebView, AndroidSelector, AndroidElementInfo, APIResponse, Metadata, ClientSideCallMetadata, SDKLanguage, WaitInfo, SetNetworkCookie, NetworkCookie, ResourceTiming, SecurityDetails, RequestSizes, RemoteAddr, ExpectedTextValue, SelectorEngine, FormField, LifecycleEvent, ConsoleMessagesFilter, RecorderSource, IndexedDBDatabase, SetOriginStorage, OriginStorage, RecordHarOptions, SerializedValue, SerializedArgument, SerializedError, StackFrame, VirtualCredential, Point, Rect, URLPattern, NameValue } from '@protocol/structs'; -export type { Binary, Channel, AndroidWebView, AndroidSelector, AndroidElementInfo, APIResponse, Metadata, ClientSideCallMetadata, SDKLanguage, WaitInfo, SetNetworkCookie, NetworkCookie, ResourceTiming, SecurityDetails, RequestSizes, RemoteAddr, ExpectedTextValue, SelectorEngine, FormField, LifecycleEvent, ConsoleMessagesFilter, RecorderSource, IndexedDBDatabase, SetOriginStorage, OriginStorage, RecordHarOptions, SerializedValue, SerializedArgument, SerializedError, StackFrame, VirtualCredential, Point, Rect, URLPattern, NameValue } from '@protocol/structs'; +import type { Binary, Channel, AndroidWebView, AndroidSelector, AndroidElementInfo, APIResponse, Metadata, ClientSideCallMetadata, SDKLanguage, WaitInfo, HttpCredentials, SetNetworkCookie, NetworkCookie, ResourceTiming, SecurityDetails, RequestSizes, RemoteAddr, ExpectedTextValue, SelectorEngine, FormField, LifecycleEvent, ConsoleMessagesFilter, RecorderSource, IndexedDBDatabase, SetOriginStorage, OriginStorage, RecordHarOptions, SerializedValue, SerializedArgument, SerializedError, StackFrame, VirtualCredential, Point, Rect, URLPattern, NameValue } from '@protocol/structs'; +export type { Binary, Channel, AndroidWebView, AndroidSelector, AndroidElementInfo, APIResponse, Metadata, ClientSideCallMetadata, SDKLanguage, WaitInfo, HttpCredentials, SetNetworkCookie, NetworkCookie, ResourceTiming, SecurityDetails, RequestSizes, RemoteAddr, ExpectedTextValue, SelectorEngine, FormField, LifecycleEvent, ConsoleMessagesFilter, RecorderSource, IndexedDBDatabase, SetOriginStorage, OriginStorage, RecordHarOptions, SerializedValue, SerializedArgument, SerializedError, StackFrame, VirtualCredential, Point, Rect, URLPattern, NameValue } from '@protocol/structs'; export type TimeoutOptions = { signal: AbortSignal | undefined, timeout: number }; @@ -404,12 +404,7 @@ export type AndroidDeviceLaunchBrowserParams = { permissions?: string[], extraHTTPHeaders?: NameValue[], offline?: boolean, - httpCredentials?: { - username: string, - password: string, - origin?: string, - send?: 'always' | 'unauthorized', - }, + httpCredentials?: HttpCredentials[], deviceScaleFactor?: number, isMobile?: boolean, hasTouch?: boolean, @@ -476,12 +471,7 @@ export type AndroidDeviceLaunchBrowserOptions = { permissions?: string[], extraHTTPHeaders?: NameValue[], offline?: boolean, - httpCredentials?: { - username: string, - password: string, - origin?: string, - send?: 'always' | 'unauthorized', - }, + httpCredentials?: HttpCredentials[], deviceScaleFactor?: number, isMobile?: boolean, hasTouch?: boolean, @@ -861,12 +851,7 @@ export type BrowserNewContextParams = { permissions?: string[], extraHTTPHeaders?: NameValue[], offline?: boolean, - httpCredentials?: { - username: string, - password: string, - origin?: string, - send?: 'always' | 'unauthorized', - }, + httpCredentials?: HttpCredentials[], deviceScaleFactor?: number, isMobile?: boolean, hasTouch?: boolean, @@ -936,12 +921,7 @@ export type BrowserNewContextOptions = { permissions?: string[], extraHTTPHeaders?: NameValue[], offline?: boolean, - httpCredentials?: { - username: string, - password: string, - origin?: string, - send?: 'always' | 'unauthorized', - }, + httpCredentials?: HttpCredentials[], deviceScaleFactor?: number, isMobile?: boolean, hasTouch?: boolean, @@ -1014,12 +994,7 @@ export type BrowserNewContextForReuseParams = { permissions?: string[], extraHTTPHeaders?: NameValue[], offline?: boolean, - httpCredentials?: { - username: string, - password: string, - origin?: string, - send?: 'always' | 'unauthorized', - }, + httpCredentials?: HttpCredentials[], deviceScaleFactor?: number, isMobile?: boolean, hasTouch?: boolean, @@ -1089,12 +1064,7 @@ export type BrowserNewContextForReuseOptions = { permissions?: string[], extraHTTPHeaders?: NameValue[], offline?: boolean, - httpCredentials?: { - username: string, - password: string, - origin?: string, - send?: 'always' | 'unauthorized', - }, + httpCredentials?: HttpCredentials[], deviceScaleFactor?: number, isMobile?: boolean, hasTouch?: boolean, @@ -1206,12 +1176,7 @@ export type BrowserContextInitializer = { permissions?: string[], extraHTTPHeaders?: NameValue[], offline?: boolean, - httpCredentials?: { - username: string, - password: string, - origin?: string, - send?: 'always' | 'unauthorized', - }, + httpCredentials?: HttpCredentials[], deviceScaleFactor?: number, isMobile?: boolean, hasTouch?: boolean, @@ -1481,18 +1446,10 @@ export type BrowserContextSetGeolocationOptions = { }; export type BrowserContextSetGeolocationResult = void; export type BrowserContextSetHTTPCredentialsParams = { - httpCredentials?: { - username: string, - password: string, - origin?: string, - }, + httpCredentials?: HttpCredentials[], }; export type BrowserContextSetHTTPCredentialsOptions = { - httpCredentials?: { - username: string, - password: string, - origin?: string, - }, + httpCredentials?: HttpCredentials[], }; export type BrowserContextSetHTTPCredentialsResult = void; export type BrowserContextSetNetworkInterceptionPatternsParams = { @@ -1857,12 +1814,7 @@ export type BrowserTypeLaunchPersistentContextParams = { permissions?: string[], extraHTTPHeaders?: NameValue[], offline?: boolean, - httpCredentials?: { - username: string, - password: string, - origin?: string, - send?: 'always' | 'unauthorized', - }, + httpCredentials?: HttpCredentials[], deviceScaleFactor?: number, isMobile?: boolean, hasTouch?: boolean, @@ -1945,12 +1897,7 @@ export type BrowserTypeLaunchPersistentContextOptions = { permissions?: string[], extraHTTPHeaders?: NameValue[], offline?: boolean, - httpCredentials?: { - username: string, - password: string, - origin?: string, - send?: 'always' | 'unauthorized', - }, + httpCredentials?: HttpCredentials[], deviceScaleFactor?: number, isMobile?: boolean, hasTouch?: boolean, @@ -2056,11 +2003,7 @@ export type ElectronLaunchParams = { latitude: number, accuracy?: number, }, - httpCredentials?: { - username: string, - password: string, - origin?: string, - }, + httpCredentials?: HttpCredentials[], ignoreHTTPSErrors?: boolean, locale?: string, offline?: boolean, @@ -2099,11 +2042,7 @@ export type ElectronLaunchOptions = { latitude: number, accuracy?: number, }, - httpCredentials?: { - username: string, - password: string, - origin?: string, - }, + httpCredentials?: HttpCredentials[], ignoreHTTPSErrors?: boolean, locale?: string, offline?: boolean, @@ -4651,12 +4590,7 @@ export type PlaywrightNewRequestParams = { pfx?: Binary, }[], maxRedirects?: number, - httpCredentials?: { - username: string, - password: string, - origin?: string, - send?: 'always' | 'unauthorized', - }, + httpCredentials?: HttpCredentials[], proxy?: { server: string, bypass?: string, @@ -4683,12 +4617,7 @@ export type PlaywrightNewRequestOptions = { pfx?: Binary, }[], maxRedirects?: number, - httpCredentials?: { - username: string, - password: string, - origin?: string, - send?: 'always' | 'unauthorized', - }, + httpCredentials?: HttpCredentials[], proxy?: { server: string, bypass?: string, diff --git a/packages/playwright-core/src/client/electron.ts b/packages/playwright-core/src/client/electron.ts index d433427c57ba2..927c8a4b9d1ad 100644 --- a/packages/playwright-core/src/client/electron.ts +++ b/packages/playwright-core/src/client/electron.ts @@ -33,12 +33,13 @@ import type * as childProcess from 'child_process'; import type { BrowserWindow } from 'electron'; import type { Playwright } from './playwright'; -type ElectronOptions = Omit & { +type ElectronOptions = Omit & { env?: NodeJS.ProcessEnv, extraHTTPHeaders?: Headers, recordHar?: BrowserContextOptions['recordHar'], colorScheme?: 'dark' | 'light' | 'no-preference' | null, acceptDownloads?: boolean, + httpCredentials?: BrowserContextOptions['httpCredentials'], timeout?: number, }; diff --git a/packages/playwright-core/src/client/fetch.ts b/packages/playwright-core/src/client/fetch.ts index 73834d56e91b8..54b17863a1745 100644 --- a/packages/playwright-core/src/client/fetch.ts +++ b/packages/playwright-core/src/client/fetch.ts @@ -21,7 +21,7 @@ import { inspect } from 'util'; import { assert } from '@isomorphic/assert'; import { headersObjectToArray } from '@isomorphic/headers'; import { isString } from '@isomorphic/rtti'; -import { toClientCertificatesProtocol } from './browserContext'; +import { toClientCertificatesProtocol, toHttpCredentialsProtocol } from './browserContext'; import { ChannelOwner } from './channelOwner'; import { TargetClosedError, isTargetClosedError } from './errors'; import { RawHeaders } from './network'; @@ -32,6 +32,7 @@ import { TimeoutSettings, kNoTimeout } from './timeoutSettings'; import type { Playwright } from './playwright'; import type { ResourceTiming } from './network'; import type { ClientCertificate, FilePayload, Headers, RemoteAddr, SecurityDetails, SetStorageState, StorageState, TimeoutOptions } from './types'; +import type { HttpCredentials } from '@protocol/structs'; import type { Serializable } from '../../types/structs'; import type * as api from '../../types/types'; import type { HeadersArray, NameValue } from '@isomorphic/types'; @@ -52,10 +53,11 @@ export type FetchOptions = { maxRetries?: number, }; -export type NewContextOptions = Omit & { +export type NewContextOptions = Omit & { extraHTTPHeaders?: Headers, storageState?: string | SetStorageState, clientCertificates?: ClientCertificate[]; + httpCredentials?: HttpCredentials | HttpCredentials[]; }; type RequestWithBodyOptions = Omit; @@ -80,6 +82,7 @@ export class APIRequest implements api.APIRequest { storageState, tracesDir: this._playwright._defaultLaunchOptions?.tracesDir, // We do not expose tracesDir in the API, so do not allow options to accidentally override it. clientCertificates: await toClientCertificatesProtocol(options.clientCertificates), + httpCredentials: toHttpCredentialsProtocol(options.httpCredentials), }, kNoTimeout)).request); this._contexts.add(context); context._request = this; diff --git a/packages/playwright-core/src/client/types.ts b/packages/playwright-core/src/client/types.ts index f340521105e1a..81c562a1be535 100644 --- a/packages/playwright-core/src/client/types.ts +++ b/packages/playwright-core/src/client/types.ts @@ -16,6 +16,7 @@ */ import type { Size } from '@isomorphic/types'; +import type { HttpCredentials } from '@protocol/structs'; import type * as channels from './channels'; export type { HeadersArray, Point, Quad, Rect, Size } from '@isomorphic/types'; @@ -63,9 +64,10 @@ export type ClientCertificate = { passphrase?: string; }; -export type BrowserContextOptions = Omit & { +export type BrowserContextOptions = Omit & { viewport?: Size | null; extraHTTPHeaders?: Headers; + httpCredentials?: HttpCredentials | HttpCredentials[]; logger?: Logger; storageState?: string | SetStorageState; har?: { diff --git a/packages/playwright-core/src/server/bidi/bidiBrowser.ts b/packages/playwright-core/src/server/bidi/bidiBrowser.ts index cf6699c924c6f..95546d70fe53c 100644 --- a/packages/playwright-core/src/server/bidi/bidiBrowser.ts +++ b/packages/playwright-core/src/server/bidi/bidiBrowser.ts @@ -31,6 +31,7 @@ import type { SdkObject } from '../instrumentation'; import type { InitScript, Page } from '../page'; import type { ConnectionTransport } from '../transport'; import type * as types from '../types'; +import type { HttpCredentials } from '@protocol/structs'; import type { BidiSession } from './bidiConnection'; import type * as channels from '../channels'; @@ -409,7 +410,7 @@ export class BidiBrowserContext extends BrowserContext { }); } - async doSetHTTPCredentials(httpCredentials?: types.Credentials): Promise { + async doSetHTTPCredentials(httpCredentials?: HttpCredentials[]): Promise { this._options.httpCredentials = httpCredentials; for (const page of this.pages()) await (page.delegate as BidiPage).updateHttpCredentials(); diff --git a/packages/playwright-core/src/server/bidi/bidiNetworkManager.ts b/packages/playwright-core/src/server/bidi/bidiNetworkManager.ts index c413733c4b067..b78b485331e70 100644 --- a/packages/playwright-core/src/server/bidi/bidiNetworkManager.ts +++ b/packages/playwright-core/src/server/bidi/bidiNetworkManager.ts @@ -15,6 +15,7 @@ */ import { eventsHelper } from '@utils/eventsHelper'; +import { findMatchingHttpCredentials } from '../browserContext'; import { parseRawCookie } from '../cookieStore'; import * as network from '../network'; import * as bidi from './third_party/bidiProtocol'; @@ -23,6 +24,7 @@ import type { RegisteredListener } from '@utils/eventsHelper'; import type * as frames from '../frames'; import type { Page } from '../page'; import type * as types from '../types'; +import type { HttpCredentials } from '@protocol/structs'; import type { BidiSession } from './bidiConnection'; import type { BidiPage } from './bidiPage'; @@ -35,7 +37,7 @@ export class BidiNetworkManager { private readonly _eventListeners: RegisteredListener[]; private _userRequestInterceptionEnabled: boolean = false; private _protocolRequestInterceptionEnabled: boolean = false; - private _credentials: types.Credentials | undefined; + private _credentials: HttpCredentials[] | undefined; private _attemptedAuthentications = new Set(); private _intercepId: bidi.Network.Intercept | undefined; @@ -197,8 +199,8 @@ export class BidiNetworkManager { private _onAuthRequired(params: bidi.Network.AuthRequiredParameters) { const isBasic = params.response.authChallenges?.some(challenge => challenge.scheme.startsWith('Basic')); - const credentials = this._page.browserContext._options.httpCredentials; - if (isBasic && credentials && (!credentials.origin || (new URL(params.request.url).origin).toLowerCase() === credentials.origin.toLowerCase())) { + const credentials = findMatchingHttpCredentials(this._page.browserContext._options.httpCredentials, params.request.url); + if (isBasic && credentials) { if (this._attemptedAuthentications.has(params.request.request)) { this._session.sendMayFail('network.continueWithAuth', { request: params.request.request, @@ -234,13 +236,13 @@ export class BidiNetworkManager { await this._updateProtocolRequestInterception(); } - async setCredentials(credentials: types.Credentials | undefined) { + async setCredentials(credentials: HttpCredentials[] | undefined) { this._credentials = credentials; await this._updateProtocolRequestInterception(); } async _updateProtocolRequestInterception(initial?: boolean) { - const enabled = this._userRequestInterceptionEnabled || !!this._credentials; + const enabled = this._userRequestInterceptionEnabled || !!this._credentials?.length; if (enabled === this._protocolRequestInterceptionEnabled) return; this._protocolRequestInterceptionEnabled = enabled; diff --git a/packages/playwright-core/src/server/browserContext.ts b/packages/playwright-core/src/server/browserContext.ts index 04f888bfa5afa..ff4528c3f1c2e 100644 --- a/packages/playwright-core/src/server/browserContext.ts +++ b/packages/playwright-core/src/server/browserContext.ts @@ -45,6 +45,7 @@ import type { ClientCertificatesProxy } from './socksClientCertificatesIntercept import type { SerializedStorage } from '@injected/storageScript'; import type * as types from './types'; import type * as channels from './channels'; +import type { HttpCredentials } from '@protocol/structs'; const BrowserContextEvent = { Console: 'console', @@ -288,7 +289,7 @@ export abstract class BrowserContext extends Sdk protected abstract doClearCookies(): Promise; protected abstract doGrantPermissions(origin: string, permissions: string[]): Promise; protected abstract doClearPermissions(): Promise; - protected abstract doSetHTTPCredentials(httpCredentials?: types.Credentials): Promise; + protected abstract doSetHTTPCredentials(httpCredentials?: HttpCredentials[]): Promise; protected abstract doAddInitScript(initScript: InitScript): Promise; protected abstract doRemoveInitScripts(initScripts: InitScript[]): Promise; protected abstract doUpdateExtraHTTPHeaders(): Promise; @@ -343,11 +344,11 @@ export abstract class BrowserContext extends Sdk }))); } - setHTTPCredentials(progress: Progress, httpCredentials?: types.Credentials): Promise { + setHTTPCredentials(progress: Progress, httpCredentials?: HttpCredentials[]): Promise { return progress.race(this.innerSetHTTPCredentials(httpCredentials)); } - innerSetHTTPCredentials(httpCredentials?: types.Credentials): Promise { + innerSetHTTPCredentials(httpCredentials?: HttpCredentials[]): Promise { return this.doSetHTTPCredentials(httpCredentials); } @@ -479,7 +480,7 @@ export abstract class BrowserContext extends Sdk const proxy = this._options.proxy || this._browser.options.proxy || { username: undefined, password: undefined }; const { username, password } = proxy; if (username) { - this._options.httpCredentials = { username, password: password! }; + this._options.httpCredentials = [{ username, password: password! }]; const token = Buffer.from(`${username}:${password}`).toString('base64'); this._options.extraHTTPHeaders = network.mergeHeaders([ this._options.extraHTTPHeaders, @@ -494,7 +495,7 @@ export abstract class BrowserContext extends Sdk return; const { username, password } = proxy; if (username) - this._options.httpCredentials = { username, password: password || '' }; + this._options.httpCredentials = [{ username, password: password || '' }]; } async addInitScript(progress: Progress, source: string): Promise { @@ -768,6 +769,11 @@ export function validateBrowserContextOptions(options: types.BrowserContextOptio verifyGeolocation(options.geolocation); } +export function findMatchingHttpCredentials(credentials: HttpCredentials[] | undefined, url: string): HttpCredentials | undefined { + const origin = new URL(url).origin.toLowerCase(); + return credentials?.find(c => !c.origin || c.origin.toLowerCase() === origin); +} + export function verifyGeolocation(geolocation?: types.Geolocation): asserts geolocation is types.Geolocation { if (!geolocation) return; diff --git a/packages/playwright-core/src/server/channels.d.ts b/packages/playwright-core/src/server/channels.d.ts index 07a6414f49295..effc7d3986ccc 100644 --- a/packages/playwright-core/src/server/channels.d.ts +++ b/packages/playwright-core/src/server/channels.d.ts @@ -18,8 +18,8 @@ import type { Progress } from './progress'; -import type { Binary, Channel, AndroidWebView, AndroidSelector, AndroidElementInfo, APIResponse, Metadata, ClientSideCallMetadata, SDKLanguage, WaitInfo, SetNetworkCookie, NetworkCookie, ResourceTiming, SecurityDetails, RequestSizes, RemoteAddr, ExpectedTextValue, SelectorEngine, FormField, LifecycleEvent, ConsoleMessagesFilter, RecorderSource, IndexedDBDatabase, SetOriginStorage, OriginStorage, RecordHarOptions, SerializedValue, SerializedArgument, SerializedError, StackFrame, VirtualCredential, Point, Rect, URLPattern, NameValue } from '@protocol/structs'; -export type { Binary, Channel, AndroidWebView, AndroidSelector, AndroidElementInfo, APIResponse, Metadata, ClientSideCallMetadata, SDKLanguage, WaitInfo, SetNetworkCookie, NetworkCookie, ResourceTiming, SecurityDetails, RequestSizes, RemoteAddr, ExpectedTextValue, SelectorEngine, FormField, LifecycleEvent, ConsoleMessagesFilter, RecorderSource, IndexedDBDatabase, SetOriginStorage, OriginStorage, RecordHarOptions, SerializedValue, SerializedArgument, SerializedError, StackFrame, VirtualCredential, Point, Rect, URLPattern, NameValue } from '@protocol/structs'; +import type { Binary, Channel, AndroidWebView, AndroidSelector, AndroidElementInfo, APIResponse, Metadata, ClientSideCallMetadata, SDKLanguage, WaitInfo, HttpCredentials, SetNetworkCookie, NetworkCookie, ResourceTiming, SecurityDetails, RequestSizes, RemoteAddr, ExpectedTextValue, SelectorEngine, FormField, LifecycleEvent, ConsoleMessagesFilter, RecorderSource, IndexedDBDatabase, SetOriginStorage, OriginStorage, RecordHarOptions, SerializedValue, SerializedArgument, SerializedError, StackFrame, VirtualCredential, Point, Rect, URLPattern, NameValue } from '@protocol/structs'; +export type { Binary, Channel, AndroidWebView, AndroidSelector, AndroidElementInfo, APIResponse, Metadata, ClientSideCallMetadata, SDKLanguage, WaitInfo, HttpCredentials, SetNetworkCookie, NetworkCookie, ResourceTiming, SecurityDetails, RequestSizes, RemoteAddr, ExpectedTextValue, SelectorEngine, FormField, LifecycleEvent, ConsoleMessagesFilter, RecorderSource, IndexedDBDatabase, SetOriginStorage, OriginStorage, RecordHarOptions, SerializedValue, SerializedArgument, SerializedError, StackFrame, VirtualCredential, Point, Rect, URLPattern, NameValue } from '@protocol/structs'; // ----------- Initializer Traits ----------- export type InitializerTraits = @@ -405,12 +405,7 @@ export type AndroidDeviceLaunchBrowserParams = { permissions?: string[], extraHTTPHeaders?: NameValue[], offline?: boolean, - httpCredentials?: { - username: string, - password: string, - origin?: string, - send?: 'always' | 'unauthorized', - }, + httpCredentials?: HttpCredentials[], deviceScaleFactor?: number, isMobile?: boolean, hasTouch?: boolean, @@ -477,12 +472,7 @@ export type AndroidDeviceLaunchBrowserOptions = { permissions?: string[], extraHTTPHeaders?: NameValue[], offline?: boolean, - httpCredentials?: { - username: string, - password: string, - origin?: string, - send?: 'always' | 'unauthorized', - }, + httpCredentials?: HttpCredentials[], deviceScaleFactor?: number, isMobile?: boolean, hasTouch?: boolean, @@ -862,12 +852,7 @@ export type BrowserNewContextParams = { permissions?: string[], extraHTTPHeaders?: NameValue[], offline?: boolean, - httpCredentials?: { - username: string, - password: string, - origin?: string, - send?: 'always' | 'unauthorized', - }, + httpCredentials?: HttpCredentials[], deviceScaleFactor?: number, isMobile?: boolean, hasTouch?: boolean, @@ -937,12 +922,7 @@ export type BrowserNewContextOptions = { permissions?: string[], extraHTTPHeaders?: NameValue[], offline?: boolean, - httpCredentials?: { - username: string, - password: string, - origin?: string, - send?: 'always' | 'unauthorized', - }, + httpCredentials?: HttpCredentials[], deviceScaleFactor?: number, isMobile?: boolean, hasTouch?: boolean, @@ -1015,12 +995,7 @@ export type BrowserNewContextForReuseParams = { permissions?: string[], extraHTTPHeaders?: NameValue[], offline?: boolean, - httpCredentials?: { - username: string, - password: string, - origin?: string, - send?: 'always' | 'unauthorized', - }, + httpCredentials?: HttpCredentials[], deviceScaleFactor?: number, isMobile?: boolean, hasTouch?: boolean, @@ -1090,12 +1065,7 @@ export type BrowserNewContextForReuseOptions = { permissions?: string[], extraHTTPHeaders?: NameValue[], offline?: boolean, - httpCredentials?: { - username: string, - password: string, - origin?: string, - send?: 'always' | 'unauthorized', - }, + httpCredentials?: HttpCredentials[], deviceScaleFactor?: number, isMobile?: boolean, hasTouch?: boolean, @@ -1207,12 +1177,7 @@ export type BrowserContextInitializer = { permissions?: string[], extraHTTPHeaders?: NameValue[], offline?: boolean, - httpCredentials?: { - username: string, - password: string, - origin?: string, - send?: 'always' | 'unauthorized', - }, + httpCredentials?: HttpCredentials[], deviceScaleFactor?: number, isMobile?: boolean, hasTouch?: boolean, @@ -1482,18 +1447,10 @@ export type BrowserContextSetGeolocationOptions = { }; export type BrowserContextSetGeolocationResult = void; export type BrowserContextSetHTTPCredentialsParams = { - httpCredentials?: { - username: string, - password: string, - origin?: string, - }, + httpCredentials?: HttpCredentials[], }; export type BrowserContextSetHTTPCredentialsOptions = { - httpCredentials?: { - username: string, - password: string, - origin?: string, - }, + httpCredentials?: HttpCredentials[], }; export type BrowserContextSetHTTPCredentialsResult = void; export type BrowserContextSetNetworkInterceptionPatternsParams = { @@ -1858,12 +1815,7 @@ export type BrowserTypeLaunchPersistentContextParams = { permissions?: string[], extraHTTPHeaders?: NameValue[], offline?: boolean, - httpCredentials?: { - username: string, - password: string, - origin?: string, - send?: 'always' | 'unauthorized', - }, + httpCredentials?: HttpCredentials[], deviceScaleFactor?: number, isMobile?: boolean, hasTouch?: boolean, @@ -1946,12 +1898,7 @@ export type BrowserTypeLaunchPersistentContextOptions = { permissions?: string[], extraHTTPHeaders?: NameValue[], offline?: boolean, - httpCredentials?: { - username: string, - password: string, - origin?: string, - send?: 'always' | 'unauthorized', - }, + httpCredentials?: HttpCredentials[], deviceScaleFactor?: number, isMobile?: boolean, hasTouch?: boolean, @@ -2057,11 +2004,7 @@ export type ElectronLaunchParams = { latitude: number, accuracy?: number, }, - httpCredentials?: { - username: string, - password: string, - origin?: string, - }, + httpCredentials?: HttpCredentials[], ignoreHTTPSErrors?: boolean, locale?: string, offline?: boolean, @@ -2100,11 +2043,7 @@ export type ElectronLaunchOptions = { latitude: number, accuracy?: number, }, - httpCredentials?: { - username: string, - password: string, - origin?: string, - }, + httpCredentials?: HttpCredentials[], ignoreHTTPSErrors?: boolean, locale?: string, offline?: boolean, @@ -4652,12 +4591,7 @@ export type PlaywrightNewRequestParams = { pfx?: Binary, }[], maxRedirects?: number, - httpCredentials?: { - username: string, - password: string, - origin?: string, - send?: 'always' | 'unauthorized', - }, + httpCredentials?: HttpCredentials[], proxy?: { server: string, bypass?: string, @@ -4684,12 +4618,7 @@ export type PlaywrightNewRequestOptions = { pfx?: Binary, }[], maxRedirects?: number, - httpCredentials?: { - username: string, - password: string, - origin?: string, - send?: 'always' | 'unauthorized', - }, + httpCredentials?: HttpCredentials[], proxy?: { server: string, bypass?: string, diff --git a/packages/playwright-core/src/server/chromium/crBrowser.ts b/packages/playwright-core/src/server/chromium/crBrowser.ts index ba563a4b56118..db00e29a01059 100644 --- a/packages/playwright-core/src/server/chromium/crBrowser.ts +++ b/packages/playwright-core/src/server/chromium/crBrowser.ts @@ -33,6 +33,7 @@ import { CRServiceWorker } from './crServiceWorker'; import type { InitScript } from '../page'; import type { ConnectionTransport } from '../transport'; import type * as types from '../types'; +import type { HttpCredentials } from '@protocol/structs'; import type { CDPSession, CRSession } from './crConnection'; import type { CRDevTools } from './crDevTools'; import type { Protocol } from './protocol'; @@ -509,7 +510,7 @@ export class CRBrowserContext extends BrowserContext { await (sw as CRServiceWorker).updateOffline(); } - async doSetHTTPCredentials(httpCredentials?: types.Credentials): Promise { + async doSetHTTPCredentials(httpCredentials?: HttpCredentials[]): Promise { this._options.httpCredentials = httpCredentials; for (const page of this.pages()) await (page.delegate as CRPage).updateHttpCredentials(); diff --git a/packages/playwright-core/src/server/chromium/crNetworkManager.ts b/packages/playwright-core/src/server/chromium/crNetworkManager.ts index 1c720b5821004..de95ef8dd3d6f 100644 --- a/packages/playwright-core/src/server/chromium/crNetworkManager.ts +++ b/packages/playwright-core/src/server/chromium/crNetworkManager.ts @@ -18,6 +18,7 @@ import { eventsHelper } from '@utils/eventsHelper'; import { assert } from '@isomorphic/assert'; import { headersArrayToObject, headersObjectToArray } from '@isomorphic/headers'; +import { findMatchingHttpCredentials } from '../browserContext'; import { helper } from '../helper'; import * as network from '../network'; import { isProtocolError, isSessionClosedError } from '../protocolError'; @@ -29,6 +30,7 @@ import type * as contexts from '../browserContext'; import type * as frames from '../frames'; import type { Page } from '../page'; import type * as types from '../types'; +import type { HttpCredentials } from '@protocol/structs'; import type { CRPage } from './crPage'; import type { CRServiceWorker } from './crServiceWorker'; @@ -45,7 +47,7 @@ export class CRNetworkManager { private _serviceWorker: CRServiceWorker | null; private _requestIdToRequest = new Map(); private _requestIdToRequestWillBeSentEvent = new Map(); - private _credentials: {origin?: string, username: string, password: string} | null = null; + private _credentials: HttpCredentials[] | null = null; private _attemptedAuthentications = new Set(); private _userRequestInterceptionEnabled = false; private _protocolRequestInterceptionEnabled = false; @@ -120,7 +122,7 @@ export class CRNetworkManager { })); } - async authenticate(credentials: types.Credentials | null) { + async authenticate(credentials: HttpCredentials[] | null) { this._credentials = credentials; await this._updateProtocolRequestInterception(); } @@ -153,7 +155,7 @@ export class CRNetworkManager { } async _updateProtocolRequestInterception() { - const enabled = this._userRequestInterceptionEnabled || !!this._credentials; + const enabled = this._userRequestInterceptionEnabled || !!this._credentials?.length; if (enabled === this._protocolRequestInterceptionEnabled) return; this._protocolRequestInterceptionEnabled = enabled; @@ -225,26 +227,20 @@ export class CRNetworkManager { _onAuthRequired(sessionInfo: SessionInfo, event: Protocol.Fetch.authRequiredPayload) { let response: 'Default' | 'CancelAuth' | 'ProvideCredentials' = 'Default'; - const shouldProvideCredentials = this._shouldProvideCredentials(event.request.url); + const credentials = findMatchingHttpCredentials(this._credentials || undefined, event.request.url); if (this._attemptedAuthentications.has(event.requestId)) { response = 'CancelAuth'; - } else if (shouldProvideCredentials) { + } else if (credentials) { response = 'ProvideCredentials'; this._attemptedAuthentications.add(event.requestId); } - const { username, password } = shouldProvideCredentials && this._credentials ? this._credentials : { username: undefined, password: undefined }; + const { username, password } = credentials || { username: undefined, password: undefined }; sessionInfo.session._sendMayFail('Fetch.continueWithAuth', { requestId: event.requestId, authChallengeResponse: { response, username, password }, }); } - _shouldProvideCredentials(url: string): boolean { - if (!this._credentials) - return false; - return !this._credentials.origin || new URL(url).origin.toLowerCase() === this._credentials.origin.toLowerCase(); - } - _onRequestPaused(sessionInfo: SessionInfo, event: Protocol.Fetch.requestPausedPayload) { if (!event.networkId) { // Fetch without networkId means that request was not recognized by inspector, and diff --git a/packages/playwright-core/src/server/fetch.ts b/packages/playwright-core/src/server/fetch.ts index 2d32cada41a67..b3f2f520a9c00 100644 --- a/packages/playwright-core/src/server/fetch.ts +++ b/packages/playwright-core/src/server/fetch.ts @@ -28,7 +28,7 @@ import { eventsHelper } from '@utils/eventsHelper'; import { monotonicTime } from '@isomorphic/time'; import { createProxyAgent } from '@utils/network'; import { getUserAgent } from './userAgent'; -import { BrowserContext, verifyClientCertificates } from './browserContext'; +import { BrowserContext, findMatchingHttpCredentials, verifyClientCertificates } from './browserContext'; import { Cookie, CookieStore, domainMatches, parseRawCookie } from './cookieStore'; import { MultipartFormData } from './formData'; import { TargetClosedError } from './errors'; @@ -43,7 +43,7 @@ import type { Playwright } from './playwright'; import type { Progress } from './progress'; import type * as types from './types'; import type { HeadersArray, ProxySettings } from './types'; -import type { HTTPCredentials } from '../../types/types'; +import type { HttpCredentials } from '@protocol/structs'; import type { RegisteredListener } from '@utils/eventsHelper'; import type * as channels from './channels'; import type * as har from '@trace/har'; @@ -55,7 +55,7 @@ type FetchRequestOptions = { userAgent: string; extraHTTPHeaders?: HeadersArray; failOnStatusCode?: boolean; - httpCredentials?: HTTPCredentials; + httpCredentials?: HttpCredentials[]; proxy?: ProxySettings; ignoreHTTPSErrors?: boolean; maxRedirects?: number; @@ -632,9 +632,7 @@ export abstract class APIRequestContext extends SdkObject { } private _getHttpCredentials(url: URL) { - if (!this._defaultOptions().httpCredentials?.origin || url.origin.toLowerCase() === this._defaultOptions().httpCredentials?.origin?.toLowerCase()) - return this._defaultOptions().httpCredentials; - return undefined; + return findMatchingHttpCredentials(this._defaultOptions().httpCredentials, url.toString()); } } @@ -841,7 +839,7 @@ function isNetworkConnectionError(e: any): boolean { return code === 'ECONNRESET' || code === 'EPIPE' || code === 'ECONNABORTED'; } -function setBasicAuthorizationHeader(headers: { [name: string]: string }, credentials: HTTPCredentials) { +function setBasicAuthorizationHeader(headers: { [name: string]: string }, credentials: HttpCredentials) { const { username, password } = credentials; const encoded = Buffer.from(`${username || ''}:${password || ''}`).toString('base64'); setHeader(headers, 'authorization', `Basic ${encoded}`); diff --git a/packages/playwright-core/src/server/firefox/ffBrowser.ts b/packages/playwright-core/src/server/firefox/ffBrowser.ts index c02dad2086a79..cf2f84efb89c9 100644 --- a/packages/playwright-core/src/server/firefox/ffBrowser.ts +++ b/packages/playwright-core/src/server/firefox/ffBrowser.ts @@ -28,6 +28,7 @@ import type { SdkObject } from '../instrumentation'; import type { InitScript, Page } from '../page'; import type { ConnectionTransport } from '../transport'; import type * as types from '../types'; +import type { HttpCredentials } from '@protocol/structs'; import type { FFSession } from './ffConnection'; import type { Protocol } from './protocol'; import type * as channels from '../channels'; @@ -317,13 +318,9 @@ export class FFBrowserContext extends BrowserContext { await this._browser.session.send('Browser.setOnlineOverride', { browserContextId: this._browserContextId, override: this._options.offline ? 'offline' : 'online' }); } - async doSetHTTPCredentials(httpCredentials?: types.Credentials): Promise { + async doSetHTTPCredentials(httpCredentials?: HttpCredentials[]): Promise { this._options.httpCredentials = httpCredentials; - let credentials = null; - if (httpCredentials) { - const { username, password, origin } = httpCredentials; - credentials = [{ username, password, origin }]; - } + const credentials = httpCredentials ? httpCredentials.map(({ username, password, origin }) => ({ username, password, origin })) : null; await this._browser.session.send('Browser.setHTTPCredentials', { browserContextId: this._browserContextId, credentials }); } diff --git a/packages/playwright-core/src/server/types.ts b/packages/playwright-core/src/server/types.ts index a834844c09036..52b10d200f5f2 100644 --- a/packages/playwright-core/src/server/types.ts +++ b/packages/playwright-core/src/server/types.ts @@ -58,13 +58,6 @@ export type ScreencastFrame = { viewportHeight: number, }; -export type Credentials = { - username: string; - password: string; - origin?: string; - sendImmediately?: boolean; -}; - export type Geolocation = { longitude: number; latitude: number; diff --git a/packages/playwright-core/src/server/webkit/webview/wvBrowser.ts b/packages/playwright-core/src/server/webkit/webview/wvBrowser.ts index 77b7f89d98a3d..0e4f37808f245 100644 --- a/packages/playwright-core/src/server/webkit/webview/wvBrowser.ts +++ b/packages/playwright-core/src/server/webkit/webview/wvBrowser.ts @@ -39,6 +39,7 @@ import type { InitScript, Page } from '../../page'; import type { Protocol } from './protocol'; import type { ProtocolRequest, ProtocolResponse } from '../../transport'; import type * as types from '../../types'; +import type { HttpCredentials } from '@protocol/structs'; import type * as channels from '../../channels'; import type { Progress } from '../../progress'; import type { ConnectOverCDPTransport } from '../../../../types/types.d.ts'; @@ -411,6 +412,6 @@ export class WVBrowserContext extends BrowserContext { override async clearCache(): Promise { throw new Error('Method not implemented.'); } override async doClose(reason: string | undefined): Promise { throw new Error('Method not implemented.'); } override async cancelDownload(uuid: string) { throw new Error('Method not implemented.'); } - protected override async doSetHTTPCredentials(httpCredentials?: types.Credentials): Promise { throw new Error('Method not implemented.'); } + protected override async doSetHTTPCredentials(httpCredentials?: HttpCredentials[]): Promise { throw new Error('Method not implemented.'); } protected override async doUpdateOffline(): Promise { throw new Error('Method not implemented.'); } } diff --git a/packages/playwright-core/src/server/webkit/wkBrowser.ts b/packages/playwright-core/src/server/webkit/wkBrowser.ts index d315e806c9abd..18b2da2ab203f 100644 --- a/packages/playwright-core/src/server/webkit/wkBrowser.ts +++ b/packages/playwright-core/src/server/webkit/wkBrowser.ts @@ -28,6 +28,7 @@ import type { SdkObject } from '../instrumentation'; import type { InitScript, Page } from '../page'; import type { ConnectionTransport } from '../transport'; import type * as types from '../types'; +import type { HttpCredentials } from '@protocol/structs'; import type { Protocol } from './protocol'; import type { PageProxyMessageReceivedPayload } from './wkConnection'; import type * as channels from '../channels'; @@ -324,7 +325,7 @@ export class WKBrowserContext extends BrowserContext { await (page.delegate as WKPage).updateOffline(); } - async doSetHTTPCredentials(httpCredentials?: types.Credentials): Promise { + async doSetHTTPCredentials(httpCredentials?: HttpCredentials[]): Promise { this._options.httpCredentials = httpCredentials; for (const page of this.pages()) await (page.delegate as WKPage).updateHttpCredentials(); diff --git a/packages/playwright-core/src/server/webkit/wkPage.ts b/packages/playwright-core/src/server/webkit/wkPage.ts index 0ef1768254d64..8e6dc38672381 100644 --- a/packages/playwright-core/src/server/webkit/wkPage.ts +++ b/packages/playwright-core/src/server/webkit/wkPage.ts @@ -752,8 +752,8 @@ export class WKPage implements PageDelegate { } async updateHttpCredentials() { - const credentials = this._browserContext._options.httpCredentials || { username: '', password: '', origin: '' }; - await this._pageProxySession.send('Emulation.setAuthCredentials', { credentials: [{ username: credentials.username, password: credentials.password, origin: credentials.origin }] }); + const credentials = (this._browserContext._options.httpCredentials || []).map(c => ({ username: c.username, password: c.password, origin: c.origin })); + await this._pageProxySession.send('Emulation.setAuthCredentials', { credentials }); } async updateFileChooserInterception() { diff --git a/packages/playwright-core/types/types.d.ts b/packages/playwright-core/types/types.d.ts index eaa024a641d57..baa5f1d759c4a 100644 --- a/packages/playwright-core/types/types.d.ts +++ b/packages/playwright-core/types/types.d.ts @@ -10453,13 +10453,28 @@ export interface BrowserContext { /** * @deprecated Browsers may cache credentials after successful authentication. Create a new browser context instead. - * @param httpCredentials + * @param httpCredentials Pass an array to use different credentials for different origins. The first entry that matches the request origin + * is used, and entries with no origin match any request. */ setHTTPCredentials(httpCredentials: null|{ username: string; password: string; - }): Promise; + + /** + * Restrain sending http credentials on specific origin (scheme://host:port). + */ + origin?: string; + }|ReadonlyArray<{ + username: string; + + password: string; + + /** + * Restrain sending http credentials on specific origin (scheme://host:port). + */ + origin?: string; + }>): Promise; /** * @param offline Whether to emulate network being offline for the browser context. @@ -11229,6 +11244,9 @@ export interface Browser { /** * Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication). If no * origin is specified, the username and password are sent to any servers upon unauthorized responses. + * + * Pass an array to use different credentials for different origins. The first entry that matches the request origin + * is used, and entries with no origin match any request. */ httpCredentials?: { username: string; @@ -11248,7 +11266,25 @@ export interface Browser { * `WWW-Authenticate` header is received. Defaults to `'unauthorized'`. */ send?: "unauthorized"|"always"; - }; + }|Array<{ + username: string; + + password: string; + + /** + * Restrain sending http credentials on specific origin (scheme://host:port). + */ + origin?: string; + + /** + * This option only applies to the requests sent from corresponding + * [APIRequestContext](https://playwright.dev/docs/api/class-apirequestcontext) and does not affect requests sent from + * the browser. `'always'` - `Authorization` header with basic authentication credentials will be sent with the each + * API request. `'unauthorized` - the credentials are only sent when 401 (Unauthorized) response with + * `WWW-Authenticate` header is received. Defaults to `'unauthorized'`. + */ + send?: "unauthorized"|"always"; + }>; /** * Whether to ignore HTTPS errors when sending network requests. Defaults to `false`. @@ -17270,6 +17306,9 @@ export interface BrowserType { /** * Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication). If no * origin is specified, the username and password are sent to any servers upon unauthorized responses. + * + * Pass an array to use different credentials for different origins. The first entry that matches the request origin + * is used, and entries with no origin match any request. */ httpCredentials?: { username: string; @@ -17289,7 +17328,25 @@ export interface BrowserType { * `WWW-Authenticate` header is received. Defaults to `'unauthorized'`. */ send?: "unauthorized"|"always"; - }; + }|Array<{ + username: string; + + password: string; + + /** + * Restrain sending http credentials on specific origin (scheme://host:port). + */ + origin?: string; + + /** + * This option only applies to the requests sent from corresponding + * [APIRequestContext](https://playwright.dev/docs/api/class-apirequestcontext) and does not affect requests sent from + * the browser. `'always'` - `Authorization` header with basic authentication credentials will be sent with the each + * API request. `'unauthorized` - the credentials are only sent when 401 (Unauthorized) response with + * `WWW-Authenticate` header is received. Defaults to `'unauthorized'`. + */ + send?: "unauthorized"|"always"; + }>; /** * If `true`, Playwright does not pass its own configurations args and only uses the ones from @@ -18885,6 +18942,9 @@ export interface APIRequest { /** * Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication). If no * origin is specified, the username and password are sent to any servers upon unauthorized responses. + * + * Pass an array to use different credentials for different origins. The first entry that matches the request origin + * is used, and entries with no origin match any request. */ httpCredentials?: { username: string; @@ -18904,7 +18964,25 @@ export interface APIRequest { * `WWW-Authenticate` header is received. Defaults to `'unauthorized'`. */ send?: "unauthorized"|"always"; - }; + }|Array<{ + username: string; + + password: string; + + /** + * Restrain sending http credentials on specific origin (scheme://host:port). + */ + origin?: string; + + /** + * This option only applies to the requests sent from corresponding + * [APIRequestContext](https://playwright.dev/docs/api/class-apirequestcontext) and does not affect requests sent from + * the browser. `'always'` - `Authorization` header with basic authentication credentials will be sent with the each + * API request. `'unauthorized` - the credentials are only sent when 401 (Unauthorized) response with + * `WWW-Authenticate` header is received. Defaults to `'unauthorized'`. + */ + send?: "unauthorized"|"always"; + }>; /** * Whether to ignore HTTPS errors when sending network requests. Defaults to `false`. @@ -23588,6 +23666,9 @@ export interface Electron { /** * Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication). If no * origin is specified, the username and password are sent to any servers upon unauthorized responses. + * + * Pass an array to use different credentials for different origins. The first entry that matches the request origin + * is used, and entries with no origin match any request. */ httpCredentials?: { username: string; @@ -23607,7 +23688,25 @@ export interface Electron { * `WWW-Authenticate` header is received. Defaults to `'unauthorized'`. */ send?: "unauthorized"|"always"; - }; + }|Array<{ + username: string; + + password: string; + + /** + * Restrain sending http credentials on specific origin (scheme://host:port). + */ + origin?: string; + + /** + * This option only applies to the requests sent from corresponding + * [APIRequestContext](https://playwright.dev/docs/api/class-apirequestcontext) and does not affect requests sent from + * the browser. `'always'` - `Authorization` header with basic authentication credentials will be sent with the each + * API request. `'unauthorized` - the credentials are only sent when 401 (Unauthorized) response with + * `WWW-Authenticate` header is received. Defaults to `'unauthorized'`. + */ + send?: "unauthorized"|"always"; + }>; /** * Whether to ignore HTTPS errors when sending network requests. Defaults to `false`. @@ -24225,6 +24324,9 @@ export interface AndroidDevice { /** * Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication). If no * origin is specified, the username and password are sent to any servers upon unauthorized responses. + * + * Pass an array to use different credentials for different origins. The first entry that matches the request origin + * is used, and entries with no origin match any request. */ httpCredentials?: { username: string; @@ -24244,7 +24346,25 @@ export interface AndroidDevice { * `WWW-Authenticate` header is received. Defaults to `'unauthorized'`. */ send?: "unauthorized"|"always"; - }; + }|Array<{ + username: string; + + password: string; + + /** + * Restrain sending http credentials on specific origin (scheme://host:port). + */ + origin?: string; + + /** + * This option only applies to the requests sent from corresponding + * [APIRequestContext](https://playwright.dev/docs/api/class-apirequestcontext) and does not affect requests sent from + * the browser. `'always'` - `Authorization` header with basic authentication credentials will be sent with the each + * API request. `'unauthorized` - the credentials are only sent when 401 (Unauthorized) response with + * `WWW-Authenticate` header is received. Defaults to `'unauthorized'`. + */ + send?: "unauthorized"|"always"; + }>; /** * Whether to ignore HTTPS errors when sending network requests. Defaults to `false`. @@ -25457,8 +25577,11 @@ export interface BrowserContextOptions { /** * Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication). If no * origin is specified, the username and password are sent to any servers upon unauthorized responses. + * + * Pass an array to use different credentials for different origins. The first entry that matches the request origin + * is used, and entries with no origin match any request. */ - httpCredentials?: HTTPCredentials; + httpCredentials?: HTTPCredentials|Array; /** * Whether to ignore HTTPS errors when sending network requests. Defaults to `false`. diff --git a/packages/playwright/types/test.d.ts b/packages/playwright/types/test.d.ts index ef7d2b1f49582..e278155a336ad 100644 --- a/packages/playwright/types/test.d.ts +++ b/packages/playwright/types/test.d.ts @@ -7449,6 +7449,9 @@ export interface PlaywrightTestOptions { * Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication). If no * origin is specified, the username and password are sent to any servers upon unauthorized responses. * + * Pass an array to use different credentials for different origins. The first entry that matches the request origin + * is used, and entries with no origin match any request. + * * **Usage** * * ```js @@ -7466,7 +7469,7 @@ export interface PlaywrightTestOptions { * ``` * */ - httpCredentials: HTTPCredentials | undefined; + httpCredentials: HTTPCredentials | HTTPCredentials[] | undefined; /** * Whether to ignore HTTPS errors when sending network requests. Defaults to `false`. * diff --git a/packages/protocol/spec/browserContext.yml b/packages/protocol/spec/browserContext.yml index c87e60bd75af2..5c1505513ccf6 100644 --- a/packages/protocol/spec/browserContext.yml +++ b/packages/protocol/spec/browserContext.yml @@ -136,11 +136,8 @@ BrowserContext: group: configuration parameters: httpCredentials: - type: object? - properties: - username: string - password: string - origin: string? + type: array? + items: HttpCredentials setNetworkInterceptionPatterns: title: Route requests diff --git a/packages/protocol/spec/electron.yml b/packages/protocol/spec/electron.yml index 877b4077469af..41a659831f60a 100644 --- a/packages/protocol/spec/electron.yml +++ b/packages/protocol/spec/electron.yml @@ -52,11 +52,8 @@ Electron: latitude: float accuracy: float? httpCredentials: - type: object? - properties: - username: string - password: string - origin: string? + type: array? + items: HttpCredentials ignoreHTTPSErrors: boolean? locale: string? offline: boolean? diff --git a/packages/protocol/spec/mixins.yml b/packages/protocol/spec/mixins.yml index 36c197654b6ca..80dcdfe8f47fb 100644 --- a/packages/protocol/spec/mixins.yml +++ b/packages/protocol/spec/mixins.yml @@ -94,6 +94,18 @@ LaunchOptions: firefoxUserPrefs: json? cdpPort: int? +HttpCredentials: + type: object + properties: + username: string + password: string + origin: string? + send: + type: enum? + literals: + - always + - unauthorized + ContextOptions: type: mixin properties: @@ -138,16 +150,8 @@ ContextOptions: items: NameValue offline: boolean? httpCredentials: - type: object? - properties: - username: string - password: string - origin: string? - send: - type: enum? - literals: - - always - - unauthorized + type: array? + items: HttpCredentials deviceScaleFactor: float? isMobile: boolean? hasTouch: boolean? diff --git a/packages/protocol/spec/playwright.yml b/packages/protocol/spec/playwright.yml index de3634d75b1fb..7eac6215db960 100644 --- a/packages/protocol/spec/playwright.yml +++ b/packages/protocol/spec/playwright.yml @@ -64,16 +64,8 @@ Playwright: pfx: binary? maxRedirects: int? httpCredentials: - type: object? - properties: - username: string - password: string - origin: string? - send: - type: enum? - literals: - - always - - unauthorized + type: array? + items: HttpCredentials proxy: type: object? properties: diff --git a/packages/protocol/src/structs.d.ts b/packages/protocol/src/structs.d.ts index 30ee9c10c1149..9ee0c14461818 100644 --- a/packages/protocol/src/structs.d.ts +++ b/packages/protocol/src/structs.d.ts @@ -110,6 +110,13 @@ export type WaitInfo = { error?: string, }; +export type HttpCredentials = { + username: string, + password: string, + origin?: string, + send?: 'always' | 'unauthorized', +}; + export type SetNetworkCookie = { name: string, value: string, diff --git a/packages/protocol/src/validator.ts b/packages/protocol/src/validator.ts index d4c876cb078bf..4d09a0d987641 100644 --- a/packages/protocol/src/validator.ts +++ b/packages/protocol/src/validator.ts @@ -172,12 +172,7 @@ scheme.AndroidDeviceLaunchBrowserParams = tObject({ permissions: tOptional(tArray(tString)), extraHTTPHeaders: tOptional(tArray(tType('NameValue'))), offline: tOptional(tBoolean), - httpCredentials: tOptional(tObject({ - username: tString, - password: tString, - origin: tOptional(tString), - send: tOptional(tEnum(['always', 'unauthorized'])), - })), + httpCredentials: tOptional(tArray(tType('HttpCredentials'))), deviceScaleFactor: tOptional(tFloat), isMobile: tOptional(tBoolean), hasTouch: tOptional(tBoolean), @@ -458,12 +453,7 @@ scheme.BrowserNewContextParams = tObject({ permissions: tOptional(tArray(tString)), extraHTTPHeaders: tOptional(tArray(tType('NameValue'))), offline: tOptional(tBoolean), - httpCredentials: tOptional(tObject({ - username: tString, - password: tString, - origin: tOptional(tString), - send: tOptional(tEnum(['always', 'unauthorized'])), - })), + httpCredentials: tOptional(tArray(tType('HttpCredentials'))), deviceScaleFactor: tOptional(tFloat), isMobile: tOptional(tBoolean), hasTouch: tOptional(tBoolean), @@ -536,12 +526,7 @@ scheme.BrowserNewContextForReuseParams = tObject({ permissions: tOptional(tArray(tString)), extraHTTPHeaders: tOptional(tArray(tType('NameValue'))), offline: tOptional(tBoolean), - httpCredentials: tOptional(tObject({ - username: tString, - password: tString, - origin: tOptional(tString), - send: tOptional(tEnum(['always', 'unauthorized'])), - })), + httpCredentials: tOptional(tArray(tType('HttpCredentials'))), deviceScaleFactor: tOptional(tFloat), isMobile: tOptional(tBoolean), hasTouch: tOptional(tBoolean), @@ -636,12 +621,7 @@ scheme.BrowserContextInitializer = tObject({ permissions: tOptional(tArray(tString)), extraHTTPHeaders: tOptional(tArray(tType('NameValue'))), offline: tOptional(tBoolean), - httpCredentials: tOptional(tObject({ - username: tString, - password: tString, - origin: tOptional(tString), - send: tOptional(tEnum(['always', 'unauthorized'])), - })), + httpCredentials: tOptional(tArray(tType('HttpCredentials'))), deviceScaleFactor: tOptional(tFloat), isMobile: tOptional(tBoolean), hasTouch: tOptional(tBoolean), @@ -808,11 +788,7 @@ scheme.BrowserContextSetGeolocationParams = tObject({ }); scheme.BrowserContextSetGeolocationResult = tOptional(tObject({})); scheme.BrowserContextSetHTTPCredentialsParams = tObject({ - httpCredentials: tOptional(tObject({ - username: tString, - password: tString, - origin: tOptional(tString), - })), + httpCredentials: tOptional(tArray(tType('HttpCredentials'))), }); scheme.BrowserContextSetHTTPCredentialsResult = tOptional(tObject({})); scheme.BrowserContextSetNetworkInterceptionPatternsParams = tObject({ @@ -1038,12 +1014,7 @@ scheme.BrowserTypeLaunchPersistentContextParams = tObject({ permissions: tOptional(tArray(tString)), extraHTTPHeaders: tOptional(tArray(tType('NameValue'))), offline: tOptional(tBoolean), - httpCredentials: tOptional(tObject({ - username: tString, - password: tString, - origin: tOptional(tString), - send: tOptional(tEnum(['always', 'unauthorized'])), - })), + httpCredentials: tOptional(tArray(tType('HttpCredentials'))), deviceScaleFactor: tOptional(tFloat), isMobile: tOptional(tBoolean), hasTouch: tOptional(tBoolean), @@ -1138,11 +1109,7 @@ scheme.ElectronLaunchParams = tObject({ latitude: tFloat, accuracy: tOptional(tFloat), })), - httpCredentials: tOptional(tObject({ - username: tString, - password: tString, - origin: tOptional(tString), - })), + httpCredentials: tOptional(tArray(tType('HttpCredentials'))), ignoreHTTPSErrors: tOptional(tBoolean), locale: tOptional(tString), offline: tOptional(tBoolean), @@ -2013,6 +1980,12 @@ scheme.LocalUtilsGlobToRegexParams = tObject({ scheme.LocalUtilsGlobToRegexResult = tObject({ regex: tString, }); +scheme.HttpCredentials = tObject({ + username: tString, + password: tString, + origin: tOptional(tString), + send: tOptional(tEnum(['always', 'unauthorized'])), +}); scheme.SetNetworkCookie = tObject({ name: tString, value: tString, @@ -2687,12 +2660,7 @@ scheme.PlaywrightNewRequestParams = tObject({ pfx: tOptional(tBinary), }))), maxRedirects: tOptional(tInt), - httpCredentials: tOptional(tObject({ - username: tString, - password: tString, - origin: tOptional(tString), - send: tOptional(tEnum(['always', 'unauthorized'])), - })), + httpCredentials: tOptional(tArray(tType('HttpCredentials'))), proxy: tOptional(tObject({ server: tString, bypass: tOptional(tString), diff --git a/tests/library/browsercontext-credentials.spec.ts b/tests/library/browsercontext-credentials.spec.ts index 20e285c568252..4713245ff90a3 100644 --- a/tests/library/browsercontext-credentials.spec.ts +++ b/tests/library/browsercontext-credentials.spec.ts @@ -51,6 +51,22 @@ it('should work with setHTTPCredentials', async ({ browser, server, failsOn401 } await context.close(); }); +it('should work with setHTTPCredentials and multiple credentials', async ({ browser, server, browserName }) => { + server.setAuth('/empty.html', 'user1', 'pass1'); + const context = await browser.newContext(); + const page = await context.newPage(); + await context.setHTTPCredentials([ + { username: 'user1', password: 'pass1', origin: server.PREFIX }, + { username: 'user2', password: 'pass2', origin: server.CROSS_PROCESS_PREFIX }, + ]); + const response1 = await page.goto(server.EMPTY_PAGE); + expect(response1!.status()).toBe(200); + // Wrong credentials are picked for the other origin. + const response2 = await page.goto(server.CROSS_PROCESS_PREFIX + '/empty.html'); + expect(response2!.status()).toBe(401); + await context.close(); +}); + it('should work with correct credentials @smoke', async ({ browser, server }) => { server.setAuth('/empty.html', 'user', 'pass'); const context = await browser.newContext({ @@ -86,6 +102,65 @@ it('should return resource body', async ({ browser, server }) => { await context.close(); }); +it('should work with a single credential in an array', async ({ browser, server }) => { + server.setAuth('/empty.html', 'user', 'pass'); + const context = await browser.newContext({ + httpCredentials: [{ username: 'user', password: 'pass' }] + }); + const page = await context.newPage(); + const response = await page.goto(server.EMPTY_PAGE); + expect(response!.status()).toBe(200); + await context.close(); +}); + +it('should work with multiple credentials for different origins', async ({ browser, server, browserName }) => { + server.setAuth('/empty.html', 'user1', 'pass1'); + const context = await browser.newContext({ + httpCredentials: [ + { username: 'user1', password: 'pass1', origin: server.PREFIX }, + { username: 'user2', password: 'pass2', origin: server.CROSS_PROCESS_PREFIX }, + ] + }); + const page = await context.newPage(); + const response1 = await page.goto(server.EMPTY_PAGE); + expect(response1!.status()).toBe(200); + // Wrong credentials are picked for the other origin. + const response2 = await page.goto(server.CROSS_PROCESS_PREFIX + '/empty.html'); + expect(response2!.status()).toBe(401); + await context.close(); +}); + +it('should fall back to credentials without origin', async ({ browser, server, browserName }) => { + server.setAuth('/empty.html', 'user', 'pass'); + const context = await browser.newContext({ + httpCredentials: [ + { username: 'user2', password: 'pass2', origin: server.CROSS_PROCESS_PREFIX }, + { username: 'user', password: 'pass' }, + ] + }); + const page = await context.newPage(); + const response1 = await page.goto(server.EMPTY_PAGE); + expect(response1!.status()).toBe(200); + // First matching entry has wrong credentials for this origin. + const response2 = await page.goto(server.CROSS_PROCESS_PREFIX + '/empty.html'); + expect(response2!.status()).toBe(401); + await context.close(); +}); + +it('should use the first matching credential', async ({ browser, server, browserName }) => { + server.setAuth('/empty.html', 'user', 'pass'); + const context = await browser.newContext({ + httpCredentials: [ + { username: 'wrong', password: 'wrong' }, + { username: 'user', password: 'pass', origin: server.PREFIX }, + ] + }); + const page = await context.newPage(); + const response = await page.goto(server.EMPTY_PAGE); + expect(response!.status()).toBe(401); + await context.close(); +}); + it('should work with correct credentials and matching origin', async ({ browser, server }) => { server.setAuth('/empty.html', 'user', 'pass'); const context = await browser.newContext({ diff --git a/tests/library/browsercontext-fetch.spec.ts b/tests/library/browsercontext-fetch.spec.ts index 54f219d2cd0c6..64d54e58dcd30 100644 --- a/tests/library/browsercontext-fetch.spec.ts +++ b/tests/library/browsercontext-fetch.spec.ts @@ -563,6 +563,21 @@ it('should return error with wrong credentials', async ({ context, server }) => expect(response2.status()).toBe(401); }); +it('should support multiple httpCredentials', async ({ contextFactory, server, browserName }) => { + server.setAuth('/empty.html', 'user1', 'pass1'); + const context = await contextFactory({ + httpCredentials: [ + { username: 'user1', password: 'pass1', origin: server.PREFIX }, + { username: 'user2', password: 'pass2', origin: server.CROSS_PROCESS_PREFIX }, + ] + }); + const response1 = await context.request.get(server.EMPTY_PAGE); + expect(response1.status()).toBe(200); + // Wrong credentials are picked for the other origin. + const response2 = await context.request.get(server.CROSS_PROCESS_PREFIX + '/empty.html'); + expect(response2.status()).toBe(401); +}); + it('should support HTTPCredentials.send for newContext', async ({ contextFactory, server }) => { it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/30534' }); const context = await contextFactory({ diff --git a/tests/library/global-fetch.spec.ts b/tests/library/global-fetch.spec.ts index d980b253f0f2a..8a92169fab4f0 100644 --- a/tests/library/global-fetch.spec.ts +++ b/tests/library/global-fetch.spec.ts @@ -220,6 +220,49 @@ it('should support HTTPCredentials.send', async ({ playwright, server }) => { await request.dispose(); }); +it('should support multiple httpCredentials', async ({ playwright, server }) => { + server.setAuth('/empty.html', 'user1', 'pass1'); + const request = await playwright.request.newContext({ + httpCredentials: [ + { username: 'user1', password: 'pass1', origin: server.PREFIX }, + { username: 'user2', password: 'pass2', origin: server.CROSS_PROCESS_PREFIX }, + ] + }); + const response1 = await request.get(server.EMPTY_PAGE); + expect(response1.status()).toBe(200); + // Wrong credentials are picked for the other origin. + const response2 = await request.get(server.CROSS_PROCESS_PREFIX + '/empty.html'); + expect(response2.status()).toBe(401); + await request.dispose(); +}); + +it('should support HTTPCredentials.send with multiple httpCredentials', async ({ playwright, server }) => { + const request = await playwright.request.newContext({ + httpCredentials: [ + { username: 'user1', password: 'pass1', origin: server.PREFIX, send: 'always' }, + { username: 'user2', password: 'pass2', origin: server.CROSS_PROCESS_PREFIX, send: 'unauthorized' }, + ] + }); + { + const [serverRequest, response] = await Promise.all([ + server.waitForRequest('/empty.html'), + request.get(server.EMPTY_PAGE) + ]); + expect(serverRequest.headers.authorization).toBe('Basic ' + Buffer.from('user1:pass1').toString('base64')); + expect(response.status()).toBe(200); + } + { + const [serverRequest, response] = await Promise.all([ + server.waitForRequest('/empty.html'), + request.get(server.CROSS_PROCESS_PREFIX + '/empty.html') + ]); + // This origin has send: 'unauthorized', so credentials are not sent proactively. + expect(serverRequest.headers.authorization).toBe(undefined); + expect(response.status()).toBe(200); + } + await request.dispose(); +}); + it('should support global ignoreHTTPSErrors option', async ({ playwright, httpsServer }) => { const request = await playwright.request.newContext({ ignoreHTTPSErrors: true }); const response = await request.get(httpsServer.EMPTY_PAGE); diff --git a/utils/doclint/documentation.js b/utils/doclint/documentation.js index 1fbc1bfe9003d..3858d8f9bc44d 100644 --- a/utils/doclint/documentation.js +++ b/utils/doclint/documentation.js @@ -892,6 +892,9 @@ function csharpOptionOverloadSuffix(option, type) { case 'int': return 'Int'; case 'long': return 'Int64'; case 'Date': return 'Date'; + // Object keeps the original option name, e.g. for `Object|Array` unions. + case 'Object': return ''; + case 'Array': return 'List'; } throw new Error(`CSharp option "${option}" has unsupported type overload "${type}"`); } diff --git a/utils/generate_types/overrides-test.d.ts b/utils/generate_types/overrides-test.d.ts index 41719262e7c1d..1644057d895ba 100644 --- a/utils/generate_types/overrides-test.d.ts +++ b/utils/generate_types/overrides-test.d.ts @@ -283,7 +283,7 @@ export interface PlaywrightTestOptions { extraHTTPHeaders: ExtraHTTPHeaders | undefined; geolocation: Geolocation | undefined; hasTouch: boolean; - httpCredentials: HTTPCredentials | undefined; + httpCredentials: HTTPCredentials | HTTPCredentials[] | undefined; ignoreHTTPSErrors: boolean; isMobile: boolean; javaScriptEnabled: boolean; From 484274c421e4037c6a560c251456b6efbf7c3e63 Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Fri, 24 Jul 2026 14:49:03 -0700 Subject: [PATCH 4/5] chore(mcp): replace BackendManager with backend dispose callback and events (#41982) --- .../src/tools/backend/browserBackend.ts | 40 +++++++++++++----- .../playwright-core/src/tools/mcp/index.ts | 1 - .../playwright-core/src/tools/mcp/program.ts | 30 +++++++------ .../src/tools/utils/mcp/server.ts | 42 ++++--------------- packages/playwright/src/program.ts | 1 - 5 files changed, 52 insertions(+), 62 deletions(-) diff --git a/packages/playwright-core/src/tools/backend/browserBackend.ts b/packages/playwright-core/src/tools/backend/browserBackend.ts index b8c8fb55d78f7..2fc6d82944af2 100644 --- a/packages/playwright-core/src/tools/backend/browserBackend.ts +++ b/packages/playwright-core/src/tools/backend/browserBackend.ts @@ -14,6 +14,8 @@ * limitations under the License. */ +import { EventEmitter } from 'events'; + import * as z from 'zod'; import debug from 'debug'; import { Context } from './context'; @@ -25,26 +27,35 @@ import type { Tool } from './tool'; import type * as mcpServer from '../utils/mcp/server'; import type { ClientInfo, ServerBackend } from '../utils/mcp/server'; -export class BrowserBackend implements ServerBackend { +export class BrowserBackend extends EventEmitter<{ disconnected: [], disposed: [] }> implements ServerBackend { private _tools: Tool[]; private _context: Context | undefined; private _sessionLog: SessionLog | undefined; private _config: ContextConfig; private _disconnected = false; - readonly browserContext: playwright.BrowserContext; + private _disposed = false; + private _browserContext: playwright.BrowserContext; + private _disposeCallback: (() => Promise) | undefined; - constructor(config: ContextConfig, browserContext: playwright.BrowserContext, tools: Tool[]) { + constructor(config: ContextConfig, browserContext: playwright.BrowserContext, tools: Tool[], disposeCallback?: () => Promise) { + super(); this._config = config; this._tools = tools; - this.browserContext = browserContext; - const markDisconnected = () => { this._disconnected = true; }; - this.browserContext.once('close', markDisconnected); - this.browserContext.browser()?.once('disconnected', markDisconnected); + this._browserContext = browserContext; + this._disposeCallback = disposeCallback; + const markDisconnected = () => { + if (this._disconnected) + return; + this._disconnected = true; + this.emit('disconnected'); + }; + this._browserContext.once('close', markDisconnected); + this._browserContext.browser()?.once('disconnected', markDisconnected); } async initialize(clientInfo: ClientInfo): Promise { this._sessionLog = this._config.saveSession ? await SessionLog.create(this._config, clientInfo.cwd) : undefined; - this._context = new Context(this.browserContext, { + this._context = new Context(this._browserContext, { config: this._config, sessionLog: this._sessionLog, cwd: clientInfo.cwd, @@ -52,10 +63,15 @@ export class BrowserBackend implements ServerBackend { } async dispose() { + if (this._disposed) + return; + this._disposed = true; await this._context?.dispose().catch(e => debug('pw:tools:error')(e)); + await this._disposeCallback?.().catch(e => debug('pw:tools:error')(e)); + this.emit('disposed'); } - async callTool(name: string, rawArguments: mcpServer.CallToolRequest['params']['arguments'] & { _meta?: Record } = {}, signal?: AbortSignal): Promise { + async callTool(name: string, rawArguments: mcpServer.CallToolRequest['params']['arguments'] & { _meta?: Record } = {}, signal?: AbortSignal): Promise { const json = !!rawArguments._meta?.json; const formatError = (message: string): mcpServer.CallToolResult => ({ content: [{ type: 'text' as const, text: json ? JSON.stringify({ isError: true, error: message }, null, 2) : `### Error\n${message}` }], @@ -90,8 +106,10 @@ export class BrowserBackend implements ServerBackend { } finally { context.setRunningTool(undefined); } - if (this._disconnected) - responseObject.isClose = true; + if (this._disconnected || responseObject.isClose) { + delete responseObject.isClose; + await this.dispose(); + } return responseObject; } } diff --git a/packages/playwright-core/src/tools/mcp/index.ts b/packages/playwright-core/src/tools/mcp/index.ts index a1a1c8c4b5a0c..d720e1c93890a 100644 --- a/packages/playwright-core/src/tools/mcp/index.ts +++ b/packages/playwright-core/src/tools/mcp/index.ts @@ -41,7 +41,6 @@ export async function createConnection(userConfig: Config = {}, contextGetter?: const context = config.browser.isolated ? await browser.newContext(config.browser.contextOptions) : browser.contexts()[0]; return new BrowserBackend(config, context, tools); }, - disposed: async () => { } }; return createServer('api', packageJSON.version, backendFactory, Promise.resolve(), false); } diff --git a/packages/playwright-core/src/tools/mcp/program.ts b/packages/playwright-core/src/tools/mcp/program.ts index 2643131dd085d..2c748848b31c7 100644 --- a/packages/playwright-core/src/tools/mcp/program.ts +++ b/packages/playwright-core/src/tools/mcp/program.ts @@ -129,25 +129,23 @@ export function decorateMCPCommand(command: Command) { await browser.bind(sessionName, { workspaceDir: clientInfo.cwd }); } const browserContext = config.browser.isolated ? await browser.newContext(config.browser.contextOptions) : browser.contexts()[0]; - return new BrowserBackend(config, browserContext, tools); - }, - disposed: async backend => { - clientCount--; - const browserContext = (backend as BrowserBackend).browserContext; + return new BrowserBackend(config, browserContext, tools, async () => { + clientCount--; - if (sharedBrowserPromise && clientCount > 0) { - if (config.browser.isolated) { - testDebug('close context'); - await browserContext.close().catch(() => { }); + if (sharedBrowserPromise && clientCount > 0) { + if (config.browser.isolated) { + testDebug('close context'); + await browserContext.close().catch(() => { }); + } + return; } - return; - } - testDebug('close browser'); - sharedBrowserPromise = undefined; - await browserContext.close().catch(() => { }); - await browserContext.browser()?.close().catch(() => { }); - } + testDebug('close browser'); + sharedBrowserPromise = undefined; + await browserContext.close().catch(() => { }); + await browserContext.browser()?.close().catch(() => { }); + }); + }, }; await mcpServer.start(factory, config.server); }); diff --git a/packages/playwright-core/src/tools/utils/mcp/server.ts b/packages/playwright-core/src/tools/utils/mcp/server.ts index 15cf6ebe1b5ed..ecdd1ae6ca11b 100644 --- a/packages/playwright-core/src/tools/utils/mcp/server.ts +++ b/packages/playwright-core/src/tools/utils/mcp/server.ts @@ -38,32 +38,11 @@ export type ClientInfo = { clientName: string; }; -class BackendManager { - private _backends = new Map(); - - async createBackend(factory: ServerBackendFactory, clientInfo: ClientInfo): Promise { - const backend = await factory.create(clientInfo); - await backend.initialize?.(clientInfo); - this._backends.set(backend, factory); - return backend; - } - - async disposeBackend(backend: ServerBackend) { - const factory = this._backends.get(backend); - if (!factory) - return; - await backend.dispose?.(); - await factory.disposed(backend).catch(serverDebug); - this._backends.delete(backend); - } -} - -const backendManager = new BackendManager(); - export interface ServerBackend { initialize?(clientInfo: ClientInfo): Promise; - callTool(name: string, args: CallToolRequest['params']['arguments'], signal: AbortSignal): Promise; + callTool(name: string, args: CallToolRequest['params']['arguments'], signal: AbortSignal): Promise; dispose?(): Promise; + once(event: 'disposed', listener: () => void): void; } export type ServerBackendFactory = { @@ -72,7 +51,6 @@ export type ServerBackendFactory = { version: string; toolSchemas: ToolSchema[]; create: (clientInfo: ClientInfo) => Promise; - disposed: (backend: ServerBackend) => Promise; }; export async function connect(factory: ServerBackendFactory, transport: Transport, transportInitialized: Promise, runHeartbeat: boolean) { @@ -94,7 +72,7 @@ export function createServer(name: string, version: string, factory: ServerBacke let backendPromise: Promise | undefined; - const onClose = () => backendPromise?.then(b => backendManager.disposeBackend(b)).catch(serverDebug); + const onClose = () => backendPromise?.then(b => b.dispose?.()).catch(serverDebug); addServerListener(server, 'close', onClose); server.setRequestHandler(CallToolRequestSchema, async (request, extra) => { @@ -102,7 +80,10 @@ export function createServer(name: string, version: string, factory: ServerBacke try { if (!backendPromise) { - backendPromise = initializeServer(server, factory, transportInitialized, runHeartbeat).catch(e => { + backendPromise = initializeServer(server, factory, transportInitialized, runHeartbeat).then(backend => { + backend.once('disposed', () => { backendPromise = undefined; }); + return backend; + }).catch(e => { backendPromise = undefined; throw e; }); @@ -110,12 +91,6 @@ export function createServer(name: string, version: string, factory: ServerBacke const backend = await backendPromise; const toolResult = await backend.callTool(request.params.name, request.params.arguments || {}, extra.signal); - if (toolResult.isClose) { - await backendManager.disposeBackend(backend).catch(serverDebug); - backendPromise = undefined; - delete toolResult.isClose; - } - const mergedResult = mergeTextParts(toolResult); serverDebugResponse('callResult', mergedResult); return mergedResult; @@ -146,7 +121,8 @@ const initializeServer = async (server: ServerType, factory: ServerBackendFactor clientName: server.getClientVersion()?.name ?? 'Playwright MCP', }; - const backend = await backendManager.createBackend(factory, clientInfo); + const backend = await factory.create(clientInfo); + await backend.initialize?.(clientInfo); if (runHeartbeat) startHeartbeat(server); return backend; diff --git a/packages/playwright/src/program.ts b/packages/playwright/src/program.ts index eea299a9db04f..2384f49a8852e 100644 --- a/packages/playwright/src/program.ts +++ b/packages/playwright/src/program.ts @@ -152,7 +152,6 @@ function addTestMCPServerCommand(program: Command) { version: packageJSON.version, toolSchemas: testServerBackendTools.map(tool => tool.schema), create: async () => new TestServerBackend(options.config, { muteConsole: options.port === undefined, headless: options.headless }), - disposed: async () => { } }; // TODO: add all options from mcp.startHttpServer. await tools.start(factory, { port: options.port === undefined ? undefined : +options.port, host: options.host }); From 3827650d171cc1b035cbefb7e00bf5948d6809df Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Fri, 24 Jul 2026 15:26:48 -0700 Subject: [PATCH 5/5] feat(webkit): roll to r2339 (#41984) --- packages/playwright-core/browsers.json | 2 +- tests/library/capabilities.spec.ts | 15 ++++++--------- tests/library/defaultbrowsercontext-2.spec.ts | 14 ++++++++++++++ 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/packages/playwright-core/browsers.json b/packages/playwright-core/browsers.json index 6383abb91ccaf..eaf37c55e0ad0 100644 --- a/packages/playwright-core/browsers.json +++ b/packages/playwright-core/browsers.json @@ -45,7 +45,7 @@ }, { "name": "webkit", - "revision": "2337", + "revision": "2339", "installByDefault": true, "revisionOverrides": { "mac14": "2251", diff --git a/tests/library/capabilities.spec.ts b/tests/library/capabilities.spec.ts index dc75d7083d9c0..88fda9503d2fb 100644 --- a/tests/library/capabilities.spec.ts +++ b/tests/library/capabilities.spec.ts @@ -142,21 +142,18 @@ it('should not crash on showDirectoryPicker', async ({ page, server, browserName await page.waitForTimeout(3_000); }); -it('should not crash on storage.getDirectory()', async ({ page, server, browserName, isMac }) => { - it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/18235' }); +it('should not crash on storage.getDirectory()', { + annotation: { type: 'issue', description: 'https://github.com/microsoft/playwright/issues/18235' } +}, async ({ page, server, browserName }) => { await page.goto(server.EMPTY_PAGE); const error = await page.evaluate(async () => { const dir = await navigator.storage.getDirectory(); return dir.name; }).catch(e => e); - if (browserName === 'webkit') { - if (isMac) - expect(error.message).toContain('UnknownError: The operation failed for an unknown transient reason'); - else - expect(error.message).toContain('TypeError: undefined is not an object'); - } else { + if (browserName === 'webkit') + expect(error.message).toContain('UnknownError: The operation failed for an unknown transient reason'); + else expect(error).toBeFalsy(); - } }); it('navigator.clipboard should be present', async ({ page, server }) => { diff --git a/tests/library/defaultbrowsercontext-2.spec.ts b/tests/library/defaultbrowsercontext-2.spec.ts index 9e0fb4102dc7d..cecdb46c7be93 100644 --- a/tests/library/defaultbrowsercontext-2.spec.ts +++ b/tests/library/defaultbrowsercontext-2.spec.ts @@ -315,3 +315,17 @@ it('exposes browser', async ({ launchPersistent }) => { // Next line should not throw. await context.close(); }); + +it('should support storage.getDirectory()', { + annotation: { type: 'issue', description: 'https://github.com/microsoft/playwright/issues/18235' } +}, async ({ launchPersistent, server }) => { + const { context } = await launchPersistent(); + const page = await context.newPage(); + await page.goto(server.EMPTY_PAGE); + const name = await page.evaluate(async () => { + const dir = await navigator.storage.getDirectory(); + return dir.name; + }).catch(e => e); + expect(name).toBe(''); + await context.close(); +});