Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
TypeScript automationchromechromiume2e-testingelectronend-to-end-testingfirefoxjavascriptplaywrighttesttest-automationtestingtesting-toolswebwebkit
chore: roll browser patches from upstream (#39944)
Pavel Feldmanbba162834511
diff --git a/browser_patches/firefox/UPSTREAM_CONFIG.sh b/browser_patches/firefox/UPSTREAM_CONFIG.shindex bde5d67eb0..3f4d29cfd4 100644--- a/browser_patches/firefox/UPSTREAM_CONFIG.sh+++ b/browser_patches/firefox/UPSTREAM_CONFIG.sh@@ -1,3 +1,3 @@REMOTE_URL="https://github.com/mozilla-firefox/firefox"BASE_BRANCH="release"-BASE_REVISION="d0f4d17d5aefe7ca5aa97afbcafcdc641cbd9f93"+BASE_REVISION="4eb5a4f7e5a3bea3de2e2bfc541e1bc122731518"diff --git a/browser_patches/firefox/juggler/NetworkObserver.js b/browser_patches/firefox/juggler/NetworkObserver.jsindex 2719cc1023..878587afd5 100644--- a/browser_patches/firefox/juggler/NetworkObserver.js+++ b/browser_patches/firefox/juggler/NetworkObserver.js@@ -792,22 +792,69 @@ function requestHeaders(httpChannel) {return headers;}-function clearRequestHeaders(httpChannel) {+function overrideRequestHeaders(httpChannel, headers) {+ // Clear all headers that are overrdable.for (const header of requestHeaders(httpChannel)) {- // We cannot remove the "host" header.- if (header.name.toLowerCase() === 'host')- continue;- // Keep the "cookie" header. If there is an override, it will be set anyway.- // Otherwise, we may delete a cookie that was set for a redirect.- if (header.name.toLowerCase() === 'cookie')+ if (!isForbiddenHeader(header.name, header.value))+ httpChannel.setRequestHeader(header.name, '', false /* merge */);+ }++ // Set the non-forbidden overridden headers.+ for (const header of headers) {+ if (isForbiddenHeader(header.name, header.value))continue;- httpChannel.setRequestHeader(header.name, '', false /* merge */);+ httpChannel.setRequestHeader(header.name, header.value, false /* merge */);}}-function overrideRequestHeaders(httpChannel, headers) {- clearRequestHeaders(httpChannel);- appendExtraHTTPHeaders(httpChannel, headers);+// Forbidden request headers according to https://developer.mozilla.org/en-US/docs/Glossary/Forbidden_request_header+// These headers cannot be set or modified programmatically.+const FORBIDDEN_HEADER_NAMES = new Set([+ 'accept-charset',+ 'accept-encoding',+ 'access-control-request-headers',+ 'access-control-request-method',+ 'connection',+ 'content-length',+ 'cookie',+ 'date',+ 'dnt',+ 'expect',+ 'host',+ 'keep-alive',+ 'origin',+ 'referer',+ 'set-cookie',+ 'te',+ 'trailer',+ 'transfer-encoding',+ 'upgrade',+ 'via',+]);++// Forbidden method names for X-HTTP-Method-* headers+const FORBIDDEN_METHODS = new Set(['CONNECT', 'TRACE', 'TRACK']);++function isForbiddenHeader(name, value) {+ const lowerName = name.toLowerCase();++ if (FORBIDDEN_HEADER_NAMES.has(lowerName))+ return true;++ if (lowerName.startsWith('proxy-'))+ return true;++ if (lowerName.startsWith('sec-'))+ return true;++ if (lowerName === 'x-http-method' ||+ lowerName === 'x-http-method-override' ||+ lowerName === 'x-method-override') {+ if (value && FORBIDDEN_METHODS.has(value.toUpperCase()))+ return true;+ }++ return false;}const redirectStatus = [301, 302, 303, 307, 308];diff --git a/browser_patches/firefox/juggler/TargetRegistry.js b/browser_patches/firefox/juggler/TargetRegistry.jsindex fd7870d1c4..f28e675c0b 100644--- a/browser_patches/firefox/juggler/TargetRegistry.js+++ b/browser_patches/firefox/juggler/TargetRegistry.js@@ -164,8 +164,6 @@ export class TargetRegistry {target.updateOverridesForBrowsingContext(tab.linkedBrowser.browsingContext);if (!hasExplicitSize)target.updateViewportSize();- if (browserContext.videoRecordingOptions)- target._startVideoRecording(browserContext.videoRecordingOptions);};const onTabCloseListener = event => {@@ -399,8 +397,7 @@ export class PageTarget {this._actor = undefined;this._actorSequenceNumber = 0;this._channel = new SimpleChannel(`browser::page[${this._targetId}]`, 'target-' + this._targetId);- this._videoRecordingInfo = undefined;- this._screencastRecordingInfo = undefined;+ this._screencastId = undefined;this._dialogs = new Map();this.forcedColors = 'none';this.disableCache = false;@@ -504,6 +501,7 @@ export class PageTarget {this.updateTouchOverride(browsingContext);this.updateUserAgent(browsingContext);this.updateTimezoneOverride(browsingContext);+ this.updateLanguageOverride(browsingContext);this.updatePlatform(browsingContext);this.updateDPPXOverride(browsingContext);this.updateZoom(browsingContext);@@ -545,6 +543,10 @@ export class PageTarget {(browsingContext || this._linkedBrowser.browsingContext).timezoneOverride = this._browserContext.timezoneOverride;}+ updateLanguageOverride(browsingContext = undefined) {+ (browsingContext || this._linkedBrowser.browsingContext).languageOverride = this._browserContext.languageOverride;+ }+updatePlatform(browsingContext = undefined) {(browsingContext || this._linkedBrowser.browsingContext).customPlatform = this._browserContext.defaultPlatform;}@@ -749,48 +751,9 @@ export class PageTarget {await this._channel.connect('').send('applyContextSetting', { name, value }).catch(e => void e);}- async _startVideoRecording({width, height, dir}) {- // On Mac the window may not yet be visible when TargetCreated and its- // NSWindow.windowNumber may be -1, so we wait until the window is known- // to be initialized and visible.- await this.windowReady();- const file = PathUtils.join(dir, helper.generateId() + '.webm');- if (width < 10 || width > 10000 || height < 10 || height > 10000)- throw new Error("Invalid size");-- const docShell = this._gBrowser.ownerGlobal.docShell;- // Exclude address bar and navigation control from the video.- const rect = this.linkedBrowser().getBoundingClientRect();- const devicePixelRatio = this._window.devicePixelRatio;- let sessionId;- const registry = this._registry;- const screencastClient = {- QueryInterface: ChromeUtils.generateQI([Ci.nsIScreencastServiceClient]),- screencastFrame(data, deviceWidth, deviceHeight, timestamp) {- },- screencastStopped() {- registry.emit(TargetRegistry.Events.ScreencastStopped, sessionId);- },- };- const viewport = this._viewportSize || this._browserContext.defaultViewportSize || { width: 0, height: 0 };- sessionId = screencastService.startVideoRecording(screencastClient, docShell, true, file, width, height, 0, viewport.width, viewport.height, devicePixelRatio * rect.top);- this._videoRecordingInfo = { sessionId, file };- this.emit(PageTarget.Events.ScreencastStarted);- }-- _stopVideoRecording() {- if (!this._videoRecordingInfo)- throw new Error('No video recording in progress');- const videoRecordingInfo = this._videoRecordingInfo;- this._videoRecordingInfo = undefined;- screencastService.stopVideoRecording(videoRecordingInfo.sessionId);- }-- videoRecordingInfo() {- return this._videoRecordingInfo;- }-async startScreencast({ width, height, quality }) {+ if (this._screencastId)+ return;// On Mac the window may not yet be visible when TargetCreated and its// NSWindow.windowNumber may be -1, so we wait until the window is known// to be initialized and visible.@@ -807,30 +770,28 @@ export class PageTarget {const screencastClient = {QueryInterface: ChromeUtils.generateQI([Ci.nsIScreencastServiceClient]),screencastFrame(data, deviceWidth, deviceHeight, timestamp) {- if (self._screencastRecordingInfo)+ if (self._screencastId)self.emit(PageTarget.Events.ScreencastFrame, { data, deviceWidth, deviceHeight, timestamp });},screencastStopped() {},};const viewport = this._viewportSize || this._browserContext.defaultViewportSize || { width: 0, height: 0 };- const screencastId = screencastService.startVideoRecording(screencastClient, docShell, false, '', width, height, quality || 90, viewport.width, viewport.height, devicePixelRatio * rect.top);- this._screencastRecordingInfo = { screencastId };- return { screencastId };+ this._screencastId = screencastService.startScreencast(screencastClient, docShell, width, height, quality || 90, viewport.width, viewport.height, devicePixelRatio * rect.top);}- screencastFrameAck({ screencastId }) {- if (!this._screencastRecordingInfo || this._screencastRecordingInfo.screencastId !== screencastId)+ screencastFrameAck() {+ if (!this._screencastId)return;- screencastService.screencastFrameAck(screencastId);+ screencastService.screencastFrameAck(this._screencastId);}stopScreencast() {- if (!this._screencastRecordingInfo)- throw new Error('No screencast in progress');- const { screencastId } = this._screencastRecordingInfo;- this._screencastRecordingInfo = undefined;- screencastService.stopVideoRecording(screencastId);+ if (!this._screencastId)+ return;+ const screencastId = this._screencastId;+ this._screencastId = undefined;+ screencastService.stopScreencast(screencastId);}ensureContextMenuClosed() {@@ -851,10 +812,7 @@ export class PageTarget {dispose() {this.ensureContextMenuClosed();this._disposed = true;- if (this._videoRecordingInfo)- this._stopVideoRecording();- if (this._screencastRecordingInfo)- this.stopScreencast();+ this.stopScreencast();this._browserContext.pages.delete(this);this._registry._browserToTarget.delete(this._linkedBrowser);this._registry._browserIdToTarget.delete(this._linkedBrowser.browsingContext.browserId);@@ -871,7 +829,6 @@ export class PageTarget {}PageTarget.Events = {- ScreencastStarted: Symbol('PageTarget.ScreencastStarted'),ScreencastFrame: Symbol('PageTarget.ScreencastFrame'),Crashed: Symbol('PageTarget.Crashed'),DialogOpened: Symbol('PageTarget.DialogOpened'),@@ -936,6 +893,7 @@ class BrowserContext {this.deviceScaleFactor = undefined;this.defaultUserAgent = null;this.timezoneOverride = undefined;+ this.languageOverride = undefined;this.defaultPlatform = null;this.touchOverride = false;this.forceOffline = false;@@ -944,7 +902,6 @@ class BrowserContext {this.forcedColors = 'none';this.reducedMotion = 'none';this.contrast = 'none';- this.videoRecordingOptions = undefined;this.crossProcessCookie = {initScripts: [],bindings: [],@@ -1040,6 +997,12 @@ class BrowserContext {page.updateTimezoneOverride();}+ setLanguageOverride(locale) {+ this.languageOverride = locale;+ for (const page of this.pages)+ page.updateLanguageOverride();+ }+setDefaultPlatform(platform) {this.defaultPlatform = platform;for (const page of this.pages)@@ -1202,14 +1165,14 @@ class BrowserContext {return result;}- async setVideoRecordingOptions(options) {- this.videoRecordingOptions = options;+ async setScreencastOptions(options) {+ this.screencastOptions = options;const promises = [];for (const page of this.pages) {if (options)- promises.push(page._startVideoRecording(options));- else if (page._videoRecordingInfo)- promises.push(page._stopVideoRecording());+ promises.push(page.startScreencast(options));+ else+ promises.push(page.stopScreencast());}await Promise.all(promises);}@@ -1301,5 +1264,4 @@ TargetRegistry.Events = {TargetDestroyed: Symbol('TargetRegistry.Events.TargetDestroyed'),DownloadCreated: Symbol('TargetRegistry.Events.DownloadCreated'),DownloadFinished: Symbol('TargetRegistry.Events.DownloadFinished'),- ScreencastStopped: Symbol('TargetRegistry.ScreencastStopped'),};diff --git a/browser_patches/firefox/juggler/content/main.js b/browser_patches/firefox/juggler/content/main.jsindex 9eb07d399c..8028692f87 100644--- a/browser_patches/firefox/juggler/content/main.js+++ b/browser_patches/firefox/juggler/content/main.js@@ -41,10 +41,6 @@ export function initialize(browsingContext, docShell) {docShell.bypassCSPEnabled = bypassCSP;},- locale: (locale) => {- docShell.languageOverride = locale;- },-javaScriptDisabled: (javaScriptDisabled) => {data.frameTree.setJavaScriptDisabled(javaScriptDisabled);},diff --git a/browser_patches/firefox/juggler/protocol/BrowserHandler.js b/browser_patches/firefox/juggler/protocol/BrowserHandler.jsindex 5e7e5ec468..b8f9ea5a58 100644--- a/browser_patches/firefox/juggler/protocol/BrowserHandler.js+++ b/browser_patches/firefox/juggler/protocol/BrowserHandler.js@@ -50,9 +50,6 @@ export class BrowserHandler {helper.on(this._targetRegistry, TargetRegistry.Events.TargetDestroyed, this._onTargetDestroyed.bind(this)),helper.on(this._targetRegistry, TargetRegistry.Events.DownloadCreated, this._onDownloadCreated.bind(this)),helper.on(this._targetRegistry, TargetRegistry.Events.DownloadFinished, this._onDownloadFinished.bind(this)),- helper.on(this._targetRegistry, TargetRegistry.Events.ScreencastStopped, sessionId => {- this._session.emitEvent('Browser.videoRecordingFinished', {screencastId: '' + sessionId});- })];for (const target of this._targetRegistry.targets())@@ -104,6 +101,10 @@ export class BrowserHandler {targetInfo: target.info()});session.setHandler(new PageHandler(target, session, channel));+ // Start screencast only after page handler is created, so that+ // any screencast frames are actually sent to the client.+ if (target.browserContext().screencastOptions)+ target.startScreencast(target.browserContext().screencastOptions);}_onTargetDestroyed(target) {@@ -230,8 +231,8 @@ export class BrowserHandler {await this._targetRegistry.browserContextForId(browserContextId).setContrast(nullToUndefined(contrast));}- async ['Browser.setVideoRecordingOptions']({browserContextId, options}) {- await this._targetRegistry.browserContextForId(browserContextId).setVideoRecordingOptions(options);+ async ['Browser.setScreencastOptions']({browserContextId, options}) {+ await this._targetRegistry.browserContextForId(browserContextId).setScreencastOptions(options);}async ['Browser.setUserAgentOverride']({browserContextId, userAgent}) {@@ -251,7 +252,7 @@ export class BrowserHandler {}async ['Browser.setLocaleOverride']({browserContextId, locale}) {- await this._targetRegistry.browserContextForId(browserContextId).applySetting('locale', nullToUndefined(locale));+ await this._targetRegistry.browserContextForId(browserContextId).setLanguageOverride(nullToUndefined(locale));}async ['Browser.setTimezoneOverride']({browserContextId, timezoneId}) {diff --git a/browser_patches/firefox/juggler/protocol/PageHandler.js b/browser_patches/firefox/juggler/protocol/PageHandler.jsindex 008087c1bc..267358890f 100644--- a/browser_patches/firefox/juggler/protocol/PageHandler.js+++ b/browser_patches/firefox/juggler/protocol/PageHandler.js@@ -92,9 +92,6 @@ export class PageHandler {// to be ignored by the protocol clients.this._isPageReady = false;- if (this._pageTarget.videoRecordingInfo())- this._onVideoRecordingStarted();-this._pageEventSink = {};helper.decorateAsEventEmitter(this._pageEventSink);@@ -105,7 +102,6 @@ export class PageHandler {helper.on(this._pageTarget, PageTarget.Events.Crashed, () => {this._session.emitEvent('Page.crashed', {});}),- helper.on(this._pageTarget, PageTarget.Events.ScreencastStarted, this._onVideoRecordingStarted.bind(this)),helper.on(this._pageTarget, PageTarget.Events.ScreencastFrame, this._onScreencastFrame.bind(this)),helper.on(this._pageNetwork, PageNetwork.Events.Request, this._handleNetworkEvent.bind(this, 'Network.requestWillBeSent')),helper.on(this._pageNetwork, PageNetwork.Events.Response, this._handleNetworkEvent.bind(this, 'Network.responseReceived')),@@ -159,11 +155,6 @@ export class PageHandler {helper.removeListeners(this._eventListeners);}- _onVideoRecordingStarted() {- const info = this._pageTarget.videoRecordingInfo();- this._session.emitEvent('Page.videoRecordingStarted', { screencastId: info.sessionId, file: info.file });- }-_onScreencastFrame(params) {this._session.emitEvent('Page.screencastFrame', params);}@@ -679,6 +670,10 @@ export class PageHandler {}async ['Page.stopScreencast'](options) {+ // If screencast is enabled at the context level, then browser+ // context will handle the stopping.+ if (this._pageTarget.browserContext().screencastOptions)+ return;await this._pageTarget.stopScreencast(options);}diff --git a/browser_patches/firefox/juggler/protocol/Protocol.js b/browser_patches/firefox/juggler/protocol/Protocol.jsindex e7400e4a9b..e1589b0cf7 100644--- a/browser_patches/firefox/juggler/protocol/Protocol.js+++ b/browser_patches/firefox/juggler/protocol/Protocol.js@@ -203,9 +203,6 @@ const Browser = {canceled: t.Optional(t.Boolean),error: t.Optional(t.String),},- 'videoRecordingFinished': {- screencastId: t.String,- },},methods: {@@ -430,13 +427,13 @@ const Browser = {contrast: t.Nullable(t.Enum(['less', 'more', 'custom', 'no-preference'])),},},- 'setVideoRecordingOptions': {+ 'setScreencastOptions': {params: {browserContextId: t.Optional(t.String),options: t.Optional({- dir: t.String,width: t.Number,height: t.Number,+ quality: t.Number,}),},},@@ -697,10 +694,6 @@ const Page = {workerId: t.String,message: t.String,},- 'videoRecordingStarted': {- screencastId: t.String,- file: t.String,- },'webSocketCreated': {frameId: t.String,wsid: t.String,@@ -834,7 +827,6 @@ const Page = {},},'reload': {- params: { },},'adoptNode': {params: {@@ -922,7 +914,6 @@ const Page = {}},'crash': {- params: {}},'handleDialog': {params: {@@ -949,14 +940,8 @@ const Page = {height: t.Number,quality: t.Number,},- returns: {- screencastId: t.String,- },},'screencastFrameAck': {- params: {- screencastId: t.String,- },},'stopScreencast': {},diff --git a/browser_patches/firefox/juggler/screencast/ScreencastEncoder.cpp b/browser_patches/firefox/juggler/screencast/ScreencastEncoder.cppdeleted file mode 100644index 103a6b4b1b..0000000000--- a/browser_patches/firefox/juggler/screencast/ScreencastEncoder.cpp+++ /dev/null@@ -1,404 +0,0 @@-/*- * Copyright (c) 2010, The WebM Project authors. All rights reserved.- * Copyright (c) 2013 The Chromium Authors. All rights reserved.- * Copyright (C) 2020 Microsoft Corporation.- *- * Redistribution and use in source and binary forms, with or without- * modification, are permitted provided that the following conditions- * are met:- * 1. Redistributions of source code must retain the above copyright- * notice, this list of conditions and the following disclaimer.- * 2. Redistributions in binary form must reproduce the above copyright- * notice, this list of conditions and the following disclaimer in the- * documentation and/or other materials provided with the distribution.- *- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.- */--/* This Source Code Form is subject to the terms of the Mozilla Public- * License, v. 2.0. If a copy of the MPL was not distributed with this- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */--#include "ScreencastEncoder.h"--#include <algorithm>-#include <libyuv.h>-#include <vpx/vp8.h>-#include <vpx/vp8cx.h>-#include <vpx/vpx_encoder.h>-#include "nsIThread.h"-#include "nsThreadUtils.h"-#include "WebMFileWriter.h"-#include "api/video/video_frame.h"--namespace mozilla {--namespace {--struct VpxCodecDeleter {- void operator()(vpx_codec_ctx_t* codec) {- if (codec) {- vpx_codec_err_t ret = vpx_codec_destroy(codec);- if (ret != VPX_CODEC_OK)- fprintf(stderr, "Failed to destroy codec: %s\n", vpx_codec_error(codec));- }- }-};--using ScopedVpxCodec = std::unique_ptr<vpx_codec_ctx_t, VpxCodecDeleter>;--// Number of timebase unints per one frame.-constexpr int timeScale = 1000;--// Defines the dimension of a macro block. This is used to compute the active-// map for the encoder.-const int kMacroBlockSize = 16;--void createImage(unsigned int width, unsigned int height,- std::unique_ptr<vpx_image_t>& out_image,- std::unique_ptr<uint8_t[]>& out_image_buffer,- int& out_buffer_size) {- std::unique_ptr<vpx_image_t> image(new vpx_image_t());- memset(image.get(), 0, sizeof(vpx_image_t));-- // libvpx seems to require both to be assigned.- image->d_w = width;- image->w = width;- image->d_h = height;- image->h = height;-- // I420- image->fmt = VPX_IMG_FMT_YV12;- image->x_chroma_shift = 1;- image->y_chroma_shift = 1;-- // libyuv's fast-path requires 16-byte aligned pointers and strides, so pad- // the Y, U and V planes' strides to multiples of 16 bytes.- const int y_stride = ((image->w - 1) & ~15) + 16;- const int uv_unaligned_stride = y_stride >> image->x_chroma_shift;- const int uv_stride = ((uv_unaligned_stride - 1) & ~15) + 16;-- // libvpx accesses the source image in macro blocks, and will over-read- // if the image is not padded out to the next macroblock: crbug.com/119633.- // Pad the Y, U and V planes' height out to compensate.- // Assuming macroblocks are 16x16, aligning the planes' strides above also- // macroblock aligned them.- static_assert(kMacroBlockSize == 16, "macroblock_size_not_16");- const int y_rows = ((image->h - 1) & ~(kMacroBlockSize-1)) + kMacroBlockSize;- const int uv_rows = y_rows >> image->y_chroma_shift;-- // Allocate a YUV buffer large enough for the aligned data & padding.- out_buffer_size = y_stride * y_rows + 2*uv_stride * uv_rows;- std::unique_ptr<uint8_t[]> image_buffer(new uint8_t[out_buffer_size]);-- // Reset image value to 128 so we just need to fill in the y plane.- memset(image_buffer.get(), 128, out_buffer_size);-- // Fill in the information for |image_|.- unsigned char* uchar_buffer =- reinterpret_cast<unsigned char*>(image_buffer.get());- image->planes[0] = uchar_buffer;- image->planes[1] = image->planes[0] + y_stride * y_rows;- image->planes[2] = image->planes[1] + uv_stride * uv_rows;- image->stride[0] = y_stride;- image->stride[1] = uv_stride;- image->stride[2] = uv_stride;-- out_image = std::move(image);- out_image_buffer = std::move(image_buffer);-}--} // namespace--class ScreencastEncoder::VPXFrame {-public:- VPXFrame(webrtc::scoped_refptr<webrtc::VideoFrameBuffer>&& buffer, const gfx::IntMargin& margin)- : m_frameBuffer(std::move(buffer))- , m_margin(margin)- { }-- void setDuration(TimeDuration duration) { m_duration = duration; }- TimeDuration duration() const { return m_duration; }-- void convertToVpxImage(vpx_image_t* image)- {- if (m_frameBuffer->type() != webrtc::VideoFrameBuffer::Type::kI420) {- fprintf(stderr, "convertToVpxImage unexpected frame buffer type: %d\n", m_frameBuffer->type());- return;- }-- auto src = m_frameBuffer->GetI420();- const int y_stride = image->stride[VPX_PLANE_Y];- MOZ_ASSERT(image->stride[VPX_PLANE_U] == image->stride[VPX_PLANE_V]);- const int uv_stride = image->stride[1];- uint8_t* y_data = image->planes[VPX_PLANE_Y];- uint8_t* u_data = image->planes[VPX_PLANE_U];- uint8_t* v_data = image->planes[VPX_PLANE_V];-- /**- * Let's say we have the following image of 6x3 pixels (same number = same pixel value):- * 112233- * 112233- * 445566- * In I420 format (see https://en.wikipedia.org/wiki/YUV), the image will have the following data planes:- * Y [stride_Y = 6]:- * 112233- * 112233- * 445566- * U [stride_U = 3] - this plane has aggregate for each 2x2 pixels:- * 123- * 456- * V [stride_V = 3] - this plane has aggregate for each 2x2 pixels:- * 123- * 456- *- * To crop this image efficiently, we can move src_Y/U/V pointer and- * adjust the src_width and src_height. However, we must cut off only **even**- * amount of lines and columns to retain semantic of U and V planes which- * contain only 1/4 of pixel information.- */- int yuvTopOffset = m_margin.top + (m_margin.top & 1);- int yuvLeftOffset = m_margin.left + (m_margin.left & 1);-- double src_width = src->width() - yuvLeftOffset;- double src_height = src->height() - yuvTopOffset;-- if (src_width > image->w || src_height > image->h) {- double scale = std::min(image->w / src_width, image->h / src_height);- double dst_width = src_width * scale;- if (dst_width > image->w) {- src_width *= image->w / dst_width;- dst_width = image->w;- }- double dst_height = src_height * scale;- if (dst_height > image->h) {- src_height *= image->h / dst_height;- dst_height = image->h;- }- libyuv::I420Scale(src->DataY() + yuvTopOffset * src->StrideY() + yuvLeftOffset, src->StrideY(),- src->DataU() + (yuvTopOffset * src->StrideU() + yuvLeftOffset) / 2, src->StrideU(),- src->DataV() + (yuvTopOffset * src->StrideV() + yuvLeftOffset) / 2, src->StrideV(),- src_width, src_height,- y_data, y_stride,- u_data, uv_stride,- v_data, uv_stride,- dst_width, dst_height,- libyuv::kFilterBilinear);- } else {- int width = std::min<int>(image->w, src_width);- int height = std::min<int>(image->h, src_height);-- libyuv::I420Copy(src->DataY() + yuvTopOffset * src->StrideY() + yuvLeftOffset, src->StrideY(),- src->DataU() + (yuvTopOffset * src->StrideU() + yuvLeftOffset) / 2, src->StrideU(),- src->DataV() + (yuvTopOffset * src->StrideV() + yuvLeftOffset) / 2, src->StrideV(),- y_data, y_stride,- u_data, uv_stride,- v_data, uv_stride,- width, height);- }- }--private:- webrtc::scoped_refptr<webrtc::VideoFrameBuffer> m_frameBuffer;- gfx::IntMargin m_margin;- TimeDuration m_duration;-};---class ScreencastEncoder::VPXCodec {-public:- VPXCodec(ScopedVpxCodec codec, vpx_codec_enc_cfg_t cfg, FILE* file)- : m_codec(std::move(codec))- , m_cfg(cfg)- , m_file(file)- , m_writer(new WebMFileWriter(file, &m_cfg))- {- nsresult rv = NS_NewNamedThread("Screencast enc", getter_AddRefs(m_encoderQueue));- if (rv != NS_OK) {- fprintf(stderr, "ScreencastEncoder::VPXCodec failed to spawn thread %d\n", rv);- return;- }-- createImage(cfg.g_w, cfg.g_h, m_image, m_imageBuffer, m_imageBufferSize);- }-- ~VPXCodec() {- m_encoderQueue->Shutdown();- m_encoderQueue = nullptr;- }-- void encodeFrameAsync(std::unique_ptr<VPXFrame>&& frame)- {- m_encoderQueue->Dispatch(NS_NewRunnableFunction("VPXCodec::encodeFrameAsync", [this, frame = std::move(frame)] {- memset(m_imageBuffer.get(), 128, m_imageBufferSize);- frame->convertToVpxImage(m_image.get());-- double frameCount = frame->duration().ToSeconds() * fps;- // For long duration repeat frame at 1 fps to ensure last frame duration is short enough.- // TODO: figure out why simply passing duration doesn't work well.- for (;frameCount > 1.5; frameCount -= 1) {- encodeFrame(m_image.get(), timeScale);- }- encodeFrame(m_image.get(), std::max<int>(1, frameCount * timeScale));- }));- }-- void finishAsync(std::function<void()>&& callback)- {- m_encoderQueue->Dispatch(NS_NewRunnableFunction("VPXCodec::finishAsync", [this, callback = std::move(callback)] {- finish();- callback();- }));- }--private:- bool encodeFrame(vpx_image_t *img, int duration)- {- vpx_codec_iter_t iter = nullptr;- const vpx_codec_cx_pkt_t *pkt = nullptr;- int flags = 0;- const vpx_codec_err_t res = vpx_codec_encode(m_codec.get(), img, m_pts, duration, flags, VPX_DL_REALTIME);- if (res != VPX_CODEC_OK) {- fprintf(stderr, "Failed to encode frame: %s\n", vpx_codec_error(m_codec.get()));- return false;- }-- bool gotPkts = false;- while ((pkt = vpx_codec_get_cx_data(m_codec.get(), &iter)) != nullptr) {- gotPkts = true;-- if (pkt->kind == VPX_CODEC_CX_FRAME_PKT) {- m_writer->writeFrame(pkt);- ++m_frameCount;- // fprintf(stderr, " #%03d %spts=%" PRId64 " sz=%zd\n", m_frameCount, (pkt->data.frame.flags & VPX_FRAME_IS_KEY) != 0 ? "[K] " : "", pkt->data.frame.pts, pkt->data.frame.sz);- m_pts += pkt->data.frame.duration;- }- }-- return gotPkts;- }-- void finish()- {- // Flush encoder.- while (encodeFrame(nullptr, 1))- ++m_frameCount;-- m_writer->finish();- fclose(m_file);- // fprintf(stderr, "ScreencastEncoder::finish %d frames\n", m_frameCount);- }-- RefPtr<nsIThread> m_encoderQueue;- ScopedVpxCodec m_codec;- vpx_codec_enc_cfg_t m_cfg;- FILE* m_file { nullptr };- std::unique_ptr<WebMFileWriter> m_writer;- int m_frameCount { 0 };- int64_t m_pts { 0 };- std::unique_ptr<uint8_t[]> m_imageBuffer;- int m_imageBufferSize { 0 };- std::unique_ptr<vpx_image_t> m_image;-};--ScreencastEncoder::ScreencastEncoder(std::unique_ptr<VPXCodec> vpxCodec, const gfx::IntMargin& margin)- : m_vpxCodec(std::move(vpxCodec))- , m_margin(margin)-{-}--ScreencastEncoder::~ScreencastEncoder()-{-}--std::unique_ptr<ScreencastEncoder> ScreencastEncoder::create(nsCString& errorString, const nsCString& filePath, int width, int height, const gfx::IntMargin& margin)-{- vpx_codec_iface_t* codec_interface = vpx_codec_vp8_cx();- if (!codec_interface) {- errorString = "Codec not found.";- return nullptr;- }-- if (width <= 0 || height <= 0 || (width % 2) != 0 || (height % 2) != 0) {- errorString.AppendPrintf("Invalid frame size: %dx%d", width, height);- return nullptr;- }-- vpx_codec_enc_cfg_t cfg;- memset(&cfg, 0, sizeof(cfg));- vpx_codec_err_t error = vpx_codec_enc_config_default(codec_interface, &cfg, 0);- if (error) {- errorString.AppendPrintf("Failed to get default codec config: %s", vpx_codec_err_to_string(error));- return nullptr;- }-- cfg.g_w = width;- cfg.g_h = height;- cfg.g_timebase.num = 1;- cfg.g_timebase.den = fps * timeScale;- cfg.g_error_resilient = VPX_ERROR_RESILIENT_DEFAULT;-- ScopedVpxCodec codec(new vpx_codec_ctx_t);- if (vpx_codec_enc_init(codec.get(), codec_interface, &cfg, 0)) {- errorString.AppendPrintf("Failed to initialize encoder: %s", vpx_codec_error(codec.get()));- return nullptr;- }-- FILE* file = fopen(filePath.get(), "wb");- if (!file) {- errorString.AppendPrintf("Failed to open file '%s' for writing: %s", filePath.get(), strerror(errno));- return nullptr;- }-- std::unique_ptr<VPXCodec> vpxCodec(new VPXCodec(std::move(codec), cfg, file));- // fprintf(stderr, "ScreencastEncoder initialized with: %s\n", vpx_codec_iface_name(codec_interface));- return std::make_unique<ScreencastEncoder>(std::move(vpxCodec), margin);-}--void ScreencastEncoder::flushLastFrame()-{- TimeStamp now = TimeStamp::Now();- if (m_lastFrameTimestamp) {- // If previous frame encoding failed for some rason leave the timestampt intact.- if (!m_lastFrame)- return;-- m_lastFrame->setDuration(now - m_lastFrameTimestamp);- m_vpxCodec->encodeFrameAsync(std::move(m_lastFrame));- }- m_lastFrameTimestamp = now;-}--void ScreencastEncoder::encodeFrame(const webrtc::VideoFrame& videoFrame)-{- // fprintf(stderr, "ScreencastEncoder::encodeFrame\n");- flushLastFrame();-- m_lastFrame = std::make_unique<VPXFrame>(videoFrame.video_frame_buffer(), m_margin);-}--void ScreencastEncoder::finish(std::function<void()>&& callback)-{- if (!m_vpxCodec) {- callback();- return;- }-- flushLastFrame();- m_vpxCodec->finishAsync([callback = std::move(callback)] () mutable {- NS_DispatchToMainThread(NS_NewRunnableFunction("ScreencastEncoder::finish callback", std::move(callback)));- });-}---} // namespace mozilladiff --git a/browser_patches/firefox/juggler/screencast/ScreencastEncoder.h b/browser_patches/firefox/juggler/screencast/ScreencastEncoder.hdeleted file mode 100644index 883ad01011..0000000000--- a/browser_patches/firefox/juggler/screencast/ScreencastEncoder.h+++ /dev/null@@ -1,45 +0,0 @@-/* This Source Code Form is subject to the terms of the Mozilla Public- * License, v. 2.0. If a copy of the MPL was not distributed with this- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */--#pragma once--#include <functional>-#include <memory>-#include "mozilla/gfx/Rect.h"-#include "mozilla/Maybe.h"-#include "mozilla/TimeStamp.h"-#include "nsISupportsImpl.h"-#include "nsStringFwd.h"--namespace webrtc {-class VideoFrame;-}--namespace mozilla {--class ScreencastEncoder {-public:- static constexpr int fps = 25;-- static std::unique_ptr<ScreencastEncoder> create(nsCString& errorString, const nsCString& filePath, int width, int height, const gfx::IntMargin& margin);-- class VPXCodec;- ScreencastEncoder(std::unique_ptr<VPXCodec>, const gfx::IntMargin& margin);- ~ScreencastEncoder();-- void encodeFrame(const webrtc::VideoFrame& videoFrame);-- void finish(std::function<void()>&& callback);--private:- void flushLastFrame();-- std::unique_ptr<VPXCodec> m_vpxCodec;- gfx::IntMargin m_margin;- TimeStamp m_lastFrameTimestamp;- class VPXFrame;- std::unique_ptr<VPXFrame> m_lastFrame;-};--} // namespace mozilladiff --git a/browser_patches/firefox/juggler/screencast/WebMFileWriter.cpp b/browser_patches/firefox/juggler/screencast/WebMFileWriter.cppdeleted file mode 100644index f720b300f2..0000000000--- a/browser_patches/firefox/juggler/screencast/WebMFileWriter.cpp+++ /dev/null@@ -1,50 +0,0 @@-/*- * Copyright (c) 2014 The WebM project authors. All Rights Reserved.- */--/* This Source Code Form is subject to the terms of the Mozilla Public- * License, v. 2.0. If a copy of the MPL was not distributed with this- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */--#include "WebMFileWriter.h"--#include <string>-#include "mkvmuxer/mkvmuxerutil.h"--namespace mozilla {--WebMFileWriter::WebMFileWriter(FILE* file, vpx_codec_enc_cfg_t* cfg)- : m_cfg(cfg)- , m_writer(new mkvmuxer::MkvWriter(file))- , m_segment(new mkvmuxer::Segment()) {- m_segment->Init(m_writer.get());- m_segment->set_mode(mkvmuxer::Segment::kFile);- m_segment->OutputCues(true);-- mkvmuxer::SegmentInfo* info = m_segment->GetSegmentInfo();- std::string version = "Playwright " + std::string(vpx_codec_version_str());- info->set_writing_app(version.c_str());-- // Add vp8 track.- m_videoTrackId = m_segment->AddVideoTrack(- static_cast<int>(m_cfg->g_w), static_cast<int>(m_cfg->g_h), 0);- if (!m_videoTrackId) {- fprintf(stderr, "Failed to add video track\n");- }-}--WebMFileWriter::~WebMFileWriter() {}--void WebMFileWriter::writeFrame(const vpx_codec_cx_pkt_t* pkt) {- int64_t pts_ns = pkt->data.frame.pts * 1000000000ll * m_cfg->g_timebase.num /- m_cfg->g_timebase.den;- m_segment->AddFrame(static_cast<uint8_t*>(pkt->data.frame.buf),- pkt->data.frame.sz, m_videoTrackId, pts_ns,- pkt->data.frame.flags & VPX_FRAME_IS_KEY);-}--void WebMFileWriter::finish() {- m_segment->Finalize();-}--} // namespace mozilladiff --git a/browser_patches/firefox/juggler/screencast/WebMFileWriter.h b/browser_patches/firefox/juggler/screencast/WebMFileWriter.hdeleted file mode 100644index 4a7fd06e6c..0000000000--- a/browser_patches/firefox/juggler/screencast/WebMFileWriter.h+++ /dev/null@@ -1,32 +0,0 @@-/* This Source Code Form is subject to the terms of the Mozilla Public- * License, v. 2.0. If a copy of the MPL was not distributed with this- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */--#pragma once--#include <memory>-#include <stdio.h>-#include <stdlib.h>-#include "vpx/vpx_encoder.h"--#include "mkvmuxer/mkvmuxer.h"-#include "mkvmuxer/mkvwriter.h"--namespace mozilla {--class WebMFileWriter {-public:- WebMFileWriter(FILE*, vpx_codec_enc_cfg_t* cfg);- ~WebMFileWriter();-- void writeFrame(const vpx_codec_cx_pkt_t* pkt);- void finish();--private:- vpx_codec_enc_cfg_t* m_cfg = nullptr;- std::unique_ptr<mkvmuxer::MkvWriter> m_writer;- std::unique_ptr<mkvmuxer::Segment> m_segment;- uint64_t m_videoTrackId = 0;-};--} // namespace mozilladiff --git a/browser_patches/firefox/juggler/screencast/moz.build b/browser_patches/firefox/juggler/screencast/moz.buildindex 2d51827214..8a2d00ca23 100644--- a/browser_patches/firefox/juggler/screencast/moz.build+++ b/browser_patches/firefox/juggler/screencast/moz.build@@ -13,7 +13,6 @@ XPIDL_MODULE = 'jugglerscreencast'SOURCES += ['HeadlessWindowCapturer.cpp','nsScreencastService.cpp',- 'ScreencastEncoder.cpp',]XPCOM_MANIFESTS += [@@ -33,17 +32,6 @@ LOCAL_INCLUDES += ['/widget/headless',]-LOCAL_INCLUDES += [- '/third_party/aom/third_party/libwebm',-]--SOURCES += [- '/third_party/aom/third_party/libwebm/mkvmuxer/mkvmuxer.cc',- '/third_party/aom/third_party/libwebm/mkvmuxer/mkvmuxerutil.cc',- '/third_party/aom/third_party/libwebm/mkvmuxer/mkvwriter.cc',- 'WebMFileWriter.cpp',-]-include('/dom/media/webrtc/third_party_build/webrtc.mozbuild')include('/ipc/chromium/chromium-config.mozbuild')diff --git a/browser_patches/firefox/juggler/screencast/nsIScreencastService.idl b/browser_patches/firefox/juggler/screencast/nsIScreencastService.idlindex 0fb00d58d1..d764e03008 100644--- a/browser_patches/firefox/juggler/screencast/nsIScreencastService.idl+++ b/browser_patches/firefox/juggler/screencast/nsIScreencastService.idl@@ -10,8 +10,6 @@ interface nsIDocShell;interface nsIScreencastServiceClient : nsISupports{void screencastFrame(in AString frame, in uint32_t deviceWidth, in uint32_t deviceHeight, in double timestamp);-- void screencastStopped();};/**@@ -20,12 +18,12 @@ interface nsIScreencastServiceClient : nsISupports[scriptable, uuid(d8c4d9e0-9462-445e-9e43-68d3872ad1de)]interface nsIScreencastService : nsISupports{- AString startVideoRecording(in nsIScreencastServiceClient client, in nsIDocShell docShell, in boolean isVideo, in ACString fileName, in uint32_t width, in uint32_t height, in uint32_t quality, in uint32_t viewportWidth, in uint32_t viewportHeight, in uint32_t offset_top);+ AString startScreencast(in nsIScreencastServiceClient client, in nsIDocShell docShell, in uint32_t width, in uint32_t height, in uint32_t quality, in uint32_t viewportWidth, in uint32_t viewportHeight, in uint32_t offset_top);/*** Will emit 'juggler-screencast-stopped' when the video file is saved.*/- void stopVideoRecording(in AString sessionId);+ void stopScreencast(in AString sessionId);void screencastFrameAck(in AString sessionId);};diff --git a/browser_patches/firefox/juggler/screencast/nsScreencastService.cpp b/browser_patches/firefox/juggler/screencast/nsScreencastService.cppindex 0da87e83eb..3e61e71a29 100644--- a/browser_patches/firefox/juggler/screencast/nsScreencastService.cpp+++ b/browser_patches/firefox/juggler/screencast/nsScreencastService.cpp@@ -5,7 +5,6 @@#include "nsScreencastService.h"#include "gfxPlatform.h"-#include "ScreencastEncoder.h"#include "HeadlessWidget.h"#include "HeadlessWindowCapturer.h"#include "mozilla/Base64.h"@@ -17,8 +16,7 @@#include "nsIRandomGenerator.h"#include "nsISupportsPrimitives.h"#include "nsThreadManager.h"-#include "nsView.h"-#include "nsViewManager.h"+#include "mozilla/PresShellWidgetListener.h"#include "modules/desktop_capture/desktop_capturer.h"#include "modules/desktop_capture/desktop_capture_options.h"#include "modules/desktop_capture/desktop_frame.h"@@ -79,13 +77,11 @@ nsresult generateUid(nsString& uid) {}}-class nsScreencastService::Session : public webrtc::VideoSinkInterface<webrtc::VideoFrame>,- public webrtc::RawFrameCallback {+class nsScreencastService::Session : public webrtc::RawFrameCallback {Session(nsIScreencastServiceClient* client,nsIWidget* widget,webrtc::scoped_refptr<webrtc::VideoCaptureModuleEx>&& capturer,- std::unique_ptr<ScreencastEncoder> encoder,int width, int height,int viewportWidth, int viewportHeight,gfx::IntMargin margin,@@ -93,7 +89,6 @@ class nsScreencastService::Session : public webrtc::VideoSinkInterface<webrtc::V: mClient(client), mWidget(widget), mCaptureModule(std::move(capturer))- , mEncoder(std::move(encoder)), mJpegQuality(jpegQuality), mWidth(width), mHeight(height)@@ -109,12 +104,11 @@ class nsScreencastService::Session : public webrtc::VideoSinkInterface<webrtc::VnsIScreencastServiceClient* client,nsIWidget* widget,webrtc::scoped_refptr<webrtc::VideoCaptureModuleEx>&& capturer,- std::unique_ptr<ScreencastEncoder> encoder,int width, int height,int viewportWidth, int viewportHeight,gfx::IntMargin margin,uint32_t jpegQuality) {- return do_AddRef(new Session(client, widget, std::move(capturer), std::move(encoder), width, height, viewportWidth, viewportHeight, margin, jpegQuality));+ return do_AddRef(new Session(client, widget, std::move(capturer), width, height, viewportWidth, viewportHeight, margin, jpegQuality));}webrtc::scoped_refptr<webrtc::VideoCaptureModuleEx> ReuseCapturer(nsIWidget* widget) {@@ -128,7 +122,7 @@ class nsScreencastService::Session : public webrtc::VideoSinkInterface<webrtc::V// The size is ignored in fact.capability.width = 1280;capability.height = 960;- capability.maxFPS = ScreencastEncoder::fps;+ capability.maxFPS = 25;capability.videoType = webrtc::VideoType::kI420;int error = mCaptureModule->StartCaptureCounted(capability);if (error) {@@ -136,10 +130,7 @@ class nsScreencastService::Session : public webrtc::VideoSinkInterface<webrtc::Vreturn false;}- if (mEncoder)- mCaptureModule->RegisterCaptureDataCallback(this);- else- mCaptureModule->RegisterRawFrameCallback(this);+ mCaptureModule->RegisterRawFrameCallback(this);return true;}@@ -149,21 +140,8 @@ class nsScreencastService::Session : public webrtc::VideoSinkInterface<webrtc::Vreturn;}mStopped = true;- if (mEncoder)- mCaptureModule->DeRegisterCaptureDataCallback(this);- else- mCaptureModule->DeRegisterRawFrameCallback(this);+ mCaptureModule->DeRegisterRawFrameCallback(this);mCaptureModule->StopCaptureCounted();- if (mEncoder) {- mEncoder->finish([this, protect = RefPtr{this}] {- NS_DispatchToMainThread(NS_NewRunnableFunction(- "NotifyScreencastStopped", [this, protect = std::move(protect)]() -> void {- mClient->ScreencastStopped();- }));- });- } else {- mClient->ScreencastStopped();- }}void ScreencastFrameAck() {@@ -174,12 +152,6 @@ class nsScreencastService::Session : public webrtc::VideoSinkInterface<webrtc::VmFramesInFlight.fetch_sub(1);}- // These callbacks end up running on the VideoCapture thread.- void OnFrame(const webrtc::VideoFrame& videoFrame) override {- if (!mEncoder)- return;- mEncoder->encodeFrame(videoFrame);- }// These callbacks end up running on the VideoCapture thread.void OnRawFrame(uint8_t* videoFrame, size_t videoFrameStride, const webrtc::VideoCaptureCapability& frameInfo) override {@@ -200,7 +172,7 @@ class nsScreencastService::Session : public webrtc::VideoSinkInterface<webrtc::Vdouble timestamp = (TimeStamp::Now() - TimeStamp::ProcessCreation()).ToSeconds();int screenshotWidth = pageWidth;int screenshotHeight = pageHeight;- int screenshotTopMargin = mMargin.TopBottom();+ int screenshotTopMargin = mMargin.top;std::unique_ptr<uint8_t[]> canvas;uint8_t* canvasPtr = videoFrame;int canvasStride = videoFrameStride;@@ -291,7 +263,6 @@ class nsScreencastService::Session : public webrtc::VideoSinkInterface<webrtc::VRefPtr<nsIScreencastServiceClient> mClient;nsIWidget* mWidget;webrtc::scoped_refptr<webrtc::VideoCaptureModuleEx> mCaptureModule;- std::unique_ptr<ScreencastEncoder> mEncoder;uint32_t mJpegQuality;bool mStopped = false;std::atomic<uint32_t> mFramesInFlight = 0;@@ -319,19 +290,16 @@ nsScreencastService::nsScreencastService() = default;nsScreencastService::~nsScreencastService() {}-nsresult nsScreencastService::StartVideoRecording(nsIScreencastServiceClient* aClient, nsIDocShell* aDocShell, bool isVideo, const nsACString& aVideoFileName, uint32_t width, uint32_t height, uint32_t quality, uint32_t viewportWidth, uint32_t viewportHeight, uint32_t offsetTop, nsAString& sessionId) {+nsresult nsScreencastService::StartScreencast(nsIScreencastServiceClient* aClient, nsIDocShell* aDocShell, uint32_t width, uint32_t height, uint32_t quality, uint32_t viewportWidth, uint32_t viewportHeight, uint32_t offsetTop, nsAString& sessionId) {MOZ_RELEASE_ASSERT(NS_IsMainThread(), "Screencast service must be started on the Main thread.");PresShell* presShell = aDocShell->GetPresShell();if (!presShell)return NS_ERROR_UNEXPECTED;- nsViewManager* viewManager = presShell->GetViewManager();- if (!viewManager)- return NS_ERROR_UNEXPECTED;- nsView* view = viewManager->GetRootView();- if (!view)+ PresShellWidgetListener* widgetListener = presShell->GetWidgetListener();+ if (!widgetListener)return NS_ERROR_UNEXPECTED;- nsIWidget* widget = view->GetWidget();+ nsIWidget* widget = widgetListener->GetWidget();webrtc::scoped_refptr<webrtc::VideoCaptureModuleEx> capturer = nullptr;for (auto& it : mIdToSession) {@@ -345,6 +313,9 @@ nsresult nsScreencastService::StartVideoRecording(nsIScreencastServiceClient* aCreturn NS_ERROR_FAILURE;gfx::IntMargin margin;+ // On Windows the captured frame size is different the window screen size,+ // so we don't try to compute the frame margin.+#if !defined(WIN32)// Screen bounds is the widget location on screen.auto screenBounds = widget->GetScreenBounds().ToUnknownRect();// Client bounds is the content location, in terms of parent widget.@@ -356,32 +327,23 @@ nsresult nsScreencastService::StartVideoRecording(nsIScreencastServiceClient* aC}// Crop the image to exclude frame (if any).margin = screenBounds - clientBounds;+#endif// Crop the image to exclude controls.margin.top += offsetTop;- nsCString error;- std::unique_ptr<ScreencastEncoder> encoder;- if (isVideo) {- encoder = ScreencastEncoder::create(error, PromiseFlatCString(aVideoFileName), width, height, margin);- if (!encoder) {- fprintf(stderr, "Failed to create ScreencastEncoder: %s\n", error.get());- return NS_ERROR_FAILURE;- }- }-nsString uid;nsresult rv = generateUid(uid);NS_ENSURE_SUCCESS(rv, rv);sessionId = uid;- auto session = Session::Create(aClient, widget, std::move(capturer), std::move(encoder), width, height, viewportWidth, viewportHeight, margin, isVideo ? 0 : quality);+ auto session = Session::Create(aClient, widget, std::move(capturer), width, height, viewportWidth, viewportHeight, margin, quality);if (!session->Start())return NS_ERROR_FAILURE;mIdToSession.emplace(sessionId, std::move(session));return NS_OK;}-nsresult nsScreencastService::StopVideoRecording(const nsAString& aSessionId) {+nsresult nsScreencastService::StopScreencast(const nsAString& aSessionId) {nsString sessionId(aSessionId);auto it = mIdToSession.find(sessionId);if (it == mIdToSession.end())diff --git a/browser_patches/firefox/patches/bootstrap.diff b/browser_patches/firefox/patches/bootstrap.diffindex 520656ae18..f273772e72 100644--- a/browser_patches/firefox/patches/bootstrap.diff+++ b/browser_patches/firefox/patches/bootstrap.diff@@ -1,16 +1,16 @@diff --git a/browser/app/winlauncher/LauncherProcessWin.cpp b/browser/app/winlauncher/LauncherProcessWin.cpp-index 9c991f1dd24e1e00d9073d3acaa21275be133ff2..d2ffc70ae4a3ab5a56cd660b1723bf90ae3df13b 100644+index 2d77838b90601a71d6789e9ff3064cf24ddbde7e..9199ef1e8cb5d7988b98e119b68be38dbfd5f3b0 100644--- a/browser/app/winlauncher/LauncherProcessWin.cpp+++ b/browser/app/winlauncher/LauncherProcessWin.cpp-@@ -23,6 +23,7 @@+@@ -22,6 +22,7 @@#include "mozilla/WinHeaderOnlyUtils.h"#include "nsWindowsHelpers.h"+#include <io.h>#include <windows.h>#include <processthreadsapi.h>--@@ -414,8 +415,18 @@ Maybe<int> LauncherMain(int& argc, wchar_t* argv[]) {+ #include <shlwapi.h>+@@ -468,8 +469,18 @@ Maybe<int> LauncherMain(int& argc, wchar_t* argv[]) {HANDLE stdHandles[] = {::GetStdHandle(STD_INPUT_HANDLE),::GetStdHandle(STD_OUTPUT_HANDLE),::GetStdHandle(STD_ERROR_HANDLE)};@@ -48,10 +48,10 @@ index 0e195e47d97b05caedeab65679e8e32a501ac629..d7ecbe4648684e9afa368c63da7795aebrowser/chrome/browser/content/activity-stream/data/content/tippytop/favicons/allegro-pl.icobrowser/defaults/settings/main/search-config-icons/96327a73-c433-5eb4-a16d-b090cadfb80bdiff --git a/browser/installer/package-manifest.in b/browser/installer/package-manifest.in-index bb06e9224a4e195122d8a47ccf97c3481342cf86..2dee940107ee17eca548ce15bd745450b9698ecf 100644+index dbfb287747ed9059cfb46838800421ac9ffe78c1..3e9ce7c6405578c900d0f13755db1db3f50e8f3f 100644--- a/browser/installer/package-manifest.in+++ b/browser/installer/package-manifest.in-@@ -194,6 +194,9 @@+@@ -196,6 +196,9 @@@RESPATH@/chrome/remote.manifest#endif@@ -62,10 +62,10 @@ index bb06e9224a4e195122d8a47ccf97c3481342cf86..2dee940107ee17eca548ce15bd745450@RESPATH@/browser/modules/*@RESPATH@/modules/*diff --git a/devtools/server/socket/websocket-server.js b/devtools/server/socket/websocket-server.js-index d49c6fbf1bf83b832795fa674f6b41f223eef812..7ea3540947ff5f61b15f27fbf4b955649f8e9ff9 100644+index 257e87fe0c618684eb4216c8028ac886ef2d5562..8c13f020100dad9bc4e093d50bd3a1f95bcea982 100644--- a/devtools/server/socket/websocket-server.js+++ b/devtools/server/socket/websocket-server.js-@@ -134,13 +134,12 @@ function writeHttpResponse(output, response) {+@@ -135,13 +135,12 @@ function writeHttpResponse(output, response) {* Process the WebSocket handshake headers and return the key to be sent in* Sec-WebSocket-Accept response header.*/@@ -81,7 +81,7 @@ index d49c6fbf1bf83b832795fa674f6b41f223eef812..7ea3540947ff5f61b15f27fbf4b95564throw new Error("The handshake request has unknown path");}-@@ -190,13 +189,13 @@ function computeKey(key) {+@@ -191,13 +190,13 @@ function computeKey(key) {/*** Perform the server part of a WebSocket opening handshake on an incoming connection.*/@@ -97,7 +97,7 @@ index d49c6fbf1bf83b832795fa674f6b41f223eef812..7ea3540947ff5f61b15f27fbf4b95564// Send response headersawait writeHttpResponse(output, [-@@ -218,8 +217,8 @@ const serverHandshake = async function (input, output) {+@@ -219,8 +218,8 @@ const serverHandshake = async function (input, output) {* Performs the WebSocket handshake and waits for the WebSocket to open.* Returns Promise with a WebSocket ready to send and receive messages.*/@@ -109,10 +109,10 @@ index d49c6fbf1bf83b832795fa674f6b41f223eef812..7ea3540947ff5f61b15f27fbf4b95564const transportProvider = {setListener(upgradeListener) {diff --git a/docshell/base/BrowsingContext.cpp b/docshell/base/BrowsingContext.cpp-index 9140f33a8021db167530eb199d8b2ba41fc2532b..2068d8a35d33385532e9a5a795fbaabc22147efd 100644+index 663b8d827f37671044cdf799abe4842f50dc3fc1..d44d4a6e874838920ceaeacbaeb458219322f37e 100644--- a/docshell/base/BrowsingContext.cpp+++ b/docshell/base/BrowsingContext.cpp-@@ -117,8 +117,15 @@ struct ParamTraits<mozilla::dom::DisplayMode>+@@ -116,8 +116,15 @@ struct ParamTraits<mozilla::dom::DisplayMode>template <>struct ParamTraits<mozilla::dom::PrefersColorSchemeOverride>@@ -130,7 +130,7 @@ index 9140f33a8021db167530eb199d8b2ba41fc2532b..2068d8a35d33385532e9a5a795fbaabctemplate <>struct ParamTraits<mozilla::dom::ForcedColorsOverride>-@@ -3337,6 +3344,32 @@ void BrowsingContext::DidSet(FieldIndex<IDX_LanguageOverride>,+@@ -3324,6 +3331,32 @@ void BrowsingContext::DidSet(FieldIndex<IDX_LanguageOverride>,});}@@ -163,7 +163,7 @@ index 9140f33a8021db167530eb199d8b2ba41fc2532b..2068d8a35d33385532e9a5a795fbaabcvoid BrowsingContext::DidSet(FieldIndex<IDX_MediumOverride>,nsString&& aOldValue) {MOZ_ASSERT(IsTop());-@@ -3684,7 +3717,7 @@ void BrowsingContext::SetGeolocationServiceOverride(+@@ -3671,7 +3704,7 @@ void BrowsingContext::SetGeolocationServiceOverride(if (aGeolocationOverride.WasPassed()) {if (!mGeolocationServiceOverride) {mGeolocationServiceOverride = new nsGeolocationService();@@ -172,36 +172,12 @@ index 9140f33a8021db167530eb199d8b2ba41fc2532b..2068d8a35d33385532e9a5a795fbaabc}mGeolocationServiceOverride->Update(aGeolocationOverride.Value());} else if (RefPtr<nsGeolocationService> serviceOverride =-@@ -4209,6 +4242,23 @@ void BrowsingContext::DidSet(FieldIndex<IDX_IsUnderHiddenEmbedderElement>,- }- }--+void BrowsingContext::DidSet(FieldIndex<IDX_ForceOffline>, bool aOldValue) {-+ const bool newValue = ForceOffline();-+ if (newValue == aOldValue) {-+ return;-+ }-+ PreOrderWalk([&](BrowsingContext* aContext) {-+ if (Document* doc = aContext->GetDocument()) {-+ if (nsPIDOMWindowOuter* win = aContext->GetDOMWindow()) {-+ nsContentUtils::DispatchTrustedEvent(-+ doc, nsGlobalWindowOuter::Cast(win),-+ newValue ? u"offline"_ns : u"online"_ns,-+ CanBubble::eYes, Cancelable::eYes, nullptr);-+ }-+ }-+ });-+}-+- bool BrowsingContext::IsPopupAllowed() {- for (auto* context = GetCurrentWindowContext(); context;- context = context->GetParentWindowContext()) {diff --git a/docshell/base/BrowsingContext.h b/docshell/base/BrowsingContext.h-index 2d3a14d59922045197e474f5d097d7e16ce6ad8c..a35557768e7ef980384595711aa1df6d8c27bbd0 100644+index 42e3b22a366db0a8c470b458696d81e4bdbd537c..72d37a4a6ff183c11a493794a44ef9420056e728 100644--- a/docshell/base/BrowsingContext.h+++ b/docshell/base/BrowsingContext.h-@@ -206,11 +206,11 @@ struct EmbedderColorSchemes {- FIELD(GVInaudibleAutoplayRequestStatus, GVAutoplayRequestStatus) \+@@ -212,11 +212,11 @@ struct EmbedderColorSchemes {+ FIELD(HasScreenAreaOverride, bool) \/* ScreenOrientation-related APIs */ \FIELD(CurrentOrientationAngle, float) \- FIELD(CurrentOrientationType, mozilla::dom::OrientationType) \@@ -214,7 +190,7 @@ index 2d3a14d59922045197e474f5d097d7e16ce6ad8c..a35557768e7ef980384595711aa1df6dFIELD(EmbedderElementType, Maybe<nsString>) \FIELD(MessageManagerGroup, nsString) \FIELD(MaxTouchPointsOverride, uint8_t) \-@@ -251,6 +251,9 @@ struct EmbedderColorSchemes {+@@ -257,6 +257,9 @@ struct EmbedderColorSchemes {* <browser> embedder element. */ \FIELD(EmbedderColorSchemes, EmbedderColorSchemes) \FIELD(DisplayMode, dom::DisplayMode) \@@ -224,7 +200,7 @@ index 2d3a14d59922045197e474f5d097d7e16ce6ad8c..a35557768e7ef980384595711aa1df6d/* The number of entries added to the session history because of this \* browsing context. */ \FIELD(HistoryEntryCount, uint32_t) \-@@ -1041,6 +1044,14 @@ class BrowsingContext : public nsILoadContext, public nsWrapperCache {+@@ -1097,6 +1100,14 @@ class BrowsingContext : public nsILoadContext, public nsWrapperCache {return GetForcedColorsOverride();}@@ -239,7 +215,7 @@ index 2d3a14d59922045197e474f5d097d7e16ce6ad8c..a35557768e7ef980384595711aa1df6dbool IsInBFCache() const;bool AllowJavascript() const { return GetAllowJavascript(); }-@@ -1220,6 +1231,11 @@ class BrowsingContext : public nsILoadContext, public nsWrapperCache {+@@ -1278,6 +1289,11 @@ class BrowsingContext : public nsILoadContext, public nsWrapperCache {return IsTop();}@@ -251,7 +227,7 @@ index 2d3a14d59922045197e474f5d097d7e16ce6ad8c..a35557768e7ef980384595711aa1df6dbool CanSet(FieldIndex<IDX_ForcedColorsOverride>, dom::ForcedColorsOverride,ContentParent*) {return IsTop();-@@ -1239,6 +1255,9 @@ class BrowsingContext : public nsILoadContext, public nsWrapperCache {+@@ -1297,6 +1313,9 @@ class BrowsingContext : public nsILoadContext, public nsWrapperCache {void DidSet(FieldIndex<IDX_ForcedColorsOverride>,dom::ForcedColorsOverride aOldValue);@@ -261,7 +237,7 @@ index 2d3a14d59922045197e474f5d097d7e16ce6ad8c..a35557768e7ef980384595711aa1df6dtemplate <typename Callback>void WalkPresContexts(Callback&&);void PresContextAffectingFieldChanged();-@@ -1247,6 +1266,15 @@ class BrowsingContext : public nsILoadContext, public nsWrapperCache {+@@ -1305,6 +1324,15 @@ class BrowsingContext : public nsILoadContext, public nsWrapperCache {void DidSet(FieldIndex<IDX_TimezoneOverride>, nsString&& aOldValue);@@ -277,30 +253,21 @@ index 2d3a14d59922045197e474f5d097d7e16ce6ad8c..a35557768e7ef980384595711aa1df6dvoid DidSet(FieldIndex<IDX_MediumOverride>, nsString&& aOldValue);bool CanSet(FieldIndex<IDX_SuspendMediaWhenInactive>, bool, ContentParent*) {-@@ -1437,6 +1465,8 @@ class BrowsingContext : public nsILoadContext, public nsWrapperCache {-- void DidSet(FieldIndex<IDX_IsUnderHiddenEmbedderElement>, bool aOldValue);--+ void DidSet(FieldIndex<IDX_ForceOffline>, bool aOldValue);-+- // Allow if the process attemping to set field is the same as the owning- // process. Deprecated. New code that might use this should generally be moved- // to WindowContext or be settable only by the parent process.diff --git a/docshell/base/CanonicalBrowsingContext.cpp b/docshell/base/CanonicalBrowsingContext.cpp-index 89dcc881f3dafe2a67321e2ee9d6347905bde4f6..a9e52c060826a5846a743e4ad960670d0093f668 100644+index fcebff1e344083e6261ad728c97d8b10434cf8d2..d01513cfa30dc74954ea38bcceda6dc100b44194 100644--- a/docshell/base/CanonicalBrowsingContext.cpp+++ b/docshell/base/CanonicalBrowsingContext.cpp-@@ -271,6 +271,8 @@ void CanonicalBrowsingContext::ReplacedBy(- txn.SetForceOffline(GetForceOffline());+@@ -272,6 +272,8 @@ void CanonicalBrowsingContext::ReplacedBy(txn.SetTopInnerSizeForRFP(GetTopInnerSizeForRFP());txn.SetIPAddressSpace(GetIPAddressSpace());+ txn.SetParentalControlsEnabled(GetParentalControlsEnabled());+ txn.SetPrefersReducedMotionOverride(GetPrefersReducedMotionOverride());+ txn.SetForcedColorsOverride(GetForcedColorsOverride());if (!GetLanguageOverride().IsEmpty()) {// Reapply language override to update the corresponding realm.-@@ -1892,6 +1894,12 @@ void CanonicalBrowsingContext::LoadURI(nsIURI* aURI,- return;+@@ -1969,6 +1971,12 @@ void CanonicalBrowsingContext::LoadURI(nsIURI* aURI,+ (void)SetIsCaptivePortalTab(true);}+ {@@ -313,23 +280,23 @@ index 89dcc881f3dafe2a67321e2ee9d6347905bde4f6..a9e52c060826a5846a743e4ad960670d}diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp-index 39a832eccf7e7c0b64b2deb1214f82e7533b249a..6bbb911f00d86340a912fe030ee87382fcd69464 100644+index 51bbec50a67621ea429411e10c4aea54d8dbc3f8..981ec35569d3f0d3e75d6ea69bea417a0c7b3148 100644--- a/docshell/base/nsDocShell.cpp+++ b/docshell/base/nsDocShell.cpp-@@ -16,6 +16,12 @@- # include <unistd.h> // for getpid()+@@ -17,6 +17,12 @@#endif-+#if JS_HAS_INTL_API+ #include "nsDeviceContext.h"++#if JS_HAS_INTL_API && !MOZ_SYSTEM_ICU+# include "unicode/locid.h"-+#endif /* JS_HAS_INTL_API */++#endif /* JS_HAS_INTL_API && !MOZ_SYSTEM_ICU */++#include "js/LocaleSensitive.h"+- #include "mozilla/ArrayUtils.h"#include "mozilla/Attributes.h"#include "mozilla/AutoRestore.h"-@@ -67,6 +73,7 @@+ #include "mozilla/BasePrincipal.h"+@@ -64,6 +70,7 @@#include "mozilla/dom/DocGroup.h"#include "mozilla/dom/Element.h"#include "mozilla/dom/FragmentDirective.h"@@ -337,7 +304,7 @@ index 39a832eccf7e7c0b64b2deb1214f82e7533b249a..6bbb911f00d86340a912fe030ee87382#include "mozilla/dom/HTMLAnchorElement.h"#include "mozilla/dom/HTMLIFrameElement.h"#include "mozilla/dom/Navigation.h"-@@ -98,6 +105,7 @@+@@ -96,6 +103,7 @@#include "mozilla/dom/DocumentBinding.h"#include "mozilla/glean/DocshellMetrics.h"#include "mozilla/ipc/ProtocolUtils.h"@@ -345,7 +312,7 @@ index 39a832eccf7e7c0b64b2deb1214f82e7533b249a..6bbb911f00d86340a912fe030ee87382#include "mozilla/net/DocumentChannel.h"#include "mozilla/net/DocumentChannelChild.h"#include "mozilla/net/ParentChannelWrapper.h"-@@ -122,6 +130,7 @@+@@ -120,6 +128,7 @@#include "nsIDocumentViewer.h"#include "mozilla/dom/Document.h"#include "nsHTMLDocument.h"@@ -353,7 +320,7 @@ index 39a832eccf7e7c0b64b2deb1214f82e7533b249a..6bbb911f00d86340a912fe030ee87382#include "nsIDocumentLoaderFactory.h"#include "nsIDOMWindow.h"#include "nsIEditingSession.h"-@@ -217,6 +226,7 @@+@@ -215,6 +224,7 @@#include "nsGlobalWindowInner.h"#include "nsGlobalWindowOuter.h"#include "nsJSEnvironment.h"@@ -361,7 +328,7 @@ index 39a832eccf7e7c0b64b2deb1214f82e7533b249a..6bbb911f00d86340a912fe030ee87382#include "nsNetCID.h"#include "nsNetUtil.h"#include "nsObjectLoadingContent.h"-@@ -358,6 +368,14 @@ nsDocShell::nsDocShell(BrowsingContext* aBrowsingContext,+@@ -354,6 +364,14 @@ nsDocShell::nsDocShell(BrowsingContext* aBrowsingContext,mAllowDNSPrefetch(true),mAllowWindowControl(true),mCSSErrorReportingEnabled(false),@@ -376,7 +343,7 @@ index 39a832eccf7e7c0b64b2deb1214f82e7533b249a..6bbb911f00d86340a912fe030ee87382mAllowAuth(mItemType == typeContent),mAllowKeywordFixup(false),mDisableMetaRefreshWhenInactive(false),-@@ -3039,6 +3057,208 @@ nsDocShell::GetMessageManager(ContentFrameMessageManager** aMessageManager) {+@@ -3041,6 +3059,174 @@ nsDocShell::GetMessageManager(ContentFrameMessageManager** aMessageManager) {return NS_OK;}@@ -451,40 +418,6 @@ index 39a832eccf7e7c0b64b2deb1214f82e7533b249a..6bbb911f00d86340a912fe030ee87382+}++NS_IMETHODIMP-+nsDocShell::GetLanguageOverride(nsAString& aLanguageOverride) {-+ aLanguageOverride = GetRootDocShell()->mLanguageOverride;-+ return NS_OK;-+}-+-+-+static void SetIcuLocale(const nsAString& aLanguageOverride) {-+ icu::Locale locale(NS_LossyConvertUTF16toASCII(aLanguageOverride).get());-+ if (icu::Locale::getDefault() != locale) {-+ UErrorCode error_code = U_ZERO_ERROR;-+ const char* lang = locale.getLanguage();-+ if (lang != nullptr && *lang != '\0') {-+ icu::Locale::setDefault(locale, error_code);-+ } else {-+ fprintf(stderr, "SetIcuLocale Failed to set the ICU default locale to %s\n", NS_LossyConvertUTF16toASCII(aLanguageOverride).get());-+ }-+ }-+-+ AutoJSAPI jsapi;-+ jsapi.Init();-+ JSContext* cx = jsapi.cx();-+ JS_ResetDefaultLocale(JS_GetRuntime(cx));-+-+ ResetDefaultLocaleInAllWorkers();-+}-+-+NS_IMETHODIMP-+nsDocShell::SetLanguageOverride(const nsAString& aLanguageOverride) {-+ mLanguageOverride = aLanguageOverride;-+ SetIcuLocale(aLanguageOverride);-+ return NS_OK;-+}-+-+NS_IMETHODIMP+nsDocShell::GetFileInputInterceptionEnabled(bool* aEnabled) {+ MOZ_ASSERT(aEnabled);+ *aEnabled = GetRootDocShell()->mFileInputInterceptionEnabled;@@ -585,7 +518,7 @@ index 39a832eccf7e7c0b64b2deb1214f82e7533b249a..6bbb911f00d86340a912fe030ee87382NS_IMETHODIMPnsDocShell::GetIsNavigating(bool* aOut) {*aOut = mIsNavigating;-@@ -4833,7 +5053,7 @@ nsDocShell::GetVisibility(bool* aVisibility) {+@@ -4817,7 +5003,7 @@ nsDocShell::GetVisibility(bool* aVisibility) {}void nsDocShell::ActivenessMaybeChanged() {@@ -594,7 +527,7 @@ index 39a832eccf7e7c0b64b2deb1214f82e7533b249a..6bbb911f00d86340a912fe030ee87382if (RefPtr<PresShell> presShell = GetPresShell()) {presShell->ActivenessMaybeChanged();}-@@ -6908,6 +7128,10 @@ bool nsDocShell::CanSavePresentation(uint32_t aLoadType,+@@ -6886,6 +7072,10 @@ bool nsDocShell::CanSavePresentation(uint32_t aLoadType,return false; // no entry to save into}@@ -605,7 +538,7 @@ index 39a832eccf7e7c0b64b2deb1214f82e7533b249a..6bbb911f00d86340a912fe030ee87382MOZ_ASSERT(!mozilla::SessionHistoryInParent(),"mOSHE cannot be non-null with SHIP");nsCOMPtr<nsIDocumentViewer> viewer = mOSHE->GetDocumentViewer();-@@ -8662,6 +8886,12 @@ nsresult nsDocShell::PerformRetargeting(nsDocShellLoadState* aLoadState) {+@@ -8587,6 +8777,12 @@ nsresult nsDocShell::PerformRetargeting(nsDocShellLoadState* aLoadState) {true, // aForceNoOpenergetter_AddRefs(newBC));MOZ_ASSERT(!newBC);@@ -618,7 +551,7 @@ index 39a832eccf7e7c0b64b2deb1214f82e7533b249a..6bbb911f00d86340a912fe030ee87382return rv;}-@@ -9977,6 +10207,16 @@ nsresult nsDocShell::InternalLoad(nsDocShellLoadState* aLoadState,+@@ -9988,6 +10184,16 @@ nsresult nsDocShell::InternalLoad(nsDocShellLoadState* aLoadState,nsINetworkPredictor::PREDICT_LOAD, attrs, nullptr);nsCOMPtr<nsIRequest> req;@@ -635,7 +568,7 @@ index 39a832eccf7e7c0b64b2deb1214f82e7533b249a..6bbb911f00d86340a912fe030ee87382rv = DoURILoad(aLoadState, aCacheKey, getter_AddRefs(req));if (NS_SUCCEEDED(rv)) {-@@ -13392,6 +13632,9 @@ class OnLinkClickEvent : public Runnable {+@@ -13404,6 +13610,9 @@ class OnLinkClickEvent : public Runnable {mHandler->OnLinkClickSync(mContent, mLoadState, mNoOpenerImplied,mTriggeringPrincipal);}@@ -645,7 +578,7 @@ index 39a832eccf7e7c0b64b2deb1214f82e7533b249a..6bbb911f00d86340a912fe030ee87382return NS_OK;}-@@ -13508,6 +13751,8 @@ nsresult nsDocShell::OnLinkClick(+@@ -13521,6 +13730,8 @@ nsresult nsDocShell::OnLinkClick(nsCOMPtr<nsIRunnable> ev = new OnLinkClickEvent(this, aContent, loadState, noOpenerImplied, aTriggeringPrincipal);@@ -655,7 +588,7 @@ index 39a832eccf7e7c0b64b2deb1214f82e7533b249a..6bbb911f00d86340a912fe030ee87382}diff --git a/docshell/base/nsDocShell.h b/docshell/base/nsDocShell.h-index 4241fdd315fa92cdcbdcdffb052ac992c015a6be..0068a3258630be2b5edaf6cdb6c35cc9ba9f5a0f 100644+index 1ce29a1afe5f0147fc9dc7b8fb20a3c5c619beb6..a9dff3bd2ffb9852cc7dfb48f7397187b170b622 100644--- a/docshell/base/nsDocShell.h+++ b/docshell/base/nsDocShell.h@@ -16,6 +16,7 @@@@ -666,7 +599,7 @@ index 4241fdd315fa92cdcbdcdffb052ac992c015a6be..0068a3258630be2b5edaf6cdb6c35cc9#include "mozilla/dom/WindowProxyHolder.h"#include "nsCOMPtr.h"#include "nsCharsetSource.h"-@@ -81,6 +82,7 @@ class nsCommandManager;+@@ -82,6 +83,7 @@ class nsCommandManager;class nsDocShellEditorData;class nsDOMNavigationTiming;class nsDSURIContentListener;@@ -674,7 +607,7 @@ index 4241fdd315fa92cdcbdcdffb052ac992c015a6be..0068a3258630be2b5edaf6cdb6c35cc9class nsGlobalWindowOuter;class FramingChecker;-@@ -413,6 +415,15 @@ class nsDocShell final : public nsDocLoader,+@@ -414,6 +416,15 @@ class nsDocShell final : public nsDocLoader,void SetWillChangeProcess() { mWillChangeProcess = true; }bool WillChangeProcess() { return mWillChangeProcess; }@@ -690,7 +623,7 @@ index 4241fdd315fa92cdcbdcdffb052ac992c015a6be..0068a3258630be2b5edaf6cdb6c35cc9// Create a content viewer within this nsDocShell for the given// `WindowGlobalChild` actor.nsresult CreateDocumentViewerForActor(-@@ -1051,6 +1062,8 @@ class nsDocShell final : public nsDocLoader,+@@ -1059,6 +1070,8 @@ class nsDocShell final : public nsDocLoader,bool CSSErrorReportingEnabled() const { return mCSSErrorReportingEnabled; }@@ -699,7 +632,7 @@ index 4241fdd315fa92cdcbdcdffb052ac992c015a6be..0068a3258630be2b5edaf6cdb6c35cc9// Handles retrieval of subframe session history for nsDocShell::LoadURI. If a// load is requested in a subframe of the current DocShell, the subframe// loadType may need to reflect the loadType of the parent document, or in-@@ -1380,6 +1393,17 @@ class nsDocShell final : public nsDocLoader,+@@ -1390,6 +1403,16 @@ class nsDocShell final : public nsDocLoader,bool mAllowDNSPrefetch : 1;bool mAllowWindowControl : 1;bool mCSSErrorReportingEnabled : 1;@@ -708,7 +641,6 @@ index 4241fdd315fa92cdcbdcdffb052ac992c015a6be..0068a3258630be2b5edaf6cdb6c35cc9+ bool mBypassCSPEnabled : 1;+ bool mForceActiveState : 1;+ bool mDisallowBFCache : 1;-+ nsString mLanguageOverride;+ RefPtr<nsGeolocationService> mGeolocationServiceOverride;+ ReducedMotionOverride mReducedMotionOverride;+ ForcedColorsOverride mForcedColorsOverride;@@ -718,7 +650,7 @@ index 4241fdd315fa92cdcbdcdffb052ac992c015a6be..0068a3258630be2b5edaf6cdb6c35cc9bool mAllowKeywordFixup : 1;bool mDisableMetaRefreshWhenInactive : 1;diff --git a/docshell/base/nsIDocShell.idl b/docshell/base/nsIDocShell.idl-index 888d99bae849fcd2988388489edcfc56443d3e23..9162631741cbed86322668d1e0e7dd43b6f19a42 100644+index 888d99bae849fcd2988388489edcfc56443d3e23..75d8bd5e9f20b4ea4d2b198c13ec3c1bba63537f 100644--- a/docshell/base/nsIDocShell.idl+++ b/docshell/base/nsIDocShell.idl@@ -44,6 +44,7 @@ interface nsIURI;@@ -729,7 +661,7 @@ index 888d99bae849fcd2988388489edcfc56443d3e23..9162631741cbed86322668d1e0e7dd43interface nsIEditor;interface nsIEditingSession;interface nsIInputStream;-@@ -719,6 +720,43 @@ interface nsIDocShell : nsIDocShellTreeItem+@@ -719,6 +720,41 @@ interface nsIDocShell : nsIDocShellTreeItem*/void synchronizeLayoutHistoryState();@@ -743,8 +675,6 @@ index 888d99bae849fcd2988388489edcfc56443d3e23..9162631741cbed86322668d1e0e7dd43++ attribute boolean disallowBFCache;+-+ attribute AString languageOverride;-++ cenum ReducedMotionOverride : 8 {+ REDUCED_MOTION_OVERRIDE_REDUCE,+ REDUCED_MOTION_OVERRIDE_NO_PREFERENCE,@@ -774,10 +704,10 @@ index 888d99bae849fcd2988388489edcfc56443d3e23..9162631741cbed86322668d1e0e7dd43* This attempts to save any applicable layout history state (like* scroll position) in the nsISHEntry. This is normally donediff --git a/dom/base/Document.cpp b/dom/base/Document.cpp-index 55d24fe16311a286813f7668a227d2ef0cc7e5d7..ec0fb7817b109c420c1fa7d732003717f786b87f 100644+index 7bbbaf6fb936eda9cf87f164f93f4a96a50cf733..ef8141e69db2cb648419c7e45e033af8bbcf53ab 100644--- a/dom/base/Document.cpp+++ b/dom/base/Document.cpp-@@ -3936,6 +3936,9 @@ void Document::SendToConsole(nsCOMArray<nsISecurityConsoleMessage>& aMessages) {+@@ -3937,6 +3937,9 @@ void Document::SendToConsole(nsCOMArray<nsISecurityConsoleMessage>& aMessages) {}void Document::ApplySettingsFromCSP(bool aSpeculative) {@@ -787,7 +717,7 @@ index 55d24fe16311a286813f7668a227d2ef0cc7e5d7..ec0fb7817b109c420c1fa7d732003717nsresult rv = NS_OK;if (!aSpeculative) {nsIContentSecurityPolicy* csp = PolicyContainer::GetCSP(mPolicyContainer);-@@ -4024,6 +4027,11 @@ nsresult Document::InitCSP(nsIChannel* aChannel) {+@@ -4025,6 +4028,11 @@ nsresult Document::InitCSP(nsIChannel* aChannel) {MOZ_ASSERT(mPolicyContainer,"Policy container must be initialized before CSP!");@@ -799,7 +729,7 @@ index 55d24fe16311a286813f7668a227d2ef0cc7e5d7..ec0fb7817b109c420c1fa7d732003717// If this is a data document - no need to set CSP.if (mLoadedAsData) {return NS_OK;-@@ -4890,6 +4898,10 @@ bool Document::HasFocus(ErrorResult& rv) const {+@@ -4903,6 +4911,10 @@ bool Document::HasFocus(ErrorResult& rv) const {return false;}@@ -810,7 +740,7 @@ index 55d24fe16311a286813f7668a227d2ef0cc7e5d7..ec0fb7817b109c420c1fa7d732003717if (!fm->IsInActiveWindow(bc)) {return false;}-@@ -20404,6 +20416,35 @@ ColorScheme Document::PreferredColorScheme(IgnoreRFP aIgnoreRFP) const {+@@ -20513,6 +20525,35 @@ ColorScheme Document::PreferredColorScheme(IgnoreRFP aIgnoreRFP) const {return PreferenceSheet::PrefsFor(*this).mColorScheme;}@@ -847,10 +777,10 @@ index 55d24fe16311a286813f7668a227d2ef0cc7e5d7..ec0fb7817b109c420c1fa7d732003717if (!sLoadingForegroundTopLevelContentDocument) {return false;diff --git a/dom/base/Document.h b/dom/base/Document.h-index a5177d3453b17ff3e570c38ae46cf002508de09d..bc32af54996216d2855259c19b9840235fa95ec1 100644+index 1d4d4c840dcb6222d9f17f3a2e970f600a5d9252..15448c18c55c54c16b2debec3b9c16f551931842 100644--- a/dom/base/Document.h+++ b/dom/base/Document.h-@@ -4253,6 +4253,8 @@ class Document : public nsINode,+@@ -4329,6 +4329,8 @@ class Document : public nsINode,// color-scheme meta tag.ColorScheme DefaultColorScheme() const;@@ -860,46 +790,10 @@ index a5177d3453b17ff3e570c38ae46cf002508de09d..bc32af54996216d2855259c19b984023static bool AutomaticStorageAccessPermissionCanBeGranted(diff --git a/dom/base/Navigator.cpp b/dom/base/Navigator.cpp-index 69c9557c0611b3d60d18ea00a7a9a1b3fbc2c5df..4a9122e8e83fd4fdbf19b6bb1276b8b8a811a181 100644+index df1ff164347bc1672c36e87184b2804ee0712537..56543649b9a6ff6f5b0f961cd26c4ca3d125399f 100644--- a/dom/base/Navigator.cpp+++ b/dom/base/Navigator.cpp-@@ -339,14 +339,18 @@ void Navigator::GetAppName(nsAString& aAppName) const {- * for more detail.- */- /* static */--void Navigator::GetAcceptLanguages(nsTArray<nsString>& aLanguages) {-+void Navigator::GetAcceptLanguages(const nsString* aLanguageOverride, nsTArray<nsString>& aLanguages) {- MOZ_ASSERT(NS_IsMainThread());-- aLanguages.Clear();-- // E.g. "de-de, en-us,en".- nsAutoString acceptLang;-- Preferences::GetLocalizedString("intl.accept_languages", acceptLang);-+ if (aLanguageOverride && aLanguageOverride->Length())-+ acceptLang = *aLanguageOverride;-+ else-+ Preferences::GetLocalizedString("intl.accept_languages", acceptLang);-+-- // Split values on commas.- for (nsDependentSubstring lang :-@@ -398,7 +402,13 @@ void Navigator::GetLanguage(nsAString& aLanguage) {- }-- void Navigator::GetLanguages(nsTArray<nsString>& aLanguages) {-- GetAcceptLanguages(aLanguages);-+ if (mWindow && mWindow->GetDocShell()) {-+ nsString languageOverride;-+ mWindow->GetDocShell()->GetLanguageOverride(languageOverride);-+ GetAcceptLanguages(&languageOverride, aLanguages);-+ } else {-+ GetAcceptLanguages(nullptr, aLanguages);-+ }-- // The returned value is cached by the binding code. The window listens to the- // accept languages change and will clear the cache when needed. It has to-@@ -2317,7 +2327,8 @@ bool Navigator::Webdriver() {+@@ -2340,7 +2340,8 @@ bool Navigator::Webdriver() {}#endif@@ -909,24 +803,11 @@ index 69c9557c0611b3d60d18ea00a7a9a1b3fbc2c5df..4a9122e8e83fd4fdbf19b6bb1276b8b8}AutoplayPolicy Navigator::GetAutoplayPolicy(AutoplayPolicyMediaType aType) {-diff --git a/dom/base/Navigator.h b/dom/base/Navigator.h-index 08e715a9d73f29d06fb0bfbc9cd881c0b18e8b17..3509280cc5ad8a2d36b208d195dfe5f28138fb0b 100644---- a/dom/base/Navigator.h-+++ b/dom/base/Navigator.h-@@ -220,7 +220,7 @@ class Navigator final : public nsISupports, public nsWrapperCache {-- StorageManager* Storage();--- static void GetAcceptLanguages(nsTArray<nsString>& aLanguages);-+ static void GetAcceptLanguages(const nsString* aLanguageOverride, nsTArray<nsString>& aLanguages);-- dom::MediaCapabilities* MediaCapabilities();- dom::MediaSession* MediaSession();diff --git a/dom/base/nsContentUtils.cpp b/dom/base/nsContentUtils.cpp-index 4d501d3939ca580783e2efd323e7a5b5f3a64223..3dfd95f37d246ca5a22ca6f2189fb6affd5c0982 100644+index 32eb5998645d749bdc711d25abc1b4919a4d737c..ae76b3c942a87593d49f18b2f76408be7517033f 100644--- a/dom/base/nsContentUtils.cpp+++ b/dom/base/nsContentUtils.cpp-@@ -9567,6 +9567,7 @@ Result<bool, nsresult> nsContentUtils::SynthesizeMouseEvent(+@@ -9524,6 +9524,7 @@ Result<bool, nsresult> nsContentUtils::SynthesizeMouseEvent(EventMessage msg;Maybe<WidgetMouseEvent::ExitFrom> exitFrom;bool contextMenuKey = false;@@ -934,7 +815,7 @@ index 4d501d3939ca580783e2efd323e7a5b5f3a64223..3dfd95f37d246ca5a22ca6f2189fb6afif (aType.EqualsLiteral("mousedown")) {msg = eMouseDown;} else if (aType.EqualsLiteral("mouseup")) {-@@ -9593,13 +9594,26 @@ Result<bool, nsresult> nsContentUtils::SynthesizeMouseEvent(+@@ -9550,13 +9551,26 @@ Result<bool, nsresult> nsContentUtils::SynthesizeMouseEvent(msg = eMouseHitTest;} else if (aType.EqualsLiteral("MozMouseExploreByTouch")) {msg = eMouseExploreByTouch;@@ -962,7 +843,7 @@ index 4d501d3939ca580783e2efd323e7a5b5f3a64223..3dfd95f37d246ca5a22ca6f2189fb6afif (MOZ_UNLIKELY(aOptions.mIsWidgetEventSynthesized)) {MOZ_ASSERT_UNREACHABLE("The event shouldn't be dispatched as a synthesized event");-@@ -9627,6 +9641,7 @@ Result<bool, nsresult> nsContentUtils::SynthesizeMouseEvent(+@@ -9584,6 +9598,7 @@ Result<bool, nsresult> nsContentUtils::SynthesizeMouseEvent(mozilla::widget::AutoSynthesizedEventCallbackNotifier notifier(callback);WidgetMouseEvent& mouseOrPointerEvent =@@ -970,7 +851,7 @@ index 4d501d3939ca580783e2efd323e7a5b5f3a64223..3dfd95f37d246ca5a22ca6f2189fb6afpointerEvent.isSome() ? pointerEvent.ref() : mouseEvent.ref();mouseOrPointerEvent.pointerId = aMouseEventData.mIdentifier;mouseOrPointerEvent.mModifiers =-@@ -9648,6 +9663,7 @@ Result<bool, nsresult> nsContentUtils::SynthesizeMouseEvent(+@@ -9605,6 +9620,7 @@ Result<bool, nsresult> nsContentUtils::SynthesizeMouseEvent(aOptions.mIsDOMEventSynthesized;mouseOrPointerEvent.mExitFrom = exitFrom;mouseOrPointerEvent.mCallbackId = notifier.SaveCallback();@@ -979,10 +860,10 @@ index 4d501d3939ca580783e2efd323e7a5b5f3a64223..3dfd95f37d246ca5a22ca6f2189fb6afnsPresContext* presContext = aPresShell->GetPresContext();if (!presContext) {diff --git a/dom/base/nsFocusManager.cpp b/dom/base/nsFocusManager.cpp-index 08781fd524336130578b4c7fa9ee96654259ebb8..b0bbf96ab91a44ee4ef1e9bfb28b17e0ff537faf 100644+index fa2125fa662b79a939d379627e1e4040fcdc9afd..6bb0c72796f0a9d85f4473c2c6bb1e62573fc2c0 100644--- a/dom/base/nsFocusManager.cpp+++ b/dom/base/nsFocusManager.cpp-@@ -1767,6 +1767,10 @@ Maybe<uint64_t> nsFocusManager::SetFocusInner(Element* aNewContent,+@@ -1840,6 +1840,10 @@ Maybe<uint64_t> nsFocusManager::SetFocusInner(Element* aNewContent,(GetActiveBrowsingContext() == newRootBrowsingContext);}@@ -993,7 +874,7 @@ index 08781fd524336130578b4c7fa9ee96654259ebb8..b0bbf96ab91a44ee4ef1e9bfb28b17e0// Exit fullscreen if a website focuses another windowif (StaticPrefs::full_screen_api_exit_on_windowRaise() &&!isElementInActiveWindow && (aFlags & FLAG_RAISE)) {-@@ -2353,6 +2357,7 @@ bool nsFocusManager::BlurImpl(BrowsingContext* aBrowsingContextToClear,+@@ -2427,6 +2431,7 @@ bool nsFocusManager::BlurImpl(BrowsingContext* aBrowsingContextToClear,bool aIsLeavingDocument, bool aAdjustWidget,bool aRemainActive, Element* aElementToFocus,uint64_t aActionId) {@@ -1001,7 +882,7 @@ index 08781fd524336130578b4c7fa9ee96654259ebb8..b0bbf96ab91a44ee4ef1e9bfb28b17e0LOGFOCUS(("<<Blur begin actionid: %" PRIu64 ">>", aActionId));// hold a reference to the focused content, which may be null-@@ -2396,6 +2401,11 @@ bool nsFocusManager::BlurImpl(BrowsingContext* aBrowsingContextToClear,+@@ -2470,6 +2475,11 @@ bool nsFocusManager::BlurImpl(BrowsingContext* aBrowsingContextToClear,return true;}@@ -1013,7 +894,7 @@ index 08781fd524336130578b4c7fa9ee96654259ebb8..b0bbf96ab91a44ee4ef1e9bfb28b17e0// Keep a ref to presShell since dispatching the DOM event may cause// the document to be destroyed.RefPtr<PresShell> presShell = docShell->GetPresShell();-@@ -3094,7 +3104,9 @@ void nsFocusManager::RaiseWindow(nsPIDOMWindowOuter* aWindow,+@@ -3169,7 +3179,9 @@ void nsFocusManager::RaiseWindow(nsPIDOMWindowOuter* aWindow,}}@@ -1025,10 +906,10 @@ index 08781fd524336130578b4c7fa9ee96654259ebb8..b0bbf96ab91a44ee4ef1e9bfb28b17e0// care of lowering the present active window. This happens in// a separate runnable to avoid touching multiple windows indiff --git a/dom/base/nsGlobalWindowOuter.cpp b/dom/base/nsGlobalWindowOuter.cpp-index bc578db43fc5311fb0ee423bf18446a156d28f84..e26964422e35455a390e46a8cb990f6a0e3a5509 100644+index 4b859af72ff2d1caf614bce7025418effce09858..57c4dde59982e84ca4b1628bd63a94a0d24f3d48 100644--- a/dom/base/nsGlobalWindowOuter.cpp+++ b/dom/base/nsGlobalWindowOuter.cpp-@@ -2516,10 +2516,16 @@ nsresult nsGlobalWindowOuter::SetNewDocument(Document* aDocument,+@@ -2514,10 +2514,16 @@ nsresult nsGlobalWindowOuter::SetNewDocument(Document* aDocument,}();if (!isContentAboutBlankInChromeDocshell) {@@ -1049,7 +930,7 @@ index bc578db43fc5311fb0ee423bf18446a156d28f84..e26964422e35455a390e46a8cb990f6a}}-@@ -2639,6 +2645,19 @@ void nsGlobalWindowOuter::DispatchDOMWindowCreated() {+@@ -2637,6 +2643,19 @@ void nsGlobalWindowOuter::DispatchDOMWindowCreated() {}}@@ -1070,10 +951,10 @@ index bc578db43fc5311fb0ee423bf18446a156d28f84..e26964422e35455a390e46a8cb990f6avoid nsGlobalWindowOuter::SetDocShell(nsDocShell* aDocShell) {diff --git a/dom/base/nsGlobalWindowOuter.h b/dom/base/nsGlobalWindowOuter.h-index f9568d471ae3b741bd251536afbe0fead2ef32fc..f289091fda0a83528e7e13cd39b3717794b0fb05 100644+index b6226ff10fc43b861092732b87d96045ab719d6c..87fae2cff5037e5fa9febee5603883a4ec782fff 100644--- a/dom/base/nsGlobalWindowOuter.h+++ b/dom/base/nsGlobalWindowOuter.h-@@ -316,6 +316,7 @@ class nsGlobalWindowOuter final : public mozilla::dom::EventTarget,+@@ -315,6 +315,7 @@ class nsGlobalWindowOuter final : public mozilla::dom::EventTarget,// Outer windows only.void DispatchDOMWindowCreated();@@ -1082,10 +963,10 @@ index f9568d471ae3b741bd251536afbe0fead2ef32fc..f289091fda0a83528e7e13cd39b37177// Outer windows only.virtual void EnsureSizeAndPositionUpToDate() override;diff --git a/dom/base/nsINode.cpp b/dom/base/nsINode.cpp-index 29336862ea9be2c5c870a7e7a55d9843bddedbbf..10126e613762585399597b1b9843ca019099e23a 100644+index 43987ca13062ce9b9d911c16ddfefc928776a76f..d41f167709f729d49cebfff6cff6e99b9deaa4fc 100644--- a/dom/base/nsINode.cpp+++ b/dom/base/nsINode.cpp-@@ -1509,6 +1509,61 @@ void nsINode::GetBoxQuadsFromWindowOrigin(const BoxQuadOptions& aOptions,+@@ -1507,6 +1507,61 @@ void nsINode::GetBoxQuadsFromWindowOrigin(const BoxQuadOptions& aOptions,mozilla::GetBoxQuadsFromWindowOrigin(this, aOptions, aResult, aRv);}@@ -1148,7 +1029,7 @@ index 29336862ea9be2c5c870a7e7a55d9843bddedbbf..10126e613762585399597b1b9843ca01DOMQuad& aQuad, const GeometryNode& aFrom,const ConvertCoordinateOptions& aOptions, CallerType aCallerType,diff --git a/dom/base/nsINode.h b/dom/base/nsINode.h-index 313d829a9a9da32a2fc2db6643e74c804322baed..f8c1f29a9a8a0dbafdc0ace13620671fd928808a 100644+index 1611ea9eb23a7b9a2885b7f870da4a7a974e52f3..6511777068ed465cc439a5e13d76fd2853cf3007 100644--- a/dom/base/nsINode.h+++ b/dom/base/nsINode.h@@ -2499,6 +2499,10 @@ class nsINode : public mozilla::dom::EventTarget {@@ -1163,7 +1044,7 @@ index 313d829a9a9da32a2fc2db6643e74c804322baed..f8c1f29a9a8a0dbafdc0ace13620671fDOMQuad& aQuad, const TextOrElementOrDocument& aFrom,const ConvertCoordinateOptions& aOptions, CallerType aCallerType,diff --git a/dom/chrome-webidl/BrowsingContext.webidl b/dom/chrome-webidl/BrowsingContext.webidl-index 9730cea647caedaeca4dcbe703e209d79a3440a7..79da6984a47bcbbc9b9ae650f083ec3d7e4a838e 100644+index 3bb17157c1dba1ca75ad9cfee2c21fcafb2dd0ee..550d4d94dfc4e0072bc7935eb8501f2785135c50 100644--- a/dom/chrome-webidl/BrowsingContext.webidl+++ b/dom/chrome-webidl/BrowsingContext.webidl@@ -62,6 +62,26 @@ enum ForcedColorsOverride {@@ -1193,7 +1074,7 @@ index 9730cea647caedaeca4dcbe703e209d79a3440a7..79da6984a47bcbbc9b9ae650f083ec3d/*** Allowed overrides of platform/pref default behaviour for touch events.*/-@@ -235,6 +255,12 @@ interface BrowsingContext {+@@ -242,6 +262,12 @@ interface BrowsingContext {// Forced-colors simulation, for DevTools[SetterThrows] attribute ForcedColorsOverride forcedColorsOverride;@@ -1206,28 +1087,11 @@ index 9730cea647caedaeca4dcbe703e209d79a3440a7..79da6984a47bcbbc9b9ae650f083ec3d/*** A unique identifier for the browser element that is hosting this* BrowsingContext tree. Every BrowsingContext in the element's tree will-diff --git a/dom/fetch/Fetch.cpp b/dom/fetch/Fetch.cpp-index 31c317670b9748defb7cbf937eff73cdb8ea95d8..904d209e8fbc8b56ee5e6056fbad2b21290d1913 100644---- a/dom/fetch/Fetch.cpp-+++ b/dom/fetch/Fetch.cpp-@@ -699,6 +699,12 @@ already_AddRefed<Promise> FetchRequest(nsIGlobalObject* aGlobal,- ipcArgs.hasCSPEventListener() = false;- ipcArgs.isWorkerRequest() = false;--+ /* --> Playwright: associate keep-alive fetch with the window */-+ BrowsingContext* bc = window ? window->GetBrowsingContext() : nullptr;-+ if (bc)-+ ipcArgs.associatedBrowsingContextID() = bc->Id();-+ /* <-- Playwright */-+- actor->DoFetchOp(ipcArgs);-- return p.forget();diff --git a/dom/fetch/FetchService.cpp b/dom/fetch/FetchService.cpp-index 77460bfa970fdcc62d58c9dd00195fc92ffba3c2..09c2a98569238396a275f8da3f533f8b163517ff 100644+index 13ad1f24ab1fd55737438ac8013d831c6a03dffe..bcc08d1843d5c1e4da437c9b66641582f5d8f403 100644--- a/dom/fetch/FetchService.cpp+++ b/dom/fetch/FetchService.cpp-@@ -268,6 +268,14 @@ RefPtr<FetchServicePromises> FetchService::FetchInstance::Fetch() {+@@ -267,6 +267,14 @@ RefPtr<FetchServicePromises> FetchService::FetchInstance::Fetch() {net::ClassificationFlags({0, 0}) // TrackingFlags);@@ -1243,10 +1107,10 @@ index 77460bfa970fdcc62d58c9dd00195fc92ffba3c2..09c2a98569238396a275f8da3f533f8bauto& args = mArgs.as<WorkerFetchArgs>();mFetchDriver->SetWorkerScript(args.mWorkerScript);diff --git a/dom/geolocation/Geolocation.cpp b/dom/geolocation/Geolocation.cpp-index 224b0f421a746fa08f8c374c2b213f8581cb95b4..a79a0674587e8091c0e38e97919768c1b44370d5 100644+index 33832d190f96b791ec38aaa1798e99399a195d86..f0d776bb3d7aa946d843c96bab8f52c6adc21a93 100644--- a/dom/geolocation/Geolocation.cpp+++ b/dom/geolocation/Geolocation.cpp-@@ -394,7 +394,10 @@ nsGeolocationRequest::Allow(JS::Handle<JS::Value> aChoices) {+@@ -393,7 +393,10 @@ nsGeolocationRequest::Allow(JS::Handle<JS::Value> aChoices) {return NS_OK;}@@ -1258,7 +1122,7 @@ index 224b0f421a746fa08f8c374c2b213f8581cb95b4..a79a0674587e8091c0e38e97919768c1// Asynchronously present the system dialog or open system preferences// (RequestGeolocationPermissionFromUser will know which to do), and wait// for the permission to change or the request to be canceled. If the-@@ -426,8 +429,6 @@ nsGeolocationRequest::Allow(JS::Handle<JS::Value> aChoices) {+@@ -425,8 +428,6 @@ nsGeolocationRequest::Allow(JS::Handle<JS::Value> aChoices) {return NS_OK;}@@ -1267,7 +1131,7 @@ index 224b0f421a746fa08f8c374c2b213f8581cb95b4..a79a0674587e8091c0e38e97919768c1bool canUseCache = false;CachedPositionAndAccuracy lastPosition = gs->GetCachedPosition();if (lastPosition.position) {-@@ -710,11 +711,16 @@ NS_INTERFACE_MAP_END+@@ -709,11 +710,16 @@ NS_INTERFACE_MAP_ENDNS_IMPL_ADDREF(nsGeolocationService)NS_IMPL_RELEASE(nsGeolocationService)@@ -1285,7 +1149,7 @@ index 224b0f421a746fa08f8c374c2b213f8581cb95b4..a79a0674587e8091c0e38e97919768c1if (XRE_IsContentProcess()) {return NS_OK;}-@@ -793,6 +799,10 @@ nsresult nsGeolocationService::Init() {+@@ -792,6 +798,10 @@ nsresult nsGeolocationService::Init() {return NS_OK;}@@ -1296,7 +1160,7 @@ index 224b0f421a746fa08f8c374c2b213f8581cb95b4..a79a0674587e8091c0e38e97919768c1nsGeolocationService::~nsGeolocationService() = default;NS_IMETHODIMP-@@ -936,6 +946,10 @@ bool nsGeolocationService::HighAccuracyRequested() {+@@ -935,6 +945,10 @@ bool nsGeolocationService::HighAccuracyRequested() {}void nsGeolocationService::UpdateAccuracy(bool aForceHigh) {@@ -1339,10 +1203,10 @@ index d46e2e88b121688f62bbd43755791a077cfa1fe8..e69d62ffb4e732137b7a0ec0385358f3namespace mozilla::dom {diff --git a/dom/html/HTMLInputElement.cpp b/dom/html/HTMLInputElement.cpp-index be7606950b20e952b078e9fffbfc30994971306a..6b84281c80c3d68c42b008cc4650f00d88376617 100644+index 4208fa72fbab3faeaf2e30480767c3bb38642ad8..c76dd6ed1a99fc19520833804d09b2e15d7e83d4 100644--- a/dom/html/HTMLInputElement.cpp+++ b/dom/html/HTMLInputElement.cpp-@@ -60,6 +60,7 @@+@@ -59,6 +59,7 @@#include "nsBaseCommandController.h"#include "nsCRTGlue.h"#include "nsColorControlFrame.h"@@ -1350,7 +1214,7 @@ index be7606950b20e952b078e9fffbfc30994971306a..6b84281c80c3d68c42b008cc4650f00d#include "nsError.h"#include "nsFileControlFrame.h"#include "nsFocusManager.h"-@@ -850,6 +851,13 @@ nsresult HTMLInputElement::InitFilePicker(FilePickerType aType) {+@@ -848,6 +849,13 @@ nsresult HTMLInputElement::InitFilePicker(FilePickerType aType) {return NS_ERROR_FAILURE;}@@ -1365,7 +1229,7 @@ index be7606950b20e952b078e9fffbfc30994971306a..6b84281c80c3d68c42b008cc4650f00dreturn NS_OK;}diff --git a/dom/media/systemservices/video_engine/desktop_capture_impl.cc b/dom/media/systemservices/video_engine/desktop_capture_impl.cc-index ad5f871cf65d86b24a6aef0a17ad227adbe0fb24..60ff2f79df8d824384a0b1768b163bda4fbc3148 100644+index d6cb5c68b6afd8c5ae333a2f06daed7966870814..62fedf543e636269c9e98c4837a73c7a7c24ef9e 100644--- a/dom/media/systemservices/video_engine/desktop_capture_impl.cc+++ b/dom/media/systemservices/video_engine/desktop_capture_impl.cc@@ -53,9 +53,10 @@ namespace webrtc {@@ -1410,8 +1274,8 @@ index ad5f871cf65d86b24a6aef0a17ad227adbe0fb24..60ff2f79df8d824384a0b1768b163bda+ capture_cursor_(aCaptureCursor),mControlThread(mozilla::GetCurrentSerialEventTarget()),mNextFrameMinimumTime(Timestamp::Zero()),- mCallbacks("DesktopCaptureImpl::mCallbacks") {}-@@ -295,6 +300,19 @@ void DesktopCaptureImpl::DeRegisterCaptureDataCallback(+ mCallbacks("DesktopCaptureImpl::mCallbacks"),+@@ -296,6 +301,19 @@ void DesktopCaptureImpl::DeRegisterCaptureDataCallback(}}@@ -1431,7 +1295,7 @@ index ad5f871cf65d86b24a6aef0a17ad227adbe0fb24..60ff2f79df8d824384a0b1768b163bdaint32_t DesktopCaptureImpl::StopCaptureIfAllClientsClose() {{auto callbacks = mCallbacks.Lock();-@@ -350,7 +368,7 @@ int32_t DesktopCaptureImpl::StartCapture(+@@ -351,7 +369,7 @@ int32_t DesktopCaptureImpl::StartCapture(return -1;}std::unique_ptr capturer = CreateDesktopCapturerAndThread(@@ -1440,16 +1304,14 @@ index ad5f871cf65d86b24a6aef0a17ad227adbe0fb24..60ff2f79df8d824384a0b1768b163bdaMOZ_ASSERT(!capturer == !mCaptureThread);if (!capturer) {-@@ -458,6 +476,15 @@ void DesktopCaptureImpl::OnCaptureResult(DesktopCapturer::Result aResult,+@@ -461,6 +479,13 @@ void DesktopCaptureImpl::OnCaptureResult(DesktopCapturer::Result aResult,frameInfo.height = aFrame->size().height();frameInfo.videoType = VideoType::kARGB;-+ size_t videoFrameStride =-+ frameInfo.width * DesktopFrame::kBytesPerPixel;+ {+ webrtc::CritScope cs(&mApiCs);+ for (auto rawFrameCallback : _rawFrameCallbacks) {-+ rawFrameCallback->OnRawFrame(videoFrame, videoFrameStride, frameInfo);++ rawFrameCallback->OnRawFrame(videoFrame, aFrame->stride(), frameInfo);+ }+ }+@@ -1457,18 +1319,18 @@ index ad5f871cf65d86b24a6aef0a17ad227adbe0fb24..60ff2f79df8d824384a0b1768b163bdaframeInfo.width * frameInfo.height * DesktopFrame::kBytesPerPixel;diff --git a/dom/media/systemservices/video_engine/desktop_capture_impl.h b/dom/media/systemservices/video_engine/desktop_capture_impl.h-index 498de96bf6961fa9ea9cbb8af74477abd063724b..967cc4d8dc07195f9bc2486340b5ed87003f0ecb 100644+index 75851401d724338f45eb7f41761575036345abf9..dc36c41f64cd29bfceb566eeebe14a998ccb224c 100644--- a/dom/media/systemservices/video_engine/desktop_capture_impl.h+++ b/dom/media/systemservices/video_engine/desktop_capture_impl.h-@@ -26,6 +26,7 @@- #include "api/video/video_sink_interface.h"+@@ -27,6 +27,7 @@+ #include "common_video/include/video_frame_buffer_pool.h"#include "modules/desktop_capture/desktop_capturer.h"#include "modules/video_capture/video_capture.h"+#include "rtc_base/deprecated/recursive_critical_section.h"#include "mozilla/DataMutex.h"#include "mozilla/Maybe.h"#include "mozilla/TimeStamp.h"-@@ -42,17 +43,44 @@ namespace webrtc {+@@ -43,17 +44,44 @@ namespace webrtc {class VideoCaptureEncodeInterface;@@ -1515,7 +1377,7 @@ index 498de96bf6961fa9ea9cbb8af74477abd063724b..967cc4d8dc07195f9bc2486340b5ed87[[nodiscard]] static std::shared_ptr<VideoCaptureModule::DeviceInfo>CreateDeviceInfo(const int32_t aId,-@@ -66,6 +94,8 @@ class DesktopCaptureImpl : public DesktopCapturer::Callback,+@@ -67,6 +95,8 @@ class DesktopCaptureImpl : public DesktopCapturer::Callback,void DeRegisterCaptureDataCallback(webrtc::VideoSinkInterface<VideoFrame>* aCallback) override;int32_t StopCaptureIfAllClientsClose() override;@@ -1524,7 +1386,7 @@ index 498de96bf6961fa9ea9cbb8af74477abd063724b..967cc4d8dc07195f9bc2486340b5ed87int32_t SetCaptureRotation(VideoRotation aRotation) override;bool SetApplyRotation(bool aEnable) override;-@@ -89,7 +119,8 @@ class DesktopCaptureImpl : public DesktopCapturer::Callback,+@@ -90,7 +120,8 @@ class DesktopCaptureImpl : public DesktopCapturer::Callback,protected:DesktopCaptureImpl(const int32_t aId, const char* aUniqueId,@@ -1534,7 +1396,7 @@ index 498de96bf6961fa9ea9cbb8af74477abd063724b..967cc4d8dc07195f9bc2486340b5ed87virtual ~DesktopCaptureImpl();private:-@@ -98,6 +129,9 @@ class DesktopCaptureImpl : public DesktopCapturer::Callback,+@@ -99,6 +130,9 @@ class DesktopCaptureImpl : public DesktopCapturer::Callback,void InitOnThread(std::unique_ptr<DesktopCapturer> aCapturer, int aFramerate);void UpdateOnThread(int aFramerate);void ShutdownOnThread();@@ -1544,7 +1406,7 @@ index 498de96bf6961fa9ea9cbb8af74477abd063724b..967cc4d8dc07195f9bc2486340b5ed87// DesktopCapturer::Callback interface.void OnCaptureResult(DesktopCapturer::Result aResult,std::unique_ptr<DesktopFrame> aFrame) override;-@@ -105,6 +139,8 @@ class DesktopCaptureImpl : public DesktopCapturer::Callback,+@@ -106,6 +140,8 @@ class DesktopCaptureImpl : public DesktopCapturer::Callback,// Notifies all mCallbacks of OnFrame(). mCaptureThread only.void NotifyOnFrame(const VideoFrame& aFrame);@@ -1554,10 +1416,10 @@ index 498de96bf6961fa9ea9cbb8af74477abd063724b..967cc4d8dc07195f9bc2486340b5ed87const nsCOMPtr<nsISerialEventTarget> mControlThread;// Set in StartCapture.diff --git a/dom/script/ScriptSettings.cpp b/dom/script/ScriptSettings.cpp-index 25779e9d7e26b7c385259dc30ceed802a5954b9f..c799c3b1d83fc2572435f3f156c6e4ccbc3396ca 100644+index f22e318c063870443f3f849a990aa5139cd33acf..b0034cfc1ccecf8765ab239a4ccc22320dd0cd28 100644--- a/dom/script/ScriptSettings.cpp+++ b/dom/script/ScriptSettings.cpp-@@ -151,6 +151,30 @@ ScriptSettingsStackEntry::~ScriptSettingsStackEntry() {+@@ -148,6 +148,30 @@ ScriptSettingsStackEntry::~ScriptSettingsStackEntry() {MOZ_ASSERT_IF(mGlobalObject, mGlobalObject->HasJSGlobal());}@@ -1588,7 +1450,7 @@ index 25779e9d7e26b7c385259dc30ceed802a5954b9f..c799c3b1d83fc2572435f3f156c6e4cc// If the entry or incumbent global ends up being something that the subject// principal doesn't subsume, we don't want to use it. This never happens on// the web, but can happen with asymmetric privilege relationships (i.e.-@@ -178,7 +202,7 @@ static nsIGlobalObject* ClampToSubject(nsIGlobalObject* aGlobalOrNull) {+@@ -175,7 +199,7 @@ static nsIGlobalObject* ClampToSubject(nsIGlobalObject* aGlobalOrNull) {NS_ENSURE_TRUE(globalPrin, GetCurrentGlobal());if (!nsContentUtils::SubjectPrincipalOrSystemIfNativeCaller()->SubsumesConsideringDomain(globalPrin)) {@@ -1645,7 +1507,7 @@ index aee376e971ae01ac1e512c3920b115bfaf06afa8..1701311534bf77e6cd9bafc0e3a28361* returned quads are further translated relative to the window* origin -- which is not the layout origin. Further translationdiff --git a/dom/webidl/Window.webidl b/dom/webidl/Window.webidl-index fa3ab3709806de414ddcb50607f2a47c61b08ad5..6f2c86e29ad74c29f35fbafc59048ec0ea0e4b2b 100644+index 7c509eb87ec87fc43e3540337dff9d4289f83233..a22a12a6a165927d5fde97a629786249e0caaae2 100644--- a/dom/webidl/Window.webidl+++ b/dom/webidl/Window.webidl@@ -424,6 +424,7 @@ dictionary SynthesizeMouseEventOptions {@@ -1656,167 +1518,11 @@ index fa3ab3709806de414ddcb50607f2a47c61b08ad5..6f2c86e29ad74c29f35fbafc59048ec0};// Mozilla-specific stuff-diff --git a/dom/workers/RuntimeService.cpp b/dom/workers/RuntimeService.cpp-index 86384aab8c9dc32f48b73efe6c8c5fe2964554a0..4706d7e7605d3f4227de61b1ed474e2d67a5d1ee 100644---- a/dom/workers/RuntimeService.cpp-+++ b/dom/workers/RuntimeService.cpp-@@ -1119,7 +1119,7 @@ void PrefLanguagesChanged(const char* /* aPrefName */, void* /* aClosure */) {- AssertIsOnMainThread();-- nsTArray<nsString> languages;-- Navigator::GetAcceptLanguages(languages);-+ Navigator::GetAcceptLanguages(nullptr, languages);-- RuntimeService* runtime = RuntimeService::GetService();- if (runtime) {-@@ -1309,8 +1309,7 @@ bool RuntimeService::RegisterWorker(WorkerPrivate& aWorkerPrivate) {- }-- // The navigator overridden properties should have already been read.---- Navigator::GetAcceptLanguages(mNavigatorProperties.mLanguages);-+ Navigator::GetAcceptLanguages(nullptr, mNavigatorProperties.mLanguages);- mNavigatorPropertiesLoaded = true;- }--@@ -1938,6 +1937,13 @@ void RuntimeService::PropagateStorageAccessPermissionGranted(- }- }--+void RuntimeService::ResetDefaultLocaleInAllWorkers() {-+ AssertIsOnMainThread();-+ BroadcastAllWorkers([](auto& worker) {-+ worker.ResetDefaultLocale();-+ });-+}-+- template <typename Func>- void RuntimeService::BroadcastAllWorkers(const Func& aFunc) {- AssertIsOnMainThread();-@@ -2500,6 +2506,14 @@ void PropagateStorageAccessPermissionGrantedToWorkers(- }- }--+void ResetDefaultLocaleInAllWorkers() {-+ AssertIsOnMainThread();-+ RuntimeService* runtime = RuntimeService::GetService();-+ if (runtime) {-+ runtime->ResetDefaultLocaleInAllWorkers();-+ }-+}-+- WorkerPrivate* GetWorkerPrivateFromContext(JSContext* aCx) {- MOZ_ASSERT(!NS_IsMainThread());- MOZ_ASSERT(aCx);-diff --git a/dom/workers/RuntimeService.h b/dom/workers/RuntimeService.h-index a77a2105534b6ab0f0521a3d657ab3e26b82df25..1f8e3cdaa6545da00349864e2aeb5588c94f39b8 100644---- a/dom/workers/RuntimeService.h-+++ b/dom/workers/RuntimeService.h-@@ -113,6 +113,8 @@ class RuntimeService final : public nsIObserver {- void PropagateStorageAccessPermissionGranted(- const nsPIDOMWindowInner& aWindow);--+ void ResetDefaultLocaleInAllWorkers();-+- const NavigatorProperties& GetNavigatorProperties() const {- return mNavigatorProperties;- }-diff --git a/dom/workers/WorkerCommon.h b/dom/workers/WorkerCommon.h-index af8d36c0d72683712a3fee22661f8c3279e103db..6b3a967c9acde2c81ab38148d4b1ac120a4717a2 100644---- a/dom/workers/WorkerCommon.h-+++ b/dom/workers/WorkerCommon.h-@@ -50,6 +50,8 @@ void ResumeWorkersForWindow(const nsPIDOMWindowInner& aWindow);- void PropagateStorageAccessPermissionGrantedToWorkers(- const nsPIDOMWindowInner& aWindow);--+void ResetDefaultLocaleInAllWorkers();-+- // All of these are implemented in WorkerScope.cpp-- bool IsWorkerGlobal(JSObject* global);-diff --git a/dom/workers/WorkerPrivate.cpp b/dom/workers/WorkerPrivate.cpp-index 9908807353b0912d4f2c728c57b7ebd0c93c20d7..f346becf0cd66690199948d767e253cc0126b4ae 100644---- a/dom/workers/WorkerPrivate.cpp-+++ b/dom/workers/WorkerPrivate.cpp-@@ -742,6 +742,18 @@ class UpdateContextOptionsRunnable final : public WorkerControlRunnable {- }- };--+class ResetDefaultLocaleRunnable final : public WorkerControlRunnable {-+ public:-+ explicit ResetDefaultLocaleRunnable(WorkerPrivate* aWorkerPrivate)-+ : WorkerControlRunnable("ResetDefaultLocaleRunnable") {}-+-+ virtual bool WorkerRun(JSContext* aCx,-+ WorkerPrivate* aWorkerPrivate) override {-+ aWorkerPrivate->ResetDefaultLocaleInternal(aCx);-+ return true;-+ }-+};-+- class UpdateLanguagesRunnable final : public WorkerThreadRunnable {- nsTArray<nsString> mLanguages;--@@ -2351,6 +2363,16 @@ void WorkerPrivate::UpdateContextOptions(- }- }--+void WorkerPrivate::ResetDefaultLocale() {-+ AssertIsOnParentThread();-+-+ RefPtr<ResetDefaultLocaleRunnable> runnable =-+ new ResetDefaultLocaleRunnable(this);-+ if (!runnable->Dispatch(this)) {-+ NS_WARNING("Failed to reset default locale in worker!");-+ }-+}-+- void WorkerPrivate::UpdateLanguages(const nsTArray<nsString>& aLanguages) {- AssertIsOnParentThread();--@@ -6021,6 +6043,15 @@ void WorkerPrivate::UpdateContextOptionsInternal(- }- }--+void WorkerPrivate::ResetDefaultLocaleInternal(JSContext* aCx) {-+ JS_ResetDefaultLocale(JS_GetRuntime(aCx));-+ auto data = mWorkerThreadAccessible.Access();-+-+ for (uint32_t index = 0; index < data->mChildWorkers.Length(); index++) {-+ data->mChildWorkers[index]->ResetDefaultLocale();-+ }-+}-+- void WorkerPrivate::UpdateLanguagesInternal(- const nsTArray<nsString>& aLanguages) {- WorkerGlobalScope* globalScope = GlobalScope();-diff --git a/dom/workers/WorkerPrivate.h b/dom/workers/WorkerPrivate.h-index ecb4fdbb280b47252231e60d79461cd92c23fc7e..b066c081cade79d5b517d1b179901d5da6ad0b87 100644---- a/dom/workers/WorkerPrivate.h-+++ b/dom/workers/WorkerPrivate.h-@@ -463,6 +463,8 @@ class WorkerPrivate final- void UpdateContextOptionsInternal(JSContext* aCx,- const JS::ContextOptions& aContextOptions);--+ void ResetDefaultLocaleInternal(JSContext* aCx);-+- void UpdateLanguagesInternal(const nsTArray<nsString>& aLanguages);-- void UpdateJSWorkerMemoryParameterInternal(JSContext* aCx, JSGCParamKey key,-@@ -1110,6 +1112,8 @@ class WorkerPrivate final-- void UpdateContextOptions(const JS::ContextOptions& aContextOptions);--+ void ResetDefaultLocale();-+- void UpdateLanguages(const nsTArray<nsString>& aLanguages);-- void UpdateJSWorkerMemoryParameter(JSGCParamKey key, Maybe<uint32_t> value);diff --git a/js/src/debugger/Object.cpp b/js/src/debugger/Object.cpp-index 2d177b5aade6d158e9ae62d317d5155b72cdcf84..28af5d41eb06d4b33cd5f86484dc29c923308835 100644+index 023ddc5a84ae1788608c17eb34bb7bf9a388d9eb..928a59e3e3ff960e049a2e8fb1d54872172a530e 100644--- a/js/src/debugger/Object.cpp+++ b/js/src/debugger/Object.cpp-@@ -2516,7 +2516,11 @@ Maybe<Completion> DebuggerObject::call(JSContext* cx,+@@ -2515,7 +2515,11 @@ Maybe<Completion> DebuggerObject::call(JSContext* cx,invokeArgs[i].set(args2[i]);}@@ -1829,10 +1535,10 @@ index 2d177b5aade6d158e9ae62d317d5155b72cdcf84..28af5d41eb06d4b33cd5f86484dc29c9}diff --git a/js/src/vm/DateTime.cpp b/js/src/vm/DateTime.cpp-index 5f329ff0f6818ad989e205b84b3fbc86bb183a33..35cfd531b6be5128256bdfe8ec8ddb248cacc045 100644+index 12cf8713d26c0b84e8bf78a92d7c886b234cdb95..8a007bd79a0c8a74e0722021a35c3f9351628f0b 100644--- a/js/src/vm/DateTime.cpp+++ b/js/src/vm/DateTime.cpp-@@ -815,7 +815,6 @@ void js::DateTimeInfo::internalResyncICUDefaultTimeZone() {+@@ -814,7 +814,6 @@ void js::DateTimeInfo::internalResyncICUDefaultTimeZone() {#if JS_HAS_INTL_APIif (const char* tzenv = std::getenv("TZ")) {std::string_view tz(tzenv);@@ -1892,10 +1598,10 @@ index 67673c5c306e7237613b0560c7b3f888bd6ad1b8..fe4a278dad4b1747b41b5a824978636a// No boxes to returnreturn;diff --git a/layout/base/PresShell.cpp b/layout/base/PresShell.cpp-index 157bfaacad6ea7477f96daf77a45d770100d9b9f..783311ffa4291c76578ca278a98fd77a0761391b 100644+index f89e8a1376c87ae1bd2493aa717930c9a1f46986..9d9883bb4aeb0ba1c9fc2d5288f93355ba627a1d 100644--- a/layout/base/PresShell.cpp+++ b/layout/base/PresShell.cpp-@@ -12456,7 +12456,9 @@ bool PresShell::ComputeActiveness() const {+@@ -11878,7 +11878,9 @@ bool PresShell::ComputeActiveness() const {if (!browserChild->IsVisible()) {MOZ_LOG(gLog, LogLevel::Debug,(" > BrowserChild %p is not visible", browserChild));@@ -1907,10 +1613,10 @@ index 157bfaacad6ea7477f96daf77a45d770100d9b9f..783311ffa4291c76578ca278a98fd77a// If the browser is visible but just due to be preserving layersdiff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp-index eb2c7147415e8ee37b4e998e76344a8ffbe5c93b..4af37692bab68bb66221f8d59ece26e04762a73d 100644+index 5853a83d5dd2896e72e8c31169487d43fcd030d1..c2432874b15663d907c47cd334cf69a93fb302f6 100644--- a/layout/base/nsLayoutUtils.cpp+++ b/layout/base/nsLayoutUtils.cpp-@@ -707,6 +707,10 @@ bool nsLayoutUtils::AllowZoomingForDocument(+@@ -703,6 +703,10 @@ bool nsLayoutUtils::AllowZoomingForDocument(!aDocument->GetPresShell()->AsyncPanZoomEnabled()) {return false;}@@ -1921,7 +1627,7 @@ index eb2c7147415e8ee37b4e998e76344a8ffbe5c93b..4af37692bab68bb66221f8d59ece26e0// True if we allow zooming for all documents on this platform, or if we are// in RDM.BrowsingContext* bc = aDocument->GetBrowsingContext();-@@ -9764,6 +9768,9 @@ void nsLayoutUtils::ComputeSystemFont(nsFont* aSystemFont,+@@ -9713,6 +9717,9 @@ void nsLayoutUtils::ComputeSystemFont(nsFont* aSystemFont,/* static */bool nsLayoutUtils::ShouldHandleMetaViewport(const Document* aDocument) {@@ -1932,10 +1638,10 @@ index eb2c7147415e8ee37b4e998e76344a8ffbe5c93b..4af37692bab68bb66221f8d59ece26e0return StaticPrefs::dom_meta_viewport_enabled() || (bc && bc->InRDMPane());}diff --git a/layout/style/GeckoBindings.h b/layout/style/GeckoBindings.h-index 79a93cb336beaf073f6d3a4e9da1366d275cb11e..9d21add386a8eacd56d30fb090757b3dd931469a 100644+index 05ffe79600949dbebf243b4b53e18580f17bb17c..1928bb27ca5ec542106ebde6785cbf31d5389d4a 100644--- a/layout/style/GeckoBindings.h+++ b/layout/style/GeckoBindings.h-@@ -592,6 +592,7 @@ bool Gecko_MediaFeatures_PrefersReducedMotion(const mozilla::dom::Document*);+@@ -596,6 +596,7 @@ bool Gecko_MediaFeatures_PrefersReducedMotion(const mozilla::dom::Document*);bool Gecko_MediaFeatures_PrefersReducedTransparency(const mozilla::dom::Document*);bool Gecko_MediaFeatures_MacRTL(const mozilla::dom::Document*);@@ -1944,10 +1650,10 @@ index 79a93cb336beaf073f6d3a4e9da1366d275cb11e..9d21add386a8eacd56d30fb090757b3dconst mozilla::dom::Document*);mozilla::StylePrefersColorScheme Gecko_MediaFeatures_PrefersColorScheme(diff --git a/layout/style/nsMediaFeatures.cpp b/layout/style/nsMediaFeatures.cpp-index 4c3d47252f4f58ef5535ee6bcf27a0fe0472dc87..aacc2f40bfe24705322af0ff78006228f5f920fc 100644+index e8c06e790a4e35316010464b9cf87b9e11cd9ecd..e76fa15fd63f0367759b17d74d8032f56f160fb2 100644--- a/layout/style/nsMediaFeatures.cpp+++ b/layout/style/nsMediaFeatures.cpp-@@ -267,11 +267,7 @@ bool Gecko_MediaFeatures_MatchesPlatform(StylePlatform aPlatform) {+@@ -273,11 +273,7 @@ bool Gecko_MediaFeatures_MatchesPlatform(StylePlatform aPlatform) {}bool Gecko_MediaFeatures_PrefersReducedMotion(const Document* aDocument) {@@ -1960,7 +1666,7 @@ index 4c3d47252f4f58ef5535ee6bcf27a0fe0472dc87..aacc2f40bfe24705322af0ff78006228}bool Gecko_MediaFeatures_PrefersReducedTransparency(const Document* aDocument) {-@@ -301,6 +297,20 @@ bool Gecko_MediaFeatures_MacRTL(const Document* aDocument) {+@@ -307,6 +303,20 @@ bool Gecko_MediaFeatures_MacRTL(const Document* aDocument) {// as a signal.StylePrefersContrast Gecko_MediaFeatures_PrefersContrast(const Document* aDocument) {@@ -1982,7 +1688,7 @@ index 4c3d47252f4f58ef5535ee6bcf27a0fe0472dc87..aacc2f40bfe24705322af0ff78006228return StylePrefersContrast::NoPreference;}diff --git a/netwerk/base/LoadInfo.cpp b/netwerk/base/LoadInfo.cpp-index e7b0d4faf9f5d7444b8e4fb7c70c993a6a8010f1..63f6b3a970a50ece9f0857d29fad35d92d453fdd 100644+index a963941c152da364181ecfb7261593f59ab244f5..0b09db5fd942cd8bff8abfa777073342a1c69cd4 100644--- a/netwerk/base/LoadInfo.cpp+++ b/netwerk/base/LoadInfo.cpp@@ -750,7 +750,8 @@ LoadInfo::LoadInfo(const LoadInfo& rhs)@@ -1995,7 +1701,7 @@ index e7b0d4faf9f5d7444b8e4fb7c70c993a6a8010f1..63f6b3a970a50ece9f0857d29fad35d9}LoadInfo::LoadInfo(-@@ -2094,4 +2095,16 @@ void LoadInfo::UpdateParentAddressSpaceInfo() {+@@ -2096,4 +2097,16 @@ void LoadInfo::UpdateParentAddressSpaceInfo() {}}@@ -2013,10 +1719,10 @@ index e7b0d4faf9f5d7444b8e4fb7c70c993a6a8010f1..63f6b3a970a50ece9f0857d29fad35d9+} // namespace mozilla::netdiff --git a/netwerk/base/LoadInfo.h b/netwerk/base/LoadInfo.h-index 383d6f1f807c7fa445169a4746251932d8e065d8..a51107be81c57351ecd56c37f37cd34473224ece 100644+index 2b4593ad7b88a71b29ed5a5ec7343c95cc960f2d..deb87ecc3e585764939cbc90dd47f037ca14eceb 100644--- a/netwerk/base/LoadInfo.h+++ b/netwerk/base/LoadInfo.h-@@ -540,6 +540,8 @@ class LoadInfo final : public nsILoadInfo {+@@ -541,6 +541,8 @@ class LoadInfo final : public nsILoadInfo {dom::UserNavigationInvolvement::None;bool mSkipHTTPSUpgrade = false;@@ -2046,10 +1752,10 @@ index be0f8bcb6ff861c942d8615f381b99a398ad80d1..00f07714532a12624f8f5925492da521} // namespace net} // namespace mozilladiff --git a/netwerk/base/nsILoadInfo.idl b/netwerk/base/nsILoadInfo.idl-index 4f4673f41b93ffecfdefaf02011511ac0e3de685..dbc045c153c7323720c3202a30577df67b350870 100644+index 884f8f0c44f66a74484065f048939b46024528a5..e195cc2062811c230dff45e56a896c65266c23e7 100644--- a/netwerk/base/nsILoadInfo.idl+++ b/netwerk/base/nsILoadInfo.idl-@@ -1714,4 +1714,6 @@ interface nsILoadInfo : nsISupports+@@ -1715,4 +1715,6 @@ interface nsILoadInfo : nsISupportsreturn static_cast<mozilla::dom::UserNavigationInvolvement>(userNavigationInvolvement);}%}@@ -2078,7 +1784,7 @@ index 7f91d2df6f8bb4020c75c132dc8f6bf26625fa1e..aaa5541a17039d6b13ad83ab176fdaaf* Set the status and reason for the forthcoming synthesized response.* Multiple calls overwrite existing values.diff --git a/netwerk/ipc/DocumentLoadListener.cpp b/netwerk/ipc/DocumentLoadListener.cpp-index a2e5c2e0397b5d56655d4d2b79e13caf2cf7ec62..38711d5cb6b7c1b409e05b2500cbd81aeea61cae 100644+index 634865583e6fefdae7a23e3ff63c3ea68a6ee609..91585bddb7de091b3324ebe2cc10e2f8e183d012 100644--- a/netwerk/ipc/DocumentLoadListener.cpp+++ b/netwerk/ipc/DocumentLoadListener.cpp@@ -190,6 +190,7 @@ static auto CreateDocumentLoadInfo(CanonicalBrowsingContext* aBrowsingContext,@@ -2090,7 +1796,7 @@ index a2e5c2e0397b5d56655d4d2b79e13caf2cf7ec62..38711d5cb6b7c1b409e05b2500cbd81areturn loadInfo.forget();}diff --git a/netwerk/protocol/http/InterceptedHttpChannel.cpp b/netwerk/protocol/http/InterceptedHttpChannel.cpp-index 65718b01f2ea65c6b0f326fb524ff33b0ea2c046..13733e5bd8ba864f7b499834d330f64a28383408 100644+index 9442c40a3d3e9f0f46978e96f08e492bf3d6b766..3ced65b2737587512cda08a90181e0412e1825d6 100644--- a/netwerk/protocol/http/InterceptedHttpChannel.cpp+++ b/netwerk/protocol/http/InterceptedHttpChannel.cpp@@ -724,10 +724,33 @@ NS_IMPL_ISUPPORTS(ResetInterceptionHeaderVisitor, nsIHttpHeaderVisitor)@@ -2163,10 +1869,10 @@ index 7a2a4f2910d74ded7f585c4d0a4c347bb9e03642..a416e1357aebbaab9d9a40ef6f0c2a03* InterceptionTimeStamps is used to record the time stamps of the* interception.diff --git a/netwerk/protocol/http/nsHttpChannel.cpp b/netwerk/protocol/http/nsHttpChannel.cpp-index eefc10ea9892f4f22f4be0e365edf0020475a7e8..db1104eba3150c43c1d5844e8d8b8f66bf3a027c 100644+index f8197fdfdeb835757c7cd30554c0df75c1d622de..59f81b246fa3ace1879b8a8eec7a0b781c4ce269 100644--- a/netwerk/protocol/http/nsHttpChannel.cpp+++ b/netwerk/protocol/http/nsHttpChannel.cpp-@@ -928,11 +928,9 @@ nsresult nsHttpChannel::OnBeforeConnect() {+@@ -944,11 +944,9 @@ nsresult nsHttpChannel::OnBeforeConnect() {// SecurityInfo.sys.mjsmLoadInfo->SetHstsStatus(isSecureURI);@@ -2179,7 +1885,7 @@ index eefc10ea9892f4f22f4be0e365edf0020475a7e8..db1104eba3150c43c1d5844e8d8b8f66BYPASS_LOCAL_CACHE(mLoadFlags, LoadPreferCacheLoadOverBypass())) {return NS_ERROR_OFFLINE;}-@@ -1045,9 +1043,7 @@ nsresult nsHttpChannel::MaybeUseHTTPSRRForUpgrade(bool aShouldUpgrade,+@@ -1061,9 +1059,7 @@ nsresult nsHttpChannel::MaybeUseHTTPSRRForUpgrade(bool aShouldUpgrade,return aStatus;}@@ -2190,7 +1896,7 @@ index eefc10ea9892f4f22f4be0e365edf0020475a7e8..db1104eba3150c43c1d5844e8d8b8f66if (mURI->SchemeIs("https") || aShouldUpgrade || !LoadUseHTTPSSVC() ||forceOffline) {-@@ -1524,15 +1520,14 @@ nsresult nsHttpChannel::ContinueConnect() {+@@ -1540,15 +1536,14 @@ nsresult nsHttpChannel::ContinueConnect() {"CORS preflight must have been finished by the time we ""do the rest of ContinueConnect");@@ -2208,7 +1914,7 @@ index eefc10ea9892f4f22f4be0e365edf0020475a7e8..db1104eba3150c43c1d5844e8d8b8f66BYPASS_LOCAL_CACHE(mLoadFlags, LoadPreferCacheLoadOverBypass())) {return NS_ERROR_OFFLINE;}-@@ -1574,7 +1569,7 @@ nsresult nsHttpChannel::ContinueConnect() {+@@ -1590,7 +1585,7 @@ nsresult nsHttpChannel::ContinueConnect() {}// We're about to hit the network. Don't if we're forced offline.@@ -2217,7 +1923,7 @@ index eefc10ea9892f4f22f4be0e365edf0020475a7e8..db1104eba3150c43c1d5844e8d8b8f66return NS_ERROR_OFFLINE;}-@@ -1682,12 +1677,9 @@ void nsHttpChannel::SpeculativeConnect() {+@@ -1698,12 +1693,9 @@ void nsHttpChannel::SpeculativeConnect() {// don't speculate if we are offline, when doing http upgrade (i.e.// websockets bootstrap), or if we can't do keep-alive (because then we// couldn't reuse the speculative connection anyhow).@@ -2231,7 +1937,7 @@ index eefc10ea9892f4f22f4be0e365edf0020475a7e8..db1104eba3150c43c1d5844e8d8b8f66return;}-@@ -4674,9 +4666,6 @@ nsresult nsHttpChannel::OpenCacheEntryInternal(bool isHttps) {+@@ -4785,9 +4777,6 @@ nsresult nsHttpChannel::OpenCacheEntryInternal(bool isHttps) {uint32_t cacheEntryOpenFlags;bool offline = gIOService->IsOffline();@@ -2241,7 +1947,7 @@ index eefc10ea9892f4f22f4be0e365edf0020475a7e8..db1104eba3150c43c1d5844e8d8b8f66bool maybeRCWN = false;nsAutoCString cacheControlRequestHeader;-@@ -4687,7 +4676,7 @@ nsresult nsHttpChannel::OpenCacheEntryInternal(bool isHttps) {+@@ -4798,7 +4787,7 @@ nsresult nsHttpChannel::OpenCacheEntryInternal(bool isHttps) {return NS_OK;}@@ -2250,7 +1956,7 @@ index eefc10ea9892f4f22f4be0e365edf0020475a7e8..db1104eba3150c43c1d5844e8d8b8f66if (offline || (mLoadFlags & INHIBIT_CACHING) || forceOffline) {if (BYPASS_LOCAL_CACHE(mLoadFlags, LoadPreferCacheLoadOverBypass()) &&!offline && !forceOffline) {-@@ -7944,6 +7933,20 @@ void nsHttpChannel::MaybeStartDNSPrefetch() {+@@ -8097,6 +8086,20 @@ void nsHttpChannel::MaybeStartDNSPrefetch() {}}@@ -2272,10 +1978,10 @@ index eefc10ea9892f4f22f4be0e365edf0020475a7e8..db1104eba3150c43c1d5844e8d8b8f66nsHttpChannel::GetEncodedBodySize(uint64_t* aEncodedBodySize) {if (mCacheEntry && !LoadCacheEntryIsWriteOnly()) {diff --git a/netwerk/protocol/http/nsHttpChannel.h b/netwerk/protocol/http/nsHttpChannel.h-index 44038353e4805831047164118ebaa55f7427d92c..0b475b28120247981a7f4ec3cc550a4825af23df 100644+index 53d4b75298d13751b5a588601b705a0528a50e65..051d7ae8ae2dd9a5f374d0bd3d85a96330cc891e 100644--- a/netwerk/protocol/http/nsHttpChannel.h+++ b/netwerk/protocol/http/nsHttpChannel.h-@@ -311,6 +311,10 @@ class nsHttpChannel final : public HttpBaseChannel,+@@ -312,6 +312,10 @@ class nsHttpChannel final : public HttpBaseChannel,void MaybeResolveProxyAndBeginConnect();void MaybeStartDNSPrefetch();@@ -2287,10 +1993,10 @@ index 44038353e4805831047164118ebaa55f7427d92c..0b475b28120247981a7f4ec3cc550a48// end server host name.ProxyDNSStrategy GetProxyDNSStrategy();diff --git a/parser/html/nsHtml5TreeOpExecutor.cpp b/parser/html/nsHtml5TreeOpExecutor.cpp-index 959d7078d87a4e9ab3db75400962c20e0d302470..aa258aa1804eb24f7a58fdb1df85d492c5513075 100644+index 72523ca8c1cfe099561efc0af5fb1574048a4615..465aac80a7a486e0e2bf5ee33b97a2bf83ebb85a 100644--- a/parser/html/nsHtml5TreeOpExecutor.cpp+++ b/parser/html/nsHtml5TreeOpExecutor.cpp-@@ -1364,6 +1364,10 @@ void nsHtml5TreeOpExecutor::UpdateReferrerInfoFromMeta(+@@ -1367,6 +1367,10 @@ void nsHtml5TreeOpExecutor::UpdateReferrerInfoFromMeta(void nsHtml5TreeOpExecutor::AddSpeculationCSP(const nsAString& aCSP) {NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");@@ -2302,10 +2008,10 @@ index 959d7078d87a4e9ab3db75400962c20e0d302470..aa258aa1804eb24f7a58fdb1df85d492nsCOMPtr<nsIContentSecurityPolicy> preloadCsp = mDocument->GetPreloadCsp();if (!preloadCsp) {diff --git a/security/manager/ssl/nsCertOverrideService.cpp b/security/manager/ssl/nsCertOverrideService.cpp-index 0ecf2c0df3aad52e004a69b4c7a22fea7532b4d8..f5982c2cf1d6ea0522ac7f7e1fb5b4ab8fa07cb4 100644+index 9d262dbf33be49f64dbfc7ff4c87db05344ecdc5..495afbbe2b830218cf6e8332cc871ab709e21b38 100644--- a/security/manager/ssl/nsCertOverrideService.cpp+++ b/security/manager/ssl/nsCertOverrideService.cpp-@@ -627,6 +627,8 @@ void nsCertOverrideService::CountPermanentOverrideTelemetry(+@@ -626,6 +626,8 @@ void nsCertOverrideService::CountPermanentOverrideTelemetry(}static bool IsDebugger() {@@ -2315,7 +2021,7 @@ index 0ecf2c0df3aad52e004a69b4c7a22fea7532b4d8..f5982c2cf1d6ea0522ac7f7e1fb5b4abnsCOMPtr<nsIMarionette> marionette = do_GetService(NS_MARIONETTE_CONTRACTID);if (marionette) {diff --git a/services/settings/Utils.sys.mjs b/services/settings/Utils.sys.mjs-index 330b49da1ebe177ae095f22c603431bb6104c54d..934fcea3c11ff1c41c92049e5041691309386cc3 100644+index b6b61710c0c5f1e19ebc492fe52a1c8e36c647f3..6fcfa8ced1fe0b1789afd5bf4cf1895675273858 100644--- a/services/settings/Utils.sys.mjs+++ b/services/settings/Utils.sys.mjs@@ -97,7 +97,7 @@ const _cdnURLs = {};@@ -2386,24 +2092,11 @@ index bb451a279599da49412da3c287e57d4b06a9c4dc..cf5ae514662d951102876efc00f58c3eclass WindowsGPOPoliciesProvider {constructor() {this._policies = null;-diff --git a/toolkit/components/resistfingerprinting/nsUserCharacteristics.cpp b/toolkit/components/resistfingerprinting/nsUserCharacteristics.cpp-index b2934974ea0b20bbffbc0e2bfd69a35331a5fcb9..00e8765a5a0a0c8b96144d707c02e006ade8f402 100644---- a/toolkit/components/resistfingerprinting/nsUserCharacteristics.cpp-+++ b/toolkit/components/resistfingerprinting/nsUserCharacteristics.cpp-@@ -589,7 +589,7 @@ void PopulateLanguages() {- // sufficient to only collect this information as the other properties are- // just reformats of Navigator::GetAcceptLanguages.- nsTArray<nsString> languages;-- dom::Navigator::GetAcceptLanguages(languages);-+ dom::Navigator::GetAcceptLanguages(nullptr, languages);- nsCString output = "["_ns;-- for (const auto& language : languages) {diff --git a/toolkit/components/startup/nsAppStartup.cpp b/toolkit/components/startup/nsAppStartup.cpp-index d8f0c072c8a52c2837d87fe749ccac6e3e59e48a..6837927e6a49a8ff4c9f709502bf8d8983bd735c 100644+index 5175a8a3ef0b99d8bde75f397579e5ef6db53f6b..4c6b3137f788b90e2d68b1f0dfb6834c63127c17 100644--- a/toolkit/components/startup/nsAppStartup.cpp+++ b/toolkit/components/startup/nsAppStartup.cpp-@@ -361,7 +361,7 @@ nsAppStartup::Quit(uint32_t aMode, int aExitCode, bool* aUserAllowedQuit) {+@@ -360,7 +360,7 @@ nsAppStartup::Quit(uint32_t aMode, int aExitCode, bool* aUserAllowedQuit) {nsCOMPtr<nsISimpleEnumerator> windowEnumerator;nsCOMPtr<nsIWindowMediator> mediator(do_GetService(NS_WINDOWMEDIATOR_CONTRACTID));@@ -2428,10 +2121,10 @@ index 36fe2d427ee8e6c52e32930367cbddfa22e0444b..593795dfb21d215895521a1cfb998339int32_t aMaxSelfProgress,int32_t aCurTotalProgress,diff --git a/toolkit/components/windowwatcher/nsWindowWatcher.cpp b/toolkit/components/windowwatcher/nsWindowWatcher.cpp-index 62cb9a0f2ca11d6fff70cc82e29db27dc97e6bf9..35e9c01eeab3454a23a16978d8c724aa793d938a 100644+index 942cb7c4003098527623a1cdf09e560cc64dba1b..864cf804b6d8a1a079c41c787995bac117ed8a72 100644--- a/toolkit/components/windowwatcher/nsWindowWatcher.cpp+++ b/toolkit/components/windowwatcher/nsWindowWatcher.cpp-@@ -1881,7 +1881,11 @@ uint32_t nsWindowWatcher::CalculateChromeFlagsForContent(+@@ -1880,7 +1880,11 @@ uint32_t nsWindowWatcher::CalculateChromeFlagsForContent(// Open a minimal popup.*aIsPopupRequested = true;@@ -2445,10 +2138,10 @@ index 62cb9a0f2ca11d6fff70cc82e29db27dc97e6bf9..35e9c01eeab3454a23a16978d8c724aa/**diff --git a/toolkit/mozapps/update/UpdateService.sys.mjs b/toolkit/mozapps/update/UpdateService.sys.mjs-index f5a9a91037cf8409c9fac77e8cbf3485b72ee366..0bffed45f195e126bf562c7b22924cf2c4105408 100644+index c5b1a1f52daf9e4b6eac755e4f71beb8e2556925..1d58a9cd3d34fae4945396d03d0e9acd64242049 100644--- a/toolkit/mozapps/update/UpdateService.sys.mjs+++ b/toolkit/mozapps/update/UpdateService.sys.mjs-@@ -3990,6 +3990,8 @@ export class UpdateService {+@@ -4021,6 +4021,8 @@ export class UpdateService {}get disabledForTesting() {@@ -2458,10 +2151,10 @@ index f5a9a91037cf8409c9fac77e8cbf3485b72ee366..0bffed45f195e126bf562c7b22924cf2}diff --git a/toolkit/toolkit.mozbuild b/toolkit/toolkit.mozbuild-index 0ab59fb09f92c3770cca46a8b953846cc524917a..f115a6f7bbb153bbbf16bbe39bf6878dd1a74a9a 100644+index 24f86c7c546995f0dee045d05122a0f70ed70b11..580d38caec31b84e88e22a002cd27add7b2dab79 100644--- a/toolkit/toolkit.mozbuild+++ b/toolkit/toolkit.mozbuild-@@ -156,6 +156,7 @@ if CONFIG["ENABLE_WEBDRIVER"]:+@@ -155,6 +155,7 @@ if CONFIG["ENABLE_WEBDRIVER"]:"/remote","/testing/firefox-ui","/testing/marionette",@@ -2505,7 +2198,7 @@ index b7c376eadc1460b0f4e378ca3047eb82a079c19c..44385776349e13f7452d7c1b382cf738// Only run this code if LauncherProcessWin.h was included beforehand, thus// signalling that the hosting process should support launcher mode.diff --git a/uriloader/base/nsDocLoader.cpp b/uriloader/base/nsDocLoader.cpp-index 95a47c3b51de1d012147042403ca9f2de4c3b247..e9693d0bbc31d8635da2be67e6cdad2a6dbead42 100644+index ef95040ffc1b598f4e91570c64908fd461b928c3..f62a103de62031f05a4f568acf1f0c4d0a4424b0 100644--- a/uriloader/base/nsDocLoader.cpp+++ b/uriloader/base/nsDocLoader.cpp@@ -897,6 +897,12 @@ void nsDocLoader::DocLoaderIsEmpty(bool aFlushLayout,@@ -2522,10 +2215,10 @@ index 95a47c3b51de1d012147042403ca9f2de4c3b247..e9693d0bbc31d8635da2be67e6cdad2a// nsDocumentViewer::LoadComplete that doesn't do various things// that are not relevant here because this wasn't an actualdiff --git a/uriloader/exthandler/nsExternalHelperAppService.cpp b/uriloader/exthandler/nsExternalHelperAppService.cpp-index 53acc63fe36e30ef7f6618ceca5a1c905ae0a117..a0614d8cf1b103a270ea29295eb8ddbff266ead0 100644+index 04c46fda68b158ba7ea61b1764f22bab8d8e2565..a0292f3a3c1771abdeb319d91406ecc20a644f01 100644--- a/uriloader/exthandler/nsExternalHelperAppService.cpp+++ b/uriloader/exthandler/nsExternalHelperAppService.cpp-@@ -112,6 +112,7 @@+@@ -111,6 +111,7 @@#include "mozilla/Components.h"#include "mozilla/ClearOnShutdown.h"@@ -2533,7 +2226,7 @@ index 53acc63fe36e30ef7f6618ceca5a1c905ae0a117..a0614d8cf1b103a270ea29295eb8ddbf#include "mozilla/Preferences.h"#include "mozilla/ipc/URIUtils.h"-@@ -867,6 +868,12 @@ NS_IMETHODIMP nsExternalHelperAppService::ApplyDecodingForExtension(+@@ -866,6 +867,12 @@ NS_IMETHODIMP nsExternalHelperAppService::ApplyDecodingForExtension(return NS_OK;}@@ -2546,7 +2239,7 @@ index 53acc63fe36e30ef7f6618ceca5a1c905ae0a117..a0614d8cf1b103a270ea29295eb8ddbfnsresult nsExternalHelperAppService::GetFileTokenForPath(const char16_t* aPlatformAppPath, nsIFile** aFile) {nsDependentString platformAppPath(aPlatformAppPath);-@@ -1498,7 +1505,12 @@ nsresult nsExternalAppHandler::SetUpTempFile(nsIChannel* aChannel) {+@@ -1497,7 +1504,12 @@ nsresult nsExternalAppHandler::SetUpTempFile(nsIChannel* aChannel) {// Strip off the ".part" from mTempLeafNamemTempLeafName.Truncate(mTempLeafName.Length() - std::size(".part") + 1);@@ -2559,7 +2252,7 @@ index 53acc63fe36e30ef7f6618ceca5a1c905ae0a117..a0614d8cf1b103a270ea29295eb8ddbfmSaver =do_CreateInstance(NS_BACKGROUNDFILESAVERSTREAMLISTENER_CONTRACTID, &rv);NS_ENSURE_SUCCESS(rv, rv);-@@ -1682,7 +1694,36 @@ NS_IMETHODIMP nsExternalAppHandler::OnStartRequest(nsIRequest* request) {+@@ -1681,7 +1693,36 @@ NS_IMETHODIMP nsExternalAppHandler::OnStartRequest(nsIRequest* request) {return NS_OK;}@@ -2597,7 +2290,7 @@ index 53acc63fe36e30ef7f6618ceca5a1c905ae0a117..a0614d8cf1b103a270ea29295eb8ddbfif (NS_FAILED(rv)) {nsresult transferError = rv;-@@ -1743,6 +1784,9 @@ NS_IMETHODIMP nsExternalAppHandler::OnStartRequest(nsIRequest* request) {+@@ -1742,6 +1783,9 @@ NS_IMETHODIMP nsExternalAppHandler::OnStartRequest(nsIRequest* request) {bool alwaysAsk = true;mMimeInfo->GetAlwaysAskBeforeHandling(&alwaysAsk);@@ -2607,7 +2300,7 @@ index 53acc63fe36e30ef7f6618ceca5a1c905ae0a117..a0614d8cf1b103a270ea29295eb8ddbfif (alwaysAsk) {// But we *don't* ask if this mimeInfo didn't come from// our user configuration datastore and the user has said-@@ -2259,6 +2303,16 @@ nsExternalAppHandler::OnSaveComplete(nsIBackgroundFileSaver* aSaver,+@@ -2258,6 +2302,15 @@ nsExternalAppHandler::OnSaveComplete(nsIBackgroundFileSaver* aSaver,NotifyTransfer(aStatus);}@@ -2617,14 +2310,13 @@ index 53acc63fe36e30ef7f6618ceca5a1c905ae0a117..a0614d8cf1b103a270ea29295eb8ddbf+ nsCString noError;+ nsresult rv = interceptor->OnDownloadComplete(this, noError);+ MOZ_ASSERT(NS_SUCCEEDED(rv), "Failed to call nsIDowloadInterceptor.OnDownloadComplete");-+ Unused << rv;+ }+ }+return NS_OK;}-@@ -2742,6 +2796,15 @@ NS_IMETHODIMP nsExternalAppHandler::Cancel(nsresult aReason) {+@@ -2741,6 +2794,14 @@ NS_IMETHODIMP nsExternalAppHandler::Cancel(nsresult aReason) {}}@@ -2634,17 +2326,16 @@ index 53acc63fe36e30ef7f6618ceca5a1c905ae0a117..a0614d8cf1b103a270ea29295eb8ddbf+ GetErrorName(aReason, errorName);+ nsresult rv = interceptor->OnDownloadComplete(this, errorName);+ MOZ_ASSERT(NS_SUCCEEDED(rv), "Failed notify nsIDowloadInterceptor about cancel");-+ Unused << rv;+ }+// Break our reference cycle with the helper app dialog (set up in// OnStartRequest)mDialog = nullptr;diff --git a/uriloader/exthandler/nsExternalHelperAppService.h b/uriloader/exthandler/nsExternalHelperAppService.h-index 78c8199490baae8f65a24b5e0fcea3a2deb3775d..3a3183475fea6188574d88bc6313e2d779bab3f9 100644+index f2e7d379f3e22ada8693d88070e2d2645ed06be4..a5932f2986b29d7b448847b175015c1901ecd95a 100644--- a/uriloader/exthandler/nsExternalHelperAppService.h+++ b/uriloader/exthandler/nsExternalHelperAppService.h-@@ -271,6 +271,8 @@ class nsExternalHelperAppService : public nsIExternalHelperAppService,+@@ -270,6 +270,8 @@ class nsExternalHelperAppService : public nsIExternalHelperAppService,mozilla::dom::BrowsingContext* aContentContext, bool aForceSave,nsIInterfaceRequestor* aWindowContext,nsIStreamListener** aStreamListener);@@ -2653,7 +2344,7 @@ index 78c8199490baae8f65a24b5e0fcea3a2deb3775d..3a3183475fea6188574d88bc6313e2d7};/**-@@ -468,6 +470,9 @@ class nsExternalAppHandler final : public nsIStreamListener,+@@ -467,6 +469,9 @@ class nsExternalAppHandler final : public nsIStreamListener,* Upon successful return, both mTempFile and mSaver will be valid.*/nsresult SetUpTempFile(nsIChannel* aChannel);@@ -2707,23 +2398,25 @@ index e6490ebb086eb4dca9db560c14e073a9e7722e29..2792373dcb30ebc787a9bdca306ac12e/**diff --git a/widget/InProcessCompositorWidget.cpp b/widget/InProcessCompositorWidget.cpp-index b3e514b77ed90b039075903e3c7b378ac894f65a..9b930df5a5f4ec4b4d1fd4f6b00c402e189d4811 100644+index 777157e17e0db442262b1a9522b0b1b39058789a..54c4dde2ee4847e79b07fffe3ec57a34d86ee468 100644--- a/widget/InProcessCompositorWidget.cpp+++ b/widget/InProcessCompositorWidget.cpp-@@ -4,7 +4,10 @@+@@ -4,9 +4,12 @@#include "InProcessCompositorWidget.h"+#include "HeadlessCompositorWidget.h"+#include "HeadlessWidget.h"#include "mozilla/VsyncDispatcher.h"+ #include "mozilla/layers/NativeLayer.h"+ #include "nsIWidget.h"+#include "mozilla/widget/PlatformWidgetTypes.h"- #include "nsBaseWidget.h"namespace mozilla {-@@ -26,6 +29,12 @@ RefPtr<CompositorWidget> CompositorWidget::CreateLocal(+ namespace widget {+@@ -27,6 +30,12 @@ RefPtr<CompositorWidget> CompositorWidget::CreateLocal(// do it after the static_cast.- nsBaseWidget* widget = static_cast<nsBaseWidget*>(aWidget);+ nsIWidget* widget = static_cast<nsIWidget*>(aWidget);MOZ_RELEASE_ASSERT(widget);+ if (aInitData.type() ==+ CompositorWidgetInitData::THeadlessCompositorWidgetInitData) {@@ -2738,7 +2431,7 @@ diff --git a/widget/cocoa/NativeKeyBindings.mm b/widget/cocoa/NativeKeyBindings.index 24b70173c2e8bb9be9fd6255984a70efe3b14099..75ac367a1c4bb44d4b68b5f4ecc6adf56dbd408e 100644--- a/widget/cocoa/NativeKeyBindings.mm+++ b/widget/cocoa/NativeKeyBindings.mm-@@ -549,6 +549,13 @@ void NativeKeyBindings::GetEditCommandsForTests(+@@ -549,6 +549,13 @@break;case KEY_NAME_INDEX_ArrowLeft:if (aEvent.IsAlt()) {@@ -2752,7 +2445,7 @@ index 24b70173c2e8bb9be9fd6255984a70efe3b14099..75ac367a1c4bb44d4b68b5f4ecc6adf5break;}if (aEvent.IsMeta() || (aEvent.IsControl() && aEvent.IsShift())) {-@@ -571,6 +578,13 @@ void NativeKeyBindings::GetEditCommandsForTests(+@@ -571,6 +578,13 @@break;case KEY_NAME_INDEX_ArrowRight:if (aEvent.IsAlt()) {@@ -2766,7 +2459,7 @@ index 24b70173c2e8bb9be9fd6255984a70efe3b14099..75ac367a1c4bb44d4b68b5f4ecc6adf5break;}if (aEvent.IsMeta() || (aEvent.IsControl() && aEvent.IsShift())) {-@@ -593,6 +607,10 @@ void NativeKeyBindings::GetEditCommandsForTests(+@@ -593,6 +607,10 @@break;case KEY_NAME_INDEX_ArrowUp:if (aEvent.IsControl()) {@@ -2777,7 +2470,7 @@ index 24b70173c2e8bb9be9fd6255984a70efe3b14099..75ac367a1c4bb44d4b68b5f4ecc6adf5break;}if (aEvent.IsMeta()) {-@@ -603,7 +621,7 @@ void NativeKeyBindings::GetEditCommandsForTests(+@@ -603,7 +621,7 @@!aEvent.IsShift()? ToObjcSelectorPtr(@selector(moveToBeginningOfDocument:)): ToObjcSelectorPtr(@@ -2786,7 +2479,7 @@ index 24b70173c2e8bb9be9fd6255984a70efe3b14099..75ac367a1c4bb44d4b68b5f4ecc6adf5aCommands);break;}-@@ -630,6 +648,10 @@ void NativeKeyBindings::GetEditCommandsForTests(+@@ -630,6 +648,10 @@break;case KEY_NAME_INDEX_ArrowDown:if (aEvent.IsControl()) {@@ -2798,18 +2491,19 @@ index 24b70173c2e8bb9be9fd6255984a70efe3b14099..75ac367a1c4bb44d4b68b5f4ecc6adf5}if (aEvent.IsMeta()) {diff --git a/widget/headless/HeadlessCompositorWidget.cpp b/widget/headless/HeadlessCompositorWidget.cpp-index bb4ee9175e66dc40de1871a7f91368fe309494a3..6814ae85038d31f1a3b1f87ba341219ffbc1e6b3 100644+index bb4ee9175e66dc40de1871a7f91368fe309494a3..7153fc6b8cd9a0288245f82963dfaa17101bd89e 100644--- a/widget/headless/HeadlessCompositorWidget.cpp+++ b/widget/headless/HeadlessCompositorWidget.cpp-@@ -3,6 +3,7 @@+@@ -3,6 +3,8 @@* License, v. 2.0. If a copy of the MPL was not distributed with this* file, You can obtain one at http://mozilla.org/MPL/2.0/. */++#include "mozilla/gfx/2D.h"+#include "mozilla/layers/CompositorThread.h"#include "mozilla/widget/PlatformWidgetTypes.h"#include "HeadlessCompositorWidget.h"#include "VsyncDispatcher.h"-@@ -15,9 +16,30 @@ HeadlessCompositorWidget::HeadlessCompositorWidget(+@@ -15,9 +17,30 @@ HeadlessCompositorWidget::HeadlessCompositorWidget(const layers::CompositorOptions& aOptions, HeadlessWidget* aWindow): CompositorWidget(aOptions),mWidget(aWindow),@@ -2840,7 +2534,7 @@ index bb4ee9175e66dc40de1871a7f91368fe309494a3..6814ae85038d31f1a3b1f87ba341219fvoid HeadlessCompositorWidget::ObserveVsync(VsyncObserver* aObserver) {if (RefPtr<CompositorVsyncDispatcher> cvd =mWidget->GetCompositorVsyncDispatcher()) {-@@ -31,6 +53,59 @@ void HeadlessCompositorWidget::NotifyClientSizeChanged(+@@ -31,6 +54,59 @@ void HeadlessCompositorWidget::NotifyClientSizeChanged(const LayoutDeviceIntSize& aClientSize) {auto size = mClientSize.Lock();*size = aClientSize;@@ -2944,19 +2638,19 @@ index facd2bc65afab8ec1aa322faa20a67464964dfb9..3c5751ad1b7f042bc7cd9a63895cebcd} // namespace widgetdiff --git a/widget/headless/HeadlessWidget.cpp b/widget/headless/HeadlessWidget.cpp-index 290de12f9d0ff858474564fa8ce54814a04f6088..c144a891b84c3c57f394d6d551e6c89dcd6d9829 100644+index eb2b51e3396b0eb40f985e077db745f0e225e126..38f744ce584b1a891dc838fd2a72b0e17f54acc9 100644--- a/widget/headless/HeadlessWidget.cpp+++ b/widget/headless/HeadlessWidget.cpp-@@ -111,6 +111,8 @@ void HeadlessWidget::Destroy() {+@@ -113,6 +113,8 @@ void HeadlessWidget::Destroy() {}}+ SetSnapshotListener(nullptr);+- nsBaseWidget::OnDestroy();+ nsIWidget::OnDestroy();- nsBaseWidget::Destroy();-@@ -593,5 +595,14 @@ nsresult HeadlessWidget::SynthesizeNativeTouchpadPan(+ nsIWidget::Destroy();+@@ -573,5 +575,14 @@ nsresult HeadlessWidget::SynthesizeNativeTouchpadPan(return NS_OK;}@@ -2972,10 +2666,10 @@ index 290de12f9d0ff858474564fa8ce54814a04f6088..c144a891b84c3c57f394d6d551e6c89d} // namespace widget} // namespace mozilladiff --git a/widget/headless/HeadlessWidget.h b/widget/headless/HeadlessWidget.h-index 60598d097d9dae829ebdc15dede78bd915e3107d..3b5ac5e5590dcb36440e28569f71592db3c1218c 100644+index 81c583f4cb8c8ded1802bb56dbe701594d5760a0..d0c835d584f7dda23afe2e4b1a323e311a575a75 100644--- a/widget/headless/HeadlessWidget.h+++ b/widget/headless/HeadlessWidget.h-@@ -131,6 +131,9 @@ class HeadlessWidget final : public nsBaseWidget {+@@ -128,6 +128,9 @@ class HeadlessWidget final : public nsIWidget {double aDeltaX, double aDeltaY, int32_t aModifierFlags,nsISynthesizedEventCallback* aCallback) override;diff --git a/browser_patches/webkit/UPSTREAM_CONFIG.sh b/browser_patches/webkit/UPSTREAM_CONFIG.shindex 6053d4ac74..e48e0850f7 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="482d54b279fd6147a45aaa122242f2ac315f46df"+BASE_REVISION="6b34ac51510516bd6a3ec2f5edc97413758d3ab1"diff --git a/browser_patches/webkit/patches/bootstrap.diff b/browser_patches/webkit/patches/bootstrap.diffindex ea880670ea..2347ee8733 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 2fd2ad9c04d5b7842c0616cbb8498a5820a35de8..c4d1d4430e4dfe11549817b81dce56e6f03fa50c 100644+index 346c8703fb8fa72385056f027b99818d0051e387..ac90d424170ef7659a0058431fb16c706b42dc65 100644--- a/Source/JavaScriptCore/CMakeLists.txt+++ b/Source/JavaScriptCore/CMakeLists.txt-@@ -1573,21 +1573,26 @@ set(JavaScriptCore_INSPECTOR_DOMAINS+@@ -1593,21 +1593,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 2fd2ad9c04d5b7842c0616cbb8498a5820a35de8..c4d1d4430e4dfe11549817b81dce56e6${JAVASCRIPTCORE_DIR}/inspector/protocol/ServiceWorker.json${JAVASCRIPTCORE_DIR}/inspector/protocol/Target.jsondiff --git a/Source/JavaScriptCore/DerivedSources-input.xcfilelist b/Source/JavaScriptCore/DerivedSources-input.xcfilelist-index 357fead1d52023c208b292ecfd53a82fae91105c..e5a8e38e7caa98b106a8f097209f2a3bce56d36c 100644+index 76fad0e5facc2040128eb1971f69d230418f34c7..7cf1d220f6ff2bdc15076522baced8d31f4f6371 100644--- a/Source/JavaScriptCore/DerivedSources-input.xcfilelist+++ b/Source/JavaScriptCore/DerivedSources-input.xcfilelist-@@ -104,20 +104,25 @@ $(PROJECT_DIR)/inspector/protocol/CPUProfiler.json+@@ -102,20 +102,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 357fead1d52023c208b292ecfd53a82fae91105c..e5a8e38e7caa98b106a8f097209f2a3b$(PROJECT_DIR)/inspector/protocol/Security.json$(PROJECT_DIR)/inspector/protocol/ServiceWorker.jsondiff --git a/Source/JavaScriptCore/DerivedSources.make b/Source/JavaScriptCore/DerivedSources.make-index 76576fec8122f9c4eaca4596c1155978f9dc4879..6bf8628a2a12bc6322ec00721cd499198f59ad38 100644+index 40706dcca1ed7c555d36f7e651dbc4af29c21c3d..cdd9d4e746548d1b56fc918c1fff78d0c20feea9 100644--- a/Source/JavaScriptCore/DerivedSources.make+++ b/Source/JavaScriptCore/DerivedSources.make-@@ -299,21 +299,26 @@ INSPECTOR_DOMAINS := \+@@ -300,21 +300,26 @@ INSPECTOR_DOMAINS := \$(JavaScriptCore)/inspector/protocol/CSS.json \$(JavaScriptCore)/inspector/protocol/Canvas.json \$(JavaScriptCore)/inspector/protocol/Console.json \@@ -118,10 +118,10 @@ index 9bc5d1fd8e2a7e576be046b3c6ae1266696cf552..610f810db1dd6865c500c0796386a828{return addPrefixToIdentifier(++s_lastUsedIdentifier);diff --git a/Source/JavaScriptCore/inspector/IdentifiersFactory.h b/Source/JavaScriptCore/inspector/IdentifiersFactory.h-index b967783b83cc6da337ab0840ce0a0a8d480cbc4f..06a09811709e5e6cb1db24ad6fc4895481d39f65 100644+index e145f18eff043f6d718f38d14159415327a0b43b..747c06864110ef4488d8e4b0f6fd74a1d9badadd 100644--- a/Source/JavaScriptCore/inspector/IdentifiersFactory.h+++ b/Source/JavaScriptCore/inspector/IdentifiersFactory.h-@@ -31,6 +31,7 @@ namespace Inspector {+@@ -32,6 +32,7 @@ namespace Inspector {class IdentifiersFactory {public:@@ -130,7 +130,7 @@ index b967783b83cc6da337ab0840ce0a0a8d480cbc4f..06a09811709e5e6cb1db24ad6fc48954JS_EXPORT_PRIVATE static String requestId(unsigned long identifier);};diff --git a/Source/JavaScriptCore/inspector/InjectedScriptBase.cpp b/Source/JavaScriptCore/inspector/InjectedScriptBase.cpp-index 3a21142b6b7151c05b0da400988b6287954ead40..85b34405cf6ad3fdeb24d6c5f5a06c9cfb96e2f8 100644+index f71488e1292102e0a6e5bfc0cb9a3ddaf572dc80..3e8381c00ac82d186484da22f1e2c3b2c8b28835 100644--- a/Source/JavaScriptCore/inspector/InjectedScriptBase.cpp+++ b/Source/JavaScriptCore/inspector/InjectedScriptBase.cpp@@ -85,7 +85,10 @@ static RefPtr<JSON::Value> jsToInspectorValue(JSC::JSGlobalObject* globalObject,@@ -146,7 +146,7 @@ index 3a21142b6b7151c05b0da400988b6287954ead40..85b34405cf6ad3fdeb24d6c5f5a06c9creturn nullptr;inspectorObject->setValue(name.string(), inspectorValue.releaseNonNull());diff --git a/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.cpp b/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.cpp-index 4803de9a1a83342b61c438bddf2fcfe10d95eb84..c374187a189d73aedbe8cad73cdecb662ffbe4f1 100644+index 449ff9c805107a41f783eaf72b9901d0df6a3e72..a56a086892caa03e171616bd90db8cbf94905b0d 100644--- a/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.cpp+++ b/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.cpp@@ -103,7 +103,7 @@ void BackendDispatcher::registerDispatcherForDomain(const String& domain, Supple@@ -199,10 +199,10 @@ index 13207d2da597e3b96cc9e83d0bee83fa859cdcf0..c4f9f4714578652cb71f106bb0bfdb69}diff --git a/Source/JavaScriptCore/inspector/InspectorTarget.cpp b/Source/JavaScriptCore/inspector/InspectorTarget.cpp-index 0cc2127c9c12c2d82dea9550bad73f4ffb99ba24..8ca65cc042d435cbc0e05dcc5c5dfc958eb24f5a 100644+index b68a7eb5e8d26ea7631b451f629734c886896684..92dba414b7e9c3587ae40c4cb7bb6e4f10895a70 100644--- a/Source/JavaScriptCore/inspector/InspectorTarget.cpp+++ b/Source/JavaScriptCore/inspector/InspectorTarget.cpp-@@ -44,6 +44,8 @@ void InspectorTarget::resume()+@@ -48,6 +48,8 @@ void InspectorTarget::resume()ASSERT(m_isPaused);m_isPaused = false;@@ -211,19 +211,19 @@ index 0cc2127c9c12c2d82dea9550bad73f4ffb99ba24..8ca65cc042d435cbc0e05dcc5c5dfc95if (m_resumeCallback) {m_resumeCallback();m_resumeCallback = nullptr;-@@ -52,7 +54,6 @@ void InspectorTarget::resume()+@@ -56,7 +58,6 @@ void InspectorTarget::resume()void InspectorTarget::setResumeCallback(WTF::Function<void()>&& callback){- ASSERT(!m_resumeCallback);- m_resumeCallback = WTFMove(callback);+ m_resumeCallback = WTF::move(callback);}diff --git a/Source/JavaScriptCore/inspector/InspectorTarget.h b/Source/JavaScriptCore/inspector/InspectorTarget.h-index 64b809b451dc6715ae7e762c702a32f1f8d722da..bfb39f616789786a1851b0a36635a8a2013ba6dc 100644+index 36ab8686085b18e43602f857c23a969335fb2bf3..df94e7f5edb3a17e51aa3151c79b33edbbe3f4ed 100644--- a/Source/JavaScriptCore/inspector/InspectorTarget.h+++ b/Source/JavaScriptCore/inspector/InspectorTarget.h-@@ -66,8 +66,12 @@ public:+@@ -61,8 +61,12 @@ public:virtual void connect(FrontendChannel::ConnectionType) = 0;virtual void disconnect() = 0;virtual void sendMessageToTargetBackend(const String&) = 0;@@ -237,10 +237,10 @@ index 64b809b451dc6715ae7e762c702a32f1f8d722da..bfb39f616789786a1851b0a36635a8a2bool m_isPaused { false };};diff --git a/Source/JavaScriptCore/inspector/JSGlobalObjectConsoleClient.cpp b/Source/JavaScriptCore/inspector/JSGlobalObjectConsoleClient.cpp-index 2b36937d913f237ca777f455ada0fbb9bf5f29df..1dd30c0c017dcce8b9019d5c2bf28005e6ea971e 100644+index ddd58da62382291979c72d62700c61c137f5b965..ab114ba249ec6901c78da7703b5e8140d7cebcca 100644--- a/Source/JavaScriptCore/inspector/JSGlobalObjectConsoleClient.cpp+++ b/Source/JavaScriptCore/inspector/JSGlobalObjectConsoleClient.cpp-@@ -222,6 +222,14 @@ void JSGlobalObjectConsoleClient::screenshot(JSGlobalObject*, Ref<ScriptArgument+@@ -232,6 +232,14 @@ void JSGlobalObjectConsoleClient::screenshot(JSGlobalObject*, Ref<ScriptArgumentwarnUnimplemented("console.screenshot"_s);}@@ -256,10 +256,10 @@ index 2b36937d913f237ca777f455ada0fbb9bf5f29df..1dd30c0c017dcce8b9019d5c2bf28005{auto message = makeString(method, " is currently ignored in JavaScript context inspection."_s);diff --git a/Source/JavaScriptCore/inspector/JSGlobalObjectConsoleClient.h b/Source/JavaScriptCore/inspector/JSGlobalObjectConsoleClient.h-index 6bbd0729a65b4a901e7da4dc50cc47c669bd9897..452b25d0e8eba3df1d5f6623dc222048bef120cd 100644+index 56ca0ba36ff4f65bc1328cc707d48118782af5d5..fed316cf8302b415d821e807fac7b0712d51c0f6 100644--- a/Source/JavaScriptCore/inspector/JSGlobalObjectConsoleClient.h+++ b/Source/JavaScriptCore/inspector/JSGlobalObjectConsoleClient.h-@@ -64,6 +64,7 @@ private:+@@ -68,6 +68,7 @@ private:void record(JSC::JSGlobalObject*, Ref<ScriptArguments>&&) final;void recordEnd(JSC::JSGlobalObject*, Ref<ScriptArguments>&&) final;void screenshot(JSC::JSGlobalObject*, Ref<ScriptArguments>&&) final;@@ -268,7 +268,7 @@ index 6bbd0729a65b4a901e7da4dc50cc47c669bd9897..452b25d0e8eba3df1d5f6623dc222048void warnUnimplemented(const String& method);void internalAddMessage(MessageType, MessageLevel, JSC::JSGlobalObject*, Ref<ScriptArguments>&&);diff --git a/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp b/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp-index ada998de5ad48030951dd17f967f852a091f1ccf..717fa83fe0e1769b91ba80725bb59ceadcce5e71 100644+index a48b3dcd1ce11c1164860ebfa36951ce58a43091..e6b7ccdb960d64f339adf2d4f0045a0d9eb1cd6a 100644--- a/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp+++ b/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp@@ -194,9 +194,8 @@ void InspectorRuntimeAgent::callFunctionOn(const Protocol::Runtime::RemoteObject@@ -295,10 +295,10 @@ index ada998de5ad48030951dd17f967f852a091f1ccf..717fa83fe0e1769b91ba80725bb59cea{Protocol::ErrorString errorString;diff --git a/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.h b/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.h-index 8240c23298f680abb6c379d02841c566fb287f1c..c9567e12c54c5775af6d52e59663e18b3a2682e4 100644+index 241790f97d1f59dfcbfa89b32a42145d11afe358..19adfb3bee0602e112af6734b6bc732d3d6ab8c4 100644--- a/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.h+++ b/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.h-@@ -64,6 +64,7 @@ public:+@@ -65,6 +65,7 @@ public:Protocol::ErrorStringOr<std::tuple<Ref<Protocol::Runtime::RemoteObject>, std::optional<bool> /* wasThrown */, std::optional<int> /* savedResultIndex */>> evaluate(const String& expression, const String& objectGroup, std::optional<bool>&& includeCommandLineAPI, std::optional<bool>&& doNotPauseOnExceptionsAndMuteConsole, std::optional<Protocol::Runtime::ExecutionContextId>&&, std::optional<bool>&& returnByValue, std::optional<bool>&& generatePreview, std::optional<bool>&& saveResult, std::optional<bool>&& emulateUserGesture) override;void awaitPromise(const Protocol::Runtime::RemoteObjectId&, std::optional<bool>&& returnByValue, std::optional<bool>&& generatePreview, std::optional<bool>&& saveResult, Ref<AwaitPromiseCallback>&&) final;void callFunctionOn(const Protocol::Runtime::RemoteObjectId&, const String& functionDeclaration, RefPtr<JSON::Array>&& arguments, std::optional<bool>&& doNotPauseOnExceptionsAndMuteConsole, std::optional<bool>&& returnByValue, std::optional<bool>&& generatePreview, std::optional<bool>&& emulateUserGesture, std::optional<bool>&& awaitPromise, Ref<CallFunctionOnCallback>&&) override;@@ -307,7 +307,7 @@ index 8240c23298f680abb6c379d02841c566fb287f1c..c9567e12c54c5775af6d52e59663e18bProtocol::ErrorStringOr<Ref<Protocol::Runtime::ObjectPreview>> getPreview(const Protocol::Runtime::RemoteObjectId&) final;Protocol::ErrorStringOr<std::tuple<Ref<JSON::ArrayOf<Protocol::Runtime::PropertyDescriptor>>, RefPtr<JSON::ArrayOf<Protocol::Runtime::InternalPropertyDescriptor>>>> getProperties(const Protocol::Runtime::RemoteObjectId&, std::optional<bool>&& ownProperties, std::optional<int>&& fetchStart, std::optional<int>&& fetchCount, std::optional<bool>&& generatePreview) final;diff --git a/Source/JavaScriptCore/inspector/agents/InspectorTargetAgent.cpp b/Source/JavaScriptCore/inspector/agents/InspectorTargetAgent.cpp-index b0d937315d615fe0ea8774b057032e4096817a49..a27540d1789d74b8a0e64266f26a27c27926e6aa 100644+index ff3a990394674c30274a320863d8bcd63aa3ffa6..9213eed13d8503120350157f8c6604a6467a7ffc 100644--- a/Source/JavaScriptCore/inspector/agents/InspectorTargetAgent.cpp+++ b/Source/JavaScriptCore/inspector/agents/InspectorTargetAgent.cpp@@ -90,6 +90,34 @@ Protocol::ErrorStringOr<void> InspectorTargetAgent::sendMessageToTarget(const St@@ -391,7 +391,7 @@ index 0b7d732f036fce96b01bd06f4c47f5d471a0ab38..a9efea4bec66aa68966c99d9e77f8a36// FrontendChannelFrontendChannel::ConnectionType connectionType() const;diff --git a/Source/JavaScriptCore/inspector/protocol/DOM.json b/Source/JavaScriptCore/inspector/protocol/DOM.json-index 504351538a9fca72749c7f2e424a363445197255..9786af592372140829191ea436136916edc32db6 100644+index 0b41f31605a2407fd068e28eaec60dbeabefd4d8..80fc7f1351949447c1f988641a26bcf695d589f2 100644--- a/Source/JavaScriptCore/inspector/protocol/DOM.json+++ b/Source/JavaScriptCore/inspector/protocol/DOM.json@@ -80,6 +80,16 @@@@ -411,7 +411,7 @@ index 504351538a9fca72749c7f2e424a363445197255..9786af592372140829191ea436136916{"id": "EventListener","type": "object",-@@ -747,7 +757,10 @@+@@ -740,7 +750,10 @@"description": "Resolves JavaScript node object for given node id.","targetTypes": ["page"],"parameters": [@@ -423,7 +423,7 @@ index 504351538a9fca72749c7f2e424a363445197255..9786af592372140829191ea436136916{ "name": "objectGroup", "type": "string", "optional": true, "description": "Symbolic group name that can be used to release multiple objects." }],"returns": [-@@ -824,6 +837,46 @@+@@ -817,6 +830,46 @@"returns": [{ "name": "mediaStats", "$ref": "MediaStats", "description": "An interleaved array of node attribute names and values." }]@@ -848,7 +848,7 @@ index 0000000000000000000000000000000000000000..1c43b476603325fa412bcfded9163e7a+ ]+}diff --git a/Source/JavaScriptCore/inspector/protocol/Network.json b/Source/JavaScriptCore/inspector/protocol/Network.json-index 96af27ece2ac200e11c4311b3ca0d9d3b5a048da..3168f7806fcbdabec07acc5e304bae1e3736240a 100644+index ddf769378ef2e15ca2fd90384e5ac01a2a5136b2..314f92e5377816f5115a85aac7255b713c1ffa8c 100644--- a/Source/JavaScriptCore/inspector/protocol/Network.json+++ b/Source/JavaScriptCore/inspector/protocol/Network.json@@ -352,6 +352,13 @@@@ -866,7 +866,7 @@ index 96af27ece2ac200e11c4311b3ca0d9d3b5a048da..3168f7806fcbdabec07acc5e304bae1e],"events": [diff --git a/Source/JavaScriptCore/inspector/protocol/Page.json b/Source/JavaScriptCore/inspector/protocol/Page.json-index 223af5102b093482e5a7b76d248ad6862b960e30..760a97841009d6f1feac0e8f2e6ae4d392180eab 100644+index 374b26c3ee9acf39aeb23fb60821b39d0afd971c..8843241e3e669c2d7537adb11e83325f216febba 100644--- a/Source/JavaScriptCore/inspector/protocol/Page.json+++ b/Source/JavaScriptCore/inspector/protocol/Page.json@@ -20,7 +20,15 @@@@ -1143,10 +1143,10 @@ index 223af5102b093482e5a7b76d248ad6862b960e30..760a97841009d6f1feac0e8f2e6ae4d3}diff --git a/Source/JavaScriptCore/inspector/protocol/Playwright.json b/Source/JavaScriptCore/inspector/protocol/Playwright.jsonnew file mode 100644-index 0000000000000000000000000000000000000000..8dc7f2bd04172dd6cabb1d869a295569b4c38ed8+index 0000000000000000000000000000000000000000..ade3e257b614f210ba5dcc024df81642425f8d51--- /dev/null+++ b/Source/JavaScriptCore/inspector/protocol/Playwright.json-@@ -0,0 +1,316 @@+@@ -0,0 +1,310 @@+{+ "domain": "Playwright",+ "availability": ["web"],@@ -1395,7 +1395,7 @@ index 0000000000000000000000000000000000000000..8dc7f2bd04172dd6cabb1d869a295569+ "description": "Clears browser memory cache.",+ "async": true,+ "parameters": [-+ { "name": "browserContextId", "$ref": "ContextID", "optional": false, "description": "Browser context id." }++ { "name": "browserContextId", "$ref": "ContextID", "optional": true, "description": "Browser context id." }+ ]+ }+ ],@@ -1454,17 +1454,11 @@ index 0000000000000000000000000000000000000000..8dc7f2bd04172dd6cabb1d869a295569+ { "name": "uuid", "type": "string" },+ { "name": "error", "type": "string" }+ ]-+ },-+ {-+ "name": "screencastFinished",-+ "parameters": [-+ { "name": "screencastId", "$ref": "Screencast.ScreencastId", "description": "Unique identifier of the screencast." }-+ ]+ }+ ]+}diff --git a/Source/JavaScriptCore/inspector/protocol/Runtime.json b/Source/JavaScriptCore/inspector/protocol/Runtime.json-index 3339fb0806d71bce472f34ff6454a6aa86be7de9..da7580b94519fd56eaf69d4094b4799075ea577d 100644+index 293f11b5a1a82c5e0f67cbdcb5d8b36789c2b148..213000a8dfe9c6a8a7f85e294e15e8ae6f137903 100644--- a/Source/JavaScriptCore/inspector/protocol/Runtime.json+++ b/Source/JavaScriptCore/inspector/protocol/Runtime.json@@ -272,6 +272,13 @@@@ -1500,10 +1494,10 @@ index 3339fb0806d71bce472f34ff6454a6aa86be7de9..da7580b94519fd56eaf69d4094b47990}diff --git a/Source/JavaScriptCore/inspector/protocol/Screencast.json b/Source/JavaScriptCore/inspector/protocol/Screencast.jsonnew file mode 100644-index 0000000000000000000000000000000000000000..9ce147f260f32fd5719a7c00d9018a5fec3e51fa+index 0000000000000000000000000000000000000000..8546676698ddb1e0606068dd99f66cc8cca6357f--- /dev/null+++ b/Source/JavaScriptCore/inspector/protocol/Screencast.json-@@ -0,0 +1,65 @@+@@ -0,0 +1,47 @@+{+ "domain": "Screencast",+ "availability": ["web"],@@ -1516,24 +1510,6 @@ index 0000000000000000000000000000000000000000..9ce147f260f32fd5719a7c00d9018a5f+ ],+ "commands": [+ {-+ "name": "startVideo",-+ "description": "Starts recoring video to speified file.",-+ "parameters": [-+ { "name": "file", "type": "string", "description": "Output file location." },-+ { "name": "width", "type": "integer" },-+ { "name": "height", "type": "integer" },-+ { "name": "toolbarHeight", "type": "integer" }-+ ],-+ "returns": [-+ { "name": "screencastId", "$ref": "ScreencastId", "description": "Unique identifier of the screencast." }-+ ]-+ },-+ {-+ "name": "stopVideo",-+ "async": true,-+ "description": "Stops recoding video. Returns after the file has been closed."-+ },-+ {+ "name": "startScreencast",+ "description": "Starts screencast.",+ "parameters": [@@ -1615,10 +1591,10 @@ index a861a83b87e4e7752e547b7070ec1ef26e1cc3e5..16d6ec26034758e127dcb599f5cb1708},{diff --git a/Source/JavaScriptCore/runtime/ConsoleClient.h b/Source/JavaScriptCore/runtime/ConsoleClient.h-index ca132d74f5f4303452ed96186eea3ae860926e0a..aaccfae22ad1a8e6c11974e36dab4b867df7f693 100644+index 6af957ee69490bad4443e90161adc2230c329105..1270e77b913578ba8965fdd30c4bd44687d891ab 100644--- a/Source/JavaScriptCore/runtime/ConsoleClient.h+++ b/Source/JavaScriptCore/runtime/ConsoleClient.h-@@ -78,6 +78,7 @@ public:+@@ -74,6 +74,7 @@ public:virtual void record(JSGlobalObject*, Ref<Inspector::ScriptArguments>&&) = 0;virtual void recordEnd(JSGlobalObject*, Ref<Inspector::ScriptArguments>&&) = 0;virtual void screenshot(JSGlobalObject*, Ref<Inspector::ScriptArguments>&&) = 0;@@ -1626,409 +1602,8 @@ index ca132d74f5f4303452ed96186eea3ae860926e0a..aaccfae22ad1a8e6c11974e36dab4b86private:enum class ArgumentRequirement { No, Yes };-diff --git a/Source/ThirdParty/libwebrtc/CMakeLists.txt b/Source/ThirdParty/libwebrtc/CMakeLists.txt-index 7fc1d9e7784759d7d12b7bce4ef1c29c66bf562e..009e93af3a7af5b90d4a66ad236999756b34ecb6 100644---- a/Source/ThirdParty/libwebrtc/CMakeLists.txt-+++ b/Source/ThirdParty/libwebrtc/CMakeLists.txt-@@ -195,17 +195,21 @@ list(APPEND webrtc_SOURCES- Source/webrtc/api/audio_options.cc- Source/webrtc/api/call/transport.cc- Source/webrtc/api/candidate.cc-+ Source/webrtc/api/create_modular_peer_connection_factory.cc- Source/webrtc/api/create_peerconnection_factory.cc- Source/webrtc/api/crypto/crypto_options.cc- Source/webrtc/api/data_channel_interface.cc-+ Source/webrtc/api/datagram_connection_factory.cc- Source/webrtc/api/dtls_transport_interface.cc- Source/webrtc/api/enable_media.cc- Source/webrtc/api/enable_media_with_defaults.cc-+ Source/webrtc/api/environment/deprecated_global_field_trials.cc- Source/webrtc/api/environment/environment_factory.cc- Source/webrtc/api/field_trials.cc- Source/webrtc/api/field_trials_registry.cc- Source/webrtc/api/frame_transformer_factory.cc- Source/webrtc/api/frame_transformer_interface.cc-+ Source/webrtc/api/ice_server_parsing.cc- Source/webrtc/api/ice_transport_factory.cc- Source/webrtc/api/jsep.cc- Source/webrtc/api/jsep_ice_candidate.cc-@@ -232,15 +236,14 @@ list(APPEND webrtc_SOURCES- Source/webrtc/api/rtp_sender_interface.cc- Source/webrtc/api/rtp_transceiver_interface.cc- Source/webrtc/api/sctp_transport_interface.cc-- # Source/webrtc/api/task_queue/default_task_queue_factory_gcd.cc- Source/webrtc/api/task_queue/default_task_queue_factory_stdlib.cc- Source/webrtc/api/task_queue/default_task_queue_factory_win.cc- Source/webrtc/api/task_queue/pending_task_safety_flag.cc- Source/webrtc/api/task_queue/task_queue_base.cc- Source/webrtc/api/transport/bitrate_settings.cc-- Source/webrtc/api/transport/field_trial_based_config.cc- Source/webrtc/api/transport/goog_cc_factory.cc- Source/webrtc/api/transport/network_types.cc-+ Source/webrtc/api/transport/rtp/corruption_detection_message.cc- Source/webrtc/api/transport/rtp/dependency_descriptor.cc- Source/webrtc/api/transport/stun.cc- Source/webrtc/api/units/data_rate.cc-@@ -250,6 +253,10 @@ list(APPEND webrtc_SOURCES- Source/webrtc/api/units/timestamp.cc- Source/webrtc/api/video/builtin_video_bitrate_allocator_factory.cc- Source/webrtc/api/video/color_space.cc-+ Source/webrtc/api/video/corruption_detection/frame_instrumentation_data.cc-+ Source/webrtc/api/video/corruption_detection/frame_instrumentation_data_reader.cc-+ Source/webrtc/api/video/corruption_detection/frame_instrumentation_evaluation.cc-+ Source/webrtc/api/video/corruption_detection/frame_instrumentation_generator.cc- Source/webrtc/api/video/encoded_frame.cc- Source/webrtc/api/video/encoded_image.cc- Source/webrtc/api/video/frame_buffer.cc-@@ -276,7 +283,6 @@ list(APPEND webrtc_SOURCES- Source/webrtc/api/video_codecs/builtin_video_encoder_factory.cc- Source/webrtc/api/video_codecs/h264_profile_level_id.cc- Source/webrtc/api/video_codecs/h265_profile_tier_level.cc-- # Source/webrtc/api/video_codecs/libaom_av1_encoder_factory.cc- Source/webrtc/api/video_codecs/scalability_mode.cc- Source/webrtc/api/video_codecs/scalability_mode_helper.cc- Source/webrtc/api/video_codecs/sdp_video_format.cc-@@ -293,6 +299,7 @@ list(APPEND webrtc_SOURCES- Source/webrtc/api/video_codecs/vp8_temporal_layers_factory.cc- Source/webrtc/api/video_codecs/vp9_profile.cc- Source/webrtc/api/voip/voip_engine_factory.cc-+ Source/webrtc/api/webrtc_sdp.cc- Source/webrtc/audio/audio_level.cc- Source/webrtc/audio/audio_receive_stream.cc- Source/webrtc/audio/audio_send_stream.cc-@@ -404,7 +411,6 @@ list(APPEND webrtc_SOURCES- Source/webrtc/common_audio/wav_header.cc- Source/webrtc/common_audio/window_generator.cc- Source/webrtc/common_video/bitrate_adjuster.cc-- Source/webrtc/common_video/corruption_detection_converters.cc- Source/webrtc/common_video/frame_rate_estimator.cc- Source/webrtc/common_video/framerate_controller.cc- Source/webrtc/common_video/generic_frame_descriptor/generic_frame_info.cc-@@ -438,6 +444,7 @@ list(APPEND webrtc_SOURCES- Source/webrtc/logging/rtc_event_log/events/rtc_event_begin_log.cc- Source/webrtc/logging/rtc_event_log/events/rtc_event_bwe_update_delay_based.cc- Source/webrtc/logging/rtc_event_log/events/rtc_event_bwe_update_loss_based.cc-+ Source/webrtc/logging/rtc_event_log/events/rtc_event_bwe_update_scream.cc- Source/webrtc/logging/rtc_event_log/events/rtc_event_dtls_transport_state.cc- Source/webrtc/logging/rtc_event_log/events/rtc_event_dtls_writable_state.cc- Source/webrtc/logging/rtc_event_log/events/rtc_event_end_log.cc-@@ -445,9 +452,6 @@ list(APPEND webrtc_SOURCES- Source/webrtc/logging/rtc_event_log/events/rtc_event_field_encoding_parser.cc- Source/webrtc/logging/rtc_event_log/events/rtc_event_field_extraction.cc- Source/webrtc/logging/rtc_event_log/events/rtc_event_frame_decoded.cc-- Source/webrtc/logging/rtc_event_log/events/rtc_event_generic_ack_received.cc-- Source/webrtc/logging/rtc_event_log/events/rtc_event_generic_packet_received.cc-- Source/webrtc/logging/rtc_event_log/events/rtc_event_generic_packet_sent.cc- Source/webrtc/logging/rtc_event_log/events/rtc_event_ice_candidate_pair.cc- Source/webrtc/logging/rtc_event_log/events/rtc_event_ice_candidate_pair_config.cc- Source/webrtc/logging/rtc_event_log/events/rtc_event_neteq_set_minimum_delay.cc-@@ -778,6 +782,10 @@ list(APPEND webrtc_SOURCES- Source/webrtc/modules/congestion_controller/rtp/control_handler.cc- Source/webrtc/modules/congestion_controller/rtp/transport_feedback_adapter.cc- Source/webrtc/modules/congestion_controller/rtp/transport_feedback_demuxer.cc-+ Source/webrtc/modules/congestion_controller/scream/delay_based_congestion_control.cc-+ Source/webrtc/modules/congestion_controller/scream/scream_network_controller.cc-+ Source/webrtc/modules/congestion_controller/scream/scream_v2.cc-+ Source/webrtc/modules/congestion_controller/scream/scream_v2_parameters.cc- Source/webrtc/modules/pacing/bitrate_prober.cc- Source/webrtc/modules/pacing/interval_budget.cc- Source/webrtc/modules/pacing/pacing_controller.cc-@@ -805,7 +813,6 @@ list(APPEND webrtc_SOURCES- Source/webrtc/modules/rtp_rtcp/source/capture_clock_offset_updater.cc- Source/webrtc/modules/rtp_rtcp/source/corruption_detection_extension.cc- Source/webrtc/modules/rtp_rtcp/source/create_video_rtp_depacketizer.cc-- Source/webrtc/modules/rtp_rtcp/source/deprecated/deprecated_rtp_sender_egress.cc- Source/webrtc/modules/rtp_rtcp/source/dtmf_queue.cc- Source/webrtc/modules/rtp_rtcp/source/fec_private_tables_bursty.cc- Source/webrtc/modules/rtp_rtcp/source/fec_private_tables_random.cc-@@ -876,7 +883,6 @@ list(APPEND webrtc_SOURCES- Source/webrtc/modules/rtp_rtcp/source/rtp_packet_to_send.cc- Source/webrtc/modules/rtp_rtcp/source/rtp_packetizer_av1.cc- Source/webrtc/modules/rtp_rtcp/source/rtp_packetizer_h265.cc-- Source/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc- Source/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl2.cc- Source/webrtc/modules/rtp_rtcp/source/rtp_sender.cc- Source/webrtc/modules/rtp_rtcp/source/rtp_sender_audio.cc-@@ -975,6 +981,7 @@ list(APPEND webrtc_SOURCES- Source/webrtc/modules/video_coding/utility/corruption_detection_settings_generator.cc- Source/webrtc/modules/video_coding/utility/decoded_frames_history.cc- Source/webrtc/modules/video_coding/utility/frame_dropper.cc-+ Source/webrtc/modules/video_coding/utility/frame_sampler.cc- Source/webrtc/modules/video_coding/utility/framerate_controller_deprecated.cc- Source/webrtc/modules/video_coding/utility/ivf_file_reader.cc- Source/webrtc/modules/video_coding/utility/ivf_file_writer.cc-@@ -1099,6 +1106,7 @@ list(APPEND webrtc_SOURCES- Source/webrtc/pc/connection_context.cc- Source/webrtc/pc/data_channel_controller.cc- Source/webrtc/pc/data_channel_utils.cc-+ Source/webrtc/pc/datagram_connection_internal.cc- Source/webrtc/pc/dtls_srtp_transport.cc- Source/webrtc/pc/dtls_transport.cc- Source/webrtc/pc/dtmf_sender.cc-@@ -1106,8 +1114,6 @@ list(APPEND webrtc_SOURCES- Source/webrtc/pc/ice_server_parsing.cc- Source/webrtc/pc/ice_transport.cc- Source/webrtc/pc/jitter_buffer_delay.cc-- Source/webrtc/pc/jsep_ice_candidate.cc-- Source/webrtc/pc/jsep_session_description.cc- Source/webrtc/pc/jsep_transport.cc- Source/webrtc/pc/jsep_transport_collection.cc- Source/webrtc/pc/jsep_transport_controller.cc-@@ -1122,9 +1128,9 @@ list(APPEND webrtc_SOURCES- Source/webrtc/pc/peer_connection_factory.cc- Source/webrtc/pc/peer_connection_message_handler.cc- Source/webrtc/pc/remote_audio_source.cc-- Source/webrtc/pc/rtcp_mux_filter.cc- Source/webrtc/pc/rtc_stats_collector.cc- Source/webrtc/pc/rtc_stats_traversal.cc-+ Source/webrtc/pc/rtcp_mux_filter.cc- Source/webrtc/pc/rtp_media_utils.cc- Source/webrtc/pc/rtp_parameters_conversion.cc- Source/webrtc/pc/rtp_receiver.cc-@@ -1153,7 +1159,6 @@ list(APPEND webrtc_SOURCES- Source/webrtc/pc/video_track.cc- Source/webrtc/pc/video_track_source.cc- Source/webrtc/pc/video_track_source_proxy.cc-- Source/webrtc/pc/webrtc_sdp.cc- Source/webrtc/pc/webrtc_session_description_factory.cc- Source/webrtc/rtc_base/async_dns_resolver.cc- Source/webrtc/rtc_base/async_packet_socket.cc-@@ -1184,12 +1189,14 @@ list(APPEND webrtc_SOURCES- Source/webrtc/rtc_base/experiments/alr_experiment.cc- Source/webrtc/rtc_base/experiments/balanced_degradation_settings.cc- Source/webrtc/rtc_base/experiments/encoder_info_settings.cc-+ Source/webrtc/rtc_base/experiments/encoder_speed_experiment.cc- Source/webrtc/rtc_base/experiments/field_trial_list.cc- Source/webrtc/rtc_base/experiments/field_trial_parser.cc- Source/webrtc/rtc_base/experiments/field_trial_units.cc- Source/webrtc/rtc_base/experiments/keyframe_interval_settings.cc- Source/webrtc/rtc_base/experiments/min_video_bitrate_experiment.cc- Source/webrtc/rtc_base/experiments/normalize_simulcast_size_experiment.cc-+ Source/webrtc/rtc_base/experiments/psnr_experiment.cc- Source/webrtc/rtc_base/experiments/quality_scaler_settings.cc- Source/webrtc/rtc_base/experiments/quality_scaling_experiment.cc- Source/webrtc/rtc_base/experiments/rate_control_settings.cc-@@ -1304,8 +1311,6 @@ list(APPEND webrtc_SOURCES- Source/webrtc/video/config/video_encoder_config.cc- Source/webrtc/video/corruption_detection/corruption_classifier.cc- Source/webrtc/video/corruption_detection/evaluation/utils.cc-- Source/webrtc/video/corruption_detection/frame_instrumentation_evaluation.cc-- Source/webrtc/video/corruption_detection/frame_instrumentation_generator.cc- Source/webrtc/video/corruption_detection/frame_pair_corruption_score.cc- Source/webrtc/video/corruption_detection/generic_mapping_functions.cc- Source/webrtc/video/corruption_detection/halton_frame_sampler.cc-@@ -1336,6 +1341,9 @@ list(APPEND webrtc_SOURCES- Source/webrtc/video/stats_counter.cc- Source/webrtc/video/stream_synchronization.cc- Source/webrtc/video/task_queue_frame_decode_scheduler.cc-+ Source/webrtc/video/timing/simulator/assembler.cc-+ Source/webrtc/video/timing/simulator/decodability_tracker.cc-+ Source/webrtc/video/timing/simulator/rendering_tracker.cc- Source/webrtc/video/transport_adapter.cc- Source/webrtc/video/unique_timestamp_counter.cc- Source/webrtc/video/video_loopback_main.cc-@@ -1788,6 +1796,14 @@ list(APPEND webrtc_SOURCES- Source/third_party/boringssl/src/util/fipstools/acvp/modulewrapper/proto.cc- )--+# Playwright begin-+list(APPEND webrtc_SOURCES-+ Source/third_party/libwebm/mkvmuxer/mkvmuxer.cc-+ Source/third_party/libwebm/mkvmuxer/mkvmuxerutil.cc-+ Source/third_party/libwebm/mkvmuxer/mkvwriter.cc-+)-+# Playwright end-+- if (WTF_CPU_X86_64 OR WTF_CPU_X86)- list(APPEND webrtc_SOURCES- Source/webrtc/common_audio/fir_filter_sse.cc-@@ -2356,6 +2372,14 @@ set(webrtc_INCLUDE_DIRECTORIES PRIVATE- Source/webrtc/modules/video_coding/include- )--+# Playwright begin-+list(APPEND webrtc_INCLUDE_DIRECTORIES-+ Source/third_party/libwebm-+ Source/third_party/libvpx/source/libvpx-+ Source/third_party/libvpx/source/libvpx/third_party/googletest/src/include-+)-+# Playwright end-+- if (APPLE)- list(APPEND webrtc_INCLUDE_DIRECTORIES PRIVATE- Source/third_party/libvpx/source/libvpx-diff --git a/Source/ThirdParty/libwebrtc/Configurations/Base-libwebrtc.xcconfig b/Source/ThirdParty/libwebrtc/Configurations/Base-libwebrtc.xcconfig-index 0c5c8e689bdddec766f9de5bffd4444a5e068d77..330dd1f585e530722178c65c883641a2b8c0f1bd 100644---- a/Source/ThirdParty/libwebrtc/Configurations/Base-libwebrtc.xcconfig-+++ b/Source/ThirdParty/libwebrtc/Configurations/Base-libwebrtc.xcconfig-@@ -24,6 +24,8 @@- HEADER_SEARCH_PATHS = Source Source/third_party/libsrtp/crypto/include Source/third_party/libsrtp/include Source/third_party/boringssl/src/include Source/third_party/libyuv/include Source/webrtc/webkit_sdk/objc/Framework/Headers Source/webrtc/common_audio/signal_processing/include Source/webrtc/modules/audio_coding/codecs/isac/main/include Source/third_party/opus/src/celt Source/third_party/opus/src/include Source/third_party/opus/src/src Source/webrtc/modules/audio_device/mac Source/webrtc/modules/audio_device/ios Source/webrtc Source/webrtc/webkit_sdk/objc Source/webrtc/webkit_sdk/objc/base Source/webrtc/webkit_sdk/objc/Framework/Classes Source/third_party/libsrtp/config Source/webrtc/webkit_sdk/objc/Framework/Classes/Common Source/webrtc/webkit_sdk/objc/Framework/Classes/Video Source/webrtc/webkit_sdk/objc/Framework/Classes/PeerConnection Source/third_party/abseil-cpp Source/third_party/libvpx/source/libvpx Source/third_party/libwebm/webm_parser/include Source/third_party/crc32c/config Source/third_party/crc32c/include Source/third_party/crc32c/src/include Source/third_party/libaom/source/libaom;- USE_HEADERMAP = NO;--+HEADER_SEARCH_PATHS = ${HEADER_SEARCH_PATHS} Source/third_party/libwebm/mkvmuxer Source/third_party/libvpx/source/libvpx/third_party/libwebm;-+- WARNING_CFLAGS = -Wno-deprecated-declarations $(inherited);-- // FIXME: Set WEBRTC_USE_BUILTIN_ISAC_FIX and WEBRTC_USE_BUILTIN_ISAC_FLOAT for iOS and Mac-diff --git a/Source/ThirdParty/libwebrtc/Configurations/libwebrtc.exp b/Source/ThirdParty/libwebrtc/Configurations/libwebrtc.exp-index 216096336500be29461eee584711a7c0aea05bf8..dab588c0f41fc6e6a31e15af0a32835a6b3e1e42 100644---- a/Source/ThirdParty/libwebrtc/Configurations/libwebrtc.exp-+++ b/Source/ThirdParty/libwebrtc/Configurations/libwebrtc.exp-@@ -415,3 +415,16 @@ __ZN6webrtc9CandidateC1ERKS0_- __ZNK6webrtc27SessionDescriptionInterface8ToStringEv- __ZN6webrtc14SdpDeserializeENS_7SdpTypeENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEPNS_13SdpParseErrorE- __ZN6webrtc18callback_list_impl21CallbackListReceiversD1Ev-+__ZN8mkvmuxer11SegmentInfo4InitEv-+__ZN8mkvmuxer9MkvWriterC1EP7__sFILE-+_ARGBToI420-+_vpx_codec_destroy-+_vpx_codec_enc_config_default-+_vpx_codec_enc_init_ver-+_vpx_codec_encode-+_vpx_codec_err_to_string-+_vpx_codec_error-+_vpx_codec_get_cx_data-+_vpx_codec_iface_name-+_vpx_codec_version_str-+_vpx_codec_vp8_cx-diff --git a/Source/ThirdParty/libwebrtc/libwebrtc.xcodeproj/project.pbxproj b/Source/ThirdParty/libwebrtc/libwebrtc.xcodeproj/project.pbxproj-index a4cb19044072d837dcf12894c454ee6914956880..2fcc5f14343d8502f7f2d87fcdff444538678617 100644---- a/Source/ThirdParty/libwebrtc/libwebrtc.xcodeproj/project.pbxproj-+++ b/Source/ThirdParty/libwebrtc/libwebrtc.xcodeproj/project.pbxproj-@@ -56,6 +56,20 @@- };- /* End PBXAggregateTarget section */--+/* Begin PBXAggregateTarget section */-+ F31720AC27FE215900EEE407 /* Copy libvpx headers */ = {-+ isa = PBXAggregateTarget;-+ buildConfigurationList = F31720B027FE215900EEE407 /* Build configuration list for PBXAggregateTarget "Copy libvpx headers" */;-+ buildPhases = (-+ F31720B127FE216400EEE407 /* ShellScript */,-+ );-+ dependencies = (-+ );-+ name = "Copy libvpx headers";-+ productName = "Copy libvpx headers";-+ };-+/* End PBXAggregateTarget section */-+- /* Begin PBXBuildFile section */- 2938424F2E258DF1006DF6A9 /* aesni-gcm-x86_64-apple.S in Sources */ = {isa = PBXBuildFile; fileRef = 293841D82E258DF1006DF6A9 /* aesni-gcm-x86_64-apple.S */; };- 293842512E258DF1006DF6A9 /* ghash-x86_64-apple.S in Sources */ = {isa = PBXBuildFile; fileRef = 293842002E258DF1006DF6A9 /* ghash-x86_64-apple.S */; };-@@ -5708,6 +5722,13 @@- remoteGlobalIDString = DDF30D0527C5C003006A526F;- remoteInfo = absl;- };-+ F31720B327FE273100EEE407 /* PBXContainerItemProxy */ = {-+ isa = PBXContainerItemProxy;-+ containerPortal = FB39D0701200ED9200088E69 /* Project object */;-+ proxyType = 1;-+ remoteGlobalIDString = F31720AC27FE215900EEE407;-+ remoteInfo = "Copy libvpx headers";-+ };- /* End PBXContainerItemProxy section */-- /* Begin PBXCopyFilesBuildPhase section */-@@ -24389,6 +24410,7 @@- );- dependencies = (- 410B3827292B73E90003E515 /* PBXTargetDependency */,-+ F31720B427FE273100EEE407 /* PBXTargetDependency */,- DD2E76E827C6B69A00F2A74C /* PBXTargetDependency */,- CDEBB4CC24C01AB400ADBD44 /* PBXTargetDependency */,- 411ED040212E0811004320BA /* PBXTargetDependency */,-@@ -24482,6 +24504,7 @@- 4460B8B92B155B6A00392062 /* vp9_qp_parser_fuzzer */,- 444A6EF02AEADFC9005FE121 /* vp9_replay_fuzzer */,- 44945C512B9BA1C300447FFD /* webm_fuzzer */,-+ F31720AC27FE215900EEE407 /* Copy libvpx headers */,- );- };- /* End PBXProject section */-@@ -24585,6 +24608,23 @@- shellPath = /bin/sh;- shellScript = "[ -z \"${WK_DERIVED_SDK_HEADERS_DIR}\" -o -d \"${WK_DERIVED_SDK_HEADERS_DIR}\" ] && touch \"${SCRIPT_OUTPUT_FILE_0}\"\n";- };-+ F31720B127FE216400EEE407 /* ShellScript */ = {-+ isa = PBXShellScriptBuildPhase;-+ buildActionMask = 2147483647;-+ files = (-+ );-+ inputFileListPaths = (-+ );-+ inputPaths = (-+ );-+ outputFileListPaths = (-+ );-+ outputPaths = (-+ );-+ runOnlyForDeploymentPostprocessing = 0;-+ shellPath = /bin/sh;-+ shellScript = "PRIVATE_HEADERS_FOLDER_PATH=usr/local/include\n\nif [[ \"${DEPLOYMENT_LOCATION}\" == \"NO\" ]]; then\n PRIVATE_HEADERS_PATH=\"${TARGET_BUILD_DIR%/}/${PRIVATE_HEADERS_FOLDER_PATH}\"\nelse\n PRIVATE_HEADERS_PATH=\"${DSTROOT}${INSTALL_PATH_PREFIX%/}/${PRIVATE_HEADERS_FOLDER_PATH}\"\nfi;\n\necho \"#### PRIVATE_HEADERS_PATH = ${PRIVATE_HEADERS_PATH}\"\necho\n\nmkdir -p \"${PRIVATE_HEADERS_PATH}\"\n\nrsync -av --no-owner --no-group --prune-empty-dirs --exclude \".svn\" --exclude \"usr\" --include \"*/\" --include \"*.h\" --exclude \"*\" \"${SRCROOT}/Source/third_party/libyuv/include/\" \"${PRIVATE_HEADERS_PATH}\"\n\nrsync -av --no-owner --no-group --prune-empty-dirs --exclude \".svn\" --exclude \"usr\" --exclude \"src\" --exclude \"internal\" --include \"*/\" --include \"*.h\" --exclude \"*\" \"${SRCROOT}/Source/third_party/libvpx/source/libvpx/vpx\" \"${PRIVATE_HEADERS_PATH}\"\n\nrsync -av --no-owner --no-group --prune-empty-dirs --exclude \".svn\" --exclude \"usr\" --include \"*/\" --include \"*.h\" --exclude \"*\" \"${SRCROOT}/Source/third_party/libwebm/\" \"${PRIVATE_HEADERS_PATH}\"\n\n";-+ };- /* End PBXShellScriptBuildPhase section */-- /* Begin PBXSourcesBuildPhase section */-@@ -27667,6 +27707,11 @@- target = DDF30D0527C5C003006A526F /* absl */;- targetProxy = DD2E76E727C6B69A00F2A74C /* PBXContainerItemProxy */;- };-+ F31720B427FE273100EEE407 /* PBXTargetDependency */ = {-+ isa = PBXTargetDependency;-+ target = F31720AC27FE215900EEE407 /* Copy libvpx headers */;-+ targetProxy = F31720B327FE273100EEE407 /* PBXContainerItemProxy */;-+ };- /* End PBXTargetDependency section */-- /* Begin XCBuildConfiguration section */-@@ -28434,6 +28479,27 @@- };- name = Production;- };-+ F31720AD27FE215900EEE407 /* Debug */ = {-+ isa = XCBuildConfiguration;-+ buildSettings = {-+ PRODUCT_NAME = "$(TARGET_NAME)";-+ };-+ name = Debug;-+ };-+ F31720AE27FE215900EEE407 /* Release */ = {-+ isa = XCBuildConfiguration;-+ buildSettings = {-+ PRODUCT_NAME = "$(TARGET_NAME)";-+ };-+ name = Release;-+ };-+ F31720AF27FE215900EEE407 /* Production */ = {-+ isa = XCBuildConfiguration;-+ buildSettings = {-+ PRODUCT_NAME = "$(TARGET_NAME)";-+ };-+ name = Production;-+ };- FB39D0711200ED9200088E69 /* Debug */ = {- isa = XCBuildConfiguration;- baseConfigurationReference = 5D7C59C71208C68B001C873E /* DebugRelease.xcconfig */;-@@ -28816,6 +28882,16 @@- defaultConfigurationIsVisible = 0;- defaultConfigurationName = Production;- };-+ F31720B027FE215900EEE407 /* Build configuration list for PBXAggregateTarget "Copy libvpx headers" */ = {-+ isa = XCConfigurationList;-+ buildConfigurations = (-+ F31720AD27FE215900EEE407 /* Debug */,-+ F31720AE27FE215900EEE407 /* Release */,-+ F31720AF27FE215900EEE407 /* Production */,-+ );-+ defaultConfigurationIsVisible = 0;-+ defaultConfigurationName = Production;-+ };- FB39D0731200ED9200088E69 /* Build configuration list for PBXProject "libwebrtc" */ = {- isa = XCConfigurationList;- buildConfigurations = (diff --git a/Source/ThirdParty/skia/CMakeLists.txt b/Source/ThirdParty/skia/CMakeLists.txt-index 3ec31514d72491bbc1c951a5fc6d1cc3305113a2..42abaab288ce69dc0a964ecb3ceb6e559ed7dc20 100644+index de02afc8c3d658aa558de21e0e07da90f128638b..76659fec1e8cc1e0ea769de7ca492c6dd4d111a4 100644--- a/Source/ThirdParty/skia/CMakeLists.txt+++ b/Source/ThirdParty/skia/CMakeLists.txt@@ -10,6 +10,8 @@ if (USE_SKIA_ENCODERS)@@ -2040,7 +1615,7 @@ index 3ec31514d72491bbc1c951a5fc6d1cc3305113a2..42abaab288ce69dc0a964ecb3ceb6e55if (ANDROID)find_package(EXPAT REQUIRED)endif ()-@@ -964,6 +966,7 @@ endif ()+@@ -965,6 +967,7 @@ endif ()target_link_libraries(Skia PRIVATEJPEG::JPEGPNG::PNG@@ -2049,10 +1624,10 @@ index 3ec31514d72491bbc1c951a5fc6d1cc3305113a2..42abaab288ce69dc0a964ecb3ceb6e55WEBKIT_ADD_TARGET_CXX_FLAGS(Skiadiff --git a/Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml b/Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml-index 9cd5e7f0e7bb86b48b57fcccea3d32105d6f901f..12c09e04936b64fa546f8a67eaf5d20ee6476b28 100644+index 317f374d175d692544bc37b3c42c13c2fbea30c2..3392e32a9a506f099854329600a67837702c2d8d 100644--- a/Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml+++ b/Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml-@@ -567,6 +567,7 @@ ApplePayEnabled:+@@ -599,6 +599,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.@@ -2060,7 +1635,7 @@ index 9cd5e7f0e7bb86b48b57fcccea3d32105d6f901f..12c09e04936b64fa546f8a67eaf5d20eAsyncClipboardAPIEnabled:type: boolstatus: mature-@@ -577,7 +578,7 @@ AsyncClipboardAPIEnabled:+@@ -609,7 +610,7 @@ AsyncClipboardAPIEnabled:default: falseWebKit:"PLATFORM(COCOA) || PLATFORM(GTK) || PLATFORM(WPE)" : true@@ -2069,7 +1644,7 @@ index 9cd5e7f0e7bb86b48b57fcccea3d32105d6f901f..12c09e04936b64fa546f8a67eaf5d20eWebCore:default: false-@@ -849,13 +850,10 @@ BlobFileAccessEnforcementEnabled:+@@ -865,13 +866,10 @@ BlobFileAccessEnforcementEnabled:sharedPreferenceForWebProcess: truedefaultValue:WebKitLegacy:@@ -2083,7 +1658,7 @@ index 9cd5e7f0e7bb86b48b57fcccea3d32105d6f901f..12c09e04936b64fa546f8a67eaf5d20edefault: falseBlockFontServiceInWebContentSandbox:-@@ -2177,6 +2175,7 @@ CrossOriginEmbedderPolicyEnabled:+@@ -2077,6 +2075,7 @@ CrossOriginEmbedderPolicyEnabled:WebCore:default: false@@ -2091,7 +1666,7 @@ index 9cd5e7f0e7bb86b48b57fcccea3d32105d6f901f..12c09e04936b64fa546f8a67eaf5d20eCrossOriginOpenerPolicyEnabled:type: boolstatus: stable-@@ -2250,6 +2249,7 @@ DOMAudioSessionFullEnabled:+@@ -2150,6 +2149,7 @@ DOMAudioSessionFullEnabled:WebCore:default: false@@ -2099,7 +1674,7 @@ index 9cd5e7f0e7bb86b48b57fcccea3d32105d6f901f..12c09e04936b64fa546f8a67eaf5d20eDOMPasteAccessRequestsEnabled:type: boolstatus: internal-@@ -2261,7 +2261,7 @@ DOMPasteAccessRequestsEnabled:+@@ -2161,7 +2161,7 @@ DOMPasteAccessRequestsEnabled:default: falseWebKit:"PLATFORM(IOS) || PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(WPE) || PLATFORM(VISION)": true@@ -2108,7 +1683,7 @@ index 9cd5e7f0e7bb86b48b57fcccea3d32105d6f901f..12c09e04936b64fa546f8a67eaf5d20eWebCore:default: false-@@ -2327,10 +2327,10 @@ DataListElementEnabled:+@@ -2227,10 +2227,10 @@ DataListElementEnabled:WebKitLegacy:default: falseWebKit:@@ -2121,7 +1696,7 @@ index 9cd5e7f0e7bb86b48b57fcccea3d32105d6f901f..12c09e04936b64fa546f8a67eaf5d20edefault: falsesharedPreferenceForWebProcess: true-@@ -2343,7 +2343,7 @@ DataTransferItemsEnabled:+@@ -2243,7 +2243,7 @@ DataTransferItemsEnabled:WebKitLegacy:default: trueWebKit:@@ -2130,7 +1705,7 @@ index 9cd5e7f0e7bb86b48b57fcccea3d32105d6f901f..12c09e04936b64fa546f8a67eaf5d20edefault: falseWebCore:default: false-@@ -2586,7 +2586,7 @@ DirectoryUploadEnabled:+@@ -2486,7 +2486,7 @@ DirectoryUploadEnabled:WebKitLegacy:default: falseWebKit:@@ -2139,7 +1714,7 @@ index 9cd5e7f0e7bb86b48b57fcccea3d32105d6f901f..12c09e04936b64fa546f8a67eaf5d20edefault: falseWebCore:default: false-@@ -3237,10 +3237,10 @@ FullScreenEnabled:+@@ -3184,10 +3184,10 @@ FullScreenEnabled:WebKitLegacy:default: falseWebKit:@@ -2152,7 +1727,16 @@ index 9cd5e7f0e7bb86b48b57fcccea3d32105d6f901f..12c09e04936b64fa546f8a67eaf5d20edefault: falsesharedPreferenceForWebProcess: true-@@ -3958,7 +3958,7 @@ InputTypeColorEnabled:+@@ -3484,7 +3484,7 @@ HardwareAccelerationEnabled:+ status: internal+ humanReadableName: "Hardware acceleration"+ humanReadableDescription: "Enable hardware acceleration"+- condition: PLATFORM(GTK) || ENABLE(WPE_PLATFORM)++ condition: PLATFORM(GTK) || PLATFORM(WPE)+ defaultValue:+ WebKitLegacy:+ default: true+@@ -3862,7 +3862,7 @@ InputTypeColorEnabled:WebKitLegacy:default: falseWebKit:@@ -2161,7 +1745,7 @@ index 9cd5e7f0e7bb86b48b57fcccea3d32105d6f901f..12c09e04936b64fa546f8a67eaf5d20edefault: falseWebCore:default: false-@@ -3991,7 +3991,7 @@ InputTypeDateEnabled:+@@ -3895,7 +3895,7 @@ InputTypeDateEnabled:"PLATFORM(IOS_FAMILY)": truedefault: falseWebKit:@@ -2170,7 +1754,7 @@ index 9cd5e7f0e7bb86b48b57fcccea3d32105d6f901f..12c09e04936b64fa546f8a67eaf5d20edefault: falseWebCore:default: false-@@ -4007,7 +4007,7 @@ InputTypeDateTimeLocalEnabled:+@@ -3911,7 +3911,7 @@ InputTypeDateTimeLocalEnabled:"PLATFORM(IOS_FAMILY)": truedefault: falseWebKit:@@ -2179,7 +1763,7 @@ index 9cd5e7f0e7bb86b48b57fcccea3d32105d6f901f..12c09e04936b64fa546f8a67eaf5d20edefault: falseWebCore:default: false-@@ -4039,7 +4039,7 @@ InputTypeTimeEnabled:+@@ -3943,7 +3943,7 @@ InputTypeTimeEnabled:"PLATFORM(IOS_FAMILY)": truedefault: falseWebKit:@@ -2188,7 +1772,7 @@ index 9cd5e7f0e7bb86b48b57fcccea3d32105d6f901f..12c09e04936b64fa546f8a67eaf5d20edefault: falseWebCore:default: false-@@ -4100,6 +4100,7 @@ InspectorMaximumResourcesContentSize:+@@ -4004,6 +4004,7 @@ InspectorMaximumResourcesContentSize:"PLATFORM(WPE)": 50default: 200@@ -2196,7 +1780,7 @@ index 9cd5e7f0e7bb86b48b57fcccea3d32105d6f901f..12c09e04936b64fa546f8a67eaf5d20eInspectorStartsAttached:type: boolstatus: embedder-@@ -4107,7 +4108,7 @@ InspectorStartsAttached:+@@ -4011,7 +4012,7 @@ InspectorStartsAttached:exposed: [ WebKit ]defaultValue:WebKit:@@ -2205,7 +1789,7 @@ index 9cd5e7f0e7bb86b48b57fcccea3d32105d6f901f..12c09e04936b64fa546f8a67eaf5d20eInspectorSupportsShowingCertificate:type: bool-@@ -6259,7 +6260,7 @@ PointerLockEnabled:+@@ -6212,7 +6213,7 @@ PointerLockEnabled:"PLATFORM(IOS_FAMILY)": falsedefault: trueWebCore:@@ -2214,7 +1798,7 @@ index 9cd5e7f0e7bb86b48b57fcccea3d32105d6f901f..12c09e04936b64fa546f8a67eaf5d20ePointerLockOptionsEnabled:type: bool-@@ -6888,7 +6889,7 @@ ScreenOrientationAPIEnabled:+@@ -6856,7 +6857,7 @@ ScreenOrientationAPIEnabled:WebKitLegacy:default: falseWebKit:@@ -2224,10 +1808,10 @@ index 9cd5e7f0e7bb86b48b57fcccea3d32105d6f901f..12c09e04936b64fa546f8a67eaf5d20edefault: falsesharedPreferenceForWebProcess: truediff --git a/Source/WTF/wtf/PlatformEnable.h b/Source/WTF/wtf/PlatformEnable.h-index 8748a245c4abddb3db269833949ef015ffe74bdf..4096072a30a7a1035a6cb644a41acb40fd32402f 100644+index 2ee5a8359e668737ca4552a41bfe7458668a20af..a656b2c9048e069c91b5eaf0ed8c33eed480f1f5 100644--- a/Source/WTF/wtf/PlatformEnable.h+++ b/Source/WTF/wtf/PlatformEnable.h-@@ -453,7 +453,7 @@+@@ -465,7 +465,7 @@// ORIENTATION_EVENTS should never get enabled on Desktop, only Mobile.#if !defined(ENABLE_ORIENTATION_EVENTS)@@ -2236,7 +1820,7 @@ index 8748a245c4abddb3db269833949ef015ffe74bdf..4096072a30a7a1035a6cb644a41acb40#endif#if OS(WINDOWS)-@@ -566,7 +566,7 @@+@@ -578,7 +578,7 @@#endif#if !defined(ENABLE_TOUCH_EVENTS)@@ -2246,7 +1830,7 @@ index 8748a245c4abddb3db269833949ef015ffe74bdf..4096072a30a7a1035a6cb644a41acb40#if !defined(ENABLE_TOUCH_ACTION_REGIONS)diff --git a/Source/WTF/wtf/PlatformEnableCocoa.h b/Source/WTF/wtf/PlatformEnableCocoa.h-index 563edfdc48bf410a6e8d2be988e51c5abd5acd24..2648127a62819a8cf00e66a401ecd925903ed64a 100644+index b03fc81380461a7a006b1cbcdf9cd5284cd4c7b6..f645ddd0efdd6a0f121a5fcaa3746fbee07e399b 100644--- a/Source/WTF/wtf/PlatformEnableCocoa.h+++ b/Source/WTF/wtf/PlatformEnableCocoa.h@@ -860,7 +860,7 @@@@ -2259,10 +1843,10 @@ index 563edfdc48bf410a6e8d2be988e51c5abd5acd24..2648127a62819a8cf00e66a401ecd925#if !defined(ENABLE_SERVER_PRECONNECT)diff --git a/Source/WTF/wtf/PlatformHave.h b/Source/WTF/wtf/PlatformHave.h-index 828987d6c829ab349c9220474e274617df4b0c4a..49d8ab0f191354ea7c74969d1455c38c0391d54e 100644+index 55a140deb990434a92049455cb42f1738b4b4717..77b550990f041d0f87abc2f3ded715a7f02c8fa5 100644--- a/Source/WTF/wtf/PlatformHave.h+++ b/Source/WTF/wtf/PlatformHave.h-@@ -1071,7 +1071,8 @@+@@ -1063,7 +1063,8 @@#endif#if PLATFORM(MAC)@@ -2272,12 +1856,56 @@ index 828987d6c829ab349c9220474e274617df4b0c4a..49d8ab0f191354ea7c74969d1455c38c#endif#if !defined(HAVE_LOCKDOWN_MODE_PDF_ADDITIONS) && \+diff --git a/Source/WTF/wtf/StdLibExtras.h b/Source/WTF/wtf/StdLibExtras.h+index cc82d99e5976a98540940ab2537be9357ea5880f..6117cf11197d3ffb95eeee2ea66b025283244868 100644+--- a/Source/WTF/wtf/StdLibExtras.h++++ b/Source/WTF/wtf/StdLibExtras.h+@@ -1579,6 +1579,39 @@ template<typename T, typename U> constexpr auto forward_like(U&& value) -> detai+ template<typename T, typename U> constexpr auto forward_like_preserving_const(U&& value) -> detail::forward_like_preserving_const_impl<T, U> { return static_cast<detail::forward_like_preserving_const_impl<T, U>>(value); }+ } // namespace WTF+++#if defined(__GLIBCXX__) && !defined(__cpp_lib_ranges_zip)++#include <wtf/ZippedRange.h>++++namespace std::ranges {++++struct _Zip {++ template<typename... _Ts>++ requires (sizeof...(_Ts) <= 2)++ constexpr auto++ operator() [[nodiscard]] (_Ts&&... __ts) const {++ if constexpr (!sizeof...(_Ts)) {++ return views::empty<tuple<>>;++ } else if constexpr (sizeof...(_Ts) == 1) {++ return [](auto&& arg1, auto&&...) {++ return std::forward<decltype(arg1)>(arg1);++ }(std::forward<_Ts>(__ts)...);++ } else {++ return [](auto&& arg1, auto&& arg2, auto&&...) {++ return zippedRange(std::forward<decltype(arg1)>(arg1), std::forward<decltype(arg2)>(arg2));++ }(std::forward<_Ts>(__ts)...);++ }++ }++};++++namespace views {++ inline constexpr _Zip zip;++}++++using WTF::zippedRange;++++} // namespace std::ranges++#endif // defined(__GLIBCXX__) && !defined(__cpp_lib_ranges_zip)+++ using WTF::GB;+ using WTF::KB;+ using WTF::MB;diff --git a/Source/WTF/wtf/unicode/UTF8Conversion.h b/Source/WTF/wtf/unicode/UTF8Conversion.h-index f507b6b97236e9e2e01d2b007c74b404e0ced2cb..ccd616e75835a389de17c5fc8314e2ce225635ff 100644+index aa4092454a9595d10976022434500fa0c927dd16..44a046daf08f84edc777114340a730487a66ee07 100644--- a/Source/WTF/wtf/unicode/UTF8Conversion.h+++ b/Source/WTF/wtf/unicode/UTF8Conversion.h-@@ -27,6 +27,11 @@-+@@ -30,6 +30,11 @@+ #include <wtf/ExportMacros.h>#include <wtf/text/Latin1Character.h>+// Can be probably removed when we drop Debian 11.@@ -2289,10 +1917,10 @@ index f507b6b97236e9e2e01d2b007c74b404e0ced2cb..ccd616e75835a389de17c5fc8314e2cenamespace Unicode {diff --git a/Source/WebCore/DerivedSources.make b/Source/WebCore/DerivedSources.make-index 685f1b72f793cb1fd5dbca1249964362cb0915e5..5a8e94b171ed3c689fe32336795856887b7cf9dd 100644+index fd78d0bc1b9e046b9c01e78e935c1ea13d75cea7..b241dbb9a5f782a173a02348014d7d8b8050dbdc 100644--- a/Source/WebCore/DerivedSources.make+++ b/Source/WebCore/DerivedSources.make-@@ -1255,6 +1255,10 @@ JS_BINDING_IDLS := \+@@ -1253,6 +1253,10 @@ JS_BINDING_IDLS := \$(WebCore)/dom/SubscriberCallback.idl \$(WebCore)/dom/SubscriptionObserver.idl \$(WebCore)/dom/SubscriptionObserverCallback.idl \@@ -2303,7 +1931,7 @@ index 685f1b72f793cb1fd5dbca1249964362cb0915e5..5a8e94b171ed3c689fe3233679585688$(WebCore)/dom/Text.idl \$(WebCore)/dom/TextDecoder.idl \$(WebCore)/dom/TextDecoderStream.idl \-@@ -1875,9 +1879,6 @@ JS_BINDING_IDLS := \+@@ -1877,9 +1881,6 @@ JS_BINDING_IDLS := \ADDITIONAL_BINDING_IDLS = \DocumentTouch.idl \GestureEvent.idl \@@ -2314,10 +1942,10 @@ index 685f1b72f793cb1fd5dbca1249964362cb0915e5..5a8e94b171ed3c689fe3233679585688vpath %.in $(WEBKITADDITIONS_HEADER_SEARCH_PATHS)diff --git a/Source/WebCore/Modules/geolocation/Geolocation.cpp b/Source/WebCore/Modules/geolocation/Geolocation.cpp-index 5fbf65401bd9b0de05a56a59ee16ea0c772f3bb8..60074b5aca723dc8dc6d90a48d38097e9bd3e7ba 100644+index 85d022853bdb80865537886accb4762fb1ea665f..5f8c788998285c85e5e08565bfc6abd95a904e42 100644--- a/Source/WebCore/Modules/geolocation/Geolocation.cpp+++ b/Source/WebCore/Modules/geolocation/Geolocation.cpp-@@ -374,8 +374,9 @@ bool Geolocation::shouldBlockGeolocationRequests()+@@ -369,8 +369,9 @@ bool Geolocation::shouldBlockGeolocationRequests()bool isSecure = SecurityOrigin::isSecure(document->url()) || document->isSecureContext();bool isLocalOrigin = securityOrigin()->isLocal();@@ -2329,7 +1957,7 @@ index 5fbf65401bd9b0de05a56a59ee16ea0c772f3bb8..60074b5aca723dc8dc6d90a48d38097e}diff --git a/Source/WebCore/Modules/speech/cocoa/WebSpeechRecognizerTask.mm b/Source/WebCore/Modules/speech/cocoa/WebSpeechRecognizerTask.mm-index e4c2dc829d75e28baad6552f345982352bc50c02..a266a521960c7d920a52220e0fd9a1bdf19f4588 100644+index 74d5031133478642f7b9dcf44286c388a7705783..00af313757c9c19514dbd9de1492bdf04d7f2482 100644--- a/Source/WebCore/Modules/speech/cocoa/WebSpeechRecognizerTask.mm+++ b/Source/WebCore/Modules/speech/cocoa/WebSpeechRecognizerTask.mm@@ -197,6 +197,7 @@ - (void)sendEndIfNeeded@@ -2377,10 +2005,10 @@ index 72b2846f2c82818fc9a64fd90b7cba0c0601e15f..22277ab6c3233f040852d9daf9becf7belseif (USE_SKIA)list(APPEND WebCore_SOURCESdiff --git a/Source/WebCore/SourcesCocoa.txt b/Source/WebCore/SourcesCocoa.txt-index c8d68f153f3dc0d8f246691a561082dcc127259a..06915064b6c3c3a9036d03b02e308b54413e6a23 100644+index 52f75feefac6b03d677e78b66aeba5216008b974..9d24ae4e4d561f5d7104e1a4117c46d32517771b 100644--- a/Source/WebCore/SourcesCocoa.txt+++ b/Source/WebCore/SourcesCocoa.txt-@@ -734,3 +734,9 @@ testing/cocoa/WebViewVisualIdentificationOverlay.mm @nonARC+@@ -744,3 +744,9 @@ testing/cocoa/WebViewVisualIdentificationOverlay.mm @nonARCplatform/graphics/angle/GraphicsContextGLANGLE.cpp @no-unifyplatform/graphics/cocoa/GraphicsContextGLCocoa.mm @nonARC @no-unifyplatform/graphics/cv/GraphicsContextGLCVCocoa.mm @nonARC @no-unify@@ -2391,10 +2019,10 @@ index c8d68f153f3dc0d8f246691a561082dcc127259a..06915064b6c3c3a9036d03b02e308b54+JSTouchList.cpp+// Playwright enddiff --git a/Source/WebCore/SourcesGTK.txt b/Source/WebCore/SourcesGTK.txt-index 963db9d5050b7cb86a7c21474a1820d60e464e3e..0f76f8dea0fd6f66b319fbc64a444de573aecf5c 100644+index 8c4a4c5e75fc792adb0c0801b3e81fd220df777c..99da4150c59018176142f34ebfccd4053c55fc49 100644--- a/Source/WebCore/SourcesGTK.txt+++ b/Source/WebCore/SourcesGTK.txt-@@ -110,3 +110,10 @@ platform/unix/LoggingUnix.cpp+@@ -107,3 +107,10 @@ platform/unix/LoggingUnix.cppplatform/unix/SharedMemoryUnix.cppplatform/xdg/MIMETypeRegistryXdg.cpp@@ -2406,10 +2034,10 @@ index 963db9d5050b7cb86a7c21474a1820d60e464e3e..0f76f8dea0fd6f66b319fbc64a444de5+JSSpeechSynthesisEventInit.cpp+// Playwright: end.diff --git a/Source/WebCore/SourcesWPE.txt b/Source/WebCore/SourcesWPE.txt-index 4921b0ad278c9c1592a7b728946ceffa48dd8271..1c75efd3ded41e03ad0320d97f4bfc2a6fb7dccc 100644+index eb48da502311408b4772385e51b4143da28fc5d0..0cbc5941fa1c659f5a76f77cc4b22ee5842e77af 100644--- a/Source/WebCore/SourcesWPE.txt+++ b/Source/WebCore/SourcesWPE.txt-@@ -110,3 +110,8 @@ platform/wpe/PasteboardWPE.cpp+@@ -114,3 +114,8 @@ platform/wpe/PasteboardWPE.cppplatform/wpe/PlatformScreenWPE.cppplatform/xdg/MIMETypeRegistryXdg.cpp@@ -2419,10 +2047,10 @@ index 4921b0ad278c9c1592a7b728946ceffa48dd8271..1c75efd3ded41e03ad0320d97f4bfc2a+JSSpeechSynthesisErrorEventInit.cpp+JSSpeechSynthesisEventInit.cppdiff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj-index 96a9f50a2c18a08010dd8204c671c2f9df102837..faddededdc12b6d35958cf4342002b41331e839a 100644+index 73e3cfee23dbf823aab021499b6d9e709670665d..7617b70b8d751a42be9c4ac1bc03fd8a0f07a12d 100644--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj-@@ -6842,6 +6842,13 @@+@@ -6915,6 +6915,13 @@EE62BD9D2DE12C1B006C9A05 /* ResolvedScopedName.h in Headers */ = {isa = PBXBuildFile; fileRef = EE62BD9B2DE12BD4006C9A05 /* ResolvedScopedName.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, ); }; };@@ -2436,7 +2064,7 @@ index 96a9f50a2c18a08010dd8204c671c2f9df102837..faddededdc12b6d35958cf4342002b41F12171F616A8CF0B000053CA /* 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 */; };-@@ -22184,6 +22191,14 @@+@@ -22451,6 +22458,14 @@EFCC6C8D20FE914000A2321B /* CanvasActivityRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CanvasActivityRecord.h; sourceTree = "<group>"; };F088343F2E721B29001B2348 /* AXLocalFrame.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AXLocalFrame.h; sourceTree = "<group>"; };F08834402E721B33001B2348 /* AXLocalFrame.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = AXLocalFrame.cpp; sourceTree = "<group>"; };@@ -2451,7 +2079,7 @@ index 96a9f50a2c18a08010dd8204c671c2f9df102837..faddededdc12b6d35958cf4342002b41F12171F316A8BC63000053CA /* WebVTTElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebVTTElement.cpp; sourceTree = "<group>"; };F12171F416A8BC63000053CA /* WebVTTElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebVTTElement.h; sourceTree = "<group>"; };F30EE46A2E721B9D00935B60 /* FrameInspectorController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FrameInspectorController.h; sourceTree = "<group>"; };-@@ -30146,6 +30161,11 @@+@@ -30487,6 +30502,11 @@BC4A5324256055590028C592 /* TextDirectionSubmenuInclusionBehavior.h */,2D4F96F11A1ECC240098BF88 /* TextIndicator.cpp */,2D4F96F21A1ECC240098BF88 /* TextIndicator.h */,@@ -2463,7 +2091,7 @@ index 96a9f50a2c18a08010dd8204c671c2f9df102837..faddededdc12b6d35958cf4342002b41F48570A42644C76D00C05F71 /* TranslationContextMenuInfo.h */,D640B24C2E3058C800EB6C49 /* UADataValues.h */,D640B24E2E3058C800EB6C49 /* UADataValues.idl */,-@@ -37939,6 +37959,8 @@+@@ -38364,6 +38384,8 @@29E4D8DF16B0940F00C84704 /* PlatformSpeechSynthesizer.h */,1AD8F81A11CAB9E900E93E54 /* PlatformStrategies.cpp */,1AD8F81911CAB9E900E93E54 /* PlatformStrategies.h */,@@ -2472,7 +2100,7 @@ index 96a9f50a2c18a08010dd8204c671c2f9df102837..faddededdc12b6d35958cf4342002b41FE3DC9932D0C063C0021B6FC /* PlatformTZoneImpls.cpp */,0FD7C21D23CE41E30096D102 /* PlatformWheelEvent.cpp */,935C476A09AC4D4F00A6AAB4 /* PlatformWheelEvent.h */,-@@ -40855,6 +40877,7 @@+@@ -41317,6 +41339,7 @@AD6E71AB1668899D00320C13 /* DocumentSharedObjectPool.h */,6BDB5DC1227BD3B800919770 /* DocumentStorageAccess.cpp */,6BDB5DC0227BD3B800919770 /* DocumentStorageAccess.h */,@@ -2480,7 +2108,7 @@ index 96a9f50a2c18a08010dd8204c671c2f9df102837..faddededdc12b6d35958cf4342002b417CE7FA5B1EF882300060C9D6 /* DocumentTouch.cpp */,7CE7FA591EF882300060C9D6 /* DocumentTouch.h */,A8185F3209765765005826D9 /* DocumentType.cpp */,-@@ -45941,6 +45964,8 @@+@@ -46446,6 +46469,8 @@F4E90A3C2B52038E002DA469 /* PlatformTextAlternatives.h in Headers */,0F7D07331884C56C00B4AF86 /* PlatformTextTrack.h in Headers */,074E82BB18A69F0E007EF54C /* PlatformTimeRanges.h in Headers */,@@ -2489,7 +2117,7 @@ index 96a9f50a2c18a08010dd8204c671c2f9df102837..faddededdc12b6d35958cf4342002b41CDD08ABD277E542600EA3755 /* PlatformTrackConfiguration.h in Headers */,CD1F9B022700323D00617EB6 /* PlatformVideoColorPrimaries.h in Headers */,CD1F9B01270020B700617EB6 /* PlatformVideoColorSpace.h in Headers */,-@@ -47563,6 +47588,7 @@+@@ -48101,6 +48126,7 @@0F54DD081881D5F5003EEDBB /* Touch.h in Headers */,71B7EE0D21B5C6870031C1EF /* TouchAction.h in Headers */,0F54DD091881D5F5003EEDBB /* TouchEvent.h in Headers */,@@ -2497,7 +2125,7 @@ index 96a9f50a2c18a08010dd8204c671c2f9df102837..faddededdc12b6d35958cf4342002b410F54DD0A1881D5F5003EEDBB /* TouchList.h in Headers */,070334D71459FFD5008D8D45 /* TrackBase.h in Headers */,513C7B6E2E7C2E7A00079881 /* TrackInfo.h in Headers */,-@@ -48824,7 +48850,9 @@+@@ -49367,7 +49393,9 @@2D22830323A8470700364B7E /* CursorMac.mm in Sources */,5CBD59592280E926002B22AA /* CustomHeaderFields.cpp in Sources */,07E4BDBF2A3A5FAB000D5509 /* DictationCaretAnimator.cpp in Sources */,@@ -2507,7 +2135,7 @@ index 96a9f50a2c18a08010dd8204c671c2f9df102837..faddededdc12b6d35958cf4342002b417CE6CBFD187F394900D46BF5 /* FormatConverter.cpp in Sources */,4667EA3E2968D9DA00BAB1E2 /* GameControllerHapticEffect.mm in Sources */,46FE73D32968E52000B8064C /* GameControllerHapticEngines.mm in Sources */,-@@ -48920,6 +48948,9 @@+@@ -49464,6 +49492,9 @@072F696F2E755BFA00281FC5 /* TextListParser.cpp in Sources */,BE39137129B267F500FA5D4F /* TextTransformCocoa.cpp in Sources */,51DF6D800B92A18E00C2DC85 /* ThreadCheck.mm in Sources */,@@ -2517,21 +2145,8 @@ index 96a9f50a2c18a08010dd8204c671c2f9df102837..faddededdc12b6d35958cf4342002b410D0B4DA32EBD20E30053FB12 /* UnifiedSource1-ARC.mm in Sources */,538EC8031F96AF81004D22A8 /* UnifiedSource1-nonARC.mm in Sources */,538EC8021F96AF81004D22A8 /* UnifiedSource1.cpp in Sources */,-diff --git a/Source/WebCore/bindings/js/WebCoreBuiltinNames.h b/Source/WebCore/bindings/js/WebCoreBuiltinNames.h-index ce08881cc4f33e96107dff5c943530db6fe2d55a..0a4c7ef9e088d313ac75b062de71f0546112e87f 100644---- a/Source/WebCore/bindings/js/WebCoreBuiltinNames.h-+++ b/Source/WebCore/bindings/js/WebCoreBuiltinNames.h-@@ -192,6 +192,8 @@ namespace WebCore {- macro(DelayNode) \- macro(DeprecationReportBody) \- macro(DigitalCredential) \-+ macro(DeviceMotionEvent) \-+ macro(DeviceOrientationEvent) \- macro(DocumentTimeline) \- macro(DynamicsCompressorNode) \- macro(ElementInternals) \diff --git a/Source/WebCore/css/query/MediaQueryFeatures.cpp b/Source/WebCore/css/query/MediaQueryFeatures.cpp-index 903f0fa8849ed236e41adabaa896146493e3f683..fee3e38e06af18b27a43cfa82352b0a4925b9cc5 100644+index 2d24dfbbd311fcda83f1a467bcf6df424d4f2f4f..5e30a87979658868f927f2a6e001bee41ef55522 100644--- a/Source/WebCore/css/query/MediaQueryFeatures.cpp+++ b/Source/WebCore/css/query/MediaQueryFeatures.cpp@@ -403,7 +403,11 @@ static const IdentifierSchema& forcedColorsFeatureSchema()@@ -2558,7 +2173,7 @@ index 903f0fa8849ed236e41adabaa896146493e3f683..fee3e38e06af18b27a43cfa82352b0a4case ForcedAccessibilityValue::On:return true;diff --git a/Source/WebCore/dom/DataTransfer.cpp b/Source/WebCore/dom/DataTransfer.cpp-index c44c8b59a1d2cff661f95bbc5538d329e5ee753d..61cd721a219fda16a788bde025ec18bb2340b233 100644+index 5f765a55524e409e527d1b69d777adb2a1870756..f11df9bb37680c6daa0fcdc49ea8946cd1059c4f 100644--- a/Source/WebCore/dom/DataTransfer.cpp+++ b/Source/WebCore/dom/DataTransfer.cpp@@ -531,6 +531,14 @@ Ref<DataTransfer> DataTransfer::createForDrag(const Document& document)@@ -2591,19 +2206,26 @@ index d798a1982a6e5809a5d299f78a57ca4aff411093..a0c968644264f85d57a9856e61bd7254static Ref<DataTransfer> createForDrop(const Document&, std::unique_ptr<Pasteboard>&&, OptionSet<DragOperation>, bool draggingFiles);static Ref<DataTransfer> createForUpdatingDropTarget(const Document&, std::unique_ptr<Pasteboard>&&, OptionSet<DragOperation>, bool draggingFiles);diff --git a/Source/WebCore/dom/DeviceMotionEvent.idl b/Source/WebCore/dom/DeviceMotionEvent.idl-index d59cba0b1c3e1876614476cd887fa1b2a9619d0c..565987a3f9ef7dc29edf8315cebe51b00953dc84 100644+index a2e91e304c473d6c2de246e51539fac8e265e216..eb3f2a61f74a7d533fcdc5aedecb723be75ba105 100644--- a/Source/WebCore/dom/DeviceMotionEvent.idl+++ b/Source/WebCore/dom/DeviceMotionEvent.idl-@@ -25,6 +25,7 @@+@@ -20,12 +20,13 @@+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE+- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.++ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.+ */+ // https://w3c.github.io/deviceorientation/#devicemotionevent[Conditional=DEVICE_ORIENTATION,+ EnabledBySetting=DeviceOrientationEventEnabled,- Exposed=Window+ Exposed=Window,+ SecureContext] interface DeviceMotionEvent : Event {- readonly attribute Acceleration? acceleration;diff --git a/Source/WebCore/dom/DeviceOrientationEvent.idl b/Source/WebCore/dom/DeviceOrientationEvent.idl-index 9043052540b13d8120fb641de6337af46c3b36ef..a0f89e64b64640d2d4dbc14734868c4d4b03fc6f 100644+index 2feeeac677ee3f36cb13c2bac1afbc57fbe70e12..6ed92e45b7659c48b3bb1e24f7f0075117178332 100644--- a/Source/WebCore/dom/DeviceOrientationEvent.idl+++ b/Source/WebCore/dom/DeviceOrientationEvent.idl@@ -25,6 +25,7 @@@@ -2611,14 +2233,23 @@ index 9043052540b13d8120fb641de6337af46c3b36ef..a0f89e64b64640d2d4dbc14734868c4d[Conditional=DEVICE_ORIENTATION,+ EnabledBySetting=DeviceOrientationEventEnabled,- Exposed=Window+ Exposed=Window,+ SecureContext] interface DeviceOrientationEvent : Event {- readonly attribute unrestricted double? alpha;diff --git a/Source/WebCore/dom/PointerEvent.cpp b/Source/WebCore/dom/PointerEvent.cpp-index b691425261078163e043b062a0a9f1fe5215d2b5..25670dbe1c99629663ba47e745f5bd46f73246ff 100644+index d2b50320eac0f2fe77b72779aaec7278a958a520..dbcb8d574a9daf2df9120cd70d6f7623e9ec31ac 100644--- a/Source/WebCore/dom/PointerEvent.cpp+++ b/Source/WebCore/dom/PointerEvent.cpp-@@ -28,10 +28,13 @@+@@ -20,7 +20,7 @@+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE+- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.++ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.+ */++ #include "config.h"+@@ -28,7 +28,9 @@#include "EventNames.h"#include "MouseEventTypes.h"@@ -2628,11 +2259,7 @@ index b691425261078163e043b062a0a9f1fe5215d2b5..25670dbe1c99629663ba47e745f5bd46#include "PointerEventTypeNames.h"#include <numbers>#include <wtf/TZoneMallocInlines.h>-+#include <wtf/IsoMallocInlines.h>-- namespace WebCore {--@@ -331,4 +334,59 @@ double PointerEvent::offsetY()+@@ -331,4 +333,59 @@ double PointerEvent::offsetY()return adjustedCoordinateForType(offsetLocation().y());}@@ -2661,22 +2288,22 @@ index b691425261078163e043b062a0a9f1fe5215d2b5..25670dbe1c99629663ba47e745f5bd46+Ref<PointerEvent> PointerEvent::create(const PlatformTouchEvent& event, const Vector<Ref<PointerEvent>>& coalescedEvents, const Vector<Ref<PointerEvent>>& predictedEvents, unsigned touchIndex, bool isPrimary, Ref<WindowProxy>&& view, const DoublePoint& touchDelta)+{+ const auto& type = pointerEventType(event.touchPoints().at(touchIndex).state());-+ return adoptRef(*new PointerEvent(type, event, coalescedEvents, predictedEvents, typeCanBubble(type), typeIsCancelable(type), touchIndex, isPrimary, WTFMove(view), touchDelta));++ return adoptRef(*new PointerEvent(type, event, coalescedEvents, predictedEvents, typeCanBubble(type), typeIsCancelable(type), touchIndex, isPrimary, WTF::move(view), touchDelta));+}++Ref<PointerEvent> PointerEvent::create(const PlatformTouchEvent& event, const Vector<Ref<PointerEvent>>& coalescedEvents, const Vector<Ref<PointerEvent>>& predictedEvents, CanBubble canBubble, IsCancelable isCancelable, unsigned touchIndex, bool isPrimary, Ref<WindowProxy>&& view, const DoublePoint& touchDelta)+{+ const auto& type = pointerEventType(event.touchPoints().at(touchIndex).state());-+ return adoptRef(*new PointerEvent(type, event, coalescedEvents, predictedEvents, canBubble, isCancelable, touchIndex, isPrimary, WTFMove(view), touchDelta));++ return adoptRef(*new PointerEvent(type, event, coalescedEvents, predictedEvents, canBubble, isCancelable, touchIndex, isPrimary, WTF::move(view), touchDelta));+}++Ref<PointerEvent> PointerEvent::create(const AtomString& type, const PlatformTouchEvent& event, const Vector<Ref<PointerEvent>>& coalescedEvents, const Vector<Ref<PointerEvent>>& predictedEvents, unsigned touchIndex, bool isPrimary, Ref<WindowProxy>&& view, const DoublePoint& touchDelta)+{-+ return adoptRef(*new PointerEvent(type, event, coalescedEvents, predictedEvents, typeCanBubble(type), typeIsCancelable(type), touchIndex, isPrimary, WTFMove(view), touchDelta));++ return adoptRef(*new PointerEvent(type, event, coalescedEvents, predictedEvents, typeCanBubble(type), typeIsCancelable(type), touchIndex, isPrimary, WTF::move(view), touchDelta));+}++PointerEvent::PointerEvent(const AtomString& type, const PlatformTouchEvent& event, const Vector<Ref<PointerEvent>>& coalescedEvents, const Vector<Ref<PointerEvent>>& predictedEvents, CanBubble canBubble, IsCancelable isCancelable, unsigned touchIndex, bool isPrimary, Ref<WindowProxy>&& view, const DoublePoint& touchDelta)-+ : MouseEvent(EventInterfaceType::PointerEvent, type, canBubble, isCancelable, typeIsComposed(type), event.timestamp().approximateMonotonicTime(), WTFMove(view), 0,++ : MouseEvent(EventInterfaceType::PointerEvent, type, canBubble, isCancelable, typeIsComposed(type), event.timestamp().approximateMonotonicTime(), 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, { }, { }, IsSimulated::No, IsTrusted::Yes)+ , m_pointerId(event.touchPoints().at(touchIndex).id())+ , m_width(2 * event.touchPoints().at(touchIndex).radius().width())@@ -2693,11 +2320,11 @@ index b691425261078163e043b062a0a9f1fe5215d2b5..25670dbe1c99629663ba47e745f5bd46+} // namespace WebCorediff --git a/Source/WebCore/dom/PointerEvent.h b/Source/WebCore/dom/PointerEvent.h-index fda79a78b54e710d750cd2a3cf6688f71971900b..02c4b52713edb424591006a2af11fba1b9958184 100644+index 0edeb2e3c8b0122d2e33b552bba39afe819ca25f..681a30414072db49de8d58c3e381674d2f6b9a4c 100644--- a/Source/WebCore/dom/PointerEvent.h+++ b/Source/WebCore/dom/PointerEvent.h-@@ -37,8 +37,8 @@- #include <WebKitAdditions/PlatformTouchEventIOS.h>+@@ -41,8 +41,8 @@+ #pragma clang diagnostic pop#endif-#if ENABLE(TOUCH_EVENTS) && (PLATFORM(WPE) || PLATFORM(GTK))@@ -2707,7 +2334,7 @@ index fda79a78b54e710d750cd2a3cf6688f71971900b..02c4b52713edb424591006a2af11fba1#endifnamespace WebCore {-@@ -95,7 +95,7 @@ public:+@@ -99,7 +99,7 @@ public:static Ref<PointerEvent> create(const AtomString& type, MouseButton, const MouseEvent&, PointerID, const String& pointerType, CanBubble, IsCancelable);static Ref<PointerEvent> create(const AtomString& type, PointerID, const String& pointerType, IsPrimary = IsPrimary::No);@@ -2716,7 +2343,7 @@ index fda79a78b54e710d750cd2a3cf6688f71971900b..02c4b52713edb424591006a2af11fba1static Ref<PointerEvent> create(const PlatformTouchEvent&, const Vector<Ref<PointerEvent>>& coalescedEvents, const Vector<Ref<PointerEvent>>& predictedEvents, unsigned touchIndex, bool isPrimary, Ref<WindowProxy>&&, const DoublePoint& touchDelta = { });static Ref<PointerEvent> create(const PlatformTouchEvent&, const Vector<Ref<PointerEvent>>& coalescedEvents, const Vector<Ref<PointerEvent>>& predictedEvents, CanBubble, IsCancelable, unsigned touchIndex, bool isPrimary, Ref<WindowProxy>&& view, const DoublePoint& touchDelta = { });static Ref<PointerEvent> create(const AtomString& type, const PlatformTouchEvent&, const Vector<Ref<PointerEvent>>& coalescedEvents, const Vector<Ref<PointerEvent>>& predictedEvents, unsigned touchIndex, bool isPrimary, Ref<WindowProxy>&&, const DoublePoint& touchDelta = { });-@@ -188,7 +188,7 @@ private:+@@ -190,7 +190,7 @@ private:PointerEvent();PointerEvent(const AtomString&, Init&&, IsTrusted);PointerEvent(const AtomString& type, PointerID, const String& pointerType, IsPrimary);@@ -2726,7 +2353,7 @@ index fda79a78b54e710d750cd2a3cf6688f71971900b..02c4b52713edb424591006a2af11fba1#endifdiff --git a/Source/WebCore/dom/TouchList.h b/Source/WebCore/dom/TouchList.h-index ec4e04a4b837664cd67303e0e041c7b58e22c5de..59d867a2671883c1e9f19d6a1fd03634267db502 100644+index 25546b5bdf24a88141f2a968c07e9d424d61f7e1..980a173d056b6dd4f89ae394dee01b510def691e 100644--- a/Source/WebCore/dom/TouchList.h+++ b/Source/WebCore/dom/TouchList.h@@ -28,8 +28,8 @@@@ -2768,7 +2395,7 @@ index d0a3d5c048647b07772e1581c76c4eb60ecf41b0..bec324636991079264e620c0dfdaf984#endif // USE(LIBWPE)diff --git a/Source/WebCore/html/FileInputType.cpp b/Source/WebCore/html/FileInputType.cpp-index 51176f56b3e691937622f5b4be0ff39f5e85630b..68c84ce1199ca81180db2b087b53bee2ab3798b5 100644+index 7a2de0702571fa37739a155e48a82b6dc4f2c069..cad655f443a1e6b1eb91c4af8287e468bf1fb934 100644--- a/Source/WebCore/html/FileInputType.cpp+++ b/Source/WebCore/html/FileInputType.cpp@@ -38,6 +38,7 @@@@ -2780,7 +2407,7 @@ index 51176f56b3e691937622f5b4be0ff39f5e85630b..68c84ce1199ca81180db2b087b53bee2#include "LocalizedStrings.h"#include "MIMETypeRegistry.h"@@ -161,6 +162,11 @@ void FileInputType::handleDOMActivateEvent(Event& event)- if (protectedElement()->isDisabledFormControl())+ if (protect(element())->isDisabledFormControl())return;+ bool intercept = false;@@ -2791,8 +2418,45 @@ index 51176f56b3e691937622f5b4be0ff39f5e85630b..68c84ce1199ca81180db2b087b53bee2if (!UserGestureIndicator::processingUserGesture())return;+diff --git a/Source/WebCore/inspector/FrameInspectorController.cpp b/Source/WebCore/inspector/FrameInspectorController.cpp+index a02cfbc44a72e4e6dcfdc9a3e4882c5f03c78532..fca59770988d2dd270881102ac0758273adaa43a 100644+--- a/Source/WebCore/inspector/FrameInspectorController.cpp++++ b/Source/WebCore/inspector/FrameInspectorController.cpp+@@ -115,6 +115,12 @@ void FrameInspectorController::connectFrontend(Inspector::FrontendChannel& front+ UNUSED_PARAM(isAutomaticInspection);+ UNUSED_PARAM(immediatelyPause);+++ // Playwright begin++ // Child frames copy parent's frontend connection.++ if (!m_frame->isMainFrame() && m_frontendRouter->hasFrontends())++ return;++ // Playwright end+++ if (RefPtr page = m_frame->page())+ page->settings().setDeveloperExtrasEnabled(true);++@@ -129,6 +135,19 @@ void FrameInspectorController::connectFrontend(Inspector::FrontendChannel& front+ m_injectedScriptManager->addClient();+ m_agents.didCreateFrontendAndBackend();+ }++++ // Playwright begin++ // Auto attach/enable agents for subframes.++ if (!m_frame->isMainFrame()) {++ LocalFrame* localMainFrame = m_frame->page()->localMainFrame();++ if (localMainFrame) {++ Ref mainFrameController = localMainFrame->inspectorController();++ auto* mainFrameConsoleAgent = mainFrameController->m_instrumentingAgents->webConsoleAgent();++ if (mainFrameConsoleAgent && mainFrameConsoleAgent->enabled())++ m_instrumentingAgents->webConsoleAgent()->enable();++ }++ }++ // Playwright end+ }++ void FrameInspectorController::disconnectFrontend(Inspector::FrontendChannel& frontendChannel)diff --git a/Source/WebCore/inspector/InspectorInstrumentation.cpp b/Source/WebCore/inspector/InspectorInstrumentation.cpp-index 6fedd639163f3dffe60f6e05ecdaf40dd40b2af9..39e858543bc54a5c125456273a32d413a8bc6bcf 100644+index c7c92ebd20a4ba15d98fa257f474ead61dad907f..1d9d08320fdcd755ac8a0bc96ec21e6ab4424094 100644--- a/Source/WebCore/inspector/InspectorInstrumentation.cpp+++ b/Source/WebCore/inspector/InspectorInstrumentation.cpp@@ -600,6 +600,12 @@ void InspectorInstrumentation::applyUserAgentOverrideImpl(InstrumentingAgents& i@@ -2872,7 +2536,7 @@ index 6fedd639163f3dffe60f6e05ecdaf40dd40b2af9..39e858543bc54a5c125456273a32d413void InspectorInstrumentation::defaultAppearanceDidChangeImpl(InstrumentingAgents& instrumentingAgents){@@ -896,6 +905,12 @@ void InspectorInstrumentation::interceptResponseImpl(InstrumentingAgents& instru- networkAgent->interceptResponse(response, identifier, WTFMove(handler));+ networkAgent->interceptResponse(response, identifier, WTF::move(handler));}+void InspectorInstrumentation::setStoppingLoadingDueToProcessSwapImpl(InstrumentingAgents& instrumentingAgents, bool value)@@ -2884,7 +2548,7 @@ index 6fedd639163f3dffe60f6e05ecdaf40dd40b2af9..39e858543bc54a5c125456273a32d413// JavaScriptCore InspectorDebuggerAgent should know Console MessageTypes.static bool isConsoleAssertMessage(MessageSource source, MessageType type){-@@ -1026,6 +1041,12 @@ void InspectorInstrumentation::consoleStopRecordingCanvasImpl(InstrumentingAgent+@@ -1033,6 +1048,12 @@ void InspectorInstrumentation::consoleStopRecordingCanvasImpl(InstrumentingAgentcanvasAgent->consoleStopRecordingCanvas(context);}@@ -2897,7 +2561,7 @@ index 6fedd639163f3dffe60f6e05ecdaf40dd40b2af9..39e858543bc54a5c125456273a32d413void InspectorInstrumentation::didDispatchDOMStorageEventImpl(InstrumentingAgents& instrumentingAgents, const String& key, const String& oldValue, const String& newValue, StorageType storageType, const SecurityOrigin& securityOrigin){if (auto* domStorageAgent = instrumentingAgents.enabledDOMStorageAgent())-@@ -1323,6 +1344,36 @@ void InspectorInstrumentation::renderLayerDestroyedImpl(InstrumentingAgents& ins+@@ -1330,6 +1351,36 @@ void InspectorInstrumentation::renderLayerDestroyedImpl(InstrumentingAgents& inslayerTreeAgent->renderLayerDestroyed(renderLayer);}@@ -2935,10 +2599,10 @@ index 6fedd639163f3dffe60f6e05ecdaf40dd40b2af9..39e858543bc54a5c125456273a32d413{return globalScope.inspectorController().m_instrumentingAgents;diff --git a/Source/WebCore/inspector/InspectorInstrumentation.h b/Source/WebCore/inspector/InspectorInstrumentation.h-index ae252cb00b1782289440083a841d2a6cbce72f9c..9a237cab446e2a716e4f903d473fdcbbb69ba0c9 100644+index a2caf79633711dea4147106e10c43af87b244446..bd20bb948eede5f6521e1ff088befd84edabca42 100644--- a/Source/WebCore/inspector/InspectorInstrumentation.h+++ b/Source/WebCore/inspector/InspectorInstrumentation.h-@@ -44,6 +44,7 @@+@@ -45,6 +45,7 @@#include "LocalFrame.h"#include "NodeDocument.h"#include "Page.h"@@ -2946,7 +2610,7 @@ index ae252cb00b1782289440083a841d2a6cbce72f9c..9a237cab446e2a716e4f903d473fdcbb#include "ResourceLoader.h"#include "ResourceLoaderIdentifier.h"#include "StorageArea.h"-@@ -78,6 +79,7 @@ class Document;+@@ -79,6 +80,7 @@ class Document;class DocumentLoader;class DocumentThreadableLoader;class EventListener;@@ -2954,7 +2618,7 @@ index ae252cb00b1782289440083a841d2a6cbce72f9c..9a237cab446e2a716e4f903d473fdcbbclass HTTPHeaderMap;class InspectorTimelineAgent;class InstrumentingAgents;-@@ -202,6 +204,7 @@ public:+@@ -203,6 +205,7 @@ public:static void didRecalculateStyle(Document&);static void didScheduleStyleRecalculation(Document&);static void applyUserAgentOverride(LocalFrame&, String&);@@ -2962,7 +2626,7 @@ index ae252cb00b1782289440083a841d2a6cbce72f9c..9a237cab446e2a716e4f903d473fdcbbstatic void applyEmulatedMedia(LocalFrame&, AtomString&);static void flexibleBoxRendererBeganLayout(const RenderObject&);-@@ -214,6 +217,7 @@ public:+@@ -215,6 +218,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&);@@ -2970,7 +2634,7 @@ index ae252cb00b1782289440083a841d2a6cbce72f9c..9a237cab446e2a716e4f903d473fdcbbstatic void willSendRequest(ServiceWorkerGlobalScope&, ResourceLoaderIdentifier, ResourceRequest&);static void didReceiveResourceResponse(ServiceWorkerGlobalScope&, ResourceLoaderIdentifier, const ResourceResponse&);-@@ -240,11 +244,11 @@ public:+@@ -241,11 +245,11 @@ public:static void frameDetachedFromParent(LocalFrame&);static void didCommitLoad(LocalFrame&, DocumentLoader*);static void frameDocumentUpdated(LocalFrame&);@@ -2983,7 +2647,7 @@ index ae252cb00b1782289440083a841d2a6cbce72f9c..9a237cab446e2a716e4f903d473fdcbb#if ENABLE(DARK_MODE_CSS)static void defaultAppearanceDidChange(Page&);#endif-@@ -255,6 +259,7 @@ public:+@@ -256,6 +260,7 @@ public:static bool shouldInterceptResponse(const LocalFrame&, const ResourceResponse&);static void interceptRequest(ResourceLoader&, Function<void(const ResourceRequest&)>&&);static void interceptResponse(const LocalFrame&, const ResourceResponse&, ResourceLoaderIdentifier, CompletionHandler<void(const ResourceResponse&, RefPtr<FragmentedSharedBuffer>)>&&);@@ -2991,7 +2655,7 @@ index ae252cb00b1782289440083a841d2a6cbce72f9c..9a237cab446e2a716e4f903d473fdcbbstatic void addMessageToConsole(LocalFrame&, std::unique_ptr<Inspector::ConsoleMessage>);static void addMessageToConsole(WorkerOrWorkletGlobalScope&, std::unique_ptr<Inspector::ConsoleMessage>);-@@ -280,6 +285,7 @@ public:+@@ -281,6 +286,7 @@ public:static void stopProfiling(WorkerOrWorkletGlobalScope&, const String& title);static void consoleStartRecordingCanvas(CanvasRenderingContext&, JSC::JSGlobalObject&, JSC::JSObject* options);static void consoleStopRecordingCanvas(CanvasRenderingContext&);@@ -2999,7 +2663,7 @@ index ae252cb00b1782289440083a841d2a6cbce72f9c..9a237cab446e2a716e4f903d473fdcbbstatic void performanceMark(ScriptExecutionContext&, const String&, std::optional<MonotonicTime>);-@@ -336,6 +342,12 @@ public:+@@ -337,6 +343,12 @@ public:static void layerTreeDidChange(Page*);static void renderLayerDestroyed(Page*, const RenderLayer&);@@ -3012,7 +2676,7 @@ index ae252cb00b1782289440083a841d2a6cbce72f9c..9a237cab446e2a716e4f903d473fdcbbstatic void frontendCreated();static void frontendDeleted();static bool hasFrontends() { return InspectorInstrumentationPublic::hasFrontends(); }-@@ -433,6 +445,7 @@ private:+@@ -434,6 +446,7 @@ private:static void didRecalculateStyleImpl(InstrumentingAgents&);static void didScheduleStyleRecalculationImpl(InstrumentingAgents&, Document&);static void applyUserAgentOverrideImpl(InstrumentingAgents&, String&);@@ -3020,7 +2684,7 @@ index ae252cb00b1782289440083a841d2a6cbce72f9c..9a237cab446e2a716e4f903d473fdcbbstatic void applyEmulatedMediaImpl(InstrumentingAgents&, AtomString&);static void flexibleBoxRendererBeganLayoutImpl(InstrumentingAgents&, const RenderObject&);-@@ -447,6 +460,7 @@ private:+@@ -448,6 +461,7 @@ private:static void didReceiveDataImpl(InstrumentingAgents&, ResourceLoaderIdentifier, const SharedBuffer*, int encodedDataLength);static void didFinishLoadingImpl(InstrumentingAgents&, ResourceLoaderIdentifier, DocumentLoader*, const NetworkLoadMetrics&, ResourceLoader*);static void didFailLoadingImpl(InstrumentingAgents&, ResourceLoaderIdentifier, DocumentLoader*, const ResourceError&);@@ -3028,7 +2692,7 @@ index ae252cb00b1782289440083a841d2a6cbce72f9c..9a237cab446e2a716e4f903d473fdcbbstatic void willLoadXHRSynchronouslyImpl(InstrumentingAgents&);static void didLoadXHRSynchronouslyImpl(InstrumentingAgents&);static void scriptImportedImpl(InstrumentingAgents&, ResourceLoaderIdentifier, const String& sourceString);-@@ -457,11 +471,11 @@ private:+@@ -458,11 +472,11 @@ private:static void frameDetachedFromParentImpl(InstrumentingAgents&, LocalFrame&);static void didCommitLoadImpl(InstrumentingAgents&, LocalFrame&, DocumentLoader*);static void frameDocumentUpdatedImpl(InstrumentingAgents&, LocalFrame&);@@ -3041,7 +2705,7 @@ index ae252cb00b1782289440083a841d2a6cbce72f9c..9a237cab446e2a716e4f903d473fdcbb#if ENABLE(DARK_MODE_CSS)static void defaultAppearanceDidChangeImpl(InstrumentingAgents&);#endif-@@ -472,6 +486,7 @@ private:+@@ -473,6 +487,7 @@ private:static bool shouldInterceptResponseImpl(InstrumentingAgents&, const ResourceResponse&);static void interceptRequestImpl(InstrumentingAgents&, ResourceLoader&, Function<void(const ResourceRequest&)>&&);static void interceptResponseImpl(InstrumentingAgents&, const ResourceResponse&, ResourceLoaderIdentifier, CompletionHandler<void(const ResourceResponse&, RefPtr<FragmentedSharedBuffer>)>&&);@@ -3049,7 +2713,7 @@ index ae252cb00b1782289440083a841d2a6cbce72f9c..9a237cab446e2a716e4f903d473fdcbbstatic void addMessageToConsoleImpl(InstrumentingAgents&, std::unique_ptr<Inspector::ConsoleMessage>);-@@ -486,6 +501,7 @@ private:+@@ -487,6 +502,7 @@ private:static void stopProfilingImpl(InstrumentingAgents&, const String& title);static void consoleStartRecordingCanvasImpl(InstrumentingAgents&, CanvasRenderingContext&, JSC::JSGlobalObject&, JSC::JSObject* options);static void consoleStopRecordingCanvasImpl(InstrumentingAgents&, CanvasRenderingContext&);@@ -3057,7 +2721,7 @@ index ae252cb00b1782289440083a841d2a6cbce72f9c..9a237cab446e2a716e4f903d473fdcbbstatic void performanceMarkImpl(InstrumentingAgents&, const String& label, std::optional<MonotonicTime>);static void didEnqueueFirstContentfulPaintImpl(InstrumentingAgents&);-@@ -541,6 +557,12 @@ private:+@@ -542,6 +558,12 @@ private:static void layerTreeDidChangeImpl(InstrumentingAgents&);static void renderLayerDestroyedImpl(InstrumentingAgents&, const RenderLayer&);@@ -3070,7 +2734,7 @@ index ae252cb00b1782289440083a841d2a6cbce72f9c..9a237cab446e2a716e4f903d473fdcbbstatic InstrumentingAgents& instrumentingAgents(Page&);static InstrumentingAgents& instrumentingAgents(const LocalFrame&);static InstrumentingAgents& instrumentingAgents(const LocalFrameView&);-@@ -1077,6 +1099,12 @@ inline void InspectorInstrumentation::applyUserAgentOverride(LocalFrame& frame,+@@ -1078,6 +1100,12 @@ inline void InspectorInstrumentation::applyUserAgentOverride(LocalFrame& frame,applyUserAgentOverrideImpl(instrumentingAgents(frame), userAgent);}@@ -3083,7 +2747,7 @@ index ae252cb00b1782289440083a841d2a6cbce72f9c..9a237cab446e2a716e4f903d473fdcbbinline void InspectorInstrumentation::applyEmulatedMedia(LocalFrame& frame, AtomString& media){FAST_RETURN_IF_NO_FRONTENDS(void());-@@ -1175,6 +1203,12 @@ inline void InspectorInstrumentation::didFailLoading(ServiceWorkerGlobalScope& g+@@ -1176,6 +1204,12 @@ inline void InspectorInstrumentation::didFailLoading(ServiceWorkerGlobalScope& gdidFailLoadingImpl(instrumentingAgents(globalScope), identifier, nullptr, error);}@@ -3096,7 +2760,7 @@ index ae252cb00b1782289440083a841d2a6cbce72f9c..9a237cab446e2a716e4f903d473fdcbbinline void InspectorInstrumentation::continueAfterXFrameOptionsDenied(LocalFrame& frame, ResourceLoaderIdentifier identifier, DocumentLoader& loader, const ResourceResponse& response){// Treat the same as didReceiveResponse.-@@ -1258,12 +1292,6 @@ inline void InspectorInstrumentation::frameDocumentUpdated(LocalFrame& frame)+@@ -1259,12 +1293,6 @@ inline void InspectorInstrumentation::frameDocumentUpdated(LocalFrame& frame)frameDocumentUpdatedImpl(instrumentingAgents(frame), frame);}@@ -3109,7 +2773,7 @@ index ae252cb00b1782289440083a841d2a6cbce72f9c..9a237cab446e2a716e4f903d473fdcbbinline void InspectorInstrumentation::frameStartedLoading(LocalFrame& frame){FAST_RETURN_IF_NO_FRONTENDS(void());-@@ -1288,6 +1316,12 @@ inline void InspectorInstrumentation::accessibilitySettingsDidChange(Page& page)+@@ -1289,6 +1317,12 @@ inline void InspectorInstrumentation::accessibilitySettingsDidChange(Page& page)accessibilitySettingsDidChangeImpl(instrumentingAgents(page));}@@ -3122,8 +2786,8 @@ index ae252cb00b1782289440083a841d2a6cbce72f9c..9a237cab446e2a716e4f903d473fdcbb#if ENABLE(DARK_MODE_CSS)inline void InspectorInstrumentation::defaultAppearanceDidChange(Page& page){-@@ -1337,6 +1371,13 @@ inline void InspectorInstrumentation::interceptResponse(const LocalFrame& frame,- interceptResponseImpl(instrumentingAgents(frame), response, identifier, WTFMove(handler));+@@ -1338,6 +1372,13 @@ inline void InspectorInstrumentation::interceptResponse(const LocalFrame& frame,+ interceptResponseImpl(instrumentingAgents(frame), response, identifier, WTF::move(handler));}+inline void InspectorInstrumentation::setStoppingLoadingDueToProcessSwap(Page* page, bool value)@@ -3136,7 +2800,7 @@ index ae252cb00b1782289440083a841d2a6cbce72f9c..9a237cab446e2a716e4f903d473fdcbbinline void InspectorInstrumentation::didDispatchDOMStorageEvent(Page& page, const String& key, const String& oldValue, const String& newValue, StorageType storageType, const SecurityOrigin& securityOrigin){FAST_RETURN_IF_NO_FRONTENDS(void());-@@ -1680,6 +1721,11 @@ inline void InspectorInstrumentation::didEnqueueLargestContentfulPaint(ScriptExe+@@ -1681,6 +1722,11 @@ inline void InspectorInstrumentation::didEnqueueLargestContentfulPaint(ScriptExedidEnqueueLargestContentfulPaintImpl(*agents, entry);}@@ -3148,7 +2812,7 @@ index ae252cb00b1782289440083a841d2a6cbce72f9c..9a237cab446e2a716e4f903d473fdcbbinline void InspectorInstrumentation::didRequestAnimationFrame(ScriptExecutionContext& scriptExecutionContext, int callbackId){FAST_RETURN_IF_NO_FRONTENDS(void());-@@ -1736,6 +1782,39 @@ inline void InspectorInstrumentation::renderLayerDestroyed(Page* page, const Ren+@@ -1737,6 +1783,39 @@ inline void InspectorInstrumentation::renderLayerDestroyed(Page* page, const RenrenderLayerDestroyedImpl(*agents, renderLayer);}@@ -3189,11 +2853,11 @@ index ae252cb00b1782289440083a841d2a6cbce72f9c..9a237cab446e2a716e4f903d473fdcbb{return context ? instrumentingAgents(*context) : nullptr;diff --git a/Source/WebCore/inspector/InspectorInstrumentationWebKit.cpp b/Source/WebCore/inspector/InspectorInstrumentationWebKit.cpp-index a67a1244fa526ad5759068e97e0d220f59565d6e..0048589109fccb9472fe35a410337771b1063d72 100644+index f866893f2d6d9748b5f58ad28db0bb06398c6f48..294f450025f595b44a3e130c738291e6b45de740 100644--- a/Source/WebCore/inspector/InspectorInstrumentationWebKit.cpp+++ b/Source/WebCore/inspector/InspectorInstrumentationWebKit.cpp@@ -50,4 +50,9 @@ void InspectorInstrumentationWebKit::interceptResponseInternal(const LocalFrame&- InspectorInstrumentation::interceptResponse(frame, response, identifier, WTFMove(handler));+ InspectorInstrumentation::interceptResponse(frame, response, identifier, WTF::move(handler));}+void InspectorInstrumentationWebKit::setStoppingLoadingDueToProcessSwapInternal(Page* page, bool value)@@ -3203,7 +2867,7 @@ index a67a1244fa526ad5759068e97e0d220f59565d6e..0048589109fccb9472fe35a410337771+} // namespace WebCorediff --git a/Source/WebCore/inspector/InspectorInstrumentationWebKit.h b/Source/WebCore/inspector/InspectorInstrumentationWebKit.h-index b8a1585c14a753344d5b52b316511d2efb2d2bfe..910b98291328cd90109beeeb66e9ecf22e124a89 100644+index 01ad196099f09a89717830cd70dded3b495cf5f5..c9d2e97c6f5f5e6b0a8f70c31af947ef2e72af8a 100644--- a/Source/WebCore/inspector/InspectorInstrumentationWebKit.h+++ b/Source/WebCore/inspector/InspectorInstrumentationWebKit.h@@ -33,6 +33,7 @@@@ -3230,7 +2894,7 @@ index b8a1585c14a753344d5b52b316511d2efb2d2bfe..910b98291328cd90109beeeb66e9ecf2inline bool InspectorInstrumentationWebKit::shouldInterceptRequest(const ResourceLoader& loader)@@ -79,4 +82,10 @@ inline void InspectorInstrumentationWebKit::interceptResponse(const LocalFrame*- interceptResponseInternal(*frame, response, identifier, WTFMove(handler));+ interceptResponseInternal(*frame, response, identifier, WTF::move(handler));}+inline void InspectorInstrumentationWebKit::setStoppingLoadingDueToProcessSwap(Page* page, bool value)@@ -3241,10 +2905,10 @@ index b8a1585c14a753344d5b52b316511d2efb2d2bfe..910b98291328cd90109beeeb66e9ecf2+}diff --git a/Source/WebCore/inspector/PageInspectorController.cpp b/Source/WebCore/inspector/PageInspectorController.cpp-index 130ee55cbc9a9098be2eb681109ede56760593fb..1480faec6d2940b97077bf53138f076974ff3e11 100644+index daaffe5cbbf4350ed327834437d81c8e9ceb7c39..cbdc7ec8b58aff3893e456ebef38ad03802c7605 100644--- a/Source/WebCore/inspector/PageInspectorController.cpp+++ b/Source/WebCore/inspector/PageInspectorController.cpp-@@ -297,6 +297,8 @@ void PageInspectorController::disconnectFrontend(FrontendChannel& frontendChanne+@@ -285,6 +285,8 @@ void PageInspectorController::disconnectFrontend(FrontendChannel& frontendChanne// Unplug all instrumentations since they aren't needed now.InspectorInstrumentation::unregisterInstrumentingAgents(m_instrumentingAgents.get());@@ -3253,7 +2917,7 @@ index 130ee55cbc9a9098be2eb681109ede56760593fb..1480faec6d2940b97077bf53138f0769}m_inspectorBackendClient->frontendCountChanged(m_frontendRouter->frontendCount());-@@ -316,6 +318,8 @@ void PageInspectorController::disconnectAllFrontends()+@@ -299,6 +301,8 @@ void PageInspectorController::disconnectAllFrontends()// The frontend should call setInspectorFrontendClient(nullptr) under closeWindow().ASSERT(!m_inspectorFrontendClient);@@ -3262,7 +2926,7 @@ index 130ee55cbc9a9098be2eb681109ede56760593fb..1480faec6d2940b97077bf53138f0769if (!m_frontendRouter->hasFrontends())return;-@@ -399,8 +403,8 @@ void PageInspectorController::inspect(Node* node)+@@ -378,8 +382,8 @@ void PageInspectorController::inspect(Node* node)if (!enabled())return;@@ -3271,9 +2935,9 @@ index 130ee55cbc9a9098be2eb681109ede56760593fb..1480faec6d2940b97077bf53138f0769+ // HACK: Always attempt to show inspector even if there is a remote connection.+ show();- ensureDOMAgent().inspect(node);+ CheckedRef { ensureDOMAgent() }->inspect(node);}-@@ -548,4 +552,34 @@ void PageInspectorController::didComposite(LocalFrame& frame)+@@ -517,4 +521,34 @@ void PageInspectorController::didComposite(LocalFrame& frame)InspectorInstrumentation::didComposite(frame);}@@ -3309,10 +2973,10 @@ index 130ee55cbc9a9098be2eb681109ede56760593fb..1480faec6d2940b97077bf53138f0769+} // namespace WebCorediff --git a/Source/WebCore/inspector/PageInspectorController.h b/Source/WebCore/inspector/PageInspectorController.h-index 3051f963a2176bb113258e02d05aa77952fa6a9e..f8c3b570e7ad689dc22f5d19d15e08524e5c8747 100644+index b7f0987dd62369d944a2cc17c6cb1c530952f348..0899fb9da82500948ceedda517839a11ecc08108 100644--- a/Source/WebCore/inspector/PageInspectorController.h+++ b/Source/WebCore/inspector/PageInspectorController.h-@@ -116,6 +116,12 @@ public:+@@ -115,6 +115,12 @@ public:WEBCORE_EXPORT void willComposite(LocalFrame&);WEBCORE_EXPORT void didComposite(LocalFrame&);@@ -3342,10 +3006,10 @@ index 3051f963a2176bb113258e02d05aa77952fa6a9e..f8c3b570e7ad689dc22f5d19d15e0852} // namespace WebCorediff --git a/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp b/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp-index 9282ad5df64f89ab129db55f8ef67a8673fed461..2bab467176d263928c5fbc27ec4683fb60e84ce4 100644+index 89bee1d256b8b3641ada8496066c9a66fa6f2d6f..bccaa466012d55fe6fb540c79481375c2799567a 100644--- a/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp+++ b/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp-@@ -55,6 +55,7 @@+@@ -54,6 +54,7 @@#include "Cookie.h"#include "CookieJar.h"#include "CustomElementRegistry.h"@@ -3353,7 +3017,7 @@ index 9282ad5df64f89ab129db55f8ef67a8673fed461..2bab467176d263928c5fbc27ec4683fb#include "DOMEditor.h"#include "DOMException.h"#include "DOMPatchSupport.h"-@@ -67,10 +68,15 @@+@@ -66,10 +67,15 @@#include "Event.h"#include "EventListener.h"#include "EventNames.h"@@ -3369,7 +3033,7 @@ index 9282ad5df64f89ab129db55f8ef67a8673fed461..2bab467176d263928c5fbc27ec4683fb#include "HTMLMediaElement.h"#include "HTMLNames.h"#include "HTMLScriptElement.h"-@@ -106,12 +112,14 @@+@@ -105,12 +111,14 @@#include "Pasteboard.h"#include "PseudoElement.h"#include "RenderGrid.h"@@ -3384,7 +3048,7 @@ index 9282ad5df64f89ab129db55f8ef67a8673fed461..2bab467176d263928c5fbc27ec4683fb#include "StaticNodeList.h"#include "StyleProperties.h"#include "StyleResolver.h"-@@ -154,7 +162,8 @@ using namespace HTMLNames;+@@ -153,7 +161,8 @@ using namespace HTMLNames;static const size_t maxTextSize = 10000;static const char16_t horizontalEllipsisUTF16[] = { horizontalEllipsis, 0 };@@ -3394,7 +3058,7 @@ index 9282ad5df64f89ab129db55f8ef67a8673fed461..2bab467176d263928c5fbc27ec4683fb{if (!colorObject)return std::nullopt;-@@ -173,7 +182,7 @@ static std::optional<Color> parseColor(RefPtr<JSON::Object>&& colorObject)+@@ -172,7 +181,7 @@ static std::optional<Color> parseColor(RefPtr<JSON::Object>&& colorObject)static std::optional<Color> parseRequiredConfigColor(const String& fieldName, JSON::Object& configObject){@@ -3403,7 +3067,7 @@ index 9282ad5df64f89ab129db55f8ef67a8673fed461..2bab467176d263928c5fbc27ec4683fb}static Color parseOptionalConfigColor(const String& fieldName, JSON::Object& configObject)-@@ -200,6 +209,20 @@ static bool parseQuad(Ref<JSON::Array>&& quadArray, FloatQuad* quad)+@@ -199,6 +208,20 @@ static bool parseQuad(Ref<JSON::Array>&& quadArray, FloatQuad* quad)return true;}@@ -3424,11 +3088,11 @@ index 9282ad5df64f89ab129db55f8ef67a8673fed461..2bab467176d263928c5fbc27ec4683fbclass RevalidateStyleAttributeTask final : public CanMakeCheckedPtr<RevalidateStyleAttributeTask> {WTF_MAKE_TZONE_ALLOCATED(RevalidateStyleAttributeTask);WTF_OVERRIDE_DELETE_FOR_CHECKED_PTR(RevalidateStyleAttributeTask);-@@ -483,6 +506,20 @@ Node* InspectorDOMAgent::assertNode(Inspector::Protocol::ErrorString& errorStrin+@@ -484,6 +507,20 @@ Node* InspectorDOMAgent::assertNode(Inspector::Protocol::ErrorString& errorStrinreturn node.unsafeGet();}-+Node* InspectorDOMAgent::assertNode(Protocol::ErrorString& errorString, std::optional<Protocol::DOM::NodeId>&& nodeId, const String& objectId)++Node* InspectorDOMAgent::assertNode(Inspector::Protocol::ErrorString& errorString, std::optional<Inspector::Protocol::DOM::NodeId>&& nodeId, const String& objectId)+{+ Node* node = nullptr;+ if (nodeId) {@@ -3445,12 +3109,11 @@ index 9282ad5df64f89ab129db55f8ef67a8673fed461..2bab467176d263928c5fbc27ec4683fbDocument* InspectorDOMAgent::assertDocument(Inspector::Protocol::ErrorString& errorString, Inspector::Protocol::DOM::NodeId nodeId){RefPtr node = assertNode(errorString, nodeId);-@@ -1603,16 +1640,7 @@ Inspector::Protocol::ErrorStringOr<void> InspectorDOMAgent::highlightNode(std::o- Inspector::Protocol::ErrorStringOr<void> InspectorDOMAgent::highlightNode(std::optional<Inspector::Protocol::DOM::NodeId>&& nodeId, const Inspector::Protocol::Runtime::RemoteObjectId& objectId, Ref<JSON::Object>&& highlightInspectorObject, RefPtr<JSON::Object>&& gridOverlayInspectorObject, RefPtr<JSON::Object>&& flexOverlayInspectorObject, std::optional<bool>&& showRulers)+@@ -1606,15 +1643,7 @@ Inspector::Protocol::ErrorStringOr<void> InspectorDOMAgent::highlightNode(std::o{Inspector::Protocol::ErrorString errorString;---- Node* node = nullptr;++- RefPtr<Node> node;- if (nodeId)- node = assertNode(errorString, *nodeId);- else if (!!objectId) {@@ -3459,11 +3122,11 @@ index 9282ad5df64f89ab129db55f8ef67a8673fed461..2bab467176d263928c5fbc27ec4683fb- } else- errorString = "Either nodeId or objectId must be specified"_s;--+ Node* node = assertNode(errorString, WTFMove(nodeId), objectId);++ RefPtr<Node> node = assertNode(errorString, WTF::move(nodeId), objectId);if (!node)return makeUnexpected(errorString);-@@ -1868,15 +1896,159 @@ Inspector::Protocol::ErrorStringOr<void> InspectorDOMAgent::setInspectedNode(Ins+@@ -1870,15 +1899,159 @@ Inspector::Protocol::ErrorStringOr<void> InspectorDOMAgent::setInspectedNode(Insreturn { };}@@ -3535,7 +3198,7 @@ index 9282ad5df64f89ab129db55f8ef67a8673fed461..2bab467176d263928c5fbc27ec4683fb+ return { { contentFrameId, ownerFrameId } };+}+-+Protocol::ErrorStringOr<void> InspectorDOMAgent::scrollIntoViewIfNeeded(const String& objectId, RefPtr<JSON::Object>&& rect)++Inspector::Protocol::ErrorStringOr<void> InspectorDOMAgent::scrollIntoViewIfNeeded(const String& objectId, RefPtr<JSON::Object>&& rect)+{+ Node* node = nodeForObjectId(objectId);+ if (!node)@@ -3580,7 +3243,7 @@ index 9282ad5df64f89ab129db55f8ef67a8673fed461..2bab467176d263928c5fbc27ec4683fb+ return { };+}+-+Protocol::ErrorStringOr<Ref<JSON::ArrayOf<Protocol::DOM::Quad>>> InspectorDOMAgent::getContentQuads(const String& objectId)++Inspector::Protocol::ErrorStringOr<Ref<JSON::ArrayOf<Inspector::Protocol::DOM::Quad>>> InspectorDOMAgent::getContentQuads(const String& objectId)+{+ Node* node = nodeForObjectId(objectId);+ if (!node)@@ -3600,53 +3263,53 @@ index 9282ad5df64f89ab129db55f8ef67a8673fed461..2bab467176d263928c5fbc27ec4683fb+ return buildArrayOfQuads(quads);+}+-+Inspector::Protocol::ErrorStringOr<Ref<Protocol::Runtime::RemoteObject>> InspectorDOMAgent::resolveNode(std::optional<Inspector::Protocol::DOM::NodeId>&& nodeId, const String& objectId, const Inspector::Protocol::Network::FrameId& frameId, std::optional<int>&& contextId, const String& objectGroup)++Inspector::Protocol::ErrorStringOr<Ref<Inspector::Protocol::Runtime::RemoteObject>> InspectorDOMAgent::resolveNode(std::optional<Inspector::Protocol::DOM::NodeId>&& nodeId, const String& objectId, const Inspector::Protocol::Network::FrameId& frameId, std::optional<int>&& contextId, const String& objectGroup){Inspector::Protocol::ErrorString errorString;-+ Node* node = nullptr;++ RefPtr<Node> node = nullptr;+ if (!!frameId) {+ auto* pageAgent = m_instrumentingAgents->enabledPageAgent();+ if (!pageAgent)+ return makeUnexpected("Page domain must be enabled"_s);-- Node* node = assertNode(errorString, nodeId);+- RefPtr node = assertNode(errorString, nodeId);+ auto* frame = pageAgent->assertFrame(errorString, frameId);+ if (!frame)+ return makeUnexpected(errorString);++ node = frame->ownerElement();+ } else {-+ node = assertNode(errorString, WTFMove(nodeId), objectId);++ node = assertNode(errorString, WTF::move(nodeId), objectId);+ }if (!node)return makeUnexpected(errorString);-- auto object = resolveNode(node, objectGroup);-+ auto object = resolveNode(node, objectGroup, WTFMove(contextId));+- auto object = resolveNode(node.get(), objectGroup);++ auto object = resolveNode(node.get(), objectGroup, WTF::move(contextId));if (!object)return makeUnexpected("Missing injected script for given nodeId"_s);-@@ -3144,7 +3316,7 @@ Inspector::Protocol::ErrorStringOr<Inspector::Protocol::DOM::NodeId> InspectorDO+@@ -3147,7 +3320,7 @@ Inspector::Protocol::ErrorStringOr<Inspector::Protocol::DOM::NodeId> InspectorDOreturn makeUnexpected("Missing node for given path"_s);}-RefPtr<Inspector::Protocol::Runtime::RemoteObject> InspectorDOMAgent::resolveNode(Node* node, const String& objectGroup)+RefPtr<Inspector::Protocol::Runtime::RemoteObject> InspectorDOMAgent::resolveNode(Node* node, const String& objectGroup, std::optional<int>&& contextId){- Document* document = &node->document();+ RefPtr document = &node->document();if (auto* templateHost = document->templateDocumentHost())-@@ -3153,12 +3325,18 @@ RefPtr<Inspector::Protocol::Runtime::RemoteObject> InspectorDOMAgent::resolveNod+@@ -3156,12 +3329,18 @@ RefPtr<Inspector::Protocol::Runtime::RemoteObject> InspectorDOMAgent::resolveNodif (!frame)return nullptr;- auto& globalObject = mainWorldGlobalObject(*frame);-- auto injectedScript = m_injectedScriptManager.injectedScriptFor(&globalObject);+- auto injectedScript = m_injectedScriptManager->injectedScriptFor(&globalObject);+ InjectedScript injectedScript;+ if (contextId) {-+ injectedScript = m_injectedScriptManager.injectedScriptForId(*contextId);++ injectedScript = m_injectedScriptManager->injectedScriptForId(*contextId);+ } else {+ auto& globalObject = mainWorldGlobalObject(*frame);-+ injectedScript = m_injectedScriptManager.injectedScriptFor(&globalObject);++ injectedScript = m_injectedScriptManager->injectedScriptFor(&globalObject);+ }+if (injectedScript.hasNoValue())@@ -3657,12 +3320,12 @@ index 9282ad5df64f89ab129db55f8ef67a8673fed461..2bab467176d263928c5fbc27ec4683fb}Node* InspectorDOMAgent::scriptValueAsNode(JSC::JSValue value)-@@ -3310,4 +3488,53 @@ Inspector::Protocol::ErrorStringOr<Ref<Inspector::Protocol::DOM::MediaStats>> In+@@ -3315,4 +3494,53 @@ Inspector::Protocol::ErrorStringOr<Ref<Inspector::Protocol::DOM::MediaStats>> In#endif}+void InspectorDOMAgent::setInputFiles(const String& objectId, Ref<JSON::Array>&& paths, Ref<SetInputFilesCallback>&& callback) {-+ InjectedScript injectedScript = m_injectedScriptManager.injectedScriptForObjectId(objectId);++ InjectedScript injectedScript = m_injectedScriptManager->injectedScriptForObjectId(objectId);+ if (injectedScript.hasNoValue()) {+ callback->sendFailure("Can not find element's context for given id"_s);+ return;@@ -3682,9 +3345,9 @@ index 9282ad5df64f89ab129db55f8ef67a8673fed461..2bab467176d263928c5fbc27ec4683fb+ HTMLInputElement* element = static_cast<HTMLInputElement*>(node);+ Vector<Ref<File>> fileObjects;+ if (element->hasAttributeWithoutSynchronization(webkitdirectoryAttr)) {-+ auto directoryFileListCreator = DirectoryFileListCreator::create([element = RefPtr { element }, callback = WTFMove(callback)](Ref<FileList>&& fileList) mutable {++ auto directoryFileListCreator = DirectoryFileListCreator::create([element = RefPtr { element }, callback = WTF::move(callback)](Ref<FileList>&& fileList) mutable {+ ASSERT(isMainThread());-+ element->setFiles(WTFMove(fileList));++ element->setFiles(WTF::move(fileList));+ callback->sendSuccess();+ });+ Vector<FileChooserFileInfo> fileChooserFiles;@@ -3704,18 +3367,18 @@ index 9282ad5df64f89ab129db55f8ef67a8673fed461..2bab467176d263928c5fbc27ec4683fb+ ScriptExecutionContext* context = element->scriptExecutionContext();+ fileObjects.append(File::create(context, path));+ }-+ RefPtr<FileList> fileList = FileList::create(WTFMove(fileObjects));-+ element->setFiles(WTFMove(fileList));++ RefPtr<FileList> fileList = FileList::create(WTF::move(fileObjects));++ element->setFiles(WTF::move(fileList));+ callback->sendSuccess();+ }+}+} // namespace WebCorediff --git a/Source/WebCore/inspector/agents/InspectorDOMAgent.h b/Source/WebCore/inspector/agents/InspectorDOMAgent.h-index cef65fc132b6bd2d5e5ee3cce2b60b7adec1bb0d..fcdc21a94d99d6564079f1375b6253f1ceb83bb1 100644+index 95f3f66244b5350e9457268ba054a5d9100eea87..71c5726fefdb5dfc1257adf6cc3aa63347bd2332 100644--- a/Source/WebCore/inspector/agents/InspectorDOMAgent.h+++ b/Source/WebCore/inspector/agents/InspectorDOMAgent.h-@@ -61,6 +61,7 @@ namespace WebCore {+@@ -62,6 +62,7 @@ namespace WebCore {class AXCoreObject;class CharacterData;@@ -3723,7 +3386,7 @@ index cef65fc132b6bd2d5e5ee3cce2b60b7adec1bb0d..fcdc21a94d99d6564079f1375b6253f1class DOMEditor;class Document;class Element;-@@ -97,6 +98,7 @@ public:+@@ -98,6 +99,7 @@ public:static String toErrorString(Exception&&);static String documentURLString(Document*);@@ -3731,7 +3394,7 @@ index cef65fc132b6bd2d5e5ee3cce2b60b7adec1bb0d..fcdc21a94d99d6564079f1375b6253f1// We represent embedded doms as a part of the same hierarchy. Hence we treat children of frame owners differently.// We also skip whitespace text nodes conditionally. Following methods encapsulate these specifics.-@@ -142,7 +144,7 @@ public:+@@ -143,7 +145,7 @@ public:Inspector::Protocol::ErrorStringOr<std::tuple<String /* searchId */, int /* resultCount */>> performSearch(const String& query, RefPtr<JSON::Array>&& nodeIds, std::optional<bool>&& caseSensitive);Inspector::Protocol::ErrorStringOr<Ref<JSON::ArrayOf<Inspector::Protocol::DOM::NodeId>>> getSearchResults(const String& searchId, int fromIndex, int toIndex);Inspector::Protocol::ErrorStringOr<void> discardSearchResults(const String& searchId);@@ -3740,7 +3403,7 @@ index cef65fc132b6bd2d5e5ee3cce2b60b7adec1bb0d..fcdc21a94d99d6564079f1375b6253f1Inspector::Protocol::ErrorStringOr<Ref<JSON::ArrayOf<String>>> getAttributes(Inspector::Protocol::DOM::NodeId);#if PLATFORM(IOS_FAMILY)Inspector::Protocol::ErrorStringOr<void> setInspectModeEnabled(bool, RefPtr<JSON::Object>&& highlightConfig, RefPtr<JSON::Object>&& gridOverlayConfig, RefPtr<JSON::Object>&& flexOverlayConfig);-@@ -179,6 +181,10 @@ public:+@@ -180,6 +182,10 @@ public:Inspector::Protocol::ErrorStringOr<void> setInspectedNode(Inspector::Protocol::DOM::NodeId);Inspector::Protocol::ErrorStringOr<void> setAllowEditingUserAgentShadowTrees(bool);Inspector::Protocol::ErrorStringOr<Ref<Inspector::Protocol::DOM::MediaStats>> getMediaStats(Inspector::Protocol::DOM::NodeId);@@ -3751,7 +3414,7 @@ index cef65fc132b6bd2d5e5ee3cce2b60b7adec1bb0d..fcdc21a94d99d6564079f1375b6253f1// InspectorInstrumentationInspector::Protocol::DOM::NodeId identifierForNode(Node&);-@@ -220,7 +226,7 @@ public:+@@ -221,7 +227,7 @@ public:Node* nodeForId(Inspector::Protocol::DOM::NodeId);Inspector::Protocol::DOM::NodeId boundNodeId(const Node*);@@ -3760,7 +3423,7 @@ index cef65fc132b6bd2d5e5ee3cce2b60b7adec1bb0d..fcdc21a94d99d6564079f1375b6253f1bool handleMousePress();void mouseDidMoveOverElement(const HitTestResult&, OptionSet<PlatformEventModifier>);void inspect(Node*);-@@ -232,12 +238,15 @@ public:+@@ -233,12 +239,15 @@ public:void reset();Node* assertNode(Inspector::Protocol::ErrorString&, Inspector::Protocol::DOM::NodeId);@@ -3776,16 +3439,16 @@ index cef65fc132b6bd2d5e5ee3cce2b60b7adec1bb0d..fcdc21a94d99d6564079f1375b6253f1private:#if ENABLE(VIDEO)void mediaMetricsTimerFired();-@@ -267,7 +276,6 @@ private:+@@ -268,7 +277,6 @@ private:void processAccessibilityChildren(AXCoreObject&, JSON::ArrayOf<Inspector::Protocol::DOM::NodeId>&);-- Node* nodeForPath(const String& path);++ RefPtr<Node> nodeForPath(const String& path);- Node* nodeForObjectId(const Inspector::Protocol::Runtime::RemoteObjectId&);void discardBindings();diff --git a/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp b/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp-index 0c13bc7782d3963656647d2ad137e108c8399aae..a898dfb9504ddab5e104f7dcacb8c9fa0a4f0512 100644+index 695d96f2e3aa24c7212a3ca879776945988dca30..b87fad8fce6b51a50b8a32898689447c9c8ccf56 100644--- a/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp+++ b/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp@@ -62,6 +62,7 @@@@ -3816,6 +3479,31 @@ index 0c13bc7782d3963656647d2ad137e108c8399aae..a898dfb9504ddab5e104f7dcacb8c9faif (resourceLoader) {auto* metrics = response.deprecatedNetworkLoadMetricsOrNull();responseObject->setTiming(buildObjectForTiming(metrics ? *metrics : NetworkLoadMetrics::emptyMetrics(), *resourceLoader));+@@ -519,7 +522,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;+-+++ // FIXME: <webkit.org/b/216125> 304 Not Modified responses for XHR/Fetch do not have all their information from the cache.+ if (isNotModified && (type == ResourceType::XHR || type == ResourceType::Fetch) && (!cachedResource || !cachedResource->encodedSize())) {+ if (auto previousResourceData = m_resourcesData->dataForURL(response.url().string())) {+@@ -530,12 +533,12 @@ void InspectorNetworkAgent::didReceiveResponse(ResourceLoaderIdentifier identifi+ m_resourcesData->maybeAddResourceData(requestId, buffer);+ });+ }+-+++ resourceResponse->setString("mimeType"_s, previousResourceData->mimeType());+-+++ resourceResponse->setInteger("status"_s, previousResourceData->httpStatusCode());+ resourceResponse->setString("statusText"_s, previousResourceData->httpStatusText());+-+++ resourceResponse->setString("source"_s, Inspector::Protocol::Helpers::getEnumConstantValue(Inspector::Protocol::Network::Response::Source::DiskCache));+ }+ }@@ -614,6 +617,9 @@ void InspectorNetworkAgent::didFailLoading(ResourceLoaderIdentifier identifier,String requestId = IdentifiersFactory::requestId(identifier.toUInt64());@@ -3842,7 +3530,7 @@ index 0c13bc7782d3963656647d2ad137e108c8399aae..a898dfb9504ddab5e104f7dcacb8c9fafor (auto& entry : headers.get()) {auto stringValue = entry.value->asString();if (!!stringValue)-@@ -1150,6 +1158,11 @@ void InspectorNetworkAgent::interceptResponse(const ResourceResponse& response,+@@ -1148,6 +1156,11 @@ void InspectorNetworkAgent::interceptResponse(const ResourceResponse& response,m_frontendDispatcher->responseIntercepted(requestId, resourceResponse.releaseNonNull());}@@ -3854,7 +3542,7 @@ index 0c13bc7782d3963656647d2ad137e108c8399aae..a898dfb9504ddab5e104f7dcacb8c9faInspector::Protocol::ErrorStringOr<void> InspectorNetworkAgent::interceptContinue(const Inspector::Protocol::Network::RequestId& requestId, Inspector::Protocol::Network::NetworkStage networkStage){switch (networkStage) {-@@ -1179,6 +1192,9 @@ Inspector::Protocol::ErrorStringOr<void> InspectorNetworkAgent::interceptWithReq+@@ -1177,6 +1190,9 @@ Inspector::Protocol::ErrorStringOr<void> InspectorNetworkAgent::interceptWithReqreturn makeUnexpected("Missing pending intercept request for given requestId"_s);auto& loader = *pendingRequest->m_loader;@@ -3864,7 +3552,7 @@ index 0c13bc7782d3963656647d2ad137e108c8399aae..a898dfb9504ddab5e104f7dcacb8c9faResourceRequest request = loader.request();if (!!url)request.setURL(URL({ }, url));-@@ -1274,13 +1290,22 @@ Inspector::Protocol::ErrorStringOr<void> InspectorNetworkAgent::interceptRequest+@@ -1272,13 +1288,22 @@ Inspector::Protocol::ErrorStringOr<void> InspectorNetworkAgent::interceptRequestresponse.setHTTPStatusCode(status);response.setHTTPStatusText(String { statusText });HTTPHeaderMap explicitHeaders;@@ -3878,17 +3566,17 @@ index 0c13bc7782d3963656647d2ad137e108c8399aae..a898dfb9504ddab5e104f7dcacb8c9faexplicitHeaders.add(header.key, headerValue);+}- response.setHTTPHeaderFields(WTFMove(explicitHeaders));+ response.setHTTPHeaderFields(WTF::move(explicitHeaders));response.setHTTPHeaderField(HTTPHeaderName::ContentType, response.mimeType());++ auto* frame = loader->frame();+ if (!setCookieValue.isEmpty() && frame && frame->page())+ frame->page()->cookieJar().setCookieFromResponse(*loader.get(), setCookieValue);+- loader->didReceiveResponse(WTFMove(response), [loader, buffer = data.releaseNonNull()]() {+ loader->didReceiveResponse(WTF::move(response), [loader, buffer = data.releaseNonNull()]() {if (loader->reachedTerminalState())return;-@@ -1344,6 +1369,12 @@ Inspector::Protocol::ErrorStringOr<void> InspectorNetworkAgent::setEmulatedCondi+@@ -1342,6 +1367,12 @@ Inspector::Protocol::ErrorStringOr<void> InspectorNetworkAgent::setEmulatedCondi#endif // ENABLE(INSPECTOR_NETWORK_THROTTLING)@@ -3902,7 +3590,7 @@ index 0c13bc7782d3963656647d2ad137e108c8399aae..a898dfb9504ddab5e104f7dcacb8c9fa{auto searchResult = Inspector::Protocol::Page::SearchResult::create()diff --git a/Source/WebCore/inspector/agents/InspectorNetworkAgent.h b/Source/WebCore/inspector/agents/InspectorNetworkAgent.h-index edd6ca69884d8e803fb9668e73f3b49b897a60e7..a0d8045d9e0d90c3216fe7f4fb83e6a0d4a2c3b3 100644+index 74228bbedd0cd1a0f5a890be4e1bd3de6218d037..07122f0183516cb07c15f01e3d129832c12f16fc 100644--- a/Source/WebCore/inspector/agents/InspectorNetworkAgent.h+++ b/Source/WebCore/inspector/agents/InspectorNetworkAgent.h@@ -35,6 +35,8 @@@@ -3914,7 +3602,7 @@ index edd6ca69884d8e803fb9668e73f3b49b897a60e7..a0d8045d9e0d90c3216fe7f4fb83e6a0#include "WebSocket.h"#include <JavaScriptCore/ContentSearchUtilities.h>#include <JavaScriptCore/InspectorBackendDispatchers.h>-@@ -103,6 +105,7 @@ public:+@@ -104,6 +106,7 @@ public:#if ENABLE(INSPECTOR_NETWORK_THROTTLING)Inspector::Protocol::ErrorStringOr<void> setEmulatedConditions(std::optional<int>&& bytesPerSecondLimit) final;#endif@@ -3922,7 +3610,7 @@ index edd6ca69884d8e803fb9668e73f3b49b897a60e7..a0d8045d9e0d90c3216fe7f4fb83e6a0// InspectorInstrumentationvoid willRecalculateStyle();-@@ -134,6 +137,7 @@ public:+@@ -135,6 +138,7 @@ public:bool shouldInterceptResponse(const ResourceResponse&);void interceptResponse(const ResourceResponse&, ResourceLoaderIdentifier, CompletionHandler<void(const ResourceResponse&, RefPtr<FragmentedSharedBuffer>)>&&);void interceptRequest(ResourceLoader&, Function<void(const ResourceRequest&)>&&);@@ -3930,7 +3618,7 @@ index edd6ca69884d8e803fb9668e73f3b49b897a60e7..a0d8045d9e0d90c3216fe7f4fb83e6a0void searchOtherRequests(const JSC::Yarr::RegularExpression&, Ref<JSON::ArrayOf<Inspector::Protocol::Page::SearchResult>>&);void searchInRequest(Inspector::Protocol::ErrorString&, const Inspector::Protocol::Network::RequestId&, const String& query, bool caseSensitive, bool isRegex, RefPtr<JSON::ArrayOf<Inspector::Protocol::GenericTypes::SearchMatch>>&);-@@ -189,6 +193,7 @@ private:+@@ -190,6 +194,7 @@ private:bool m_enabled { false };bool m_loadingXHRSynchronously { false };bool m_interceptionEnabled { false };@@ -3939,7 +3627,7 @@ index edd6ca69884d8e803fb9668e73f3b49b897a60e7..a0d8045d9e0d90c3216fe7f4fb83e6a0} // namespace WebCorediff --git a/Source/WebCore/inspector/agents/InspectorPageAgent.cpp b/Source/WebCore/inspector/agents/InspectorPageAgent.cpp-index 3f648b2a5fead536fa308257b0615a3547989467..d19e0372a8cb74baf958df6bddc19eae97bd3861 100644+index 736145be7718ac0c15480dbfe7bf3813fa254b9f..b16a37ec4de3400d19a8a706ba59d67bbc184c3f 100644--- a/Source/WebCore/inspector/agents/InspectorPageAgent.cpp+++ b/Source/WebCore/inspector/agents/InspectorPageAgent.cpp@@ -32,21 +32,27 @@@@ -4054,7 +3742,7 @@ index 3f648b2a5fead536fa308257b0615a3547989467..d19e0372a8cb74baf958df6bddc19eae+ m_interceptFileChooserDialog = false;+ m_bypassCSP = false;- setShowPaintRects(false);+ std::ignore = setShowPaintRects(false);#if !PLATFORM(IOS_FAMILY)@@ -197,6 +232,22 @@ Inspector::Protocol::ErrorStringOr<void> InspectorPageAgent::reload(std::optionareturn { };@@ -4098,7 +3786,7 @@ index 3f648b2a5fead536fa308257b0615a3547989467..d19e0372a8cb74baf958df6bddc19eaereturn { };+#if ENABLE(DEVICE_ORIENTATION)-+ case Protocol::Page::Setting::DeviceOrientationEventEnabled:++ case Inspector::Protocol::Page::Setting::DeviceOrientationEventEnabled:+ inspectedPageSettings.setDeviceOrientationEventEnabled(value.value_or(false));+ return { };+#endif@@ -4111,26 +3799,26 @@ index 3f648b2a5fead536fa308257b0615a3547989467..d19e0372a8cb74baf958df6bddc19eaereturn { };+#if ENABLE(NOTIFICATIONS)-+ case Protocol::Page::Setting::NotificationsEnabled:++ case Inspector::Protocol::Page::Setting::NotificationsEnabled:+ inspectedPageSettings.setNotificationsEnabled(value.value_or(false));+ return { };+#endif++#if ENABLE(FULLSCREEN_API)-+ case Protocol::Page::Setting::FullScreenEnabled:++ case Inspector::Protocol::Page::Setting::FullScreenEnabled:+ inspectedPageSettings.setFullScreenEnabled(value.value_or(false));+ return { };+#endif+-+ case Protocol::Page::Setting::InputTypeMonthEnabled:++ case Inspector::Protocol::Page::Setting::InputTypeMonthEnabled:+ inspectedPageSettings.setInputTypeMonthEnabled(value.value_or(false));+ return { };+-+ case Protocol::Page::Setting::InputTypeWeekEnabled:++ case Inspector::Protocol::Page::Setting::InputTypeWeekEnabled:+ inspectedPageSettings.setInputTypeWeekEnabled(value.value_or(false));+ return { };+-+ case Protocol::Page::Setting::FixedBackgroundsPaintRelativeToDocument:++ case Inspector::Protocol::Page::Setting::FixedBackgroundsPaintRelativeToDocument:+ // Enable this setting similar to iOS to ensure scrolling works with+ // `background-attachment: fixed`.+ // See https://github.com/microsoft/playwright/issues/31551.@@ -4138,7 +3826,7 @@ index 3f648b2a5fead536fa308257b0615a3547989467..d19e0372a8cb74baf958df6bddc19eae+ return { };++#if ENABLE(POINTER_LOCK)-+ case Protocol::Page::Setting::PointerLockEnabled:++ case Inspector::Protocol::Page::Setting::PointerLockEnabled:+ inspectedPageSettings.setPointerLockEnabled(value.value_or(false));+ return { };+#endif@@ -4151,7 +3839,7 @@ index 3f648b2a5fead536fa308257b0615a3547989467..d19e0372a8cb74baf958df6bddc19eaereturn { };+#if ENABLE(MEDIA_STREAM)-+ case Protocol::Page::Setting::SpeechRecognitionEnabled:++ case Inspector::Protocol::Page::Setting::SpeechRecognitionEnabled:+ inspectedPageSettings.setSpeechRecognitionEnabled(value.value_or(false));+ return { };+#endif@@ -4245,7 +3933,7 @@ index 3f648b2a5fead536fa308257b0615a3547989467..d19e0372a8cb74baf958df6bddc19eaeLocalFrame* InspectorPageAgent::assertFrame(Inspector::Protocol::ErrorString& errorString, const Inspector::Protocol::Network::FrameId& frameId)@@ -766,6 +887,12 @@ void InspectorPageAgent::defaultUserPreferencesDidChange()- m_frontendDispatcher->defaultUserPreferencesDidChange(WTFMove(defaultUserPreferences));+ m_frontendDispatcher->defaultUserPreferencesDidChange(WTF::move(defaultUserPreferences));}+void InspectorPageAgent::didNavigateWithinPage(LocalFrame& frame)@@ -4332,6 +4020,15 @@ index 3f648b2a5fead536fa308257b0615a3547989467..d19e0372a8cb74baf958df6bddc19eaevoid InspectorPageAgent::applyEmulatedMedia(AtomString& media){if (!m_emulatedMedia.isEmpty())+@@ -934,7 +1115,7 @@ Inspector::Protocol::ErrorStringOr<String> InspectorPageAgent::snapshotNode(Insp+ Node* node = domAgent->assertNode(errorString, nodeId);+ if (!node)+ return makeUnexpected(errorString);+-+++ RefPtr localMainFrame = m_inspectedPage->localMainFrame();+ if (!localMainFrame)+ return makeUnexpected("Main frame isn't local"_s);@@ -946,11 +1127,13 @@ Inspector::Protocol::ErrorStringOr<String> InspectorPageAgent::snapshotNode(Inspreturn snapshot->toDataURL("image/png"_s, std::nullopt, PreserveResolution::Yes);}@@ -4351,7 +4048,7 @@ index 3f648b2a5fead536fa308257b0615a3547989467..d19e0372a8cb74baf958df6bddc19eaereturn snapshot->toDataURL("image/png"_s, std::nullopt, PreserveResolution::Yes);}-+Protocol::ErrorStringOr<void> InspectorPageAgent::setForcedColors(std::optional<Protocol::Page::ForcedColors>&& forcedColors)++Inspector::Protocol::ErrorStringOr<void> InspectorPageAgent::setForcedColors(std::optional<Inspector::Protocol::Page::ForcedColors>&& forcedColors)+{+ if (!forcedColors) {+ m_inspectedPage->setUseForcedColorsOverride(std::nullopt);@@ -4359,10 +4056,10 @@ index 3f648b2a5fead536fa308257b0615a3547989467..d19e0372a8cb74baf958df6bddc19eae+ }++ switch (*forcedColors) {-+ case Protocol::Page::ForcedColors::Active:++ case Inspector::Protocol::Page::ForcedColors::Active:+ m_inspectedPage->setUseForcedColorsOverride(true);+ return { };-+ case Protocol::Page::ForcedColors::None:++ case Inspector::Protocol::Page::ForcedColors::None:+ m_inspectedPage->setUseForcedColorsOverride(false);+ return { };+ }@@ -4371,7 +4068,7 @@ index 3f648b2a5fead536fa308257b0615a3547989467..d19e0372a8cb74baf958df6bddc19eae+ return { };+}+-+Protocol::ErrorStringOr<void> InspectorPageAgent::setTimeZone(const String& timeZone)++Inspector::Protocol::ErrorStringOr<void> InspectorPageAgent::setTimeZone(const String& timeZone)+{+ bool success = WTF::setTimeZoneOverride(timeZone);+ if (!success)@@ -4380,7 +4077,7 @@ index 3f648b2a5fead536fa308257b0615a3547989467..d19e0372a8cb74baf958df6bddc19eae+ return { };+}+-+Protocol::ErrorStringOr<void> InspectorPageAgent::setTouchEmulationEnabled(bool enabled)++Inspector::Protocol::ErrorStringOr<void> InspectorPageAgent::setTouchEmulationEnabled(bool enabled)+{+ setScreenHasTouchDeviceOverride(enabled);+ m_inspectedPage->settings().setTouchEventDOMAttributesEnabled(enabled);@@ -4405,7 +4102,7 @@ index 3f648b2a5fead536fa308257b0615a3547989467..d19e0372a8cb74baf958df6bddc19eae}-#endif+-+Protocol::ErrorStringOr<void> InspectorPageAgent::insertText(const String& text)++Inspector::Protocol::ErrorStringOr<void> InspectorPageAgent::insertText(const String& text)+{+ UserGestureIndicator indicator { IsProcessingUserGesture::Yes };+ RefPtr frame = m_inspectedPage->focusController().focusedOrMainFrame();@@ -4421,13 +4118,13 @@ index 3f648b2a5fead536fa308257b0615a3547989467..d19e0372a8cb74baf958df6bddc19eae+ return { };+}+-+Protocol::ErrorStringOr<void> InspectorPageAgent::setInterceptFileChooserDialog(bool enabled)++Inspector::Protocol::ErrorStringOr<void> InspectorPageAgent::setInterceptFileChooserDialog(bool enabled)+{+ m_interceptFileChooserDialog = enabled;+ return { };+}+-+Protocol::ErrorStringOr<void> InspectorPageAgent::setDefaultBackgroundColorOverride(RefPtr<JSON::Object>&& color)++Inspector::Protocol::ErrorStringOr<void> InspectorPageAgent::setDefaultBackgroundColorOverride(RefPtr<JSON::Object>&& color)+{+ auto* localFrame = dynamicDowncast<LocalFrame>(m_inspectedPage->mainFrame());+ LocalFrameView* view = localFrame ? localFrame->view() : nullptr;@@ -4439,18 +4136,18 @@ index 3f648b2a5fead536fa308257b0615a3547989467..d19e0372a8cb74baf958df6bddc19eae+ return { };+ }+-+ view->updateBackgroundRecursively(InspectorDOMAgent::parseColor(WTFMove(color)));++ view->updateBackgroundRecursively(InspectorDOMAgent::parseColor(WTF::move(color)));+ return { };+}+-+Protocol::ErrorStringOr<void> InspectorPageAgent::createUserWorld(const String& name)++Inspector::Protocol::ErrorStringOr<void> InspectorPageAgent::createUserWorld(const String& name)+{+ if (createdUserWorlds().contains(name))+ return makeUnexpected("World with the given name already exists"_s);++ Ref<DOMWrapperWorld> world = ScriptController::createWorld(name, ScriptController::WorldType::User);+ ensureUserWorldsExistInAllFrames({world.ptr()});-+ createdUserWorlds().set(name, WTFMove(world));++ createdUserWorlds().set(name, WTF::move(world));+ return { };+}+@@ -4463,19 +4160,19 @@ index 3f648b2a5fead536fa308257b0615a3547989467..d19e0372a8cb74baf958df6bddc19eae+ }+}+-+Protocol::ErrorStringOr<void> InspectorPageAgent::setBypassCSP(bool enabled)++Inspector::Protocol::ErrorStringOr<void> InspectorPageAgent::setBypassCSP(bool enabled)+{+ m_bypassCSP = enabled;+ return { };+}+-+Protocol::ErrorStringOr<void> InspectorPageAgent::crash()++Inspector::Protocol::ErrorStringOr<void> InspectorPageAgent::crash()+{+ WTFCrash();+ return { };+}+-+Protocol::ErrorStringOr<void> InspectorPageAgent::updateScrollingState()++Inspector::Protocol::ErrorStringOr<void> InspectorPageAgent::updateScrollingState()+{+ auto* scrollingCoordinator = m_inspectedPage->scrollingCoordinator();+ if (!scrollingCoordinator)@@ -4486,10 +4183,10 @@ index 3f648b2a5fead536fa308257b0615a3547989467..d19e0372a8cb74baf958df6bddc19eae} // namespace WebCorediff --git a/Source/WebCore/inspector/agents/InspectorPageAgent.h b/Source/WebCore/inspector/agents/InspectorPageAgent.h-index 84cc27a3481eeb11246aee3935f46f745bdbc440..c09811571337865301d9f6d0ced770d0aa624a83 100644+index d3b89895516a53d0aa2913687ba05e77aaa8c5b1..f71896e61c08cb67a22d00f094195ab49d0fb6e7 100644--- a/Source/WebCore/inspector/agents/InspectorPageAgent.h+++ b/Source/WebCore/inspector/agents/InspectorPageAgent.h-@@ -46,6 +46,7 @@+@@ -47,6 +47,7 @@namespace Inspector {enum class ResourceType;@@ -4497,7 +4194,7 @@ index 84cc27a3481eeb11246aee3935f46f745bdbc440..c09811571337865301d9f6d0ced770d0}namespace WebCore {-@@ -53,6 +54,7 @@ namespace WebCore {+@@ -54,6 +55,7 @@ namespace WebCore {class DOMWrapperWorld;class DocumentLoader;class Frame;@@ -4505,7 +4202,7 @@ index 84cc27a3481eeb11246aee3935f46f745bdbc440..c09811571337865301d9f6d0ced770d0class InspectorBackendClient;class InspectorOverlay;class LocalFrame;-@@ -67,6 +69,9 @@ public:+@@ -69,6 +71,9 @@ public:InspectorPageAgent(PageAgentContext&, InspectorBackendClient*, InspectorOverlay&);~InspectorPageAgent();@@ -4515,7 +4212,7 @@ index 84cc27a3481eeb11246aee3935f46f745bdbc440..c09811571337865301d9f6d0ced770d0// InspectorAgentBasevoid didCreateFrontendAndBackend();void willDestroyFrontendAndBackend(Inspector::DisconnectReason);-@@ -75,7 +80,10 @@ public:+@@ -77,7 +82,10 @@ public:Inspector::Protocol::ErrorStringOr<void> enable();Inspector::Protocol::ErrorStringOr<void> disable();Inspector::Protocol::ErrorStringOr<void> reload(std::optional<bool>&& ignoreCache, std::optional<bool>&& revalidateAllResources);@@ -4526,7 +4223,7 @@ index 84cc27a3481eeb11246aee3935f46f745bdbc440..c09811571337865301d9f6d0ced770d0Inspector::Protocol::ErrorStringOr<void> overrideSetting(Inspector::Protocol::Page::Setting, std::optional<bool>&& value);Inspector::Protocol::ErrorStringOr<void> overrideUserPreference(Inspector::Protocol::Page::UserPreferenceName, std::optional<Inspector::Protocol::Page::UserPreferenceValue>&&);Inspector::Protocol::ErrorStringOr<Ref<JSON::ArrayOf<Inspector::Protocol::Page::Cookie>>> getCookies();-@@ -91,41 +99,60 @@ public:+@@ -93,41 +101,60 @@ public:#endifInspector::Protocol::ErrorStringOr<void> setShowPaintRects(bool);Inspector::Protocol::ErrorStringOr<void> setEmulatedMedia(const String&);@@ -4592,7 +4289,7 @@ index 84cc27a3481eeb11246aee3935f46f745bdbc440..c09811571337865301d9f6d0ced770d0Ref<InspectorOverlay> protectedOverlay() const;-@@ -140,17 +167,21 @@ private:+@@ -142,17 +169,21 @@ private:const Ref<Inspector::PageBackendDispatcher> m_backendDispatcher;WeakRef<Page> m_inspectedPage;@@ -4616,7 +4313,7 @@ index 84cc27a3481eeb11246aee3935f46f745bdbc440..c09811571337865301d9f6d0ced770d0} // namespace WebCorediff --git a/Source/WebCore/inspector/agents/page/PageRuntimeAgent.cpp b/Source/WebCore/inspector/agents/page/PageRuntimeAgent.cpp-index 3bbd19cfdcc1683a67bc79bbc129e3e002c20a8a..34ae027c0cd3c6b3fef88046bda08b92f16a46b3 100644+index 99c4b223a9bb34d7ef41fa7e5024c6893d61e57e..d6d17ab97b32ce5761f13e02dea21fe7150dba1b 100644--- a/Source/WebCore/inspector/agents/page/PageRuntimeAgent.cpp+++ b/Source/WebCore/inspector/agents/page/PageRuntimeAgent.cpp@@ -35,6 +35,7 @@@@ -4635,7 +4332,7 @@ index 3bbd19cfdcc1683a67bc79bbc129e3e002c20a8a..34ae027c0cd3c6b3fef88046bda08b92#include "SecurityOrigin.h"#include "UserGestureEmulationScope.h"#include <JavaScriptCore/InjectedScript.h>-@@ -89,13 +91,74 @@ Inspector::Protocol::ErrorStringOr<void> PageRuntimeAgent::disable()+@@ -90,13 +92,74 @@ Inspector::Protocol::ErrorStringOr<void> PageRuntimeAgent::disable(){Ref { m_instrumentingAgents.get() }->setEnabledPageRuntimeAgent(nullptr);@@ -4686,7 +4383,7 @@ index 3bbd19cfdcc1683a67bc79bbc129e3e002c20a8a..34ae027c0cd3c6b3fef88046bda08b92+ globalObject->putDirectNativeFunction(vm, globalObject, JSC::Identifier::fromString(vm, name), 1, bindingCallback, JSC::ImplementationVisibility::Public, JSC::NoIntrinsic, JSC::attributesForStructure(static_cast<unsigned>(JSC::PropertyAttribute::Function)));+}+-+Protocol::ErrorStringOr<void> PageRuntimeAgent::addBinding(const String& name)++Inspector::Protocol::ErrorStringOr<void> PageRuntimeAgent::addBinding(const String& name)+{+ if (!m_bindingNames.add(name).isNewEntry)+ return {};@@ -4710,7 +4407,7 @@ index 3bbd19cfdcc1683a67bc79bbc129e3e002c20a8a..34ae027c0cd3c6b3fef88046bda08b92}void PageRuntimeAgent::didClearWindowObjectInWorld(LocalFrame& frame, DOMWrapperWorld& world)-@@ -104,7 +167,26 @@ void PageRuntimeAgent::didClearWindowObjectInWorld(LocalFrame& frame, DOMWrapper+@@ -105,7 +168,26 @@ void PageRuntimeAgent::didClearWindowObjectInWorld(LocalFrame& frame, DOMWrapperif (!pageAgent)return;@@ -4737,7 +4434,7 @@ index 3bbd19cfdcc1683a67bc79bbc129e3e002c20a8a..34ae027c0cd3c6b3fef88046bda08b92}InjectedScript PageRuntimeAgent::injectedScriptForEval(Inspector::Protocol::ErrorString& errorString, std::optional<Inspector::Protocol::Runtime::ExecutionContextId>&& executionContextId)-@@ -143,9 +225,6 @@ void PageRuntimeAgent::reportExecutionContextCreation()+@@ -144,9 +226,6 @@ void PageRuntimeAgent::reportExecutionContextCreation()return;m_inspectedPage->forEachLocalFrame([&](LocalFrame& frame) {@@ -4804,21 +4501,130 @@ index ed8bec9c10c9d1bf659efab09f77ad7d8e439594..49bdaf8b08d157ecb7cd412ea847eb8cprotected:static SameSiteInfo sameSiteInfo(const Document&, IsForDOMCookieAccess = IsForDOMCookieAccess::No);diff --git a/Source/WebCore/loader/DocumentLoader.cpp b/Source/WebCore/loader/DocumentLoader.cpp-index a91656adad1a649988389fc8ab7c6bfb0b6d998d..43c549fc9f21237c6995b2006ab09ec5d836e731 100644+index a0c561dd044d7037385d22b6d5f818e93af08a90..064bc1ab5248e128a167b8c9bd6ea0114962e7f2 100644--- a/Source/WebCore/loader/DocumentLoader.cpp+++ b/Source/WebCore/loader/DocumentLoader.cpp+@@ -7,13 +7,13 @@+ * are met:+ *+ * 1. Redistributions of source code must retain the above copyright+- * notice, this list of conditions and the following disclaimer.++ * notice, this list of conditions and the following disclaimer.+ * 2. Redistributions in binary form must reproduce the above copyright+ * notice, this list of conditions and the following disclaimer in the+- * documentation and/or other materials provided with the distribution.++ * documentation and/or other materials provided with the distribution.+ * 3. Neither the name of Apple Inc. ("Apple") nor the names of+ * its contributors may be used to endorse or promote products derived+- * from this software without specific prior written permission.++ * from this software without specific prior written permission.+ *+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED+@@ -266,7 +266,7 @@ void DocumentLoader::setRequest(ResourceRequest&& req)+ shouldNotifyAboutProvisionalURLChange = true;++ // We should never be getting a redirect callback after the data+- // source is committed, except in the unreachable URL case. It++ // source is committed, except in the unreachable URL case. It+ // would be a WebFoundation bug if it sent a redirect callback after commit.+ ASSERT(!m_committed);++@@ -324,8 +324,8 @@ void DocumentLoader::frameDestroyed()+ }++ // Cancels the data source's pending loads. Conceptually, a data source only loads+-// one document at a time, but one document may have many related resources.+-// stopLoading will stop all loads initiated by the data source,++// one document at a time, but one document may have many related resources.++// stopLoading will stop all loads initiated by the data source,+ // but not loads initiated by child frames' data sources -- that's the WebFrame's job.+ void DocumentLoader::stopLoading()+ {+@@ -355,7 +355,7 @@ void DocumentLoader::stopLoading()+ callback(nullptr);+ m_iconLoaders.clear();+ m_iconsPendingLoadDecision.clear();+-+++ #if ENABLE(APPLICATION_MANIFEST)+ m_applicationManifestLoader = nullptr;+ m_finishedLoadingApplicationManifest = false;+@@ -367,19 +367,19 @@ void DocumentLoader::stopLoading()++ if (RefPtr document = this->document())+ document->suspendFontLoading();+-+++ #if ENABLE(WEB_ARCHIVE) || ENABLE(MHTML)+ clearArchiveResources();+ #endif++ if (!loading) {+- // If something above restarted loading we might run into mysterious crashes like++ // If something above restarted loading we might run into mysterious crashes like+ // https://bugs.webkit.org/show_bug.cgi?id=62764 and <rdar://problem/9328684>+ ASSERT(!isLoading());+ return;+ }++- // We might run in to infinite recursion if we're stopping loading as the result of++ // We might run in to infinite recursion if we're stopping loading as the result of+ // detaching from the frame, so break out of that recursion here.+ // See <rdar://problem/9673866> for more details.+ if (m_isStopping)+@@ -409,10 +409,10 @@ void DocumentLoader::stopLoading()+ // in unexpected side effects such as erroneous event dispatch. ( http://webkit.org/b/117112 )+ if (RefPtr document = this->document())+ document->cancelParsing();+-+++ stopLoadingSubresources();+ stopLoadingPlugIns();+-+++ m_isStopping = false;+ }++@@ -500,7 +500,7 @@ void DocumentLoader::finishedLoading()+ maybeFinishLoadingMultipartContent();++ timing().markEndTime();+-+++ commitIfReady();+ RefPtr frameLoader = this->frameLoader();+ if (!frameLoader)+@@ -640,7 +640,7 @@ void DocumentLoader::willSendRequest(ResourceRequest&& newRequest, const Resourc+ {+ // Note that there are no asserts here as there are for the other callbacks. This is due to the+ // fact that this "callback" is sent when starting every load, and the state of callback+- // deferrals plays less of a part in this function in preventing the bad behavior deferring++ // deferrals plays less of a part in this function in preventing the bad behavior deferring+ // callbacks is meant to prevent.+ ASSERT(!newRequest.isNull());++@@ -717,7 +717,7 @@ void DocumentLoader::willSendRequest(ResourceRequest&& newRequest, const Resourc++ RefPtr document = frame->document();+ ASSERT(document);+-+++ // Update cookie policy base URL as URL changes, except for subframes, which use the+ // URL of the main frame which doesn't change when we redirect.+ if (frame->isMainFrame())@@ -769,8 +769,10 @@ void DocumentLoader::willSendRequest(ResourceRequest&& newRequest, const Resourcif (!didReceiveRedirectResponse)- return completionHandler(WTFMove(newRequest));+ return completionHandler(WTF::move(newRequest));+ InspectorInstrumentation::willCheckNavigationPolicy(*frame);- auto navigationPolicyCompletionHandler = [this, protectedThis = Ref { *this }, frame, completionHandler = WTFMove(completionHandler)] (ResourceRequest&& request, WeakPtr<FormSubmission>&&, NavigationPolicyDecision navigationPolicyDecision) mutable {+ auto navigationPolicyCompletionHandler = [this, protectedThis = Ref { *this }, frame, completionHandler = WTF::move(completionHandler)] (ResourceRequest&& request, WeakPtr<FormSubmission>&&, NavigationPolicyDecision navigationPolicyDecision) mutable {m_waitingForNavigationPolicy = false;+ InspectorInstrumentation::didCheckNavigationPolicy(*frame, navigationPolicyDecision != NavigationPolicyDecision::ContinueLoad);switch (navigationPolicyDecision) {case NavigationPolicyDecision::IgnoreLoad:case NavigationPolicyDecision::LoadWillContinueInAnotherProcess:-@@ -1547,11 +1549,17 @@ void DocumentLoader::detachFromFrame(LoadWillContinueInAnotherProcess loadWillCo+@@ -1558,11 +1560,17 @@ void DocumentLoader::detachFromFrame(LoadWillContinueInAnotherProcess loadWillCoif (auto navigationID = std::exchange(m_navigationID, { }))frame->loader().client().documentLoaderDetached(*navigationID, loadWillContinueInAnotherProcess);@@ -4838,24 +4644,42 @@ index a91656adad1a649988389fc8ab7c6bfb0b6d998d..43c549fc9f21237c6995b2006ab09ec5void DocumentLoader::setNavigationID(NavigationIdentifier navigationID){m_navigationID = navigationID;+@@ -1699,7 +1707,7 @@ bool DocumentLoader::maybeCreateArchive()+ m_archive = archive.copyRef();+ if (!archive)+ return false;+-+++ addAllArchiveResources(*archive);+ ASSERT(archive->mainResource());+ Ref mainResource = *archive->mainResource();+@@ -1778,7 +1786,7 @@ RefPtr<ArchiveResource> DocumentLoader::subresource(const URL& url) const+ {+ if (!isCommitted())+ return nullptr;+-+++ auto* resource = m_cachedResourceLoader->cachedResource(url);+ if (!resource || !resource->isLoaded())+ return archiveResourceForURL(url);diff --git a/Source/WebCore/loader/DocumentLoader.h b/Source/WebCore/loader/DocumentLoader.h-index a02a5f78423b113d49c7ab21659dd8cc88f64b15..704d9d18f6243aaaaf8f6bc3d2815234d2e32b8a 100644+index de644ddbc38f74d3edee5c66b69c23fb97455c4b..1a74efb2c13dfefb505d67c188a39301dbd6e255 100644--- a/Source/WebCore/loader/DocumentLoader.h+++ b/Source/WebCore/loader/DocumentLoader.h-@@ -206,6 +206,8 @@ public:+@@ -213,6 +213,8 @@ public:WEBCORE_EXPORT virtual void detachFromFrame(LoadWillContinueInAnotherProcess);+ void replacedByFragmentNavigation(LocalFrame&);+WEBCORE_EXPORT FrameLoader* frameLoader() const;- WEBCORE_EXPORT RefPtr<FrameLoader> protectedFrameLoader() const;WEBCORE_EXPORT SubresourceLoader* mainResourceLoader() const;+ WEBCORE_EXPORT RefPtr<FragmentedSharedBuffer> mainResourceData() const;diff --git a/Source/WebCore/loader/FrameLoader.cpp b/Source/WebCore/loader/FrameLoader.cpp-index 8b36290fc4bf8eb2bd4c8080b34d1b17ad63ffd0..370d562b68535d99308072a17adf5258b159945e 100644+index ae5f9ae95fd8c3d434e26e05b24e7e22825eaf7c..fbae9958f0c7ef3832609849c93a3d7c4940c44e 100644--- a/Source/WebCore/loader/FrameLoader.cpp+++ b/Source/WebCore/loader/FrameLoader.cpp-@@ -1349,6 +1349,7 @@ void FrameLoader::loadInSameDocument(URL url, RefPtr<SerializedScriptValue> stat+@@ -1354,6 +1354,7 @@ void FrameLoader::loadInSameDocument(URL url, RefPtr<SerializedScriptValue> stat}m_client->dispatchDidNavigateWithinPage();@@ -4863,31 +4687,31 @@ index 8b36290fc4bf8eb2bd4c8080b34d1b17ad63ffd0..370d562b68535d99308072a17adf5258document->statePopped(stateObject ? stateObject.releaseNonNull() : SerializedScriptValue::nullValue());m_client->dispatchDidPopStateWithinPage();-@@ -1902,6 +1903,7 @@ void FrameLoader::loadWithDocumentLoader(DocumentLoader* loader, FrameLoadType t+@@ -1903,6 +1904,7 @@ void FrameLoader::loadWithDocumentLoader(DocumentLoader* loader, FrameLoadType tconst String& httpMethod = loader->request().httpMethod();if (shouldPerformFragmentNavigation(isFormSubmission, httpMethod, policyChecker().loadType(), newURL)) {+ loader->replacedByFragmentNavigation(m_frame);RefPtr oldDocumentLoader = m_documentLoader;- NavigationAction action { frame->protectedDocument().releaseNonNull(), loader->request(), InitiatedByMainFrame::Unknown, loader->isRequestFromClientOrUserInput(), policyChecker().loadType(), isFormSubmission };-@@ -1940,7 +1942,9 @@ void FrameLoader::loadWithDocumentLoader(DocumentLoader* loader, FrameLoadType t+ NavigationAction action { protect(frame->document()).releaseNonNull(), loader->request(), InitiatedByMainFrame::Unknown, loader->isRequestFromClientOrUserInput(), policyChecker().loadType(), isFormSubmission };+@@ -1941,7 +1943,9 @@ void FrameLoader::loadWithDocumentLoader(DocumentLoader* loader, FrameLoadType tauto 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, WTFMove(formSubmission), [this, protectedThis = Ref { *this }, allowNavigationToInvalidURL, completionHandler = completionHandlerCaller.release()] (const ResourceRequest& request, WeakPtr<const FormSubmission>&& weakFormSubmission, NavigationPolicyDecision navigationPolicyDecision) mutable {+ policyChecker().checkNavigationPolicy(ResourceRequest(loader->request()), ResourceResponse { } /* redirectResponse */, loader, WTF::move(formSubmission), [this, protectedThis = Ref { *this }, allowNavigationToInvalidURL, completionHandler = completionHandlerCaller.release()] (const ResourceRequest& request, WeakPtr<const FormSubmission>&& weakFormSubmission, NavigationPolicyDecision navigationPolicyDecision) mutable {+ InspectorInstrumentation::didCheckNavigationPolicy(m_frame, navigationPolicyDecision != NavigationPolicyDecision::ContinueLoad);continueLoadAfterNavigationPolicy(request, RefPtr { weakFormSubmission.get() }.get(), navigationPolicyDecision, allowNavigationToInvalidURL);completionHandler();}, policyDecisionMode, determineNavigationType(type, NavigationHistoryBehavior::Auto));-@@ -3278,10 +3282,15 @@ String FrameLoader::userAgent(const URL& url) const+@@ -3286,10 +3290,15 @@ String FrameLoader::userAgent(const URL& url) constString FrameLoader::navigatorPlatform() const{+ String platform;+- auto customNavigatorPlatform = m_frame->protectedMainFrame()->customNavigatorPlatform();+ auto customNavigatorPlatform = protect(m_frame->mainFrame())->customNavigatorPlatform();if (!customNavigatorPlatform.isEmpty())- return customNavigatorPlatform;- return String();@@ -4899,7 +4723,7 @@ index 8b36290fc4bf8eb2bd4c8080b34d1b17ad63ffd0..370d562b68535d99308072a17adf5258}void FrameLoader::dispatchOnloadEvents()-@@ -3743,6 +3752,8 @@ void FrameLoader::receivedMainResourceError(const ResourceError& error, LoadWill+@@ -3741,6 +3750,8 @@ void FrameLoader::receivedMainResourceError(const ResourceError& error, LoadWillcheckCompleted();if (frame->page())checkLoadComplete(loadWillContinueInAnotherProcess);@@ -4908,21 +4732,21 @@ index 8b36290fc4bf8eb2bd4c8080b34d1b17ad63ffd0..370d562b68535d99308072a17adf5258}void FrameLoader::continueFragmentScrollAfterNavigationPolicy(const ResourceRequest& request, const SecurityOrigin* requesterOrigin, bool shouldContinue, NavigationHistoryBehavior historyHandling)-@@ -4695,9 +4706,6 @@ String FrameLoader::referrer() const+@@ -4693,9 +4704,6 @@ String FrameLoader::referrer() constvoid FrameLoader::dispatchDidClearWindowObjectsInAllWorlds(){-- if (!protectedFrame()->checkedScript()->canExecuteScripts(ReasonForCallingCanExecuteScripts::NotAboutToExecuteScript))+- if (!protect(m_frame->script())->canExecuteScripts(ReasonForCallingCanExecuteScripts::NotAboutToExecuteScript))- return;-Vector<Ref<DOMWrapperWorld>> worlds;ScriptController::getAllWorlds(worlds);for (auto& world : worlds)-@@ -4707,13 +4715,12 @@ void FrameLoader::dispatchDidClearWindowObjectsInAllWorlds()+@@ -4705,13 +4713,12 @@ void FrameLoader::dispatchDidClearWindowObjectsInAllWorlds()void FrameLoader::dispatchDidClearWindowObjectInWorld(DOMWrapperWorld& world){Ref frame = m_frame.get();-- if (!frame->checkedScript()->canExecuteScripts(ReasonForCallingCanExecuteScripts::NotAboutToExecuteScript) || !frame->protectedWindowProxy()->existingJSWindowProxy(world))+- if (!protect(frame->script())->canExecuteScripts(ReasonForCallingCanExecuteScripts::NotAboutToExecuteScript) || !protect(frame->windowProxy())->existingJSWindowProxy(world))- return;-- m_client->dispatchDidClearWindowObjectInWorld(world);@@ -4930,7 +4754,7 @@ index 8b36290fc4bf8eb2bd4c8080b34d1b17ad63ffd0..370d562b68535d99308072a17adf5258- if (RefPtr page = frame->page())- page->inspectorController().didClearWindowObjectInWorld(frame, world);+ if (frame->windowProxy().existingJSWindowProxy(world)) {-+ if (frame->checkedScript()->canExecuteScripts(ReasonForCallingCanExecuteScripts::NotAboutToExecuteScript))++ if (protect(frame->script())->canExecuteScripts(ReasonForCallingCanExecuteScripts::NotAboutToExecuteScript))+ m_client->dispatchDidClearWindowObjectInWorld(world);+ if (RefPtr page = frame->page())+ page->inspectorController().didClearWindowObjectInWorld(m_frame, world);@@ -4939,7 +4763,7 @@ index 8b36290fc4bf8eb2bd4c8080b34d1b17ad63ffd0..370d562b68535d99308072a17adf5258InspectorInstrumentation::didClearWindowObjectInWorld(frame, world);}diff --git a/Source/WebCore/loader/LoaderStrategy.h b/Source/WebCore/loader/LoaderStrategy.h-index 6ed1b1210c605fa0670622c42f043d61d1d37e77..7622ed46da39966706d17863cbf8aa52fecd1246 100644+index 9a5561ea2fa43baab02c7f8d43d29cf4a5543411..4b1c8dfd6be705aa3560685bb2453dd4e309372f 100644--- a/Source/WebCore/loader/LoaderStrategy.h+++ b/Source/WebCore/loader/LoaderStrategy.h@@ -89,6 +89,7 @@ public:@@ -4951,10 +4775,10 @@ index 6ed1b1210c605fa0670622c42f043d61d1d37e77..7622ed46da39966706d17863cbf8aa52virtual bool shouldPerformSecurityChecks() const { return false; }virtual bool havePerformedSecurityChecks(const ResourceResponse&) const { return false; }diff --git a/Source/WebCore/loader/ProgressTracker.cpp b/Source/WebCore/loader/ProgressTracker.cpp-index 48105098fe5559ba6a668df6e10391b70327c9c6..b8ee8e094a9b8f383379f364e586cdaa6315af67 100644+index 11161be2551c2a80ffc1d75c4454621a43576bd2..2549d584195355f2e4559ee7913e25d82da1ba26 100644--- a/Source/WebCore/loader/ProgressTracker.cpp+++ b/Source/WebCore/loader/ProgressTracker.cpp-@@ -163,6 +163,8 @@ void ProgressTracker::progressCompleted(LocalFrame& frame)+@@ -158,6 +158,8 @@ void ProgressTracker::progressCompleted(LocalFrame& frame)if (!m_numProgressTrackedFrames || originatingProgressFrame == &frame)finalProgressComplete();@@ -4963,9 +4787,9 @@ index 48105098fe5559ba6a668df6e10391b70327c9c6..b8ee8e094a9b8f383379f364e586cdaam_client->didChangeEstimatedProgress();}-@@ -189,8 +191,6 @@ void ProgressTracker::finalProgressComplete()+@@ -184,8 +186,6 @@ void ProgressTracker::finalProgressComplete()m_client->progressFinished(*frame);- protectedPage()->progressFinished(*frame);+ protect(m_page)->progressFinished(*frame);frame->loader().loadProgressingStatusChanged();-- InspectorInstrumentation::frameStoppedLoading(*frame);@@ -4973,10 +4797,10 @@ index 48105098fe5559ba6a668df6e10391b70327c9c6..b8ee8e094a9b8f383379f364e586cdaa}diff --git a/Source/WebCore/loader/cache/CachedResourceLoader.cpp b/Source/WebCore/loader/cache/CachedResourceLoader.cpp-index 5b5119235f88f5d5819d2ab4827b7bb20fccb77f..cb3f4385c645aef4659b8e1330f21c58037b2a71 100644+index 08cd1cb04c8c8213b32effd331dab3466bdccac9..1b87e7801fcc1f1ba289ee2b37ee298266e1f022 100644--- a/Source/WebCore/loader/cache/CachedResourceLoader.cpp+++ b/Source/WebCore/loader/cache/CachedResourceLoader.cpp-@@ -1134,8 +1134,11 @@ ResourceErrorOr<CachedResourceHandle<CachedResource>> CachedResourceLoader::requ+@@ -1132,8 +1132,11 @@ ResourceErrorOr<CachedResourceHandle<CachedResource>> CachedResourceLoader::requrequest.updateReferrerPolicy(document ? document->referrerPolicy() : ReferrerPolicy::Default);@@ -4990,23 +4814,23 @@ index 5b5119235f88f5d5819d2ab4827b7bb20fccb77f..cb3f4385c645aef4659b8e1330f21c58if (RefPtr documentLoader = m_documentLoader.get()) {bool madeHTTPS { request.resourceRequest().wasSchemeOptimisticallyUpgraded() };-@@ -1774,8 +1777,9 @@ Vector<Ref<SVGImage>> CachedResourceLoader::allCachedSVGImages() const+@@ -1786,8 +1789,9 @@ Vector<Ref<SVGImage>> CachedResourceLoader::allCachedSVGImages() constResourceErrorOr<CachedResourceHandle<CachedResource>> CachedResourceLoader::preload(CachedResource::Type type, CachedResourceRequest&& request){-- if (InspectorInstrumentation::willIntercept(protectedFrame().get(), request.resourceRequest()))+- if (InspectorInstrumentation::willIntercept(protect(frame()).get(), request.resourceRequest()))- return makeUnexpected(ResourceError { errorDomainWebKitInternal, 0, request.resourceRequest().url(), "Inspector intercept"_s });+ // Playwright: <link rel=preload ... /> requests are intercepted (see https://github.com/microsoft/playwright/issues/16745)-+ // if (InspectorInstrumentation::willIntercept(protectedFrame().get(), request.resourceRequest()))++ // if (InspectorInstrumentation::willIntercept(protect(frame()).get(), request.resourceRequest()))+ // return makeUnexpected(ResourceError { errorDomainWebKitInternal, 0, request.resourceRequest().url(), "Inspector intercept"_s });RefPtr document = m_document.get();ASSERT(document);diff --git a/Source/WebCore/page/ChromeClient.h b/Source/WebCore/page/ChromeClient.h-index 81ff4871e3b9431d3f0142578cdd44770dc0f10a..4468041518a0f1670191ebcda5c0be457c728f62 100644+index 2ca94f05a703d9d15f2c5453eed734c658ef1132..8ed2fce6feb37532b3a3b16dc4816b3406678cfb 100644--- a/Source/WebCore/page/ChromeClient.h+++ b/Source/WebCore/page/ChromeClient.h-@@ -401,7 +401,7 @@ public:+@@ -403,7 +403,7 @@ public:#endif#if ENABLE(ORIENTATION_EVENTS)@@ -5016,10 +4840,10 @@ index 81ff4871e3b9431d3f0142578cdd44770dc0f10a..4468041518a0f1670191ebcda5c0be45virtual RefPtr<ColorChooser> createColorChooser(ColorChooserClient&, const Color&) = 0;diff --git a/Source/WebCore/page/EventHandler.cpp b/Source/WebCore/page/EventHandler.cpp-index 41bded29a6b376a386fab5ca93241e6fa6a8b3b2..f207476cd37e911d0c0fc0450c6f46535cf7e581 100644+index e273214a726f85c3a898d0a76c76c7035edeb36c..c1c07dbe4481702e768db0696f2a413bc1075d57 100644--- a/Source/WebCore/page/EventHandler.cpp+++ b/Source/WebCore/page/EventHandler.cpp-@@ -4733,6 +4733,12 @@ bool EventHandler::handleDrag(const MouseEventWithHitTestResults& event, CheckDr+@@ -4760,6 +4760,12 @@ bool EventHandler::handleDrag(const MouseEventWithHitTestResults& event, CheckDrif (!document)return false;@@ -5032,7 +4856,7 @@ index 41bded29a6b376a386fab5ca93241e6fa6a8b3b2..f207476cd37e911d0c0fc0450c6f4653dragState().dataTransfer = DataTransfer::createForDrag(*document);auto hasNonDefaultPasteboardData = HasNonDefaultPasteboardData::No;-@@ -5337,6 +5343,7 @@ static HitTestResult hitTestResultInFrame(LocalFrame* frame, const LayoutPoint&+@@ -5364,6 +5370,7 @@ static HitTestResult hitTestResultInFrame(LocalFrame* frame, const LayoutPoint&return result;}@@ -5040,7 +4864,7 @@ index 41bded29a6b376a386fab5ca93241e6fa6a8b3b2..f207476cd37e911d0c0fc0450c6f4653Expected<bool, RemoteFrameGeometryTransformer> EventHandler::handleTouchEvent(const PlatformTouchEvent& event){Ref frame = m_frame.get();-@@ -5410,7 +5417,7 @@ Expected<bool, RemoteFrameGeometryTransformer> EventHandler::handleTouchEvent(co+@@ -5437,7 +5444,7 @@ Expected<bool, RemoteFrameGeometryTransformer> EventHandler::handleTouchEvent(co// Increment the platform touch id by 1 to avoid storing a key of 0 in the hashmap.unsigned touchPointTargetKey = point.id() + 1;@@ -5049,7 +4873,7 @@ index 41bded29a6b376a386fab5ca93241e6fa6a8b3b2..f207476cd37e911d0c0fc0450c6f4653bool pointerCancelled = false;#endifRefPtr<EventTarget> touchTarget;-@@ -5457,7 +5464,7 @@ Expected<bool, RemoteFrameGeometryTransformer> EventHandler::handleTouchEvent(co+@@ -5484,7 +5491,7 @@ Expected<bool, RemoteFrameGeometryTransformer> EventHandler::handleTouchEvent(co// we also remove it from the map.touchTarget = m_originatingTouchPointTargets.take(touchPointTargetKey);@@ -5058,7 +4882,7 @@ index 41bded29a6b376a386fab5ca93241e6fa6a8b3b2..f207476cd37e911d0c0fc0450c6f4653HitTestResult result = hitTestResultAtPoint(pagePoint, hitType | HitTestRequest::Type::AllowChildFrameContent);pointerTarget = result.targetElement();pointerCancelled = (pointerTarget != touchTarget);-@@ -5482,7 +5489,7 @@ Expected<bool, RemoteFrameGeometryTransformer> EventHandler::handleTouchEvent(co+@@ -5509,7 +5516,7 @@ Expected<bool, RemoteFrameGeometryTransformer> EventHandler::handleTouchEvent(coif (!targetFrame)continue;@@ -5067,7 +4891,7 @@ index 41bded29a6b376a386fab5ca93241e6fa6a8b3b2..f207476cd37e911d0c0fc0450c6f4653// FIXME: WPE currently does not send touch stationary events, so create a naive TouchReleased PlatformTouchPoint// on release if the hit test result changed since the previous TouchPressed or TouchMovedif (pointState == PlatformTouchPoint::TouchReleased && pointerCancelled) {-@@ -5496,7 +5503,7 @@ Expected<bool, RemoteFrameGeometryTransformer> EventHandler::handleTouchEvent(co+@@ -5523,7 +5530,7 @@ Expected<bool, RemoteFrameGeometryTransformer> EventHandler::handleTouchEvent(co}#endif@@ -5075,8 +4899,8 @@ index 41bded29a6b376a386fab5ca93241e6fa6a8b3b2..f207476cd37e911d0c0fc0450c6f4653+#if !ENABLE(IOS_TOUCH_EVENTS)// FIXME: Pass the touch delta for pointermove events by remembering the position per pointerID similar to// Apple's m_touchLastGlobalPositionAndDeltaMap- document->protectedPage()->pointerCaptureController().dispatchEventForTouchAtIndex(-@@ -5571,6 +5578,7 @@ Expected<bool, RemoteFrameGeometryTransformer> EventHandler::handleTouchEvent(co+ protect(document->page())->pointerCaptureController().dispatchEventForTouchAtIndex(+@@ -5598,6 +5605,7 @@ Expected<bool, RemoteFrameGeometryTransformer> EventHandler::handleTouchEvent(coreturn swallowedEvent;}@@ -5085,10 +4909,10 @@ index 41bded29a6b376a386fab5ca93241e6fa6a8b3b2..f207476cd37e911d0c0fc0450c6f4653#if ENABLE(TOUCH_EVENTS)diff --git a/Source/WebCore/page/FocusController.cpp b/Source/WebCore/page/FocusController.cpp-index e02867ec6ec9958a3e7103d16556f7df730f2440..53b9cd6603660fa5d9ce446612eaeba38b2dcef1 100644+index c513e8afbce1f96d5bad3e86ee40f9c673026511..9cf4757d8b4a93f4f3a3b77e0055deefaa6c9a26 100644--- a/Source/WebCore/page/FocusController.cpp+++ b/Source/WebCore/page/FocusController.cpp-@@ -630,13 +630,14 @@ bool FocusController::relinquishFocusToChrome(FocusDirection direction)+@@ -635,13 +635,14 @@ bool FocusController::relinquishFocusToChrome(FocusDirection direction)return false;Ref page = m_page.get();@@ -5106,11 +4930,11 @@ index e02867ec6ec9958a3e7103d16556f7df730f2440..53b9cd6603660fa5d9ce446612eaeba3}diff --git a/Source/WebCore/page/FrameConsoleClient.cpp b/Source/WebCore/page/FrameConsoleClient.cpp-index c2650f4fe59d3ba423ad7da1a4ba58e1f8c01c72..69d0c717f73dfb65b91cd577ccf74a48dfa1e882 100644+index b288e17d7ed9adebc63503f868ab99a83d65cdeb..b4fbb17112af2b3eed8056eb09c84920e92827cc 100644--- a/Source/WebCore/page/FrameConsoleClient.cpp+++ b/Source/WebCore/page/FrameConsoleClient.cpp@@ -471,4 +471,12 @@ void FrameConsoleClient::screenshot(JSC::JSGlobalObject* lexicalGlobalObject, Re- addMessage(makeUnique<Inspector::ConsoleMessage>(MessageSource::ConsoleAPI, MessageType::Image, MessageLevel::Log, dataURL, ScriptArguments::create(lexicalGlobalObject, WTFMove(adjustedArguments)), lexicalGlobalObject, /* requestIdentifier */ 0, timestamp));+ addMessage(makeUnique<Inspector::ConsoleMessage>(MessageSource::ConsoleAPI, MessageType::Image, MessageLevel::Log, dataURL, ScriptArguments::create(lexicalGlobalObject, WTF::move(adjustedArguments)), lexicalGlobalObject, /* requestIdentifier */ 0, timestamp));}+void FrameConsoleClient::bindingCalled(JSC::JSGlobalObject* globalObject, const String& name, const String& arg)@@ -5123,7 +4947,7 @@ index c2650f4fe59d3ba423ad7da1a4ba58e1f8c01c72..69d0c717f73dfb65b91cd577ccf74a48+} // namespace WebCorediff --git a/Source/WebCore/page/FrameConsoleClient.h b/Source/WebCore/page/FrameConsoleClient.h-index 66c57501b719d3c58ab8d6f780d9e7e7b5df3745..0e31080ca92bf2095d592cbccb1838cf4a00d6ca 100644+index 1cb164735331abf30b1eae0b49b827d251dcc3c9..7d0ccff34bab67f4b4f3345e69dd0a0fb9578cc9 100644--- a/Source/WebCore/page/FrameConsoleClient.h+++ b/Source/WebCore/page/FrameConsoleClient.h@@ -92,6 +92,7 @@ private:@@ -5135,10 +4959,10 @@ index 66c57501b719d3c58ab8d6f780d9e7e7b5df3745..0e31080ca92bf2095d592cbccb1838cfWeakRef<LocalFrame> m_frame;};diff --git a/Source/WebCore/page/FrameSnapshotting.cpp b/Source/WebCore/page/FrameSnapshotting.cpp-index 87f9c7b340f96150c1472a47bc0908042b4241bb..c48304e6c4eba0b9e246b8f07a6f873b07667af8 100644+index 729093bd1ad56a1fcbea91f1f5df661d3a33ebaf..5780aa53bbaa26c5019109963fa8d1f647a11984 100644--- a/Source/WebCore/page/FrameSnapshotting.cpp+++ b/Source/WebCore/page/FrameSnapshotting.cpp-@@ -119,7 +119,7 @@ RefPtr<ImageBuffer> snapshotFrameRectWithClip(LocalFrame& frame, const IntRect&+@@ -118,7 +118,7 @@ RefPtr<ImageBuffer> snapshotFrameRectWithClip(LocalFrame& frame, const IntRect&// Other paint behaviors are set by paintContentsForSnapshot.frame.view()->setPaintBehavior(paintBehavior);@@ -5147,7 +4971,7 @@ index 87f9c7b340f96150c1472a47bc0908042b4241bb..c48304e6c4eba0b9e246b8f07a6f873bif (options.flags.contains(SnapshotFlags::PaintWith3xBaseScale))scaleFactor = 3;-@@ -138,6 +138,8 @@ RefPtr<ImageBuffer> snapshotFrameRectWithClip(LocalFrame& frame, const IntRect&+@@ -137,6 +137,8 @@ RefPtr<ImageBuffer> snapshotFrameRectWithClip(LocalFrame& frame, const IntRect&return nullptr;buffer->context().translate(-imageRect.location());@@ -5156,7 +4980,7 @@ index 87f9c7b340f96150c1472a47bc0908042b4241bb..c48304e6c4eba0b9e246b8f07a6f873bif (!clipRects.isEmpty()) {Path clipPath;-@@ -146,7 +148,10 @@ RefPtr<ImageBuffer> snapshotFrameRectWithClip(LocalFrame& frame, const IntRect&+@@ -145,7 +147,10 @@ RefPtr<ImageBuffer> snapshotFrameRectWithClip(LocalFrame& frame, const IntRect&buffer->context().clipPath(clipPath);}@@ -5181,7 +5005,7 @@ index 4935bfd9a6e43d59a101c153fa89a8484fcb49e2..8384f5b5db8e405f86e1201d144d92d7struct SnapshotOptions {diff --git a/Source/WebCore/page/History.cpp b/Source/WebCore/page/History.cpp-index 96a08d5355dc7a8ba7c7becf7d9578081534dabf..584a68a408a14c0f034f5747bacca87f29a9fbe5 100644+index ee349890baf073f0432f590edbe326ec9f97115e..3022988b7d0b9b610cba13f8f429cd4c62404212 100644--- a/Source/WebCore/page/History.cpp+++ b/Source/WebCore/page/History.cpp@@ -34,6 +34,7 @@@@ -5192,17 +5016,26 @@ index 96a08d5355dc7a8ba7c7becf7d9578081534dabf..584a68a408a14c0f034f5747bacca87f#include "LocalFrame.h"#include "LocalFrameLoaderClient.h"#include "Logging.h"+@@ -94,7 +95,7 @@ ExceptionOr<History::ScrollRestoration> History::scrollRestoration() const+ RefPtr historyItem = frame->loader().history().currentItem();+ if (!historyItem)+ return ScrollRestoration::Auto;+-+++ return historyItem->shouldRestoreScrollPosition() ? ScrollRestoration::Auto : ScrollRestoration::Manual;+ }+@@ -312,6 +313,8 @@ ExceptionOr<void> History::stateObjectAdded(RefPtr<SerializedScriptValue>&& data}- frame->loader().updateURLAndHistory(fullURL, WTFMove(data), historyBehavior);+ frame->loader().updateURLAndHistory(fullURL, WTF::move(data), historyBehavior);+ InspectorInstrumentation::didNavigateWithinPage(*frame);+return { };}diff --git a/Source/WebCore/page/LocalFrame.cpp b/Source/WebCore/page/LocalFrame.cpp-index 8695417fdb85d3d9fcd575579faf096f301bee8a..ce3c228d06f2bd1f2df5f5ef1591fe41c5cf2671 100644+index 1ce54cf2275bfd6253469e849ee8dbc5c0a64264..2905dc35d52ddafeb7e190144da59993dc8b3468 100644--- a/Source/WebCore/page/LocalFrame.cpp+++ b/Source/WebCore/page/LocalFrame.cpp@@ -41,6 +41,7 @@@@ -5213,15 +5046,7 @@ index 8695417fdb85d3d9fcd575579faf096f301bee8a..ce3c228d06f2bd1f2df5f5ef1591fe41#include "DiagnosticLoggingClient.h"#include "DiagnosticLoggingKeys.h"#include "DocumentLoader.h"-@@ -65,6 +66,7 @@- #include "FrameSelection.h"- #include "GraphicsContext.h"- #include "GraphicsLayer.h"-+#include "HTMLAreaElement.h"- #include "HTMLAttachmentElement.h"- #include "HTMLFormControlElement.h"- #include "HTMLFormElement.h"-@@ -87,6 +89,7 @@+@@ -89,6 +90,7 @@#include "Logging.h"#include "Navigator.h"#include "NodeList.h"@@ -5229,7 +5054,7 @@ index 8695417fdb85d3d9fcd575579faf096f301bee8a..ce3c228d06f2bd1f2df5f5ef1591fe41#include "NodeTraversal.h"#include "Page.h"#include "PaymentSession.h"-@@ -220,6 +223,7 @@ LocalFrame::LocalFrame(Page& page, ClientCreator&& clientCreator, FrameIdentifie+@@ -222,6 +224,7 @@ LocalFrame::LocalFrame(Page& page, ClientCreator&& clientCreator, FrameIdentifievoid LocalFrame::init(){@@ -5237,7 +5062,7 @@ index 8695417fdb85d3d9fcd575579faf096f301bee8a..ce3c228d06f2bd1f2df5f5ef1591fe41loader().init();}-@@ -450,7 +454,7 @@ void LocalFrame::orientationChanged()+@@ -452,7 +455,7 @@ void LocalFrame::orientationChanged()IntDegrees LocalFrame::orientation() const{if (RefPtr page = this->page())@@ -5246,521 +5071,149 @@ index 8695417fdb85d3d9fcd575579faf096f301bee8a..ce3c228d06f2bd1f2df5f5ef1591fe41return 0;}#endif // ENABLE(ORIENTATION_EVENTS)-@@ -1699,6 +1703,364 @@ String LocalFrame::frameURLProtocol() const+@@ -1696,7 +1699,6 @@ String LocalFrame::frameURLProtocol() constreturn ""_s;}-+#if !PLATFORM(IOS_FAMILY)-+-+void LocalFrame::betterApproximateNode(const IntPoint& testPoint, const NodeQualifier& nodeQualifierFunction, Node*& best, Node* failedNode, IntPoint& bestPoint, IntRect& bestRect, const IntRect& testRect)+-#if PLATFORM(COCOA)++ static bool nodeIsMouseFocusable(Node& node)+ {+@@ -1946,7 +1948,6 @@ RefPtr<Node> LocalFrame::nodeRespondingToDoubleClickEvent(const FloatPoint& view+ return qualifyingNodeAtViewportLocation(viewportLocation, adjustedViewportLocation, WTF::move(ancestorRespondingToDoubleClickEvent), ShouldApproximate::Yes);+ }++-#endif // PLATFORM(COCOA)++ } // namespace WebCore++diff --git a/Source/WebCore/page/LocalFrame.h b/Source/WebCore/page/LocalFrame.h+index c2ac6d0d1a599ac6947c5875d13aa389dcd591d4..00c457575f11c0c39c8913cd54f597688c35df28 100644+--- a/Source/WebCore/page/LocalFrame.h++++ b/Source/WebCore/page/LocalFrame.h+@@ -29,6 +29,7 @@++ #include <WebCore/DOMPasteAccess.h>+ #include <WebCore/Frame.h>++#include <WebCore/IntDegrees.h>+ #include <WebCore/HitTestRequest.h>+ #include <WebCore/ScrollbarMode.h>+ #include <wtf/CheckedRef.h>+@@ -129,9 +130,7 @@ enum {+ enum OverflowScrollAction { DoNotPerformOverflowScroll, PerformOverflowScroll };+ #endif++-#if PLATFORM(COCOA)+ using NodeQualifier = Function<RefPtr<Node> (const HitTestResult&, Node* terminationNode, IntRect* nodeBounds)>;+-#endif++ class LocalFrame final : public Frame {+ public:+@@ -235,7 +234,6 @@ public:+ WEBCORE_EXPORT DataDetectionResultsStorage& dataDetectionResults();+ #endif++-#if PLATFORM(COCOA)+ RefPtr<Node> betterApproximateNode(const IntPoint& testPoint, const NodeQualifier&, Node* best, Node* failedNode, IntPoint& bestPoint, IntRect& bestRect, const IntRect& testRect);++ WEBCORE_EXPORT RefPtr<Node> nodeRespondingToInteraction(const FloatPoint& viewportLocation, FloatPoint& adjustedViewportLocation);+@@ -249,7 +247,6 @@ public:+ WEBCORE_EXPORT RefPtr<Node> nodeRespondingToDoubleClickEvent(const FloatPoint& viewportLocation, FloatPoint& adjustedViewportLocation);++ static bool nodeWillRespondToMouseEvents(Node&);+-#endif // PLATFORM(COCOA)++ #if PLATFORM(IOS_FAMILY)+ const ViewportArguments& viewportArguments() const;+@@ -327,6 +324,7 @@ public:++ WEBCORE_EXPORT FloatSize screenSize() const;+ void setOverrideScreenSize(FloatSize&&);++ bool hasScreenSizeOverride() const { return !!m_overrideScreenSize; }++ void selfOnlyRef();+ void selfOnlyDeref();+diff --git a/Source/WebCore/page/Page.cpp b/Source/WebCore/page/Page.cpp+index 9ca90a896204491535d0656f8d7f90f5d2d6c014..0419fa1758253d1c1fff32276fcd317073a23d9b 100644+--- a/Source/WebCore/page/Page.cpp++++ b/Source/WebCore/page/Page.cpp+@@ -672,6 +672,44 @@ void Page::setOverrideViewportArguments(const std::optional<ViewportArguments>&+ localTopDocument->updateViewportArguments();+ }+++FloatSize Page::screenSize()+{-+ IntRect candidateRect;-+ constexpr OptionSet<HitTestRequest::Type> hitType { HitTestRequest::Type::ReadOnly, HitTestRequest::Type::Active, HitTestRequest::Type::DisallowUserAgentShadowContent, HitTestRequest::Type::AllowVisibleChildFrameContentOnly };-+ auto* candidate = nodeQualifierFunction(eventHandler().hitTestResultAtPoint(testPoint, hitType), failedNode, &candidateRect);-+-+ // Bail if we have no candidate, or the candidate is already equal to our current best node,-+ // or our candidate is the avoidedNode and there is a current best node.-+ if (!candidate || candidate == best)-+ return;-+-+ // The document should never be considered the best alternative.-+ if (candidate->isDocumentNode())-+ return;-+-+ if (best) {-+ IntRect bestIntersect = intersection(testRect, bestRect);-+ IntRect candidateIntersect = intersection(testRect, candidateRect);-+ // if the candidate intersection is smaller than the current best intersection, bail.-+ if (candidateIntersect.width() * candidateIntersect.height() <= bestIntersect.width() * bestIntersect.height())-+ return;-+ }-+-+ // At this point we either don't have a previous best, or our current candidate has a better intersection.-+ best = candidate;-+ bestPoint = testPoint;-+ bestRect = candidateRect;++ RefPtr localMainFrame = this->localMainFrame();++ RefPtr frameView = localMainFrame ? localMainFrame->view() : nullptr;++ if (!frameView)++ return { };++ return m_overrideScreenSize.value_or(screenRect(frameView.get()).size());+}+-+bool LocalFrame::hitTestResultAtViewportLocation(const FloatPoint& viewportLocation, HitTestResult& hitTestResult, IntPoint& center)++void Page::setOverrideScreenSize(std::optional<FloatSize> size)+{-+ if (!m_doc || !m_doc->renderView())-+ return false;-+-+ FrameView* view = m_view.get();-+ if (!view)-+ return false;++ if (size == m_overrideScreenSize)++ return;+-+ center = view->windowToContents(roundedIntPoint(viewportLocation));-+ constexpr OptionSet<HitTestRequest::Type> hitType { HitTestRequest::Type::ReadOnly, HitTestRequest::Type::Active, HitTestRequest::Type::DisallowUserAgentShadowContent, HitTestRequest::Type::AllowVisibleChildFrameContentOnly };-+ hitTestResult = eventHandler().hitTestResultAtPoint(center, hitType);-+ return true;++ m_overrideScreenSize = size;++ RefPtr localMainFrame = this->localMainFrame();++ if (auto* document = localMainFrame ? localMainFrame->document() : nullptr)++ document->updateViewportArguments();+}+-+WTF_ALLOW_UNSAFE_BUFFER_USAGE_BEGIN-+Node* LocalFrame::qualifyingNodeAtViewportLocation(const FloatPoint& viewportLocation, FloatPoint& adjustedViewportLocation, const NodeQualifier& nodeQualifierFunction, ShouldApproximate shouldApproximate, ShouldFindRootEditableElement shouldFindRootEditableElement)++#if ENABLE(ORIENTATION_EVENTS)++int Page::orientation() const+{-+ adjustedViewportLocation = viewportLocation;-+-+ IntPoint testCenter;-+ HitTestResult candidateInfo;-+ if (!hitTestResultAtViewportLocation(viewportLocation, candidateInfo, testCenter))-+ return nullptr;-+-+ IntPoint bestPoint = testCenter;-+-+ // We have the candidate node at the location, check whether it or one of its ancestors passes-+ // the qualifier function, which typically checks if the node responds to a particular event type.-+ Node* approximateNode = nodeQualifierFunction(candidateInfo, 0, 0);-+-+ if (shouldFindRootEditableElement == ShouldFindRootEditableElement::Yes && approximateNode && approximateNode->isContentEditable()) {-+ // If we are in editable content, we look for the root editable element.-+ approximateNode = approximateNode->rootEditableElement();-+ // If we have a focusable node, there is no need to approximate.-+ if (approximateNode)-+ shouldApproximate = ShouldApproximate::No;-+ }-+-+ float scale = page() ? page()->pageScaleFactor() : 1;-+#if PLATFORM(IOS_FAMILY)-+ float ppiFactor = screenPPIFactor();-+#else-+ float ppiFactor = 326; // most popular iPhone PPI-+#endif-+-+ static const float unscaledSearchRadius = 15;-+ int searchRadius = static_cast<int>(unscaledSearchRadius * ppiFactor / scale);-+-+ if (approximateNode && shouldApproximate == ShouldApproximate::Yes) {-+ const float testOffsets[] = {-+ -.3f, -.3f,-+ -.6f, -.6f,-+ +.3f, +.3f,-+ -.9f, -.9f,-+ };-+-+ Node* originalApproximateNode = approximateNode;-+ for (unsigned n = 0; n < std::size(testOffsets); n += 2) {-+ IntSize testOffset(testOffsets[n] * searchRadius, testOffsets[n + 1] * searchRadius);-+ IntPoint testPoint = testCenter + testOffset;-+-+ constexpr OptionSet<HitTestRequest::Type> hitType { HitTestRequest::Type::ReadOnly, HitTestRequest::Type::Active, HitTestRequest::Type::DisallowUserAgentShadowContent, HitTestRequest::Type::AllowChildFrameContent };-+ auto candidateInfo = eventHandler().hitTestResultAtPoint(testPoint, hitType);-+ Node* candidateNode = nodeQualifierFunction(candidateInfo, 0, 0);-+ if (candidateNode && candidateNode->isDescendantOf(originalApproximateNode)) {-+ approximateNode = candidateNode;-+ bestPoint = testPoint;-+ break;-+ }-+ }-+ } else if (!approximateNode && shouldApproximate == ShouldApproximate::Yes) {-+ // Grab the closest parent element of our failed candidate node.-+ Node* candidate = candidateInfo.innerNode();-+ Node* failedNode = candidate;-+-+ while (candidate && !candidate->isElementNode())-+ candidate = candidate->parentInComposedTree();-+-+ if (candidate)-+ failedNode = candidate;-+-+ // The center point was tested earlier.-+ const float testOffsets[] = {-+ -.3f, -.3f,-+ +.3f, -.3f,-+ -.3f, +.3f,-+ +.3f, +.3f,-+ -.6f, -.6f,-+ +.6f, -.6f,-+ -.6f, +.6f,-+ +.6f, +.6f,-+ -1.f, 0,-+ +1.f, 0,-+ 0, +1.f,-+ 0, -1.f,-+ };-+ IntRect bestFrame;-+ IntRect testRect(testCenter, IntSize());-+ testRect.inflate(searchRadius);-+ int currentTestRadius = 0;-+ for (unsigned n = 0; n < std::size(testOffsets); n += 2) {-+ IntSize testOffset(testOffsets[n] * searchRadius, testOffsets[n + 1] * searchRadius);-+ IntPoint testPoint = testCenter + testOffset;-+ int testRadius = std::max(abs(testOffset.width()), abs(testOffset.height()));-+ if (testRadius > currentTestRadius) {-+ // Bail out with the best match within a radius-+ currentTestRadius = testRadius;-+ if (approximateNode)-+ break;-+ }-+ betterApproximateNode(testPoint, nodeQualifierFunction, approximateNode, failedNode, bestPoint, bestFrame, testRect);-+ }-+ }-+-+ if (approximateNode) {-+ IntPoint p = m_view->contentsToWindow(bestPoint);-+ adjustedViewportLocation = p;-+ if (shouldFindRootEditableElement == ShouldFindRootEditableElement::Yes && approximateNode->isContentEditable()) {-+ // When in editable content, look for the root editable node again,-+ // since this could be the node found with the approximation.-+ approximateNode = approximateNode->rootEditableElement();-+ }-+ }-+-+ return approximateNode;++ return m_overrideOrientation.value_or(chrome().client().deviceOrientation());+}-+WTF_ALLOW_UNSAFE_BUFFER_USAGE_END+-+Node* LocalFrame::deepestNodeAtLocation(const FloatPoint& viewportLocation)++void Page::setOverrideOrientation(std::optional<int> orientation)+{-+ IntPoint center;-+ HitTestResult hitTestResult;-+ if (!hitTestResultAtViewportLocation(viewportLocation, hitTestResult, center))-+ return nullptr;++ if (orientation == m_overrideOrientation)++ return;++++ m_overrideOrientation = orientation;+-+ return hitTestResult.innerNode();++ if (RefPtr localMainFrame = this->localMainFrame())++ localMainFrame->orientationChanged();+}++#endif+-+static bool nodeIsMouseFocusable(Node& node)+ ScrollingCoordinator* Page::scrollingCoordinator()+ {+ if (!m_scrollingCoordinator && m_settings->scrollingCoordinatorEnabled()) {+@@ -4345,6 +4383,26 @@ void Page::setUseDarkAppearanceOverride(std::optional<bool> valueOverride)+ appearanceDidChange();+ }+++void Page::setUseReducedMotionOverride(std::optional<bool> valueOverride)+{-+ if (!is<Element>(node))-+ return false;-+-+ auto& element = downcast<Element>(node);-+ if (element.isMouseFocusable())-+ return true;-+-+ if (RefPtr shadowRoot = element.shadowRoot()) {-+ if (shadowRoot->delegatesFocus()) {-+ for (auto& node : composedTreeDescendants(element)) {-+ if (is<Element>(node) && downcast<Element>(node).isMouseFocusable())-+ return true;-+ }-+ }-+ }++ if (valueOverride == m_useReducedMotionOverride)++ return;+-+ return false;-+}++ m_useReducedMotionOverride = valueOverride;+-+static bool nodeWillRespondToMouseEvents(Node& node)-+{-+ return node.willRespondToMouseClickEvents() || node.willRespondToMouseMoveEvents() || nodeIsMouseFocusable(node);++ appearanceDidChange();+}+-+Node* LocalFrame::approximateNodeAtViewportLocationLegacy(const FloatPoint& viewportLocation, FloatPoint& adjustedViewportLocation)++void Page::setUseForcedColorsOverride(std::optional<bool> valueOverride)+{-+ // This function is only used for UIWebView.-+ auto&& ancestorRespondingToClickEvents = [](const HitTestResult& hitTestResult, Node* terminationNode, IntRect* nodeBounds) -> Node* {-+ bool bodyHasBeenReached = false;-+ bool pointerCursorStillValid = true;++ if (valueOverride == m_useForcedColorsOverride)++ return;+-+ if (nodeBounds)-+ *nodeBounds = IntRect();++ m_useForcedColorsOverride = valueOverride;+-+ auto node = hitTestResult.innerNode();-+ if (!node)-+ return nullptr;-+-+ Node* pointerCursorNode = nullptr;-+ for (; node && node != terminationNode; node = node->parentInComposedTree()) {-+ // We only accept pointer nodes before reaching the body tag.-+ if (node->hasTagName(HTMLNames::bodyTag)) {-+ // Make sure we cover the case of an empty editable body.-+ if (!pointerCursorNode && node->isContentEditable())-+ pointerCursorNode = node;-+ bodyHasBeenReached = true;-+ pointerCursorStillValid = false;-+ }-+-+ // If we already have a pointer, and we reach a table, don't accept it.-+ if (pointerCursorNode && (node->hasTagName(HTMLNames::tableTag) || node->hasTagName(HTMLNames::tbodyTag)))-+ pointerCursorStillValid = false;-+-+ // If we haven't reached the body, and we are still paying attention to pointer cursors, and the node has a pointer cursor.-+ if (pointerCursorStillValid && node->renderStyle() && node->renderStyle()->cursor() == CursorType::Pointer)-+ pointerCursorNode = node;-+ else if (pointerCursorNode) {-+ // We want the lowest unbroken chain of pointer cursors.-+ pointerCursorStillValid = false;-+ }-+-+ if (nodeWillRespondToMouseEvents(*node)) {-+ // If we're at the body or higher, use the pointer cursor node (which may be null).-+ if (bodyHasBeenReached)-+ node = pointerCursorNode;-+-+ // If we are interested about the frame, use it.-+ if (nodeBounds) {-+ // This is a check to see whether this node is an area element. The only way this can happen is if this is the first check.-+ if (node == hitTestResult.innerNode() && node != hitTestResult.innerNonSharedNode() && is<HTMLAreaElement>(*node))-+ *nodeBounds = snappedIntRect(downcast<HTMLAreaElement>(*node).computeRect(hitTestResult.innerNonSharedNode()->renderer()));-+ else if (node && node->renderer())-+ *nodeBounds = node->renderer()->absoluteBoundingBoxRect(true);-+ }-+-+ return node;-+ }-+ }-+-+ return nullptr;-+ };-+-+ return qualifyingNodeAtViewportLocation(viewportLocation, adjustedViewportLocation, WTFMove(ancestorRespondingToClickEvents), ShouldApproximate::Yes);-+}-+-+static inline NodeQualifier ancestorRespondingToClickEventsNodeQualifier(SecurityOrigin* securityOrigin = nullptr)-+{-+ return [securityOrigin](const HitTestResult& hitTestResult, Node* terminationNode, IntRect* nodeBounds) -> Node* {-+ if (nodeBounds)-+ *nodeBounds = IntRect();-+-+ auto node = hitTestResult.innerNode();-+ if (!node || (securityOrigin && !securityOrigin->isSameOriginAs(node->document().securityOrigin())))-+ return nullptr;-+-+ for (; node && node != terminationNode; node = node->parentInComposedTree()) {-+ if (nodeWillRespondToMouseEvents(*node)) {-+ // If we are interested about the frame, use it.-+ if (nodeBounds) {-+ // This is a check to see whether this node is an area element. The only way this can happen is if this is the first check.-+ if (node == hitTestResult.innerNode() && node != hitTestResult.innerNonSharedNode() && is<HTMLAreaElement>(*node))-+ *nodeBounds = snappedIntRect(downcast<HTMLAreaElement>(*node).computeRect(hitTestResult.innerNonSharedNode()->renderer()));-+ else if (node && node->renderer())-+ *nodeBounds = node->renderer()->absoluteBoundingBoxRect(true);-+ }-+-+ return node;-+ }-+ }-+-+ return nullptr;-+ };-+}-+-+Node* LocalFrame::nodeRespondingToClickEvents(const FloatPoint& viewportLocation, FloatPoint& adjustedViewportLocation, SecurityOrigin* securityOrigin)-+{-+ return qualifyingNodeAtViewportLocation(viewportLocation, adjustedViewportLocation, ancestorRespondingToClickEventsNodeQualifier(securityOrigin), ShouldApproximate::Yes);-+}-+-+Node* LocalFrame::nodeRespondingToDoubleClickEvent(const FloatPoint& viewportLocation, FloatPoint& adjustedViewportLocation)-+{-+ auto&& ancestorRespondingToDoubleClickEvent = [](const HitTestResult& hitTestResult, Node* terminationNode, IntRect* nodeBounds) -> Node* {-+ if (nodeBounds)-+ *nodeBounds = IntRect();-+-+ auto* node = hitTestResult.innerNode();-+ if (!node)-+ return nullptr;-+-+ for (; node && node != terminationNode; node = node->parentInComposedTree()) {-+ if (!node->hasEventListeners(eventNames().dblclickEvent))-+ continue;-+#if ENABLE(TOUCH_EVENTS)-+ if (!node->allowsDoubleTapGesture())-+ continue;-+#endif-+ if (nodeBounds && node->renderer())-+ *nodeBounds = node->renderer()->absoluteBoundingBoxRect(true);-+ return node;-+ }-+ return nullptr;-+ };-+-+ return qualifyingNodeAtViewportLocation(viewportLocation, adjustedViewportLocation, WTFMove(ancestorRespondingToDoubleClickEvent), ShouldApproximate::Yes);-+}-+-+Node* LocalFrame::nodeRespondingToInteraction(const FloatPoint& viewportLocation, FloatPoint& adjustedViewportLocation)-+{-+ return qualifyingNodeAtViewportLocation(viewportLocation, adjustedViewportLocation, ancestorRespondingToClickEventsNodeQualifier(), ShouldApproximate::Yes, ShouldFindRootEditableElement::No);-+}-+-+Node* LocalFrame::nodeRespondingToScrollWheelEvents(const FloatPoint& viewportLocation)-+{-+ auto&& ancestorRespondingToScrollWheelEvents = [](const HitTestResult& hitTestResult, Node* terminationNode, IntRect* nodeBounds) -> Node* {-+ if (nodeBounds)-+ *nodeBounds = IntRect();-+-+ Node* scrollingAncestor = nullptr;-+ for (Node* node = hitTestResult.innerNode(); node && node != terminationNode && !node->hasTagName(HTMLNames::bodyTag); node = node->parentNode()) {-+ RenderObject* renderer = node->renderer();-+ if (!renderer)-+ continue;-+-+ if ((renderer->isRenderTextControlSingleLine() || renderer->isRenderTextControlMultiLine()) && downcast<RenderTextControl>(*renderer).canScroll()) {-+ scrollingAncestor = node;-+ continue;-+ }-+-+ auto& style = renderer->style();-+-+ if (renderer->hasNonVisibleOverflow()-+ && (style.overflowY() == Overflow::Auto || style.overflowY() == Overflow::Scroll-+ || style.overflowX() == Overflow::Auto || style.overflowX() == Overflow::Scroll)) {-+ scrollingAncestor = node;-+ }-+ }-+-+ return scrollingAncestor;-+ };-+-+ FloatPoint adjustedViewportLocation;-+ return qualifyingNodeAtViewportLocation(viewportLocation, adjustedViewportLocation, WTFMove(ancestorRespondingToScrollWheelEvents), ShouldApproximate::No);-+}-+-+#endif // !PLATFORM(IOS_FAMILY)-+- } // namespace WebCore-- #undef FRAME_RELEASE_LOG_ERROR-diff --git a/Source/WebCore/page/LocalFrame.h b/Source/WebCore/page/LocalFrame.h-index 359610beb3d6cfb793449126bb4e8f27e1c7ec25..355cdbb3baa599cb4510923588d855a9631bde3a 100644---- a/Source/WebCore/page/LocalFrame.h-+++ b/Source/WebCore/page/LocalFrame.h-@@ -29,6 +29,7 @@-- #include <WebCore/DOMPasteAccess.h>- #include <WebCore/Frame.h>-+#include <WebCore/IntDegrees.h>- #include <WebCore/ScrollbarMode.h>- #include <wtf/CheckedRef.h>- #include <wtf/HashSet.h>-@@ -125,8 +126,8 @@ enum {- };-- enum OverflowScrollAction { DoNotPerformOverflowScroll, PerformOverflowScroll };--using NodeQualifier = Function<Node* (const HitTestResult&, Node* terminationNode, IntRect* nodeBounds)>;- #endif-+using NodeQualifier = Function<Node* (const HitTestResult&, Node* terminationNode, IntRect* nodeBounds)>;-- class LocalFrame final : public Frame {- public:-@@ -236,10 +237,6 @@ public:- WEBCORE_EXPORT DataDetectionResultsStorage& dataDetectionResults();- #endif---#if PLATFORM(IOS_FAMILY)-- const ViewportArguments& viewportArguments() const;-- WEBCORE_EXPORT void setViewportArguments(const ViewportArguments&);--- WEBCORE_EXPORT Node* deepestNodeAtLocation(const FloatPoint& viewportLocation);- WEBCORE_EXPORT Node* nodeRespondingToClickEvents(const FloatPoint& viewportLocation, FloatPoint& adjustedViewportLocation, SecurityOrigin* = nullptr);- WEBCORE_EXPORT Node* nodeRespondingToDoubleClickEvent(const FloatPoint& viewportLocation, FloatPoint& adjustedViewportLocation);-@@ -247,6 +244,10 @@ public:- WEBCORE_EXPORT Node* nodeRespondingToScrollWheelEvents(const FloatPoint& viewportLocation);- WEBCORE_EXPORT Node* approximateNodeAtViewportLocationLegacy(const FloatPoint& viewportLocation, FloatPoint& adjustedViewportLocation);--+#if PLATFORM(IOS_FAMILY)-+ const ViewportArguments& viewportArguments() const;-+ WEBCORE_EXPORT void setViewportArguments(const ViewportArguments&);-+- WEBCORE_EXPORT NSArray *wordsInCurrentParagraph() const;- WEBCORE_EXPORT CGRect renderRectForPoint(CGPoint, bool* isReplaced, float* fontSize) const;--@@ -314,6 +315,7 @@ public:-- WEBCORE_EXPORT FloatSize screenSize() const;- void setOverrideScreenSize(FloatSize&&);-+ bool hasScreenSizeOverride() const { return !!m_overrideScreenSize; }-- void selfOnlyRef();- void selfOnlyDeref();-@@ -397,7 +399,6 @@ private:- #if ENABLE(DATA_DETECTION)- std::unique_ptr<DataDetectionResultsStorage> m_dataDetectionResults;- #endif--#if PLATFORM(IOS_FAMILY)- void betterApproximateNode(const IntPoint& testPoint, const NodeQualifier&, Node*& best, Node* failedNode, IntPoint& bestPoint, IntRect& bestRect, const IntRect& testRect);- bool hitTestResultAtViewportLocation(const FloatPoint& viewportLocation, HitTestResult&, IntPoint& center);--@@ -405,6 +406,7 @@ private:- enum class ShouldFindRootEditableElement : bool { No, Yes };- Node* qualifyingNodeAtViewportLocation(const FloatPoint& viewportLocation, FloatPoint& adjustedViewportLocation, const NodeQualifier&, ShouldApproximate, ShouldFindRootEditableElement = ShouldFindRootEditableElement::Yes);--+#if PLATFORM(IOS_FAMILY)- void setTimersPausedInternal(bool);-- const UniqueRef<ViewportArguments> m_viewportArguments;-diff --git a/Source/WebCore/page/Page.cpp b/Source/WebCore/page/Page.cpp-index 1f52568a3824aeddd30db2e42effd41f3a117bc5..f0dbdaa384d968c652583345bea4063fba710136 100644---- a/Source/WebCore/page/Page.cpp-+++ b/Source/WebCore/page/Page.cpp-@@ -686,6 +686,45 @@ void Page::setOverrideViewportArguments(const std::optional<ViewportArguments>&- localTopDocument->updateViewportArguments();- }--+FloatSize Page::screenSize()-+{-+ auto* localMainFrame = dynamicDowncast<LocalFrame>(mainFrame());-+ RefPtr frameView = localMainFrame ? localMainFrame->view() : nullptr;-+ if (!frameView)-+ return { };-+ return m_overrideScreenSize.value_or(screenRect(frameView.get()).size());-+}-+-+void Page::setOverrideScreenSize(std::optional<FloatSize> size)-+{-+ if (size == m_overrideScreenSize)-+ return;-+-+ m_overrideScreenSize = size;-+ auto* localMainFrame = dynamicDowncast<LocalFrame>(mainFrame());-+ if (auto* document = localMainFrame ? localMainFrame->document() : nullptr)-+ document->updateViewportArguments();-+}-+-+#if ENABLE(ORIENTATION_EVENTS)-+int Page::orientation() const-+{-+ return m_overrideOrientation.value_or(chrome().client().deviceOrientation());-+}-+-+void Page::setOverrideOrientation(std::optional<int> orientation)-+{-+ if (orientation == m_overrideOrientation)-+ return;-+-+ m_overrideOrientation = orientation;-+-+ auto* localMainFrame = dynamicDowncast<LocalFrame>(mainFrame());-+ if (localMainFrame)-+ localMainFrame->orientationChanged();-+}-+#endif-+- ScrollingCoordinator* Page::scrollingCoordinator()- {- if (!m_scrollingCoordinator && m_settings->scrollingCoordinatorEnabled()) {-@@ -4440,6 +4479,26 @@ void Page::setUseDarkAppearanceOverride(std::optional<bool> valueOverride)- appearanceDidChange();- }--+void Page::setUseReducedMotionOverride(std::optional<bool> valueOverride)-+{-+ if (valueOverride == m_useReducedMotionOverride)-+ return;-+-+ m_useReducedMotionOverride = valueOverride;-+-+ appearanceDidChange();-+}-+-+void Page::setUseForcedColorsOverride(std::optional<bool> valueOverride)-+{-+ if (valueOverride == m_useForcedColorsOverride)-+ return;-+-+ m_useForcedColorsOverride = valueOverride;-+-+ appearanceDidChange();-+}++ appearanceDidChange();++}+void Page::setFullscreenInsets(const FloatBoxExtent& insets){if (insets == m_fullscreenInsets)diff --git a/Source/WebCore/page/Page.h b/Source/WebCore/page/Page.h-index 18087d6b43bc6da12bf9bb87c5747d3e3533cd25..1ca5fcdb4e873b059e0fd866c4716082e0003bc3 100644+index 326a924ba84973e9b88c232b0cb498b27ca3d107..70ef6826e8d54d6dc207755eb72d8f5dab99aef1 100644--- a/Source/WebCore/page/Page.h+++ b/Source/WebCore/page/Page.h-@@ -406,6 +406,9 @@ public:+@@ -408,6 +408,9 @@ public:const ViewportArguments* overrideViewportArguments() const { return m_overrideViewportArguments.get(); }WEBCORE_EXPORT void setOverrideViewportArguments(const std::optional<ViewportArguments>&);@@ -5770,7 +5223,7 @@ index 18087d6b43bc6da12bf9bb87c5747d3e3533cd25..1ca5fcdb4e873b059e0fd866c4716082static void refreshPlugins(bool reload);WEBCORE_EXPORT PluginData& pluginData();WEBCORE_EXPORT Ref<PluginData> protectedPluginData();-@@ -504,6 +507,10 @@ public:+@@ -493,6 +496,10 @@ public:#if ENABLE(DRAG_SUPPORT)DragController& dragController() { return m_dragController.get(); }const DragController& dragController() const { return m_dragController.get(); }@@ -5781,7 +5234,7 @@ index 18087d6b43bc6da12bf9bb87c5747d3e3533cd25..1ca5fcdb4e873b059e0fd866c4716082#endifFocusController& focusController() const { return m_focusController; }#if ENABLE(CONTEXT_MENUS)-@@ -694,6 +701,10 @@ public:+@@ -679,6 +686,10 @@ public:WEBCORE_EXPORT void setUseColorAppearance(bool useDarkAppearance, bool useElevatedUserInterfaceLevel);bool defaultUseDarkAppearance() const { return m_useDarkAppearance; }void setUseDarkAppearanceOverride(std::optional<bool>);@@ -5792,7 +5245,7 @@ index 18087d6b43bc6da12bf9bb87c5747d3e3533cd25..1ca5fcdb4e873b059e0fd866c4716082#if ENABLE(TEXT_AUTOSIZING)float textAutosizingWidth() const { return m_textAutosizingWidth; }-@@ -1173,6 +1184,11 @@ public:+@@ -1146,6 +1157,11 @@ public:WEBCORE_EXPORT void setInteractionRegionsEnabled(bool);#endif@@ -5804,7 +5257,7 @@ index 18087d6b43bc6da12bf9bb87c5747d3e3533cd25..1ca5fcdb4e873b059e0fd866c4716082#if ENABLE(DEVICE_ORIENTATION) && PLATFORM(IOS_FAMILY)DeviceOrientationUpdateProvider* deviceOrientationUpdateProvider() const { return m_deviceOrientationUpdateProvider.get(); }#endif-@@ -1496,6 +1512,9 @@ private:+@@ -1474,6 +1490,9 @@ private:#if ENABLE(DRAG_SUPPORT)const UniqueRef<DragController> m_dragController;@@ -5814,7 +5267,7 @@ index 18087d6b43bc6da12bf9bb87c5747d3e3533cd25..1ca5fcdb4e873b059e0fd866c4716082#endifconst UniqueRef<FocusController> m_focusController;#if ENABLE(CONTEXT_MENUS)-@@ -1574,6 +1593,8 @@ private:+@@ -1552,6 +1571,8 @@ private:bool m_useElevatedUserInterfaceLevel { false };bool m_useDarkAppearance { false };std::optional<bool> m_useDarkAppearanceOverride;@@ -5823,7 +5276,7 @@ index 18087d6b43bc6da12bf9bb87c5747d3e3533cd25..1ca5fcdb4e873b059e0fd866c4716082#if ENABLE(TEXT_AUTOSIZING)float m_textAutosizingWidth { 0 };-@@ -1756,6 +1777,11 @@ private:+@@ -1726,6 +1747,11 @@ private:#endifstd::unique_ptr<ViewportArguments> m_overrideViewportArguments;@@ -5836,7 +5289,7 @@ index 18087d6b43bc6da12bf9bb87c5747d3e3533cd25..1ca5fcdb4e873b059e0fd866c4716082#if ENABLE(DEVICE_ORIENTATION) && PLATFORM(IOS_FAMILY)RefPtr<DeviceOrientationUpdateProvider> m_deviceOrientationUpdateProvider;diff --git a/Source/WebCore/page/PointerCaptureController.cpp b/Source/WebCore/page/PointerCaptureController.cpp-index 986c7877f75d5e4307a563ffb3bb1e2e1f54d063..39f2672955af66f0bed6b619527289826a19cbcc 100644+index 1ac4d5c1571a4c20f29772ac56d9b75611a7cf10..5996222d95d103a67212eeb52cefa787e2840a23 100644--- a/Source/WebCore/page/PointerCaptureController.cpp+++ b/Source/WebCore/page/PointerCaptureController.cpp@@ -209,7 +209,7 @@ bool PointerCaptureController::preventsCompatibilityMouseEventsForIdentifier(Poi@@ -5858,7 +5311,7 @@ index 986c7877f75d5e4307a563ffb3bb1e2e1f54d063..39f2672955af66f0bed6b61952728982#endifdiff --git a/Source/WebCore/page/PointerCaptureController.h b/Source/WebCore/page/PointerCaptureController.h-index a018d3ec3f7d0c507758227b1e9c17515e8c7e87..b25f12a2a8e6ede500dac6a3850b23c342e15299 100644+index be1a0170215d1126ae4ea08de3f23192a7bc63b1..669495b8783ea5d26f9237009f85a3892104c139 100644--- a/Source/WebCore/page/PointerCaptureController.h+++ b/Source/WebCore/page/PointerCaptureController.h@@ -63,7 +63,7 @@ public:@@ -5886,7 +5339,7 @@ index a018d3ec3f7d0c507758227b1e9c17515e8c7e87..b25f12a2a8e6ede500dac6a3850b23c3#endif;diff --git a/Source/WebCore/page/Screen.cpp b/Source/WebCore/page/Screen.cpp-index 2702535975b19ffef91752ee06db9a30b73eb10e..36629bd6d5c47a43d864514a090e8a4aa9019a7d 100644+index cd1f3ce09ba0ab6e414bfcb12f38918404946700..f78cd1f89fb32ce4b9109c80f1f7c303c351b4fc 100644--- a/Source/WebCore/page/Screen.cpp+++ b/Source/WebCore/page/Screen.cpp@@ -125,6 +125,9 @@ int Screen::availLeft() const@@ -5896,7 +5349,7 @@ index 2702535975b19ffef91752ee06db9a30b73eb10e..36629bd6d5c47a43d864514a090e8a4a+ if (frame->hasScreenSizeOverride())+ return 0;+- return static_cast<int>(screenAvailableRect(frame->protectedView().get()).x());+ return static_cast<int>(screenAvailableRect(protect(frame->view()).get()).x());}@@ -140,6 +143,9 @@ int Screen::availTop() const@@ -5906,7 +5359,7 @@ index 2702535975b19ffef91752ee06db9a30b73eb10e..36629bd6d5c47a43d864514a090e8a4a+ if (frame->hasScreenSizeOverride())+ return 0;+- return static_cast<int>(screenAvailableRect(frame->protectedView().get()).y());+ return static_cast<int>(screenAvailableRect(protect(frame->view()).get()).y());}@@ -155,6 +161,9 @@ int Screen::availHeight() const@@ -5916,7 +5369,7 @@ index 2702535975b19ffef91752ee06db9a30b73eb10e..36629bd6d5c47a43d864514a090e8a4a+ if (frame->hasScreenSizeOverride())+ return static_cast<int>(frame->screenSize().height());+- return static_cast<int>(screenAvailableRect(frame->protectedView().get()).height());+ return static_cast<int>(screenAvailableRect(protect(frame->view()).get()).height());}@@ -170,6 +179,9 @@ int Screen::availWidth() const@@ -5926,11 +5379,11 @@ index 2702535975b19ffef91752ee06db9a30b73eb10e..36629bd6d5c47a43d864514a090e8a4a+ if (frame->hasScreenSizeOverride())+ return static_cast<int>(frame->screenSize().width());+- return static_cast<int>(screenAvailableRect(frame->protectedView().get()).width());+ return static_cast<int>(screenAvailableRect(protect(frame->view()).get()).width());}diff --git a/Source/WebCore/page/csp/ContentSecurityPolicy.cpp b/Source/WebCore/page/csp/ContentSecurityPolicy.cpp-index d4811f27153cddc0eae0a0ab638d5ec765e05b19..b13a1b20017e82ec4aae09d5d606d75def6882d6 100644+index 9549a4197e46b09276b5e5b8950bbcab0d72f17e..9b73d730aa07d40f8712a62c8ff095e5bfda2f14 100644--- a/Source/WebCore/page/csp/ContentSecurityPolicy.cpp+++ b/Source/WebCore/page/csp/ContentSecurityPolicy.cpp@@ -354,6 +354,8 @@ template<typename Predicate, typename... Args>@@ -6049,7 +5502,7 @@ index 0000000000000000000000000000000000000000..7bea08826a16de4774a55c81ccba0d81++}diff --git a/Source/WebCore/platform/DragData.h b/Source/WebCore/platform/DragData.h-index 261f2d839e1c9efc0991da46d30c42ecee00463e..d170e0e17e546d1bd01e274bfd65fa8f4d5c1bf3 100644+index f20dc0d58d02e8e6207bd973950a6340477f5d57..40f8abd4c6975da4c203b7f153181b96c6850233 100644--- a/Source/WebCore/platform/DragData.h+++ b/Source/WebCore/platform/DragData.h@@ -93,8 +93,8 @@ public:@@ -6093,7 +5546,7 @@ index 11cef75ac77ed181b76fac06229ba2eadd387e02..cc77e9aa4054e848f258526b41745363};diff --git a/Source/WebCore/platform/PlatformKeyboardEvent.h b/Source/WebCore/platform/PlatformKeyboardEvent.h-index d0d2eaee99fdd9e78fd62fac26ce59b227fca0d5..99b9dd7e2841cdf2f25a81c964adccc935836a49 100644+index 4e601893cc311bff51f91eff7dbf5479d7b4363a..432ec68c157460ad475f57ffaa7786cfe2436f47 100644--- a/Source/WebCore/platform/PlatformKeyboardEvent.h+++ b/Source/WebCore/platform/PlatformKeyboardEvent.h@@ -134,6 +134,7 @@ namespace WebCore {@@ -6200,25 +5653,13 @@ index 1e04806dbf9cfb27dda3e5d2c3c61aa66efd8ae6..f319930cc2c6dba499e35b58c59fa5fe// FIXME: since WPE currently does not send touch stationary events, we need to be able to// create a PlatformTouchPoint of type TouchCancelled artificiallyPlatformTouchPoint(unsigned id, State state, DoublePoint screenPos, DoublePoint pos)-diff --git a/Source/WebCore/platform/Skia.cmake b/Source/WebCore/platform/Skia.cmake-index da490f391aa2e1876e792d66c08125e86e8a4719..eb8913849dd8934e4b2d60e9c18527ffc3d38264 100644---- a/Source/WebCore/platform/Skia.cmake-+++ b/Source/WebCore/platform/Skia.cmake-@@ -14,6 +14,7 @@ list(APPEND WebCore_PRIVATE_FRAMEWORK_HEADERS- platform/graphics/skia/FontCascadeSkiaInlines.h- platform/graphics/skia/GraphicsContextSkia.h- platform/graphics/skia/ImageBufferSkiaBackend.h-+ platform/graphics/skia/ImageBufferUtilitiesSkia.h- platform/graphics/skia/SkiaHarfBuzzFont.h- platform/graphics/skia/SkiaHarfBuzzFontCache.h- platform/graphics/skia/SkiaPaintingEngine.h-diff --git a/Source/WebCore/platform/adwaita/ScrollbarThemeAdwaita.cpp b/Source/WebCore/platform/adwaita/ScrollbarThemeAdwaita.cpp-index 744f448415ba85819156bd0e575333ac23199f6e..e5d3d9382e8e9b033faa8f3c7168a47838286ff3 100644---- a/Source/WebCore/platform/adwaita/ScrollbarThemeAdwaita.cpp-+++ b/Source/WebCore/platform/adwaita/ScrollbarThemeAdwaita.cpp-@@ -43,7 +43,7 @@+diff --git a/Source/WebCore/platform/adwaita/AdwaitaScrollbarPainter.h b/Source/WebCore/platform/adwaita/AdwaitaScrollbarPainter.h+index 2a8741ef404e5453bd5cff096f41ff2d3aa7d06f..c2598bef2100170441c26b1a01ee4c7b35dc5b63 100644+--- a/Source/WebCore/platform/adwaita/AdwaitaScrollbarPainter.h++++ b/Source/WebCore/platform/adwaita/AdwaitaScrollbarPainter.h+@@ -36,7 +36,7 @@ class GraphicsContext;- namespace WebCore {+ namespace AdwaitaScrollbarPainter {-static const unsigned scrollbarSize = 21;+static const unsigned scrollbarSize = 0;@@ -6251,7 +5692,7 @@ index 515ddea3cd42796efa9f41ad74be07a7447c337e..36db42e2a0822d5609b39046191f05a1namespace WebCore {diff --git a/Source/WebCore/platform/graphics/win/ComplexTextControllerUniscribe.cpp b/Source/WebCore/platform/graphics/win/ComplexTextControllerUniscribe.cpp-index 63d2978699a1ff636465def5191395a055e06c32..4c2cf5bd8a83f4ffe23920b77008008a5b517bd0 100644+index 04dceb079874694093b5d26a0dfb3c81cfbc3758..2ab74fc7611e01a14c8e233dd3e1ba4d6ab42341 100644--- a/Source/WebCore/platform/graphics/win/ComplexTextControllerUniscribe.cpp+++ b/Source/WebCore/platform/graphics/win/ComplexTextControllerUniscribe.cpp@@ -168,6 +168,33 @@ static Vector<unsigned> stringIndicesFromClusters(const Vector<WORD>& clusters,@@ -6311,11 +5752,11 @@ index 98d93889a1b97450fde21cee53e45111b622dca7..9362518e8351eb8fe5b30a2d7875417breturn getScreenProperties().screenHasTouchDevice;}diff --git a/Source/WebCore/platform/libwpe/PlatformKeyboardEventLibWPE.cpp b/Source/WebCore/platform/libwpe/PlatformKeyboardEventLibWPE.cpp-index 3bd964f3b0fd5531bba3981ed9c730accf806424..1a6419d30d433940a9f85b8db6d1c524945f86e7 100644+index ee7238303b628d0be016c80e391fe8edb9de1439..dc3b000902cd7d8344ed3a16f49f57766864dd47 100644--- a/Source/WebCore/platform/libwpe/PlatformKeyboardEventLibWPE.cpp+++ b/Source/WebCore/platform/libwpe/PlatformKeyboardEventLibWPE.cpp-@@ -30,9 +30,11 @@-+@@ -29,9 +29,11 @@+ #if USE(LIBWPE)#include "WindowsKeyboardCodes.h"#include <wpe/wpe.h>+#include <wtf/HashMap.h>@@ -6323,10 +5764,10 @@ index 3bd964f3b0fd5531bba3981ed9c730accf806424..1a6419d30d433940a9f85b8db6d1c524#include <wtf/text/MakeString.h>#include <wtf/text/StringBuilder.h>+#include <mutex>+ #endifnamespace WebCore {--@@ -1303,6 +1305,246 @@ int PlatformKeyboardEvent::windowsKeyCodeForWPEKeyCode(unsigned keycode)+@@ -1304,6 +1306,246 @@ int PlatformKeyboardEvent::windowsKeyCodeForWPEKeyCode(unsigned keycode)return 0;}@@ -6682,7 +6123,7 @@ index e47f5bade7c0a27e8a27f8dc95b51174f025b4a6..016efe9bc0898bb648a33973e771b49eVector<String> PlatformPasteboard::typesSafeForDOMToReadAndWrite(const String&) constdiff --git a/Source/WebCore/platform/mediastream/libwebrtc/gstreamer/GStreamerVideoDecoderFactory.cpp b/Source/WebCore/platform/mediastream/libwebrtc/gstreamer/GStreamerVideoDecoderFactory.cpp-index 9782359f77caad3e3ed3c75c0741fb47ae8925f9..b8a8186919b5c891289bc0b4bd839851e86809cc 100644+index aaabf3c17d676c14cfdc179ba90d042f9197318c..473313051009124d0043c57c551dbdce3dea2f02 100644--- a/Source/WebCore/platform/mediastream/libwebrtc/gstreamer/GStreamerVideoDecoderFactory.cpp+++ b/Source/WebCore/platform/mediastream/libwebrtc/gstreamer/GStreamerVideoDecoderFactory.cpp@@ -41,6 +41,7 @@@@ -6693,24 +6134,8 @@ index 9782359f77caad3e3ed3c75c0741fb47ae8925f9..b8a8186919b5c891289bc0b4bd839851#include <wtf/text/MakeString.h>#include <wtf/text/WTFString.h>-diff --git a/Source/WebCore/platform/mediastream/libwebrtc/gstreamer/GStreamerVideoEncoderFactory.cpp b/Source/WebCore/platform/mediastream/libwebrtc/gstreamer/GStreamerVideoEncoderFactory.cpp-index 895127ff387ac367838afa20cfeda7fadb2e660c..41a7bfe085c5540f477189d9eff9e1ba1cd066b9 100644---- a/Source/WebCore/platform/mediastream/libwebrtc/gstreamer/GStreamerVideoEncoderFactory.cpp-+++ b/Source/WebCore/platform/mediastream/libwebrtc/gstreamer/GStreamerVideoEncoderFactory.cpp-@@ -60,9 +60,8 @@ public:- return webrtc::make_ref_counted<GStreamerEncodedImageBuffer>(data);- }--- const uint8_t* data() const final { return m_data.data(); }-- uint8_t* data() final { return const_cast<uint8_t*>(m_data.data()); }-- size_t size() const final { return m_data.size_bytes(); }-+ const uint8_t* data() const override { return m_data.data(); }-+ size_t size() const override { return m_data.size_bytes(); }-- protected:- GStreamerEncodedImageBuffer(std::span<const uint8_t> data)diff --git a/Source/WebCore/platform/network/HTTPHeaderMap.cpp b/Source/WebCore/platform/network/HTTPHeaderMap.cpp-index 1178c8fb001994bc9e6166376a367d9bc148913c..fcc6534568cad6b42a819a435f84ba2b9baae6f8 100644+index df27a094a0b2239892c96b4f5835826bcf8d7540..3bbea5c96110c0ae70d944b7f6fb018e438cf8c4 100644--- a/Source/WebCore/platform/network/HTTPHeaderMap.cpp+++ b/Source/WebCore/platform/network/HTTPHeaderMap.cpp@@ -237,8 +237,11 @@ void HTTPHeaderMap::add(HTTPHeaderName name, const String& value)@@ -6739,17 +6164,142 @@ index 0708ea1a644e2dea797a284a2f7d46ec47620451..ff69e387c3dd246cd93e45c49e1d461dWEBCORE_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 ff4b0aa51b104f1f71246e223553458012b5ab4e..fc58265466d7177ad25cfde1aa664dfec0634e11 100644+index 59226d34782375aaacbd6e2bd500ccefe5887de4..8b2561d9196fd7796495eb6ec87c3e0b5a2242c6 100644--- a/Source/WebCore/platform/network/ResourceResponseBase.cpp+++ b/Source/WebCore/platform/network/ResourceResponseBase.cpp+@@ -21,7 +21,7 @@+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE+- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.++ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.+ */++ #include "config.h"@@ -79,6 +79,7 @@ ResourceResponseBase::ResourceResponseBase(std::optional<ResourceResponseData>&&- , m_httpStatusText(data ? WTFMove(data->httpStatusText) : String { })- , m_httpVersion(data ? WTFMove(data->httpVersion) : String { })- , m_httpHeaderFields(data ? WTFMove(data->httpHeaderFields) : HTTPHeaderMap { })+ , m_httpStatusText(data ? WTF::move(data->httpStatusText) : String { })+ , m_httpVersion(data ? WTF::move(data->httpVersion) : String { })+ , m_httpHeaderFields(data ? WTF::move(data->httpHeaderFields) : HTTPHeaderMap { })+ , m_httpRequestHeaderFields(data ? data->httpRequestHeaderFields : HTTPHeaderMap { })- , m_networkLoadMetrics(data && data->networkLoadMetrics ? Box<NetworkLoadMetrics>::create(WTFMove(*data->networkLoadMetrics)) : Box<NetworkLoadMetrics> { })- , m_certificateInfo(data ? WTFMove(data->certificateInfo) : std::nullopt)+ , m_networkLoadMetrics(data && data->networkLoadMetrics ? Box<NetworkLoadMetrics>::create(WTF::move(*data->networkLoadMetrics)) : Box<NetworkLoadMetrics> { })+ , m_certificateInfo(data ? WTF::move(data->certificateInfo) : std::nullopt), m_httpStatusCode(data ? data->httpStatusCode : 0)+@@ -279,7 +280,7 @@ const String& ResourceResponseBase::mimeType() const+ {+ lazyInit(CommonFieldsOnly);++- return m_mimeType;++ return m_mimeType;+ }++ void ResourceResponseBase::setMimeType(String&& mimeType)+@@ -293,7 +294,7 @@ void ResourceResponseBase::setMimeType(String&& mimeType)+ // FIXME: Should invalidate or update platform response if present.+ }++-long long ResourceResponseBase::expectedContentLength() const++long long ResourceResponseBase::expectedContentLength() const+ {+ lazyInit(CommonFieldsOnly);++@@ -306,7 +307,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.+- m_expectedContentLength = expectedContentLength;++ m_expectedContentLength = expectedContentLength;++ // FIXME: Should invalidate or update platform response if present.+ }+@@ -397,7 +398,7 @@ const String& ResourceResponseBase::httpStatusText() const+ {+ lazyInit(AllFields);++- return m_httpStatusText;++ return m_httpStatusText;+ }++ void ResourceResponseBase::setHTTPStatusText(String&& statusText)+@@ -412,16 +413,16 @@ void ResourceResponseBase::setHTTPStatusText(String&& statusText)+ const String& ResourceResponseBase::httpVersion() const+ {+ lazyInit(AllFields);+-+++ return m_httpVersion;+ }++ void ResourceResponseBase::setHTTPVersion(String&& versionText)+ {+ lazyInit(AllFields);+-+++ m_httpVersion = versionText;+-+++ // FIXME: Should invalidate or update platform response if present.+ }++@@ -559,12 +560,12 @@ String ResourceResponseBase::httpHeaderField(StringView name) const++ // If we already have the header, just return it instead of consuming memory by grabing all headers.+ String value = m_httpHeaderFields.get(name);+- if (!value.isEmpty())++ if (!value.isEmpty())+ return value;++ lazyInit(AllFields);++- return m_httpHeaderFields.get(name);++ return m_httpHeaderFields.get(name);+ }++ String ResourceResponseBase::httpHeaderField(HTTPHeaderName name) const+@@ -578,7 +579,7 @@ String ResourceResponseBase::httpHeaderField(HTTPHeaderName name) const++ lazyInit(AllFields);++- return m_httpHeaderFields.get(name);++ return m_httpHeaderFields.get(name);+ }++ void ResourceResponseBase::updateHeaderParsedState(HTTPHeaderName name)+@@ -688,7 +689,7 @@ void ResourceResponseBase::parseCacheControlDirectives() const+ m_cacheControlDirectives = WebCore::parseCacheControlDirectives(m_httpHeaderFields);+ m_haveParsedCacheControlHeader = true;+ }+-+++ bool ResourceResponseBase::cacheControlContainsNoCache() const+ {+ if (!m_haveParsedCacheControlHeader)+@@ -709,7 +710,7 @@ bool ResourceResponseBase::cacheControlContainsMustRevalidate() const+ parseCacheControlDirectives();+ return m_cacheControlDirectives.mustRevalidate;+ }+-+++ bool ResourceResponseBase::cacheControlContainsImmutable() const+ {+ if (!m_haveParsedCacheControlHeader)+@@ -864,7 +865,7 @@ void ResourceResponseBase::lazyInit(InitLevel initLevel) const+ bool ResourceResponseBase::equalForWebKitLegacyChallengeComparison(const ResourceResponse& a, const ResourceResponse& b)+ {+ if (a.isNull() != b.isNull())+- return false;++ return false;+ if (a.url() != b.url())+ return false;+ if (a.mimeType() != b.mimeType())+@@ -898,7 +899,7 @@ std::optional<ResourceResponseData> ResourceResponseBase::getResponseData() cons+ if (m_isNull)+ return std::nullopt;+ lazyInit(AllFields);+-+++ return { ResourceResponseData {+ URL { m_url },+ String { m_mimeType },@@ -908,6 +909,7 @@ std::optional<ResourceResponseData> ResourceResponseBase::getResponseData() consString { m_httpStatusText },String { m_httpVersion },@@ -6771,17 +6321,38 @@ index ff4b0aa51b104f1f71246e223553458012b5ab4e..fc58265466d7177ad25cfde1aa664dfedecoder >> httpStatusCode;if (!httpStatusCode)@@ -1043,6 +1050,7 @@ std::optional<WebCore::ResourceResponseData> Coder<WebCore::ResourceResponseData- WTFMove(*httpStatusText),- WTFMove(*httpVersion),- WTFMove(*httpHeaderFields),-+ WTFMove(*httpRequestHeaderFields),+ WTF::move(*httpStatusText),+ WTF::move(*httpVersion),+ WTF::move(*httpHeaderFields),++ WTF::move(*httpRequestHeaderFields),std::nullopt,*source,*type,diff --git a/Source/WebCore/platform/network/ResourceResponseBase.h b/Source/WebCore/platform/network/ResourceResponseBase.h-index 8fa7524fba38b22ac5ad8a7d8d64c54d9d792746..58c7cdd1d14f01c075ac15271ad84740b3a0e055 100644+index 82fb074cbf598b56598b3557828583248290c155..e4a77c696945dbf410698b725ac0256fe4ff58ba 100644--- a/Source/WebCore/platform/network/ResourceResponseBase.h+++ b/Source/WebCore/platform/network/ResourceResponseBase.h+@@ -21,7 +21,7 @@+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE+- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.++ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.+ */++ #pragma once+@@ -228,9 +228,9 @@ public:+ WEBCORE_EXPORT bool containsInvalidHTTPHeaders() const;++ WEBCORE_EXPORT static ResourceResponse dataURLResponse(const URL&, const DataURLDecoder::Result&);+-+++ WEBCORE_EXPORT ResourceResponseBase(std::optional<ResourceResponseData>&&);+-+++ WEBCORE_EXPORT std::optional<ResourceResponseData> getResponseData() const;++ protected:@@ -265,6 +265,11 @@ protected:String m_httpStatusText;String m_httpVersion;@@ -6800,15 +6371,15 @@ index 8fa7524fba38b22ac5ad8a7d8d64c54d9d792746..58c7cdd1d14f01c075ac15271ad84740ResourceResponseData& operator=(ResourceResponseData&&) = default;- ResourceResponseData(URL&& url, String&& mimeType, long long expectedContentLength, String&& textEncodingName, int httpStatusCode, String&& httpStatusText, String&& httpVersion, HTTPHeaderMap&& httpHeaderFields, std::optional<NetworkLoadMetrics>&& networkLoadMetrics, ResourceResponseSource source, ResourceResponseBaseType type, ResourceResponseBaseTainting tainting, bool isRedirected, UsedLegacyTLS usedLegacyTLS, WasPrivateRelayed wasPrivateRelayed, String&& proxyName, bool isRangeRequested, std::optional<CertificateInfo> certificateInfo, IPAddressSpace ipAddressSpace)+ ResourceResponseData(URL&& url, String&& mimeType, long long expectedContentLength, String&& textEncodingName, int httpStatusCode, String&& httpStatusText, String&& httpVersion, HTTPHeaderMap&& httpHeaderFields, HTTPHeaderMap&& httpRequestHeaderFields, std::optional<NetworkLoadMetrics>&& networkLoadMetrics, ResourceResponseSource source, ResourceResponseBaseType type, ResourceResponseBaseTainting tainting, bool isRedirected, UsedLegacyTLS usedLegacyTLS, WasPrivateRelayed wasPrivateRelayed, String&& proxyName, bool isRangeRequested, std::optional<CertificateInfo> certificateInfo, IPAddressSpace ipAddressSpace)- : url(WTFMove(url))- , mimeType(WTFMove(mimeType))+ : url(WTF::move(url))+ , mimeType(WTF::move(mimeType)), expectedContentLength(expectedContentLength)@@ -317,6 +322,7 @@ struct ResourceResponseData {- , httpStatusText(WTFMove(httpStatusText))- , httpVersion(WTFMove(httpVersion))- , httpHeaderFields(WTFMove(httpHeaderFields))-+ , httpRequestHeaderFields(WTFMove(httpRequestHeaderFields))- , networkLoadMetrics(WTFMove(networkLoadMetrics))+ , httpStatusText(WTF::move(httpStatusText))+ , httpVersion(WTF::move(httpVersion))+ , httpHeaderFields(WTF::move(httpHeaderFields))++ , httpRequestHeaderFields(WTF::move(httpRequestHeaderFields))+ , networkLoadMetrics(WTF::move(networkLoadMetrics)), source(source), type(type)@@ -341,6 +347,7 @@ struct ResourceResponseData {@@ -6820,10 +6391,10 @@ index 8fa7524fba38b22ac5ad8a7d8d64c54d9d792746..58c7cdd1d14f01c075ac15271ad84740ResourceResponseBase::Source source;ResourceResponseBase::Type type;diff --git a/Source/WebCore/platform/network/cocoa/NetworkStorageSessionCocoa.mm b/Source/WebCore/platform/network/cocoa/NetworkStorageSessionCocoa.mm-index 36b9854bdd1198290dcc133b1d97e8231b5d2be1..8389d6f2fcbd4f384ec0f5d7ef111b971d5b43de 100644+index fc53db15a4730cbb4f06ad6c29f694faed1a79a4..3dc6bb08bc413144f04d612e13ca0de5a84688df 100644--- a/Source/WebCore/platform/network/cocoa/NetworkStorageSessionCocoa.mm+++ b/Source/WebCore/platform/network/cocoa/NetworkStorageSessionCocoa.mm-@@ -581,6 +581,27 @@ bool NetworkStorageSession::setCookieFromDOM(const URL& firstParty, const SameSi+@@ -587,6 +587,27 @@ bool NetworkStorageSession::setCookieFromDOM(const URL& firstParty, const SameSireturn false;}@@ -6865,7 +6436,7 @@ index 96e0a63b347c170c963bc7e851f383b91665c5c8..2f0afc26bcc87e9440e201728778892bbool m_detectedDatabaseCorruption { false };diff --git a/Source/WebCore/platform/network/curl/NetworkStorageSessionCurl.cpp b/Source/WebCore/platform/network/curl/NetworkStorageSessionCurl.cpp-index a765e8f33e07b492c5db681bdb8d0a1b560f3a89..aeecd7d3e5f2b22b039c377178ce93b2d3aee109 100644+index 565d89cd623fb332cc11883d962371e50f4d45b2..5224d88a87aa7f82a41ad96616b57a24ded9d1a8 100644--- a/Source/WebCore/platform/network/curl/NetworkStorageSessionCurl.cpp+++ b/Source/WebCore/platform/network/curl/NetworkStorageSessionCurl.cpp@@ -136,6 +136,12 @@ void NetworkStorageSession::setCookieAcceptPolicy(CookieAcceptPolicy policy) con@@ -6882,7 +6453,7 @@ index a765e8f33e07b492c5db681bdb8d0a1b560f3a89..aeecd7d3e5f2b22b039c377178ce93b2{switch (cookieDatabase().acceptPolicy()) {diff --git a/Source/WebCore/platform/network/soup/NetworkStorageSessionSoup.cpp b/Source/WebCore/platform/network/soup/NetworkStorageSessionSoup.cpp-index f913d41de9dc40582c45d62145aef4f55184a9ac..59c9b7041b2e1ad36d7b92e2ccc56ab3bcc690f7 100644+index 9e6bbc08a5364904e3204e02a6959fbd739208b0..ebc9a4b734b01240a802629bef338e9fbca1944c 100644--- a/Source/WebCore/platform/network/soup/NetworkStorageSessionSoup.cpp+++ b/Source/WebCore/platform/network/soup/NetworkStorageSessionSoup.cpp@@ -531,6 +531,26 @@ void NetworkStorageSession::replaceCookies(const Vector<Cookie>& cookies)@@ -7001,7 +6572,7 @@ index f6c0cc49e9c39686bb5a5b36c29762173f2b4d1f..f396b564ee4aa7203d1728ff84608373OptionSet<PlatformEvent::Modifier> PlatformKeyboardEvent::currentStateOfModifierKeys()diff --git a/Source/WebCore/platform/win/PasteboardWin.cpp b/Source/WebCore/platform/win/PasteboardWin.cpp-index b493793408e0c5ea091d1269ce49671d0e826dab..1b02d5ce7995a567ffadc57dc137af5221526426 100644+index 74b13efd7217257e8e63b5bd25951cde74d1735e..6d86d767bbabe071d341eaba3f074ef6b3557fca 100644--- a/Source/WebCore/platform/win/PasteboardWin.cpp+++ b/Source/WebCore/platform/win/PasteboardWin.cpp@@ -1144,7 +1144,21 @@ void Pasteboard::writeCustomData(const Vector<PasteboardCustomData>& data)@@ -7052,11 +6623,26 @@ index b493793408e0c5ea091d1269ce49671d0e826dab..1b02d5ce7995a567ffadc57dc137af52+}+} // namespace WebCore+diff --git a/Source/WebCore/rendering/RenderLayerCompositor.cpp b/Source/WebCore/rendering/RenderLayerCompositor.cpp+index 14cb9f8091065e5875734d5cb53bea88945e4fb4..a9412b97ac7c78e931b9f21acbdbb97ee7ebcb3a 100644+--- a/Source/WebCore/rendering/RenderLayerCompositor.cpp++++ b/Source/WebCore/rendering/RenderLayerCompositor.cpp+@@ -1083,8 +1083,10 @@ bool RenderLayerCompositor::updateCompositingLayers(CompositingUpdateType update+ return false;+ }+++#if !PLATFORM(GTK) // Temporal workaround until https://bugs.webkit.org/show_bug.cgi?id=307077 is fixed+ if (!m_compositing && (m_forceCompositingMode || (isRootFrameCompositor() && page().pageOverlayController().overlayCount())))+ enableCompositingMode(true);++#endif++ bool isPageScroll = !updateRootArg || updateRootArg == &rootRenderLayer();+ CheckedPtr updateRoot = &rootRenderLayer();diff --git a/Source/WebCore/rendering/RenderTextControl.cpp b/Source/WebCore/rendering/RenderTextControl.cpp-index 5d22a455aa69a0b4dae059ac03d8ff2fca416695..553c943267dc0b8b41b4970195911631d63f1f5b 100644+index 0c806a55ba312f10fae97c7e395b67747cbf8327..50f29e994d3450b9796283040c6c20b432fc868d 100644--- a/Source/WebCore/rendering/RenderTextControl.cpp+++ b/Source/WebCore/rendering/RenderTextControl.cpp-@@ -251,13 +251,13 @@ void RenderTextControl::layoutExcludedChildren(RelayoutChildren relayoutChildren+@@ -244,13 +244,13 @@ void RenderTextControl::layoutExcludedChildren(RelayoutChildren relayoutChildren}}@@ -7072,12 +6658,12 @@ index 5d22a455aa69a0b4dae059ac03d8ff2fca416695..553c943267dc0b8b41b4970195911631{if (auto innerTextElement = this->innerTextElement(); innerTextElement && innerTextElement->renderer())diff --git a/Source/WebCore/rendering/RenderTextControl.h b/Source/WebCore/rendering/RenderTextControl.h-index 94c56047c1173e10738ba43d506252b7ae5fa6b2..b0a0419a558168008dce23569446bfaad11513ae 100644+index 2dd4c506974fc81bbc8d64a9638f08acf5de5a31..c7aaccb73e924dbff4ac9f9ee5f82fac8e98477f 100644--- a/Source/WebCore/rendering/RenderTextControl.h+++ b/Source/WebCore/rendering/RenderTextControl.h-@@ -39,8 +39,8 @@ public:+@@ -38,8 +38,8 @@ public:+WEBCORE_EXPORT HTMLTextFormControlElement& textFormControlElement() const;- WEBCORE_EXPORT Ref<HTMLTextFormControlElement> protectedTextFormControlElement() const;-#if PLATFORM(IOS_FAMILY)bool canScroll() const;@@ -7086,7 +6672,7 @@ index 94c56047c1173e10738ba43d506252b7ae5fa6b2..b0a0419a558168008dce23569446bfaa#endifdiff --git a/Source/WebCore/workers/WorkerConsoleClient.cpp b/Source/WebCore/workers/WorkerConsoleClient.cpp-index a26df7a696aa30e47f5f647872f35a41c096c3b4..aac61e5f901eeaf4979810e56ed03095f686f232 100644+index 826c1e53ac8f5ba3343ac992e217c5e20dce09b8..ac1a86b9ced5f0133f04073604047e2e72b413ff 100644--- a/Source/WebCore/workers/WorkerConsoleClient.cpp+++ b/Source/WebCore/workers/WorkerConsoleClient.cpp@@ -253,4 +253,6 @@ Ref<WorkerOrWorkletGlobalScope> WorkerConsoleClient::protectedGlobalScope()@@ -7097,10 +6683,10 @@ index a26df7a696aa30e47f5f647872f35a41c096c3b4..aac61e5f901eeaf4979810e56ed03095+} // namespace WebCorediff --git a/Source/WebCore/workers/WorkerConsoleClient.h b/Source/WebCore/workers/WorkerConsoleClient.h-index 8c872ab3be52ed96741795db7a7379851762d32f..40da72b82cf319dff7f89eb25751f9278062b827 100644+index a1ae48a654d89c7ee36611884f9ea64367523824..cc43f238783da61f1487f22473988e327e15f478 100644--- a/Source/WebCore/workers/WorkerConsoleClient.h+++ b/Source/WebCore/workers/WorkerConsoleClient.h-@@ -58,6 +58,7 @@ private:+@@ -59,6 +59,7 @@ private:void record(JSC::JSGlobalObject*, Ref<Inspector::ScriptArguments>&&) override;void recordEnd(JSC::JSGlobalObject*, Ref<Inspector::ScriptArguments>&&) override;void screenshot(JSC::JSGlobalObject*, Ref<Inspector::ScriptArguments>&&) override;@@ -7109,7 +6695,7 @@ index 8c872ab3be52ed96741795db7a7379851762d32f..40da72b82cf319dff7f89eb25751f927Ref<WorkerOrWorkletGlobalScope> protectedGlobalScope();diff --git a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp b/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp-index 25c84e8b2c7bacca1426fdfd5b625d47540ea07e..ad4b1846ce482d94cd2eb57c42bc28c6d9e72af0 100644+index 2309bc596ce634b7bf5e1c1e1fbd14403c1854b0..8e369ecbdc276a927f07c7fea612f4db29e79bd0 100644--- a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp+++ b/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp@@ -98,6 +98,8 @@@@ -7137,10 +6723,10 @@ index 25c84e8b2c7bacca1426fdfd5b625d47540ea07e..ad4b1846ce482d94cd2eb57c42bc28c6{if (CheckedPtr storageSession = m_networkProcess->storageSession(m_sessionID))diff --git a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h b/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h-index 25c5e65773c6819be3b68173e4f1cef8e3869deb..f67ed1c639962e22d9ed87505b75eb7b530964ba 100644+index a908a09e7584aed9417c76e20f6e3da2b92eccbb..2b9ebe07dc4309919bc180434ba312d78808fa32 100644--- a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h+++ b/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h-@@ -399,6 +399,8 @@ private:+@@ -397,6 +397,8 @@ private:void clearPageSpecificData(WebCore::PageIdentifier);@@ -7163,41 +6749,41 @@ index 6f43a9c68ee5c247184e327bdda83ce65df444f5..b34971ca9e296106dda574f165c4f28dLogUserInteraction(WebCore::RegistrableDomain domain)ResourceLoadStatisticsUpdated(Vector<WebCore::ResourceLoadStatistics> statistics) -> ()diff --git a/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm b/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm-index 428292ed83ecacbab52d5b6408af5344c78acf06..7a5c0ace0a314eadf3299bdece46413549b58af8 100644+index 0e5e0a6a203675f45e107ed487a3ed120c70ee4f..91f26663519d0cea2b868c48c618613a94008582 100644--- a/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm+++ b/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm-@@ -1136,6 +1136,14 @@ - (void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)data+@@ -894,6 +894,14 @@ - (void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)dataresourceResponse.setDeprecatedNetworkLoadMetrics(WebCore::copyTimingData(taskMetrics.get(), networkDataTask->networkLoadMetrics()));- resourceResponse.setProxyName(WTFMove(proxyName));+ resourceResponse.setProxyName(WTF::move(proxyName));++ __block WebCore::HTTPHeaderMap requestHeaders;+ NSURLSessionTaskTransactionMetrics *m = dataTask._incompleteTaskMetrics.transactionMetrics.lastObject;+ [m.request.allHTTPHeaderFields enumerateKeysAndObjectsUsingBlock:^(NSString *name, NSString *value, BOOL *) {+ requestHeaders.set(String(name), String(value));+ }];-+ resourceResponse.m_httpRequestHeaderFields = WTFMove(requestHeaders);++ resourceResponse.m_httpRequestHeaderFields = WTF::move(requestHeaders);+- networkDataTask->didReceiveResponse(WTFMove(resourceResponse), negotiatedLegacyTLS, privateRelayed, [completionHandler = makeBlockPtr(completionHandler), taskIdentifier](WebCore::PolicyAction policyAction) {+ networkDataTask->didReceiveResponse(WTF::move(resourceResponse), negotiatedLegacyTLS, privateRelayed, [completionHandler = makeBlockPtr(completionHandler), taskIdentifier](WebCore::PolicyAction policyAction) {#if !LOG_DISABLEDLOG(NetworkSession, "%zu didReceiveResponse completionHandler (%s)", taskIdentifier, toString(policyAction).characters());diff --git a/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp b/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp-index 6b03d650bc91f5d6f634e2d627d4745ba44e93ca..db97531e193720058d423324c09b3f221ae6e4d2 100644+index 0a2c25f815f594b2de6168ffd8b083c625e42e1f..682c4584f34d6fab8b576b331561102d34a3751a 100644--- a/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp+++ b/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp@@ -166,6 +166,7 @@ void NetworkDataTaskCurl::curlDidReceiveResponse(CurlRequest& request, CurlRespoupdateNetworkLoadMetrics(receivedResponse.networkLoadMetrics);- m_response.setDeprecatedNetworkLoadMetrics(Box<NetworkLoadMetrics>::create(WTFMove(receivedResponse.networkLoadMetrics)));+ m_response.setDeprecatedNetworkLoadMetrics(Box<NetworkLoadMetrics>::create(WTF::move(receivedResponse.networkLoadMetrics)));+ m_response.m_httpRequestHeaderFields = request.resourceRequest().httpHeaderFields();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 a65b25c05248a546c4e5f8cc7116e7c9f75877f0..35562a3e3560c98743fe5e7580398b628061d795 100644+index 38aee06c97b6c7d20e0569295bde4192999d9c6e..eb7159615e69a275fe0b52790311209e698458a3 100644--- a/Source/WebKit/NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in+++ b/Source/WebKit/NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in-@@ -453,9 +453,11 @@+@@ -455,9 +455,11 @@;; FIXME: This should be removed when <rdar://problem/10479685> is fixed.;; Restrict AppSandboxed processes from creating /Library/Keychains, but allow access to the contents of /Library/Keychains:@@ -7213,123 +6799,35 @@ index a65b25c05248a546c4e5f8cc7116e7c9f75877f0..35562a3e3560c98743fe5e7580398b62;; 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 e3d4922f91cd6d36a6e238b06fae4ffc89a4ba56..3d4b3f1976d049190fdf553c4463e33cb12b8be8 100644+index 9ebef44bdd6458e145f3dbdf9c5733020b378f10..29722291ef1391809c931aa7e0e5417d84d20f23 100644--- a/Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp+++ b/Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp@@ -396,6 +396,8 @@ void NetworkDataTaskSoup::didSendRequest(GRefPtr<GInputStream>&& inputStream)else- m_inputStream = WTFMove(inputStream);+ m_inputStream = WTF::move(inputStream);+ auto& additionalMetrics = additionalNetworkLoadMetricsForWebInspector();+ m_response.m_httpRequestHeaderFields = additionalMetrics.requestHeaders;dispatchDidReceiveResponse();}-diff --git a/Source/WebKit/NetworkProcess/webrtc/NetworkRTCProvider.cpp b/Source/WebKit/NetworkProcess/webrtc/NetworkRTCProvider.cpp-index 4881fbb66a9408432aa504bbc7502b0d4c74d635..16be794ecf35afefbac97cf558c8f9844a8d15a3 100644---- a/Source/WebKit/NetworkProcess/webrtc/NetworkRTCProvider.cpp-+++ b/Source/WebKit/NetworkProcess/webrtc/NetworkRTCProvider.cpp-@@ -50,9 +50,10 @@- #else // PLATFORM(COCOA)+diff --git a/Source/WebKit/PlatformWPE.cmake b/Source/WebKit/PlatformWPE.cmake+index e0e3a8185373f3e51937955343fae379cd435fca..9d936f5e3c0d7fac37d5eb914310fd7fe7565bae 100644+--- a/Source/WebKit/PlatformWPE.cmake++++ b/Source/WebKit/PlatformWPE.cmake+@@ -228,6 +228,7 @@ set(WPE_API_HEADER_TEMPLATES+ ${WEBKIT_DIR}/UIProcess/API/glib/WebKitWebsitePolicies.h.in+ ${WEBKIT_DIR}/UIProcess/API/glib/WebKitXRPermissionRequest.h.in+ ${WEBKIT_DIR}/UIProcess/API/glib/webkit.h.in++ ${WEBKIT_DIR}/UIProcess/API/gtk/WebKitPointerLockPermissionRequest.h.in+ )- WTF_IGNORE_WARNINGS_IN_THIRD_PARTY_CODE_BEGIN-+#include <webrtc/api/environment/environment_factory.h>- #include <webrtc/rtc_base/async_packet_socket.h>- WTF_IGNORE_WARNINGS_IN_THIRD_PARTY_CODE_END--#endif // PLATFORM(COCOA)-+#endif // !PLATFORM(COCOA)-- namespace WebKit {- using namespace WebCore;-@@ -325,7 +326,7 @@ void NetworkRTCProvider::createUDPSocket(LibWebRTCSocketIdentifier identifier, c- {- assertIsRTCNetworkThread();--- std::unique_ptr<webrtc::AsyncPacketSocket> socket(m_packetSocketFactory->CreateUdpSocket(address.rtcAddress(), minPort, maxPort));-+ std::unique_ptr<webrtc::AsyncPacketSocket> socket(m_packetSocketFactory->CreateUdpSocket(webrtc::CreateEnvironment(), address.rtcAddress(), minPort, maxPort));- createSocket(identifier, WTFMove(socket), Socket::Type::UDP, m_ipcConnection.copyRef());- }--@@ -355,7 +356,7 @@ void NetworkRTCProvider::createClientTCPSocket(LibWebRTCSocketIdentifier identif-- webrtc::PacketSocketTcpOptions tcpOptions;- tcpOptions.opts = options;-- std::unique_ptr<webrtc::AsyncPacketSocket> socket(m_packetSocketFactory->CreateClientTcpSocket(localAddress, remoteAddress, tcpOptions));-+ std::unique_ptr<webrtc::AsyncPacketSocket> socket(m_packetSocketFactory->CreateClientTcpSocket(webrtc::CreateEnvironment(), localAddress, remoteAddress, tcpOptions));- createSocket(identifier, WTFMove(socket), Socket::Type::ClientTCP, m_ipcConnection.copyRef());- });- });-diff --git a/Source/WebKit/PlatformGTK.cmake b/Source/WebKit/PlatformGTK.cmake-index 6adf1ede60ded2a7e2d24b12be85b0cf1e264afa..2b6c5dd682faea86de2ea829f6779a38adf88b6b 100644---- a/Source/WebKit/PlatformGTK.cmake-+++ b/Source/WebKit/PlatformGTK.cmake-@@ -341,6 +341,9 @@ list(APPEND WebKit_PRIVATE_INCLUDE_DIRECTORIES- list(APPEND WebKit_SYSTEM_INCLUDE_DIRECTORIES- ${GSTREAMER_INCLUDE_DIRS}- ${GSTREAMER_PBUTILS_INCLUDE_DIRS}-+# Playwright begin-+ ${LIBVPX_INCLUDE_DIRS}-+# Playwright end- )-- list(APPEND WebKit_INTERFACE_INCLUDE_DIRECTORIES-@@ -384,6 +387,9 @@ if (USE_LIBWEBRTC)- list(APPEND WebKit_SYSTEM_INCLUDE_DIRECTORIES- "${THIRDPARTY_DIR}/libwebrtc/Source/"- "${THIRDPARTY_DIR}/libwebrtc/Source/webrtc"-+# Playwright begin-+ "${THIRDPARTY_DIR}/libwebrtc/Source/third_party/libyuv/include"-+# Playwright end- )- endif ()--@@ -435,6 +441,12 @@ else ()- set(WebKitGTK_ENUM_HEADER_TEMPLATE ${WEBKIT_DIR}/UIProcess/API/gtk/WebKitEnumTypesGtk3.h.in)- endif ()--+# Playwright begin-+list(APPEND WebKit_PRIVATE_INCLUDE_DIRECTORIES-+ "${THIRDPARTY_DIR}/libwebrtc/Source/third_party/libwebm"-+)-+# Playwright end-+- # To generate WebKitEnumTypes.h we want to use all installed headers, except WebKitEnumTypes.h itself.- set(WebKitGTK_ENUM_GENERATION_HEADERS ${WebKitGTK_INSTALLED_HEADERS})- list(REMOVE_ITEM WebKitGTK_ENUM_GENERATION_HEADERS ${WebKitGTK_DERIVED_SOURCES_DIR}/webkit/WebKitEnumTypes.h)-diff --git a/Source/WebKit/PlatformWPE.cmake b/Source/WebKit/PlatformWPE.cmake-index 1bf484dfa41f97dde28210bafa8d6808d8b8c18d..cfeab00a1f649cda9f28b77526fb427109dcdacc 100644---- a/Source/WebKit/PlatformWPE.cmake-+++ b/Source/WebKit/PlatformWPE.cmake-@@ -226,6 +226,7 @@ set(WPE_API_HEADER_TEMPLATES- ${WEBKIT_DIR}/UIProcess/API/glib/WebKitWebsitePolicies.h.in- ${WEBKIT_DIR}/UIProcess/API/glib/WebKitXRPermissionRequest.h.in- ${WEBKIT_DIR}/UIProcess/API/glib/webkit.h.in-+ ${WEBKIT_DIR}/UIProcess/API/gtk/WebKitPointerLockPermissionRequest.h.in- )-- if (ENABLE_2022_GLIB_API)-@@ -455,6 +456,16 @@ list(APPEND WebKit_PRIVATE_INCLUDE_DIRECTORIES- "${JavaScriptCoreGLib_DERIVED_SOURCES_DIR}/jsc"- )--+# Playwright begin-+list(APPEND WebKit_SYSTEM_INCLUDE_DIRECTORIES-+ "${THIRDPARTY_DIR}/libwebrtc/Source/third_party/libyuv/include"-+)-+-+list(APPEND WebKit_PRIVATE_INCLUDE_DIRECTORIES-+ "${THIRDPARTY_DIR}/libwebrtc/Source/third_party/libwebm"-+)-+# Playwright end-+- list(APPEND WebKit_LIBRARIES- GLib::Module- Soup3::Soup3-diff --git a/Source/WebKit/PlatformWin.cmake b/Source/WebKit/PlatformWin.cmake-index 86a1febedca9fcbe7203db8cec94e8db1ef25a43..5817071222a03d57dd4d6afa550f47559a244d54 100644---- a/Source/WebKit/PlatformWin.cmake-+++ b/Source/WebKit/PlatformWin.cmake-@@ -54,8 +54,13 @@ list(APPEND WebKit_SOURCES+ if (ENABLE_2022_GLIB_API)+diff --git a/Source/WebKit/PlatformWin.cmake b/Source/WebKit/PlatformWin.cmake+index 86a1febedca9fcbe7203db8cec94e8db1ef25a43..bda8ea972400bc6f3b28ef5fd40463d5a50e3a9c 100644+--- a/Source/WebKit/PlatformWin.cmake++++ b/Source/WebKit/PlatformWin.cmake+@@ -54,8 +54,13 @@ list(APPEND WebKit_SOURCESUIProcess/win/AutomationClientWin.cppUIProcess/win/AutomationSessionClientWin.cpp@@ -7351,48 +6849,23 @@ index 86a1febedca9fcbe7203db8cec94e8db1ef25a43..5817071222a03d57dd4d6afa550f4755WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp-@@ -119,6 +125,36 @@ list(APPEND WebKit_PRIVATE_LIBRARIES- comctl32- )--+# Playwright begin-+list(APPEND WebKit_SYSTEM_INCLUDE_DIRECTORIES-+ "${THIRDPARTY_DIR}/libwebrtc/Source/third_party/libyuv/include"-+ "${LIBVPX_CUSTOM_INCLUDE_DIR}"-+)-+-+list(APPEND WebKit_PRIVATE_INCLUDE_DIRECTORIES-+ "${THIRDPARTY_DIR}/libwebrtc/Source/third_party/libwebm"-+)-+-+add_library(mkvmuxer STATIC-+ "${THIRDPARTY_DIR}/libwebrtc/Source/third_party/libwebm/mkvmuxer/mkvmuxer.cc"-+ "${THIRDPARTY_DIR}/libwebrtc/Source/third_party/libwebm/mkvmuxer/mkvmuxerutil.cc"-+ "${THIRDPARTY_DIR}/libwebrtc/Source/third_party/libwebm/mkvmuxer/mkvwriter.cc"-+)-+target_include_directories(mkvmuxer PRIVATE-+ "${THIRDPARTY_DIR}/libwebrtc/Source/third_party/libwebm"-+)-+target_link_libraries(WebKit PRIVATE mkvmuxer)-+-+add_subdirectory(-+ "${THIRDPARTY_DIR}/libwebrtc/Source/third_party/libyuv"-+ "${CMAKE_BINARY_DIR}/libyuv"-+ EXCLUDE_FROM_ALL-+)-+target_link_libraries(WebKit PRIVATE yuv)-+target_link_libraries(WebKit PRIVATE ${LIBVPX_LIBRARIES})-+-+# Playwright end-+- list(APPEND WebProcess_SOURCES- WebProcess/EntryPoint/win/WebProcessMain.cpp-+diff --git a/Source/WebKit/Shared/API/Cocoa/WebKitPrivate.h b/Source/WebKit/Shared/API/Cocoa/WebKitPrivate.h+index 3e3718b9be38ecb2115030a13c71e226d4b14f64..408b6706a324078f6d1e575863a8581c7b021560 100644+--- a/Source/WebKit/Shared/API/Cocoa/WebKitPrivate.h++++ b/Source/WebKit/Shared/API/Cocoa/WebKitPrivate.h+@@ -44,6 +44,7 @@+ #import <WebKit/WKWebViewPrivate.h>+ #import <WebKit/_WKActivatedElementInfo.h>+ #import <WebKit/_WKAttachment.h>++#import <WebKit/_WKBrowserInspector.h>+ #import <WebKit/_WKCaptionStyleMenuController.h>+ #import <WebKit/_WKContentWorldConfiguration.h>+ #import <WebKit/_WKElementAction.h>diff --git a/Source/WebKit/Shared/AuxiliaryProcess.h b/Source/WebKit/Shared/AuxiliaryProcess.h-index f7e60f52af0df8081d3f223a21b10674e79c2542..e3cb79b52db7073122d78acabf03b2d19cabf1ea 100644+index 97d887311d7dabc0902587072b234cfbfb0c8264..3950ae8702e3288e18e98a2b167564ab6ec9f7e1 100644--- a/Source/WebKit/Shared/AuxiliaryProcess.h+++ b/Source/WebKit/Shared/AuxiliaryProcess.h-@@ -221,6 +221,11 @@ struct AuxiliaryProcessInitializationParameters {+@@ -216,6 +216,11 @@ struct AuxiliaryProcessInitializationParameters {IPC::Connection::Identifier connectionIdentifier;HashMap<String, String> extraInitializationData;WTF::AuxiliaryProcessType processType;@@ -7405,7 +6878,7 @@ index f7e60f52af0df8081d3f223a21b10674e79c2542..e3cb79b52db7073122d78acabf03b2d1} // namespace WebKitdiff --git a/Source/WebKit/Shared/NativeWebKeyboardEvent.h b/Source/WebKit/Shared/NativeWebKeyboardEvent.h-index 2b12d508987512d01c3b8dc708a4e6724814c634..461750cded70022b8f378d92c6dafeb4eb25c1ed 100644+index 02d7072a9124bdc6ae3abb395c6e1451a18916db..aa5d78c48f7cb1b9213725ef2d87c75c1af038b2 100644--- a/Source/WebKit/Shared/NativeWebKeyboardEvent.h+++ b/Source/WebKit/Shared/NativeWebKeyboardEvent.h@@ -33,6 +33,7 @@@@ -7416,12 +6889,12 @@ index 2b12d508987512d01c3b8dc708a4e6724814c634..461750cded70022b8f378d92c6dafeb4#endif#if PLATFORM(GTK)-@@ -70,23 +71,39 @@ public:+@@ -70,11 +71,19 @@ public:#if USE(APPKIT)// FIXME: Share iOS's HandledByInputMethod enum here instead of passing a boolean.NativeWebKeyboardEvent(NSEvent *, bool handledByInputMethod, bool replacesSoftSpace, const Vector<WebCore::KeypressCommand>&);+ NativeWebKeyboardEvent(WebEventType type, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, OptionSet<WebEventModifier> modifiers, MonotonicTime timestamp, Vector<WebCore::KeypressCommand>&& commands)-+ : WebKeyboardEvent(type, text, unmodifiedText, key, code, keyIdentifier, windowsVirtualKeyCode, nativeVirtualKeyCode, isAutoRepeat, isKeypad, isSystemKey, modifiers, timestamp, WTFMove(commands))++ : WebKeyboardEvent(type, text, unmodifiedText, key, code, keyIdentifier, windowsVirtualKeyCode, nativeVirtualKeyCode, isAutoRepeat, isKeypad, isSystemKey, modifiers, timestamp, WTF::move(commands))+ {+ }#elif PLATFORM(GTK)@@ -7430,23 +6903,25 @@ index 2b12d508987512d01c3b8dc708a4e6724814c634..461750cded70022b8f378d92c6dafeb4NativeWebKeyboardEvent(const String&, std::optional<Vector<WebCore::CompositionUnderline>>&&, std::optional<EditingRange>&&);NativeWebKeyboardEvent(WebEventType, const String& text, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, Vector<String>&& commands, bool isAutoRepeat, bool isKeypad, OptionSet<WebEventModifier>);+ NativeWebKeyboardEvent(WebEventType type, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, OptionSet<WebEventModifier> modifiers, MonotonicTime timestamp, Vector<String>&& commands)-+ : WebKeyboardEvent(type, text, unmodifiedText, key, code, keyIdentifier, windowsVirtualKeyCode, nativeVirtualKeyCode, isAutoRepeat, isKeypad, isSystemKey, modifiers, timestamp, WTFMove(commands))++ : WebKeyboardEvent(type, text, unmodifiedText, key, code, keyIdentifier, windowsVirtualKeyCode, nativeVirtualKeyCode, isAutoRepeat, isKeypad, isSystemKey, modifiers, timestamp, WTF::move(commands))+ {+ }#elif PLATFORM(IOS_FAMILY)enum class HandledByInputMethod : bool { No, Yes };NativeWebKeyboardEvent(::WebEvent *, HandledByInputMethod);- #elif USE(LIBWPE)+@@ -82,6 +91,10 @@ public:+ #if USE(LIBWPE)enum class HandledByInputMethod : bool { No, Yes };NativeWebKeyboardEvent(struct wpe_input_keyboard_event*, const String&, bool isAutoRepeat, HandledByInputMethod, std::optional<Vector<WebCore::CompositionUnderline>>&&, std::optional<EditingRange>&&);+ NativeWebKeyboardEvent(WebEventType type, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, OptionSet<WebEventModifier> modifiers, MonotonicTime timestamp)+ : WebKeyboardEvent(type, text, unmodifiedText, key, code, keyIdentifier, windowsVirtualKeyCode, nativeVirtualKeyCode, isAutoRepeat, isKeypad, isSystemKey, modifiers, timestamp)+ {+ }- #if PLATFORM(WPE) && ENABLE(WPE_PLATFORM)- NativeWebKeyboardEvent(WPEEvent*, const String&, bool isAutoRepeat);- NativeWebKeyboardEvent(const String&, std::optional<Vector<WebCore::CompositionUnderline>>&&, std::optional<EditingRange>&&);#endif+ #if ENABLE(WPE_PLATFORM)+ NativeWebKeyboardEvent(WPEEvent*, const String&, bool isAutoRepeat);+@@ -92,6 +105,10 @@ public:+ NativeWebKeyboardEvent(struct wpe_input_keyboard_event*, const String&, bool isAutoRepeat, HandledByInputMethod, std::optional<Vector<WebCore::CompositionUnderline>>&&, std::optional<EditingRange>&&);#elif PLATFORM(WIN)NativeWebKeyboardEvent(HWND, UINT message, WPARAM, LPARAM, Vector<MSG>&& pendingCharEvents);+ NativeWebKeyboardEvent(WebEventType type, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, OptionSet<WebEventModifier> modifiers, MonotonicTime timestamp)@@ -7457,26 +6932,26 @@ index 2b12d508987512d01c3b8dc708a4e6724814c634..461750cded70022b8f378d92c6dafeb4#if USE(APPKIT)diff --git a/Source/WebKit/Shared/NativeWebMouseEvent.h b/Source/WebKit/Shared/NativeWebMouseEvent.h-index 1b740b10a2db5df04771876ebb31b25d9c885c9b..54649116411c9927610d82fa21fa74601ea62b5e 100644+index fc425c3817e9b43bca3afe6b650bd091797f2448..30c4096aaee42cc822ad79098be0d75919d5cec3 100644--- a/Source/WebKit/Shared/NativeWebMouseEvent.h+++ b/Source/WebKit/Shared/NativeWebMouseEvent.h-@@ -87,6 +87,11 @@ public:+@@ -91,6 +91,11 @@ public:NativeWebMouseEvent(HWND, UINT message, WPARAM, LPARAM, bool, float deviceScaleFactor);#endif+#if PLATFORM(GTK) || USE(LIBWPE) || PLATFORM(WIN)+ NativeWebMouseEvent(WebEventType type, WebMouseEventButton button, unsigned short buttons, const WebCore::IntPoint& position, const WebCore::IntPoint& globalPosition, float deltaX, float deltaY, float deltaZ, int clickCount, OptionSet<WebEventModifier> modifiers, MonotonicTime timestamp)-+ : WebMouseEvent({type, modifiers, timestamp}, button, buttons, position, globalPosition, deltaX, deltaY, deltaZ, clickCount) { }++ : WebMouseEvent({type, modifiers, timestamp}, button, buttons, position, globalPosition, deltaX, deltaY, deltaZ, clickCount, 0, WebMouseEventInputSource::Hardware) { }+#endif+#if USE(APPKIT)NSEvent* nativeEvent() const { return m_nativeEvent.get(); }#elif PLATFORM(GTK)diff --git a/Source/WebKit/Shared/NativeWebWheelEvent.h b/Source/WebKit/Shared/NativeWebWheelEvent.h-index 29ac04187fdc501e1dfe948029fdd764d8d8442d..56c2758a60fc90b2ed90f4684477df754091b570 100644+index 58c90822b9bda82b1bdba018ddc1e20378a52461..71c59771e2cc2db98f699cc43b624fc3c0e13127 100644--- a/Source/WebKit/Shared/NativeWebWheelEvent.h+++ b/Source/WebKit/Shared/NativeWebWheelEvent.h-@@ -76,6 +76,11 @@ public:+@@ -79,6 +79,11 @@ public:NativeWebWheelEvent(HWND, UINT message, WPARAM, LPARAM, float deviceScaleFactor);#endif@@ -7489,10 +6964,10 @@ index 29ac04187fdc501e1dfe948029fdd764d8d8442d..56c2758a60fc90b2ed90f4684477df75NSEvent* 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 6db8201887dcd57b0e629457e41071bc0d6af9eb..b92c4067e4b22116aa56a0bdc0bb8e5d1dc33d3c 100644+index 28284f8b63d59d4ae21223cce2012e78e7829f56..41aaae3573cb952d517e73607361a6476f325e63 100644--- a/Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in+++ b/Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in-@@ -2699,6 +2699,9 @@ class WebCore::AuthenticationChallenge {+@@ -2717,6 +2717,9 @@ class WebCore::AuthenticationChallenge {class WebCore::DragData {#if PLATFORM(COCOA)String pasteboardName();@@ -7502,7 +6977,7 @@ index 6db8201887dcd57b0e629457e41071bc0d6af9eb..b92c4067e4b22116aa56a0bdc0bb8e5d#endifWebCore::IntPoint clientPosition();WebCore::IntPoint globalPosition();-@@ -3485,6 +3488,7 @@ enum class WebCore::WasPrivateRelayed : bool;+@@ -3503,6 +3506,7 @@ enum class WebCore::WasPrivateRelayed : bool;String httpStatusText;String httpVersion;WebCore::HTTPHeaderMap httpHeaderFields;@@ -7511,7 +6986,7 @@ index 6db8201887dcd57b0e629457e41071bc0d6af9eb..b92c4067e4b22116aa56a0bdc0bb8e5dWebCore::ResourceResponseBase::Source source;WebCore::ResourceResponseBase::Type type;diff --git a/Source/WebKit/Shared/WebKeyboardEvent.cpp b/Source/WebKit/Shared/WebKeyboardEvent.cpp-index 8040819bba9dcde87311aaafe7d8177d0e07281d..b20b2d56a90d1139b5e01942a3a18b20c4f83714 100644+index b81260e021336831e0a8a45279edf1ebc1d1da22..ad3601d874eb87da17ac6975271f9fde266549c7 100644--- a/Source/WebKit/Shared/WebKeyboardEvent.cpp+++ b/Source/WebKit/Shared/WebKeyboardEvent.cpp@@ -51,6 +51,24 @@ WebKeyboardEvent::WebKeyboardEvent(WebEvent&& event, const String& text, const S@@ -7528,7 +7003,7 @@ index 8040819bba9dcde87311aaafe7d8177d0e07281d..b20b2d56a90d1139b5e01942a3a18b20+ , m_windowsVirtualKeyCode(windowsVirtualKeyCode)+ , m_nativeVirtualKeyCode(nativeVirtualKeyCode)+ , m_macCharCode(0)-+ , m_commands(WTFMove(commands))++ , m_commands(WTF::move(commands))+ , m_isAutoRepeat(isAutoRepeat)+ , m_isKeypad(isKeypad)+ , m_isSystemKey(isSystemKey)@@ -7553,7 +7028,7 @@ index 8040819bba9dcde87311aaafe7d8177d0e07281d..b20b2d56a90d1139b5e01942a3a18b20+ , m_windowsVirtualKeyCode(windowsVirtualKeyCode)+ , m_nativeVirtualKeyCode(nativeVirtualKeyCode)+ , m_macCharCode(0)-+ , m_commands(WTFMove(commands))++ , m_commands(WTF::move(commands))+ , m_isAutoRepeat(isAutoRepeat)+ , m_isKeypad(isKeypad)+ , m_isSystemKey(isSystemKey)@@ -7593,7 +7068,7 @@ index 8040819bba9dcde87311aaafe7d8177d0e07281d..b20b2d56a90d1139b5e01942a3a18b20{}diff --git a/Source/WebKit/Shared/WebKeyboardEvent.h b/Source/WebKit/Shared/WebKeyboardEvent.h-index ce11155ce7a2c4e46e249cdd0e613bf2fad0e51f..6b64cd195819600dc81085d1bfdfbc6c393bd379 100644+index b0fa2a97f017bfaae88204fd737d411f2ec8ed44..7c805dd37431c1adf6a21e6843f347828fe5391e 100644--- a/Source/WebKit/Shared/WebKeyboardEvent.h+++ b/Source/WebKit/Shared/WebKeyboardEvent.h@@ -42,14 +42,18 @@ public:@@ -7606,7 +7081,7 @@ index ce11155ce7a2c4e46e249cdd0e613bf2fad0e51f..6b64cd195819600dc81085d1bfdfbc6c+ WebKeyboardEvent(WebEventType, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, OptionSet<WebEventModifier>, MonotonicTime timestamp, Vector<String>&& commands);#elif PLATFORM(IOS_FAMILY)WebKeyboardEvent(WebEvent&&, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, int macCharCode, bool handledByInputMethod, bool isAutoRepeat, bool isKeypad, bool isSystemKey);- #elif USE(LIBWPE)+ #elif USE(LIBWPE) || ENABLE(WPE_PLATFORM)WebKeyboardEvent(WebEvent&&, const String& text, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool handledByInputMethod, std::optional<Vector<WebCore::CompositionUnderline>>&&, std::optional<EditingRange>&&, bool isAutoRepeat, bool isKeypad);+ WebKeyboardEvent(WebEventType, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, OptionSet<WebEventModifier>, MonotonicTime timestamp);#else@@ -7624,10 +7099,10 @@ index ce11155ce7a2c4e46e249cdd0e613bf2fad0e51f..6b64cd195819600dc81085d1bfdfbc6c#endifdiff --git a/Source/WebKit/Shared/WebMouseEvent.h b/Source/WebKit/Shared/WebMouseEvent.h-index 249ed5bf7a9ca037349cae92a063e718d015333d..6c179a0545456967f26ebf64f701e0290acaa589 100644+index bb4add3d11084126cee36228b6f3ff7d54d7a6f5..c0601efc42769db53cdd24788e3ddca34f311911 100644--- a/Source/WebKit/Shared/WebMouseEvent.h+++ b/Source/WebKit/Shared/WebMouseEvent.h-@@ -70,6 +70,7 @@ public:+@@ -74,6 +74,7 @@ public:WebMouseEventButton button() const { return m_button; }unsigned short buttons() const { return m_buttons; }@@ -7636,26 +7111,28 @@ index 249ed5bf7a9ca037349cae92a063e718d015333d..6c179a0545456967f26ebf64f701e029void setPosition(const WebCore::DoublePoint& position) { m_position = position; }const WebCore::DoublePoint& globalPosition() const { return m_globalPosition; }diff --git a/Source/WebKit/Shared/WebPageCreationParameters.h b/Source/WebKit/Shared/WebPageCreationParameters.h-index a1fc59d1789a2dc91a5ba5ce8f39c3949f621471..582735cd523cda46afb1ea20ca366a8244aa2285 100644+index 89788953d745be3ba7362eddd81c5d30414f1b3b..b9012215e881ecad2b97265b03fb49152db256ae 100644--- a/Source/WebKit/Shared/WebPageCreationParameters.h+++ b/Source/WebKit/Shared/WebPageCreationParameters.h-@@ -311,6 +311,8 @@ struct WebPageCreationParameters {+@@ -313,6 +313,9 @@ struct WebPageCreationParameters {WebCore::ShouldRelaxThirdPartyCookieBlocking shouldRelaxThirdPartyCookieBlocking { WebCore::ShouldRelaxThirdPartyCookieBlocking::No };bool httpsUpgradeEnabled { true };+++ std::optional<int> deviceOrientationOverride { };+ bool shouldPauseInInspectorWhenShown { false };#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 b876f1c0f83234f8b38f78e748c55f6613609ae7..7c160dbfc3887449d77937af60494c060741a933 100644+index 4ca6fc620263b984a12b4d1b53ebe85481686202..cccb74fa82f11b661916d211bccc028cae9fff90 100644--- a/Source/WebKit/Shared/WebPageCreationParameters.serialization.in+++ b/Source/WebKit/Shared/WebPageCreationParameters.serialization.in-@@ -228,6 +228,8 @@ enum class WebCore::UserInterfaceLayoutDirection : bool;+@@ -229,6 +229,9 @@ enum class WebCore::UserInterfaceLayoutDirection : bool;bool httpsUpgradeEnabled;++ std::optional<int> deviceOrientationOverride;+ bool shouldPauseInInspectorWhenShown;+#if ENABLE(APP_HIGHLIGHTS)@@ -7684,15 +7161,15 @@ index b41816f4ba670a7058014f078ef02441c3ab0abf..983d8679574a2555b348ab0df7699253if (execDirectory) {String processPath = FileSystem::pathByAppendingComponent(FileSystem::stringFromFileSystemRepresentation(execDirectory), StringView::fromLatin1(processName));diff --git a/Source/WebKit/Shared/gtk/NativeWebKeyboardEventGtk.cpp b/Source/WebKit/Shared/gtk/NativeWebKeyboardEventGtk.cpp-index 388c57d1276b59bc889d62515efe3bd4989ace84..bf8389a08c0c726e05fb2d19eaa68e833e230819 100644+index 6091f843195ae84a25e955304170d84df8ec012e..6c8ce488b96ffeee50371925df704accf03e154c 100644--- a/Source/WebKit/Shared/gtk/NativeWebKeyboardEventGtk.cpp+++ b/Source/WebKit/Shared/gtk/NativeWebKeyboardEventGtk.cpp@@ -51,7 +51,7 @@ NativeWebKeyboardEvent::NativeWebKeyboardEvent(const String& text, std::optional}NativeWebKeyboardEvent::NativeWebKeyboardEvent(WebEventType type, const String& text, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, Vector<String>&& commands, bool isAutoRepeat, bool isKeypad, OptionSet<WebEventModifier> modifiers)-- : WebKeyboardEvent(WebEvent(type, modifiers, MonotonicTime::now()), text, key, code, keyIdentifier, windowsVirtualKeyCode, nativeVirtualKeyCode, false, std::nullopt, std::nullopt, WTFMove(commands), isAutoRepeat, isKeypad)-+ : WebKeyboardEvent(WebEvent(type, modifiers, MonotonicTime::now()), text, key, code, keyIdentifier, windowsVirtualKeyCode, nativeVirtualKeyCode, false, std::nullopt, std::nullopt, WTFMove(commands), false, isKeypad)+- : WebKeyboardEvent(WebEvent(type, modifiers, MonotonicTime::now()), text, key, code, keyIdentifier, windowsVirtualKeyCode, nativeVirtualKeyCode, false, std::nullopt, std::nullopt, WTF::move(commands), isAutoRepeat, isKeypad)++ : WebKeyboardEvent(WebEvent(type, modifiers, MonotonicTime::now()), text, key, code, keyIdentifier, windowsVirtualKeyCode, nativeVirtualKeyCode, false, std::nullopt, std::nullopt, WTF::move(commands), false, isKeypad){}@@ -7992,10 +7469,10 @@ index 053e9336017d8818b3cbea79ce7c145fd5c46274..5632498d6ef875df80fc68ec206a9d08JSC::Config::configureForTesting();else if (!strcmp(argv[i], "-disable-jit"))diff --git a/Source/WebKit/Sources.txt b/Source/WebKit/Sources.txt-index c15d1c070dc089fd20de3e4a36c5d642c5f4b725..94d7dfe878652d97a5e82eb45dc968b8f83756ff 100644+index 2ff64a35be0d18321b1086c2c24387c063b8b83f..8f50c9cff94223f4e90adb4cd2d659e178c65d55 100644--- a/Source/WebKit/Sources.txt+++ b/Source/WebKit/Sources.txt-@@ -405,6 +405,7 @@ UIProcess/AboutSchemeHandler.cpp+@@ -403,6 +403,7 @@ UIProcess/AboutSchemeHandler.cppUIProcess/AuxiliaryProcessProxy.cppUIProcess/BackgroundProcessResponsivenessTimer.cppUIProcess/BrowsingContextGroup.cpp@@ -8003,7 +7480,7 @@ index c15d1c070dc089fd20de3e4a36c5d642c5f4b725..94d7dfe878652d97a5e82eb45dc968b8UIProcess/DeviceIdHashSaltStorage.cppUIProcess/DisplayLink.cppUIProcess/DisplayLinkProcessProxyClient.cpp-@@ -416,6 +417,8 @@ UIProcess/FrameLoadState.cpp+@@ -414,6 +415,8 @@ UIProcess/FrameLoadState.cppUIProcess/FrameProcess.cppUIProcess/GeolocationPermissionRequestManagerProxy.cppUIProcess/GeolocationPermissionRequestProxy.cpp@@ -8012,7 +7489,7 @@ index c15d1c070dc089fd20de3e4a36c5d642c5f4b725..94d7dfe878652d97a5e82eb45dc968b8UIProcess/LegacyGlobalSettings.cppUIProcess/MediaKeySystemPermissionRequestManagerProxy.cppUIProcess/MediaKeySystemPermissionRequestProxy.cpp-@@ -423,10 +426,12 @@ UIProcess/ModelElementController.cpp+@@ -421,10 +424,12 @@ UIProcess/ModelElementController.cppUIProcess/OverrideLanguages.cppUIProcess/PageClient.cppUIProcess/PageLoadState.cpp@@ -8034,21 +7511,19 @@ index c15d1c070dc089fd20de3e4a36c5d642c5f4b725..94d7dfe878652d97a5e82eb45dc968b8UIProcess/WebPageProxy.cppUIProcess/WebPageProxyMessageReceiverRegistration.cppUIProcess/WebPageProxyTesting.cpp-@@ -638,6 +645,9 @@ UIProcess/Inspector/WebPageInspectorController.cpp+@@ -640,6 +647,7 @@ UIProcess/Inspector/WebPageInspectorController.cppUIProcess/Inspector/WebPageInspectorTargetProxy.cppUIProcess/Inspector/Agents/InspectorBrowserAgent.cpp+UIProcess/Inspector/Agents/InspectorScreencastAgent.cpp-+UIProcess/Inspector/Agents/ScreencastEncoder.cpp-+UIProcess/Inspector/Agents/WebMFileWriter.cppUIProcess/Media/AudioSessionRoutingArbitratorProxy.cppUIProcess/Media/MediaUsageManager.cppdiff --git a/Source/WebKit/SourcesCocoa.txt b/Source/WebKit/SourcesCocoa.txt-index f9f7c25eb148ddbc404a3aad700abe87be534cf3..cfd16f4edc556d04451e78a90b054b2cb2209411 100644+index 6c8674c676b3f869db7dd78f976d16f239372ecc..2c70d8c7dcd8179d7c10d9ad6e186f3c5195dda6 100644--- a/Source/WebKit/SourcesCocoa.txt+++ b/Source/WebKit/SourcesCocoa.txt-@@ -279,6 +279,7 @@ UIProcess/API/Cocoa/_WKArchiveExclusionRule.mm @nonARC+@@ -283,6 +283,7 @@ UIProcess/API/Cocoa/_WKArchiveExclusionRule.mm @nonARCUIProcess/API/Cocoa/_WKAttachment.mm @nonARCUIProcess/API/Cocoa/_WKAutomationSession.mm @nonARCUIProcess/API/Cocoa/_WKAutomationSessionConfiguration.mm @nonARC@@ -8056,19 +7531,11 @@ index f9f7c25eb148ddbc404a3aad700abe87be534cf3..cfd16f4edc556d04451e78a90b054b2cUIProcess/API/Cocoa/_WKContentRuleListAction.mm @nonARCUIProcess/API/Cocoa/_WKContextMenuElementInfo.mm @nonARCUIProcess/API/Cocoa/_WKCustomHeaderFields.mm @nonARC @no-unify-@@ -535,6 +536,7 @@ UIProcess/Inspector/ios/WKInspectorHighlightView.mm @nonARC- UIProcess/Inspector/ios/WKInspectorNodeSearchGestureRecognizer.mm @nonARC-- UIProcess/Inspector/mac/RemoteWebInspectorUIProxyMac.mm @nonARC-+UIProcess/Inspector/mac/ScreencastEncoderMac.mm @nonARC- UIProcess/Inspector/mac/WebInspectorUIProxyMac.mm @nonARC- UIProcess/Inspector/mac/WKInspectorResourceURLSchemeHandler.mm @nonARC- UIProcess/Inspector/mac/WKInspectorViewController.mm @nonARCdiff --git a/Source/WebKit/SourcesGTK.txt b/Source/WebKit/SourcesGTK.txt-index 138449e964461d660390ef64489f2cb5dad8439e..0b828e17561c168df7cebec87bb252794bbb1333 100644+index 2327e9e6ae538686f92ff71aa644f87b74c921cc..fe3318e5bc94db3cb442803137a00d14d5d9cc9b 100644--- a/Source/WebKit/SourcesGTK.txt+++ b/Source/WebKit/SourcesGTK.txt-@@ -133,6 +133,7 @@ UIProcess/API/glib/WebKitAutomationSession.cpp @no-unify+@@ -134,6 +134,7 @@ UIProcess/API/glib/WebKitAutomationSession.cpp @no-unifyUIProcess/API/glib/WebKitBackForwardList.cpp @no-unifyUIProcess/API/glib/WebKitBackForwardListItem.cpp @no-unifyUIProcess/API/glib/WebKitClipboardPermissionRequest.cpp @no-unify@@ -8076,7 +7543,15 @@ index 138449e964461d660390ef64489f2cb5dad8439e..0b828e17561c168df7cebec87bb25279UIProcess/API/glib/WebKitContextMenuClient.cpp @no-unifyUIProcess/API/glib/WebKitCookieManager.cpp @no-unifyUIProcess/API/glib/WebKitCredential.cpp @no-unify-@@ -270,6 +271,7 @@ UIProcess/glib/DisplayVBlankMonitorDRM.cpp+@@ -263,6 +264,7 @@ UIProcess/linux/MemoryPressureMonitor.cpp+ UIProcess/WebsiteData/glib/WebsiteDataStoreGLib.cpp+ UIProcess/WebsiteData/soup/WebsiteDataStoreSoup.cpp+++UIProcess/glib/BrowserInspectorWebSocketServer.cpp+ UIProcess/glib/DRMMainDevice.cpp @no-unify+ UIProcess/glib/DisplayLinkGLib.cpp+ UIProcess/glib/DisplayVBlankMonitor.cpp+@@ -270,6 +272,7 @@ UIProcess/glib/DisplayVBlankMonitorDRM.cppUIProcess/glib/DisplayVBlankMonitorThreaded.cppUIProcess/glib/DisplayVBlankMonitorTimer.cppUIProcess/glib/FenceMonitor.cpp@@ -8084,7 +7559,7 @@ index 138449e964461d660390ef64489f2cb5dad8439e..0b828e17561c168df7cebec87bb25279UIProcess/glib/ScreenManager.cppUIProcess/glib/SystemSettingsManagerProxy.cppUIProcess/glib/WebPageProxyGLib.cpp-@@ -287,7 +289,6 @@ UIProcess/gtk/DisplayX11.cpp @no-unify+@@ -287,7 +290,6 @@ UIProcess/gtk/DisplayX11.cpp @no-unifyUIProcess/gtk/DisplayWayland.cpp @no-unifyUIProcess/gtk/GRefPtrGtk.cpp @no-unifyUIProcess/gtk/GtkUtilities.cpp @no-unify@@ -8092,7 +7567,7 @@ index 138449e964461d660390ef64489f2cb5dad8439e..0b828e17561c168df7cebec87bb25279UIProcess/gtk/HardwareAccelerationManager.cppUIProcess/gtk/KeyBindingTranslator.cppUIProcess/gtk/PointerLockManager.cpp @no-unify-@@ -303,6 +304,10 @@ UIProcess/gtk/ViewGestureControllerGtk.cpp+@@ -303,6 +305,10 @@ UIProcess/gtk/ViewGestureControllerGtk.cppUIProcess/gtk/WebColorPickerGtk.cppUIProcess/gtk/WebContextMenuProxyGtk.cppUIProcess/gtk/WebDataListSuggestionsDropdownGtk.cpp@@ -8104,10 +7579,10 @@ index 138449e964461d660390ef64489f2cb5dad8439e..0b828e17561c168df7cebec87bb25279UIProcess/gtk/WebPasteboardProxyGtk.cppUIProcess/gtk/WebPopupMenuProxyGtk.cppdiff --git a/Source/WebKit/SourcesWPE.txt b/Source/WebKit/SourcesWPE.txt-index 20043fd8e7c2b845b25a9e743f14c884bcba3535..cb247f2f5759ffb1fd8111e47bea4a75c36517e4 100644+index d1cfdba673d22324a7e9188cc40070bf30eea360..7bce1f94bbcfdd78ed10ffdee1c7ce5d13dc0c9e 100644--- a/Source/WebKit/SourcesWPE.txt+++ b/Source/WebKit/SourcesWPE.txt-@@ -136,6 +136,7 @@ UIProcess/API/glib/WebKitAuthenticationRequest.cpp @no-unify+@@ -137,6 +137,7 @@ UIProcess/API/glib/WebKitAuthenticationRequest.cpp @no-unifyUIProcess/API/glib/WebKitAutomationSession.cpp @no-unifyUIProcess/API/glib/WebKitBackForwardList.cpp @no-unifyUIProcess/API/glib/WebKitBackForwardListItem.cpp @no-unify@@ -8115,7 +7590,7 @@ index 20043fd8e7c2b845b25a9e743f14c884bcba3535..cb247f2f5759ffb1fd8111e47bea4a75UIProcess/API/glib/WebKitContextMenuClient.cpp @no-unifyUIProcess/API/glib/WebKitCookieManager.cpp @no-unifyUIProcess/API/glib/WebKitCredential.cpp @no-unify-@@ -170,6 +171,7 @@ UIProcess/API/glib/WebKitOptionMenu.cpp @no-unify+@@ -171,6 +172,7 @@ UIProcess/API/glib/WebKitOptionMenu.cpp @no-unifyUIProcess/API/glib/WebKitOptionMenuItem.cpp @no-unifyUIProcess/API/glib/WebKitPermissionRequest.cpp @no-unifyUIProcess/API/glib/WebKitPermissionStateQuery.cpp @no-unify@@ -8123,7 +7598,15 @@ index 20043fd8e7c2b845b25a9e743f14c884bcba3535..cb247f2f5759ffb1fd8111e47bea4a75UIProcess/API/glib/WebKitPolicyDecision.cpp @no-unifyUIProcess/API/glib/WebKitPrivate.cpp @no-unifyUIProcess/API/glib/WebKitProtocolHandler.cpp @no-unify-@@ -245,6 +247,7 @@ UIProcess/glib/DisplayVBlankMonitorDRM.cpp+@@ -239,6 +241,7 @@ UIProcess/Gamepad/wpe/PlatformGamepadWPE.cpp++ UIProcess/geoclue/GeoclueGeolocationProvider.cpp+++UIProcess/glib/BrowserInspectorWebSocketServer.cpp+ UIProcess/glib/DRMMainDevice.cpp @no-unify+ UIProcess/glib/DisplayLinkGLib.cpp+ UIProcess/glib/DisplayVBlankMonitor.cpp+@@ -246,6 +249,7 @@ UIProcess/glib/DisplayVBlankMonitorDRM.cppUIProcess/glib/DisplayVBlankMonitorThreaded.cppUIProcess/glib/DisplayVBlankMonitorTimer.cppUIProcess/glib/FenceMonitor.cpp@@ -8131,7 +7614,7 @@ index 20043fd8e7c2b845b25a9e743f14c884bcba3535..cb247f2f5759ffb1fd8111e47bea4a75UIProcess/glib/ScreenManager.cppUIProcess/glib/SystemSettingsManagerProxy.cppUIProcess/glib/WebPageProxyGLib.cpp-@@ -282,6 +285,12 @@ UIProcess/wpe/DisplayVBlankMonitorWPE.cpp+@@ -284,6 +288,12 @@ UIProcess/wpe/DisplayVBlankMonitorWPE.cppUIProcess/wpe/ScreenManagerWPE.cppUIProcess/wpe/SystemSettingsManagerProxyWPE.cppUIProcess/wpe/WPEUtilities.cpp@@ -8145,11 +7628,11 @@ index 20043fd8e7c2b845b25a9e743f14c884bcba3535..cb247f2f5759ffb1fd8111e47bea4a75UIProcess/wpe/WebPasteboardProxyWPE.cppUIProcess/wpe/WebPreferencesWPE.cppdiff --git a/Source/WebKit/UIProcess/API/APIPageConfiguration.cpp b/Source/WebKit/UIProcess/API/APIPageConfiguration.cpp-index 9a30137e814926fc47a5de9a4b2a54efe4778b2b..903027b0babae99757936c635b72a860ded1485c 100644+index be65e4df37f9cabe694a5dc3c3489fb0d4ecef8c..eaa76aba0cf70222ce85e1277830ef596ea099ce 100644--- a/Source/WebKit/UIProcess/API/APIPageConfiguration.cpp+++ b/Source/WebKit/UIProcess/API/APIPageConfiguration.cpp-@@ -278,6 +278,11 @@ RefPtr<WebPageProxy> PageConfiguration::protectedRelatedPage() const- return relatedPage();+@@ -261,6 +261,11 @@ BrowsingContextGroup* PageConfiguration::preferredBrowsingContextGroup() const+ return nullptr;}+WebKit::WebPageProxy* PageConfiguration::openerPageForInspector() const@@ -8161,21 +7644,39 @@ index 9a30137e814926fc47a5de9a4b2a54efe4778b2b..903027b0babae99757936c635b72a860{return m_data.pageToCloneSessionStorageFrom.get();diff --git a/Source/WebKit/UIProcess/API/APIPageConfiguration.h b/Source/WebKit/UIProcess/API/APIPageConfiguration.h-index 684800f30c8fdbc796e6e051fd606cf1fe360f44..13f88317adbaa30d408abf737171dcd7624edec6 100644+index d57d51192f786dabd007b8128a0a69fc9ddaaa3d..7e9caa2ed2ce23fe942ebae95fda7a392d335924 100644--- a/Source/WebKit/UIProcess/API/APIPageConfiguration.h+++ b/Source/WebKit/UIProcess/API/APIPageConfiguration.h-@@ -173,6 +173,10 @@ public:- void setRelatedPage(WeakPtr<WebKit::WebPageProxy>&& relatedPage) { m_data.relatedPage = WTFMove(relatedPage); }- RefPtr<WebKit::WebPageProxy> protectedRelatedPage() const;+@@ -170,6 +170,10 @@ public:+ WebKit::WebPageProxy* relatedPage() const;+ void setRelatedPage(WeakPtr<WebKit::WebPageProxy>&& relatedPage) { m_data.relatedPage = WTF::move(relatedPage); }+ // This is similar to relatedPage(), but it is also set for noopener links.+ WebKit::WebPageProxy* openerPageForInspector() const;-+ void setOpenerPageForInspector(WeakPtr<WebKit::WebPageProxy>&& openerPageForInspector) { m_data.openerPageForInspector = WTFMove(openerPageForInspector); }++ void setOpenerPageForInspector(WeakPtr<WebKit::WebPageProxy>&& openerPageForInspector) { m_data.openerPageForInspector = WTF::move(openerPageForInspector); }+WebKit::WebPageProxy* pageToCloneSessionStorageFrom() const;void setPageToCloneSessionStorageFrom(WeakPtr<WebKit::WebPageProxy>&&);-@@ -534,6 +538,7 @@ private:+@@ -297,7 +301,7 @@ public:+ #if ENABLE(APP_BOUND_DOMAINS)+ bool ignoresAppBoundDomains() const { return m_data.ignoresAppBoundDomains; }+ void setIgnoresAppBoundDomains(bool shouldIgnore) { m_data.ignoresAppBoundDomains = shouldIgnore; }+-+++ bool limitsNavigationsToAppBoundDomains() const { return m_data.limitsNavigationsToAppBoundDomains; }+ void setLimitsNavigationsToAppBoundDomains(bool limits) { m_data.limitsNavigationsToAppBoundDomains = limits; }+ #endif+@@ -442,7 +446,7 @@ public:++ bool isLockdownModeExplicitlySet() const;+ bool lockdownModeEnabled() const;+-+++ bool isEnhancedSecurityEnabled() const;++ void setAllowTestOnlyIPC(bool enabled) { m_data.allowTestOnlyIPC = enabled; }+@@ -531,6 +535,7 @@ private:#endifRefPtr<WebKit::WebPageGroup> pageGroup;WeakPtr<WebKit::WebPageProxy> relatedPage;@@ -8184,7 +7685,7 @@ index 684800f30c8fdbc796e6e051fd606cf1fe360f44..13f88317adbaa30d408abf737171dcd7WebCore::Site openedSite;WTF::String openedMainFrameName;diff --git a/Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.cpp b/Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.cpp-index c5f71591fa0cc654a597eb0e25c60b5f9632596c..3638376f2e8ddcf7fe70355e7cd1d70057f8907e 100644+index b909437495735fa6bb662d63f9a1f08552e012f2..2e21776b6adeb2ae8ef8cfc668e3d67c9120f5f2 100644--- a/Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.cpp+++ b/Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.cpp@@ -52,6 +52,10 @@ Ref<ProcessPoolConfiguration> ProcessPoolConfiguration::copy()@@ -8199,13 +7700,28 @@ index c5f71591fa0cc654a597eb0e25c60b5f9632596c..3638376f2e8ddcf7fe70355e7cd1d700copy->m_shouldTakeUIBackgroundAssertion = this->m_shouldTakeUIBackgroundAssertion;copy->m_shouldCaptureDisplayInUIProcess = this->m_shouldCaptureDisplayInUIProcess;diff --git a/Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.h b/Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.h-index 24c73a26a542863f734cb698daeceadf693c70e0..871a97de130d0d15396a3716eca055334e31cae2 100644+index 637b5c677a806040d62d2796cff59a7f1505a8fd..f02e0b487fb1550f8093e8a5306b26f0b2267564 100644--- a/Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.h+++ b/Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.h-@@ -96,6 +96,16 @@ public:+@@ -49,7 +49,7 @@ public:++ explicit ProcessPoolConfiguration();+ virtual ~ProcessPoolConfiguration();+-+++ Ref<ProcessPoolConfiguration> copy();++ bool usesSingleWebProcess() const { return m_usesSingleWebProcess; }+@@ -92,10 +92,20 @@ public:++ bool attrStyleEnabled() const { return m_attrStyleEnabled; }+ void setAttrStyleEnabled(bool enabled) { m_attrStyleEnabled = enabled; }+-++bool shouldThrowExceptionForGlobalConstantRedeclaration() const { return m_shouldThrowExceptionForGlobalConstantRedeclaration; }void setShouldThrowExceptionForGlobalConstantRedeclaration(bool shouldThrow) { m_shouldThrowExceptionForGlobalConstantRedeclaration = shouldThrow; }-+-+++#if PLATFORM(MAC)+ bool forceOverlayScrollbars() const { return m_forceOverlayScrollbars; }+ void setForceOverlayScrollbars(bool forceOverlayScrollbars) { m_forceOverlayScrollbars = forceOverlayScrollbars; }@@ -8213,13 +7729,13 @@ index 24c73a26a542863f734cb698daeceadf693c70e0..871a97de130d0d15396a3716eca05533++ /* playwright revert fb205fb */+ const Vector<WTF::String>& overrideLanguages() const { return m_overrideLanguages; }-+ void setOverrideLanguages(Vector<WTF::String>&& languages) { m_overrideLanguages = WTFMove(languages); }++ void setOverrideLanguages(Vector<WTF::String>&& languages) { m_overrideLanguages = WTF::move(languages); }+ /* end playwright revert fb205fb */+bool alwaysRunsAtBackgroundPriority() const { return m_alwaysRunsAtBackgroundPriority; }void setAlwaysRunsAtBackgroundPriority(bool alwaysRunsAtBackgroundPriority) { m_alwaysRunsAtBackgroundPriority = alwaysRunsAtBackgroundPriority; }-@@ -181,6 +191,10 @@ private:+@@ -176,6 +186,10 @@ private:bool m_ignoreSynchronousMessagingTimeoutsForTesting { false };bool m_attrStyleEnabled { false };bool m_shouldThrowExceptionForGlobalConstantRedeclaration { true };@@ -8231,10 +7747,10 @@ index 24c73a26a542863f734cb698daeceadf693c70e0..871a97de130d0d15396a3716eca05533bool m_shouldTakeUIBackgroundAssertion { true };bool m_shouldCaptureDisplayInUIProcess { DEFAULT_CAPTURE_DISPLAY_IN_UI_PROCESS };diff --git a/Source/WebKit/UIProcess/API/APIUIClient.h b/Source/WebKit/UIProcess/API/APIUIClient.h-index 02569041290e3ea8c89a61bb82ca05b65acf0624..fb4cc85b71b966d8033767ae7a2d4ba91fbd172d 100644+index d9f80360027a2e0c9dd5a3594189dddfde53966d..c6862db4346514707fb84427123fb4ce568ffc99 100644--- a/Source/WebKit/UIProcess/API/APIUIClient.h+++ b/Source/WebKit/UIProcess/API/APIUIClient.h-@@ -116,6 +116,7 @@ public:+@@ -115,6 +115,7 @@ public:virtual void runJavaScriptAlert(WebKit::WebPageProxy&, const WTF::String&, WebKit::WebFrameProxy*, WebKit::FrameInfoData&&, Function<void()>&& completionHandler) { completionHandler(); }virtual void runJavaScriptConfirm(WebKit::WebPageProxy&, const WTF::String&, WebKit::WebFrameProxy*, WebKit::FrameInfoData&&, Function<void(bool)>&& completionHandler) { completionHandler(false); }virtual void runJavaScriptPrompt(WebKit::WebPageProxy&, const WTF::String&, const WTF::String&, WebKit::WebFrameProxy*, WebKit::FrameInfoData&&, Function<void(const WTF::String&)>&& completionHandler) { completionHandler(WTF::String()); }@@ -8243,7 +7759,7 @@ index 02569041290e3ea8c89a61bb82ca05b65acf0624..fb4cc85b71b966d8033767ae7a2d4ba9virtual void setStatusText(WebKit::WebPageProxy*, const WTF::String&) { }virtual void mouseDidMoveOverElement(WebKit::WebPageProxy&, const WebKit::WebHitTestResultData&, OptionSet<WebKit::WebEventModifier>) { }diff --git a/Source/WebKit/UIProcess/API/C/WKInspector.cpp b/Source/WebKit/UIProcess/API/C/WKInspector.cpp-index 1aa386d598a35dbda34161ed956d653a2da99bec..9aaeb894594f797931bac01314eb3e2ca8669855 100644+index 5c80a1fbd3be779d7d99d04e7f803cbc9de739b0..9d2b7166e4e12ab43a23f5cb9d12b8c0b825ef56 100644--- a/Source/WebKit/UIProcess/API/C/WKInspector.cpp+++ b/Source/WebKit/UIProcess/API/C/WKInspector.cpp@@ -28,6 +28,11 @@@@ -8286,7 +7802,7 @@ index 026121d114c5fcad84c1396be8d692625beaa3bd..edd6e5cae033124c589959a42522fde0}#endifdiff --git a/Source/WebKit/UIProcess/API/C/WKPage.cpp b/Source/WebKit/UIProcess/API/C/WKPage.cpp-index bb4436009c3d2b62e66be0c02e651be9b494d0e2..103a397323d52801d06b3868e5cb66e720b7a29f 100644+index d0fa40efed0a6c61d903058464bcdced85276d6c..0d99584472bebf4a95d0e34df63e6ea6b8abe251 100644--- a/Source/WebKit/UIProcess/API/C/WKPage.cpp+++ b/Source/WebKit/UIProcess/API/C/WKPage.cpp@@ -1912,6 +1912,13 @@ void WKPageSetPageUIClient(WKPageRef pageRef, const WKPageUIClientBase* wkClient@@ -8373,7 +7889,7 @@ index ae4a98c2fe5782eb2356dc8b6b486f6b44db6db3..62b2f3c351fe287af11c1ee2815f1fab// Version 15.WKPageDecidePolicyForSpeechRecognitionPermissionRequestCallback decidePolicyForSpeechRecognitionPermissionRequest;diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKUIDelegate.h b/Source/WebKit/UIProcess/API/Cocoa/WKUIDelegate.h-index 5057b0e45a90686bfc2252b37ecb587b14db9890..dea0a533a1a13328376abb29eb19aeafde39b49b 100644+index acaeaef1be6d64f16d56d966db12cf9bb1f0507e..bb81783b20e33f69ceef2d00785a2e9c811dabe8 100644--- a/Source/WebKit/UIProcess/API/Cocoa/WKUIDelegate.h+++ b/Source/WebKit/UIProcess/API/Cocoa/WKUIDelegate.h@@ -153,6 +153,12 @@ WK_SWIFT_UI_ACTOR@@ -8403,10 +7919,10 @@ index 47b1b5ed21a65035d9bef05a991845480cfa1e93..17bd5eeafa50f94062b6f2a1b178efbfNS_ASSUME_NONNULL_ENDdiff --git a/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm b/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm-index 7c1368d9d5a668498069370a24abb72e90de6aa2..a2b007e414d7b271182e505e13afe958d9666b6a 100644+index 083bb2ee778bfc04e66bfe261f81e0dfcb8496fb..c2138b162edc34a44163137745e9526447d24841 100644--- a/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm+++ b/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm-@@ -55,6 +55,7 @@+@@ -56,6 +56,7 @@#import "_WKWebPushActionInternal.h"#import "_WKWebsiteDataStoreConfigurationInternal.h"#import "_WKWebsiteDataStoreDelegate.h"@@ -8414,7 +7930,7 @@ index 7c1368d9d5a668498069370a24abb72e90de6aa2..a2b007e414d7b271182e505e13afe958#import <WebCore/Credential.h>#import <WebCore/RegistrableDomain.h>#import <WebCore/ResourceResponse.h>-@@ -521,6 +522,11 @@ - (void)removeDataOfTypes:(NSSet *)dataTypes modifiedSince:(NSDate *)date comple+@@ -517,6 +518,11 @@ - (void)removeDataOfTypes:(NSSet *)dataTypes modifiedSince:(NSDate *)date comple});}@@ -8569,7 +8085,7 @@ index da15690a3d5a783a96aa5557676abeb7c349061d..cf3c06c2f1e9def8fa342019770f03d3@property (nonatomic) BOOL processSwapsOnNavigationWithinSameNonHTTPFamilyProtocol WK_API_AVAILABLE(macos(12.0), ios(15.0));@property (nonatomic) BOOL prewarmsProcessesAutomatically WK_API_AVAILABLE(macos(10.14.4), ios(12.2));diff --git a/Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm b/Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm-index bb3ae06ac0364a9350befbc073c48b8f9d50e43b..2817e21943ddf5ea147beb5bd4607ca236268254 100644+index 450fd8f758f9b21abc0a29b628f6042b42281a8e..be99131c2427c18d2d29e86debdbf094afb839f6 100644--- a/Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm+++ b/Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm@@ -250,6 +250,16 @@ - (BOOL)processSwapsOnNavigation@@ -8617,10 +8133,10 @@ index 289e0dd591b20396fd3a1fd6a29fe8a7096bd703..e39ccf4f27a747e1f0ad07aad7b65e0b- (void)deallocdiff --git a/Source/WebKit/UIProcess/API/glib/WebKitBrowserInspector.cpp b/Source/WebKit/UIProcess/API/glib/WebKitBrowserInspector.cppnew file mode 100644-index 0000000000000000000000000000000000000000..575245fc1f279a75f7e74c26652cf772a2fc95b7+index 0000000000000000000000000000000000000000..77f295edf36e1f6ca156afbab06501ae6d0e8f11--- /dev/null+++ b/Source/WebKit/UIProcess/API/glib/WebKitBrowserInspector.cpp-@@ -0,0 +1,158 @@+@@ -0,0 +1,173 @@+/*+ * Copyright (C) 2019 Microsoft Corporation.+ *@@ -8650,6 +8166,7 @@ index 0000000000000000000000000000000000000000..575245fc1f279a75f7e74c26652cf772+#include "WebKitBrowserInspector.h"++#include "BrowserInspectorPipe.h"++#include "BrowserInspectorWebSocketServer.h"+#include "InspectorPlaywrightAgentClientGLib.h"+#include "WebKitBrowserInspectorPrivate.h"+#include "WebKitWebViewPrivate.h"@@ -8779,6 +8296,20 @@ index 0000000000000000000000000000000000000000..575245fc1f279a75f7e74c26652cf772+{+ WebKit::initializeBrowserInspectorPipe(makeUnique<WebKit::InspectorPlaywrightAgentClientGlib>(String::fromUTF8(defaultProxyURI), ignoreHosts));+}++++/**++ * webkit_browser_inspector_initialize_web_socket:++ * @port: port number to start the remote debugging server on++ * @defaultProxyURI: default proxy URI++ * @ignoreHosts: list of hosts to ignore for proxy++ *++ * Creates browser inspector and configures HTTP server to communicate with++ * remote debugging clients on the specified port.++ */++void webkit_browser_inspector_initialize_web_socket(unsigned port, const char* defaultProxyURI, const char* const* ignoreHosts)++{++ WebKit::initializeBrowserInspectorWebSocket(port, makeUnique<WebKit::InspectorPlaywrightAgentClientGlib>(String::fromUTF8(defaultProxyURI), ignoreHosts));++}diff --git a/Source/WebKit/UIProcess/API/glib/WebKitBrowserInspectorPrivate.h b/Source/WebKit/UIProcess/API/glib/WebKitBrowserInspectorPrivate.hnew file mode 100644index 0000000000000000000000000000000000000000..e0b1da48465c850f541532ed961d1b778bea6028@@ -8818,12 +8349,12 @@ 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 f07bac875d627da3b53f481ee67cb23d93158416..eb59181e28c0660cb0f389d7450832056af67069 100644+index ecbe5c804188309e51f606fa03fddd593674bc4d..0e71df3670f44be57c5b31aafa291dbfe60cfdd8 100644--- a/Source/WebKit/UIProcess/API/glib/WebKitProtocolHandler.cpp+++ b/Source/WebKit/UIProcess/API/glib/WebKitProtocolHandler.cpp-@@ -166,51 +166,7 @@ static bool canvasAccelerationEnabled(WebKitURISchemeRequest* request)+@@ -160,51 +160,7 @@ static bool canvasAccelerationEnabled(WebKitURISchemeRequest* request)+ return webkit_settings_get_enable_2d_canvas_acceleration(webkit_web_view_get_settings(webView));}- #endif-static bool uiProcessContextIsEGL()-{@@ -8873,7 +8404,7 @@ index f07bac875d627da3b53f481ee67cb23d93158416..eb59181e28c0660cb0f389d745083205// Base on function 'drmGetFormatName' from 'https://gitlab.freedesktop.org/mesa/drm/-/blob/main/xf86drm.c'.static String webkitDrmGetFormatName(uint32_t format){-@@ -264,42 +220,6 @@ static String modifierListToString(const Vector<uint64_t, 1>& modifiers)+@@ -258,47 +214,6 @@ static String modifierListToString(const Vector<uint64_t, 1>& modifiers)#endif}@@ -8895,6 +8426,11 @@ index f07bac875d627da3b53f481ee67cb23d93158416..eb59181e28c0660cb0f389d745083205- case RendererBufferDescription::Type::SharedMemory:- bufferDescription.append("Shared Memory: "_s, formatName);- break;+-#if OS(ANDROID)+- case RendererBufferDescription::Type::AHardwareBuffer:+- bufferDescription.append("AHardwareBuffer: "_s, formatName);+- break;+-#endif- }- switch (description.usage) {- case RendererBufferFormat::Usage::Rendering:@@ -8916,7 +8452,7 @@ index f07bac875d627da3b53f481ee67cb23d93158416..eb59181e28c0660cb0f389d745083205#if USE(GBM)static String preferredBufferFormats(WebKitURISchemeRequest* request, JSON::Array& jsonArray){-@@ -353,6 +273,87 @@ static String preferredBufferFormats(WebKitURISchemeRequest* request, JSON::Arra+@@ -352,6 +267,87 @@ static String preferredBufferFormats(WebKitURISchemeRequest* request, JSON::Arra}#endif // USE(GBM)#endif // USE(LIBDRM)@@ -9004,7 +8540,7 @@ index f07bac875d627da3b53f481ee67cb23d93158416..eb59181e28c0660cb0f389d745083205#endif // PLATFORM(GTK) || (PLATFORM(WPE) && ENABLE(WPE_PLATFORM))static String vblankMonitorType(const DisplayVBlankMonitor& monitor)-@@ -385,7 +386,6 @@ static String threadedRenderingInfo(const RenderProcessInfo& info)+@@ -382,7 +378,6 @@ static String threadedRenderingInfo(const RenderProcessInfo& info)static String supportedBufferFormats(const RenderProcessInfo& info, JSON::Array& jsonArray){StringBuilder builder;@@ -9012,7 +8548,7 @@ index f07bac875d627da3b53f481ee67cb23d93158416..eb59181e28c0660cb0f389d745083205for (const auto& format : info.supportedBufferFormats) {StringBuilder jsonStringBuilder;auto formatName = webkitDrmGetFormatName(format.fourcc);-@@ -400,7 +400,6 @@ static String supportedBufferFormats(const RenderProcessInfo& info, JSON::Array&+@@ -397,7 +392,6 @@ static String supportedBufferFormats(const RenderProcessInfo& info, JSON::Array&}jsonArray.pushString(jsonStringBuilder.toString());}@@ -9020,7 +8556,7 @@ index f07bac875d627da3b53f481ee67cb23d93158416..eb59181e28c0660cb0f389d745083205return builder.toString();}#endif-@@ -741,14 +740,18 @@ void WebKitProtocolHandler::handleGPU(WebKitURISchemeRequest* request, RenderPro+@@ -732,14 +726,18 @@ void WebKitProtocolHandler::handleGPU(WebKitURISchemeRequest* request, RenderProif (showBuffersInfo) {#if PLATFORM(GTK) || (PLATFORM(WPE) && ENABLE(WPE_PLATFORM))addTableRow(hardwareAccelerationObject, "Renderer"_s, dmabufRendererWithSupportedBuffers());@@ -9030,7 +8566,7 @@ index f07bac875d627da3b53f481ee67cb23d93158416..eb59181e28c0660cb0f389d745083205#if USE(GBM)auto jsonFormats = JSON::Array::create();auto formatsString = preferredBufferFormats(request, jsonFormats.get());- addTableRow(hardwareAccelerationObject, "Preferred buffer formats"_s, formatsString, WTFMove(jsonFormats));+ addTableRow(hardwareAccelerationObject, "Preferred buffer formats"_s, formatsString, WTF::move(jsonFormats));#endif- addTableRow(hardwareAccelerationObject, "Buffer format"_s, renderBufferDescription(request));#endif // USE(LIBDRM)@@ -9041,12 +8577,12 @@ index f07bac875d627da3b53f481ee67cb23d93158416..eb59181e28c0660cb0f389d745083205}diff --git a/Source/WebKit/UIProcess/API/glib/WebKitUIClient.cpp b/Source/WebKit/UIProcess/API/glib/WebKitUIClient.cpp-index 58db8106ba2912b6dc3bc6e4669c4ca3d6dba6af..9142592ff78edad31b6fe259260cc4fb0fcc00c6 100644+index e94ec4aae750773fdb635e2b302735f6821ae3ef..eb8547be6916f5f95dc3be86c35292b4f7d7b0c5 100644--- a/Source/WebKit/UIProcess/API/glib/WebKitUIClient.cpp+++ b/Source/WebKit/UIProcess/API/glib/WebKitUIClient.cpp@@ -102,6 +102,10 @@ private:page.makeViewBlankIfUnpaintedSinceLastLoadCommit();- webkitWebViewRunJavaScriptPrompt(m_webView, message.utf8(), defaultValue.utf8(), WTFMove(completionHandler));+ webkitWebViewRunJavaScriptPrompt(m_webView, message.utf8(), defaultValue.utf8(), WTF::move(completionHandler));}+ void handleJavaScriptDialog(WebPageProxy&, bool accept, const String& value) final+ {@@ -9056,10 +8592,10 @@ index 58db8106ba2912b6dc3bc6e4669c4ca3d6dba6af..9142592ff78edad31b6fe259260cc4fbbool canRunBeforeUnloadConfirmPanel() const final { return true; }diff --git a/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp b/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp-index b7ad2bb3f930650465ce118deebaeda0ded88814..32adb61370580ceb6f2f83e063fe792202779694 100644+index abf5d3f7cfa46b4e2552c8e3229ac4fea68489b8..ca4d7f72baba1af3c3b3340fb23690326471b9a3 100644--- a/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp+++ b/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp-@@ -430,10 +430,19 @@ static void webkitWebContextSetProperty(GObject* object, guint propID, const GVa+@@ -425,10 +425,19 @@ static void webkitWebContextSetProperty(GObject* object, guint propID, const GVa}}@@ -9079,7 +8615,7 @@ index b7ad2bb3f930650465ce118deebaeda0ded88814..32adb61370580ceb6f2f83e063fe7922GUniquePtr<char> bundleFilename(g_build_filename(injectedBundleDirectory(), INJECTED_BUNDLE_FILENAME, nullptr));WebKitWebContext* webContext = WEBKIT_WEB_CONTEXT(object);-@@ -492,6 +501,8 @@ static void webkitWebContextConstructed(GObject* object)+@@ -484,6 +493,8 @@ static void webkitWebContextConstructed(GObject* object)static void webkitWebContextDispose(GObject* object){@@ -9088,7 +8624,7 @@ index b7ad2bb3f930650465ce118deebaeda0ded88814..32adb61370580ceb6f2f83e063fe7922WebKitWebContextPrivate* priv = WEBKIT_WEB_CONTEXT(object)->priv;if (!priv->clientsDetached) {priv->clientsDetached = true;-@@ -953,6 +964,11 @@ WebKitNetworkSession* webkit_web_context_get_network_session_for_automation(WebK+@@ -945,6 +956,11 @@ WebKitNetworkSession* webkit_web_context_get_network_session_for_automation(WebKreturn nullptr;#endif}@@ -9125,7 +8661,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 c9a70dd4f86cb7ee3280c702e5f1c226c65f8d23..36c77bc83962e931ffa397c5145d788a40631a06 100644+index d232384bfd442590c8617d713cdc8d3a9c6bd5fe..71778e8188ea307580ac7a89c242c5c7d7318fea 100644--- a/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp+++ b/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp@@ -40,6 +40,7 @@@@ -9144,7 +8680,7 @@ index c9a70dd4f86cb7ee3280c702e5f1c226c65f8d23..36c77bc83962e931ffa397c5145d788aDECIDE_POLICY,PERMISSION_REQUEST,-@@ -531,6 +533,13 @@ GRefPtr<WebKitOptionMenu> WebKitWebViewClient::showOptionMenu(WebKitPopupMenu& p+@@ -535,6 +537,13 @@ GRefPtr<WebKitOptionMenu> WebKitWebViewClient::showOptionMenu(WebKitPopupMenu& pvoid WebKitWebViewClient::frameDisplayed(WKWPE::View&){@@ -9152,13 +8688,13 @@ index c9a70dd4f86cb7ee3280c702e5f1c226c65f8d23..36c77bc83962e931ffa397c5145d788a+#if USE(SKIA)+ sk_sp<SkImage> surface(webkitWebViewBackendTakeScreenshot(m_webView->priv->backend.get()));+ if (surface)-+ getPage(m_webView).inspectorController().didPaint(WTFMove(surface));++ getPage(m_webView).inspectorController().didPaint(WTF::move(surface));+#endif+{SetForScope inFrameDisplayedGuard(m_webView->priv->inFrameDisplayed, true);for (const auto& callback : m_webView->priv->frameDisplayedCallbacks) {-@@ -638,7 +647,7 @@ static gboolean webkitWebViewDecidePolicy(WebKitWebView*, WebKitPolicyDecision*+@@ -642,7 +651,7 @@ static gboolean webkitWebViewDecidePolicy(WebKitWebView*, WebKitPolicyDecision*static gboolean webkitWebViewPermissionRequest(WebKitWebView*, WebKitPermissionRequest* request){@@ -9167,7 +8703,7 @@ index c9a70dd4f86cb7ee3280c702e5f1c226c65f8d23..36c77bc83962e931ffa397c5145d788aif (WEBKIT_IS_POINTER_LOCK_PERMISSION_REQUEST(request)) {webkit_permission_request_allow(request);return TRUE;-@@ -961,6 +970,10 @@ static void webkitWebViewConstructed(GObject* object)+@@ -977,6 +986,10 @@ static void webkitWebViewConstructed(GObject* object)priv->websitePolicies = adoptGRef(webkit_website_policies_new());Ref configuration = priv->relatedView && priv->relatedView->priv->configurationForNextRelatedView ? priv->relatedView->priv->configurationForNextRelatedView.releaseNonNull() : webkitWebViewCreatePageConfiguration(webView);@@ -9175,10 +8711,10 @@ index c9a70dd4f86cb7ee3280c702e5f1c226c65f8d23..36c77bc83962e931ffa397c5145d788a+ // Playwright: REGRESSION(278896@main): Need to preserve configuration's preferences.+ configuration->setPreferences(webkitSettingsGetPreferences(priv->settings.get()));+- webkitWebViewCreatePage(webView, WTFMove(configuration));+ webkitWebViewCreatePage(webView, WTF::move(configuration));webkitWebContextWebViewCreated(priv->context.get(), webView);-@@ -2046,6 +2059,15 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass)+@@ -2068,6 +2081,15 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass)G_TYPE_BOOLEAN, 1,WEBKIT_TYPE_SCRIPT_DIALOG);@@ -9194,7 +8730,7 @@ index c9a70dd4f86cb7ee3280c702e5f1c226c65f8d23..36c77bc83962e931ffa397c5145d788a/*** WebKitWebView::decide-policy:* @web_view: the #WebKitWebView on which the signal is emitted-@@ -2836,6 +2858,23 @@ void webkitWebViewRunJavaScriptBeforeUnloadConfirm(WebKitWebView* webView, const+@@ -2858,6 +2880,23 @@ void webkitWebViewRunJavaScriptBeforeUnloadConfirm(WebKitWebView* webView, constwebkit_script_dialog_unref(webView->priv->currentScriptDialog);}@@ -9231,7 +8767,7 @@ index 4e16a2a088f6e48f43362850cc047da7de3c88ef..5ca5ae9572d2ed962d80a5dd67f8f379bool webkitWebViewIsScriptDialogRunning(WebKitWebView*, WebKitScriptDialog*);String webkitWebViewGetCurrentScriptDialogMessage(WebKitWebView*);diff --git a/Source/WebKit/UIProcess/API/glib/webkit.h.in b/Source/WebKit/UIProcess/API/glib/webkit.h.in-index 17162406b03ac58b27d3e359407dc6b7734d8510..f820dfe84a4b0a4d775b8df6b0c44c095ed87fc4 100644+index 9d13feb910ba0556e13e2b065531e285909c97a3..4a42710d90bdc43504da4e94b1527b88470cd202 100644--- a/Source/WebKit/UIProcess/API/glib/webkit.h.in+++ b/Source/WebKit/UIProcess/API/glib/webkit.h.in@@ -45,6 +45,7 @@@@ -9243,9 +8779,18 @@ index 17162406b03ac58b27d3e359407dc6b7734d8510..f820dfe84a4b0a4d775b8df6b0c44c09#include <@API_INCLUDE_PREFIX@/WebKitClipboardPermissionRequest.h>#include <@API_INCLUDE_PREFIX@/WebKitColorChooserRequest.h>diff --git a/Source/WebKit/UIProcess/API/gtk/PageClientImpl.cpp b/Source/WebKit/UIProcess/API/gtk/PageClientImpl.cpp-index d6c64a8f5cd1f676a8dd51a051dcbd9161f07573..1c7e24caab783dc80d4633fd021c811e503d3b59 100644+index 09776daa9a925ccd5e8015d8e9af4de9c9a2f62a..6e4bb294b8c8e1c03b628bc2d662e0fa4cfb1c3c 100644--- a/Source/WebKit/UIProcess/API/gtk/PageClientImpl.cpp+++ b/Source/WebKit/UIProcess/API/gtk/PageClientImpl.cpp+@@ -246,7 +246,7 @@ WebCore::IntPoint PageClientImpl::accessibilityScreenToRootView(const WebCore::I+ return screenToRootView(point);+ }++-WebCore::IntRect PageClientImpl::rootViewToAccessibilityScreen(const WebCore::IntRect& rect)++WebCore::IntRect PageClientImpl::rootViewToAccessibilityScreen(const WebCore::IntRect& rect)+ {+ return rootViewToScreen(rect);+ }@@ -255,6 +255,8 @@ void PageClientImpl::doneWithKeyEvent(const NativeWebKeyboardEvent& event, bool{if (wasEventHandled || event.type() != WebEventType::KeyDown || !event.nativeEvent())@@ -9262,13 +8807,13 @@ index d6c64a8f5cd1f676a8dd51a051dcbd9161f07573..1c7e24caab783dc80d4633fd021c811e-RefPtr<ViewSnapshot> PageClientImpl::takeViewSnapshot(std::optional<WebCore::IntRect>&& clipRect)+RefPtr<ViewSnapshot> PageClientImpl::takeViewSnapshot(std::optional<WebCore::IntRect>&& clipRect, bool nominalResolution){-- return webkitWebViewBaseTakeViewSnapshot(WEBKIT_WEB_VIEW_BASE(m_viewWidget), WTFMove(clipRect));-+ return webkitWebViewBaseTakeViewSnapshot(WEBKIT_WEB_VIEW_BASE(m_viewWidget), WTFMove(clipRect), nominalResolution);+- return webkitWebViewBaseTakeViewSnapshot(WEBKIT_WEB_VIEW_BASE(m_viewWidget), WTF::move(clipRect));++ return webkitWebViewBaseTakeViewSnapshot(WEBKIT_WEB_VIEW_BASE(m_viewWidget), WTF::move(clipRect), nominalResolution);}void PageClientImpl::didChangeContentSize(const IntSize& size)diff --git a/Source/WebKit/UIProcess/API/gtk/PageClientImpl.h b/Source/WebKit/UIProcess/API/gtk/PageClientImpl.h-index ae0d906fb4bb5ff323f1e494f866c1f24b4d1e0e..e62064b583cef05f6d7c5a47b0130a4fc7e21ec8 100644+index d78e37c1be9e07c2ec95ae95e8693018d822a4e3..b531b97a991603b0888e2659f8bd63d26d2120e3 100644--- a/Source/WebKit/UIProcess/API/gtk/PageClientImpl.h+++ b/Source/WebKit/UIProcess/API/gtk/PageClientImpl.h@@ -104,7 +104,7 @@ private:@@ -9282,10 +8827,10 @@ index ae0d906fb4bb5ff323f1e494f866c1f24b4d1e0e..e62064b583cef05f6d7c5a47b0130a4fvoid didPerformDragControllerAction() override;diff --git a/Source/WebKit/UIProcess/API/gtk/WebKitBrowserInspector.h b/Source/WebKit/UIProcess/API/gtk/WebKitBrowserInspector.hnew file mode 100644-index 0000000000000000000000000000000000000000..45221096280941d747ef3f46749b1466b2d70090+index 0000000000000000000000000000000000000000..1d6c987019e69d2e1ab97266d01180542534f4b0--- /dev/null+++ b/Source/WebKit/UIProcess/API/gtk/WebKitBrowserInspector.h-@@ -0,0 +1,81 @@+@@ -0,0 +1,86 @@+/*+ * Copyright (C) 2019 Microsoft Corporation.+ *@@ -9364,6 +8909,11 @@ index 0000000000000000000000000000000000000000..45221096280941d747ef3f46749b1466+webkit_browser_inspector_initialize_pipe (const char* defaultProxyURI,+ const char* const* ignoreHosts);+++WEBKIT_API void++webkit_browser_inspector_initialize_web_socket (unsigned port,++ const char* defaultProxyURI,++ const char* const* ignoreHosts);+++G_END_DECLS++#endif@@ -9381,10 +8931,10 @@ index 496079da90993ac37689b060b69ecd4a67c2b6a8..af30181ca922f16c0f6e245c70e5ce7dG_BEGIN_DECLSdiff --git a/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp b/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp-index df76f897d1060dda98472453fda4cc316102124c..e38dcd8e63dcdb41cae2336594e1eb0f1eae5424 100644+index 631ce852083435f7cd4f4a9464586df94511aecc..0a6c195381d12a98643bca74587bd56d58c4be41 100644--- a/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp+++ b/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp-@@ -2888,6 +2888,11 @@ void webkitWebViewBaseResetClickCounter(WebKitWebViewBase* webkitWebViewBase)+@@ -2879,6 +2879,11 @@ void webkitWebViewBaseResetClickCounter(WebKitWebViewBase* webkitWebViewBase)#endif}@@ -9396,7 +8946,7 @@ index df76f897d1060dda98472453fda4cc316102124c..e38dcd8e63dcdb41cae2336594e1eb0fvoid webkitWebViewBaseEnterAcceleratedCompositingMode(WebKitWebViewBase* webkitWebViewBase, const LayerTreeContext& layerTreeContext){ASSERT(webkitWebViewBase->priv->acceleratedBackingStore);-@@ -2944,12 +2949,12 @@ void webkitWebViewBasePageClosed(WebKitWebViewBase* webkitWebViewBase)+@@ -2935,12 +2940,12 @@ void webkitWebViewBasePageClosed(WebKitWebViewBase* webkitWebViewBase)webkitWebViewBase->priv->acceleratedBackingStore->update({ });}@@ -9465,7 +9015,7 @@ index 9091ae5198e765c2cfe0584d121afe4f88df3c0e..b0efedec419673ef2bfd0fd79406774evirtual void didChangePageID(WKWPE::View&) { }virtual void didReceiveUserMessage(WKWPE::View&, WebKit::UserMessage&&, CompletionHandler<void(WebKit::UserMessage&&)>&& completionHandler) { completionHandler(WebKit::UserMessage()); }diff --git a/Source/WebKit/UIProcess/API/wpe/PageClientImpl.cpp b/Source/WebKit/UIProcess/API/wpe/PageClientImpl.cpp-index eea16f6d30a313411de1accb074aa8dabb553b39..1bea5b67f4b3f2c980fd17132ac3de5f0132b9db 100644+index 1c346654cfcdcb3138a63af2f0ca5ad1748cd733..db8bcf38c093ece4b6078b58c856c280847b6fbd 100644--- a/Source/WebKit/UIProcess/API/wpe/PageClientImpl.cpp+++ b/Source/WebKit/UIProcess/API/wpe/PageClientImpl.cpp@@ -36,9 +36,12 @@@@ -9481,8 +9031,8 @@ index eea16f6d30a313411de1accb074aa8dabb553b39..1bea5b67f4b3f2c980fd17132ac3de5f#include "WebDateTimePicker.h"#include "WebKitPopupMenu.h"#include <WebCore/ActivityState.h>-@@ -59,6 +62,12 @@- #include <wpe/wpe-platform.h>+@@ -62,6 +65,12 @@+ #include <wpe/wpe.h>#endif+#if USE(SKIA)@@ -9494,7 +9044,16 @@ index eea16f6d30a313411de1accb074aa8dabb553b39..1bea5b67f4b3f2c980fd17132ac3de5fnamespace WebKit {WTF_MAKE_TZONE_ALLOCATED_IMPL(PageClientImpl);-@@ -306,14 +315,14 @@ Ref<WebContextMenuProxy> PageClientImpl::createContextMenuProxy(WebPageProxy& pa+@@ -230,7 +239,7 @@ WebCore::IntPoint PageClientImpl::accessibilityScreenToRootView(const WebCore::I++ WebCore::IntRect PageClientImpl::rootViewToAccessibilityScreen(const WebCore::IntRect& rect)+ {+- return rootViewToScreen(rect);++ return rootViewToScreen(rect);+ }++ void PageClientImpl::doneWithKeyEvent(const NativeWebKeyboardEvent&, bool)+@@ -318,14 +327,14 @@ Ref<WebContextMenuProxy> PageClientImpl::createContextMenuProxy(WebPageProxy& pa}#endif@@ -9513,23 +9072,23 @@ index eea16f6d30a313411de1accb074aa8dabb553b39..1bea5b67f4b3f2c980fd17132ac3de5f}RefPtr<WebDateTimePicker> PageClientImpl::createDateTimePicker(WebPageProxy& page)-@@ -566,11 +575,11 @@ void PageClientImpl::callAfterNextPresentationUpdate(CompletionHandler<void()>&&+@@ -585,11 +594,11 @@ void PageClientImpl::callAfterNextPresentationUpdate(CompletionHandler<void()>&&+ m_view.callAfterNextPresentationUpdate(WTF::move(callback));}- #if USE(SKIA)-RefPtr<ViewSnapshot> PageClientImpl::takeViewSnapshot(std::optional<WebCore::IntRect>&& clipRect)+RefPtr<ViewSnapshot> PageClientImpl::takeViewSnapshot(std::optional<WebCore::IntRect>&& clipRect, bool nominalResolution){#if ENABLE(WPE_PLATFORM)if (m_view.wpeView()) {-- auto snapshot = static_cast<WKWPE::ViewPlatform&>(m_view).takeViewSnapshot(WTFMove(clipRect));-+ auto snapshot = static_cast<WKWPE::ViewPlatform&>(m_view).takeViewSnapshot(WTFMove(clipRect), nominalResolution);+- auto snapshot = static_cast<WKWPE::ViewPlatform&>(m_view).takeViewSnapshot(WTF::move(clipRect));++ auto snapshot = static_cast<WKWPE::ViewPlatform&>(m_view).takeViewSnapshot(WTF::move(clipRect), nominalResolution);// FIXME Forward the Expected in https://webkit.org/b/300271if (snapshot)- return WTFMove(snapshot.value());-@@ -582,4 +591,11 @@ RefPtr<ViewSnapshot> PageClientImpl::takeViewSnapshot(std::optional<WebCore::Int+ return WTF::move(snapshot.value());+@@ -600,4 +609,11 @@ RefPtr<ViewSnapshot> PageClientImpl::takeViewSnapshot(std::optional<WebCore::Int+ return nullptr;}- #endif+#if ENABLE(DATE_AND_TIME_INPUT_TYPES)+RefPtr<WebDateTimePicker> PageClientImpl::createDateTimePicker(WebPageProxy& page)@@ -9540,57 +9099,57 @@ index eea16f6d30a313411de1accb074aa8dabb553b39..1bea5b67f4b3f2c980fd17132ac3de5f+} // namespace WebKitdiff --git a/Source/WebKit/UIProcess/API/wpe/PageClientImpl.h b/Source/WebKit/UIProcess/API/wpe/PageClientImpl.h-index ba703ee7750a35f796e8d82e1f0027fc6d75aad6..51f1a7f1728e1f6ee9eb1fdd8426534cb1453f9a 100644+index 5566ef5b4432632366679149f411659c7331ad9e..24c551315008d1a1c788144c149281ce27b45c10 100644--- a/Source/WebKit/UIProcess/API/wpe/PageClientImpl.h+++ b/Source/WebKit/UIProcess/API/wpe/PageClientImpl.h-@@ -189,7 +189,11 @@ private:+@@ -193,7 +193,11 @@ private:+WebKitWebResourceLoadManager* webResourceLoadManager() override;- #if USE(SKIA)- RefPtr<ViewSnapshot> takeViewSnapshot(std::optional<WebCore::IntRect>&&) override;+ RefPtr<ViewSnapshot> takeViewSnapshot(std::optional<WebCore::IntRect>&&, bool nominalResolution) override;-+#endif++#if ENABLE(DATE_AND_TIME_INPUT_TYPES)+ RefPtr<WebDateTimePicker> createDateTimePicker(WebPageProxy&) override;- #endif++#endifWKWPE::View& m_view;+ DefaultUndoController m_undoController;diff --git a/Source/WebKit/UIProcess/API/wpe/WPEWebViewPlatform.cpp b/Source/WebKit/UIProcess/API/wpe/WPEWebViewPlatform.cpp-index 05e5262945726478b99903ce2c1736a1e6b88382..39fa888c826d5017955eb93ee16a858cb95f0185 100644+index d2cb304f89e2a93d452dd69eb3fb72aa49b27af7..413078a5b0fd8aab3054881192f357e366158f5a 100644--- a/Source/WebKit/UIProcess/API/wpe/WPEWebViewPlatform.cpp+++ b/Source/WebKit/UIProcess/API/wpe/WPEWebViewPlatform.cpp-@@ -669,9 +669,9 @@ void ViewPlatform::callAfterNextPresentationUpdate(CompletionHandler<void()>&& c+@@ -637,9 +637,9 @@ void ViewPlatform::callAfterNextPresentationUpdate(CompletionHandler<void()>&& c+ }}- #if USE(SKIA)-Expected<Ref<ViewSnapshot>, String> ViewPlatform::takeViewSnapshot(std::optional<WebCore::IntRect>&& clipRect)+Expected<Ref<ViewSnapshot>, String> ViewPlatform::takeViewSnapshot(std::optional<WebCore::IntRect>&& clipRect, bool nominalResolution){-- return m_backingStore->takeSnapshot(WTFMove(clipRect));-+ return m_backingStore->takeSnapshot(WTFMove(clipRect), nominalResolution);+- return m_backingStore->takeSnapshot(WTF::move(clipRect));++ return m_backingStore->takeSnapshot(WTF::move(clipRect), nominalResolution);}- #endif+ } // namespace WKWPEdiff --git a/Source/WebKit/UIProcess/API/wpe/WPEWebViewPlatform.h b/Source/WebKit/UIProcess/API/wpe/WPEWebViewPlatform.h-index 28473fc1ab7f3410e8655f38544b61654bf5ae1d..3ff1fa0628d378781858f0d65c9144d63ad3ffe8 100644+index c3ca21d8e499d08a4e5ebf4a32290114abfae4ee..1de5446d0763256ac826a5e71e51e6d2838172f8 100644--- a/Source/WebKit/UIProcess/API/wpe/WPEWebViewPlatform.h+++ b/Source/WebKit/UIProcess/API/wpe/WPEWebViewPlatform.h-@@ -64,7 +64,7 @@ public:+@@ -63,7 +63,7 @@ public:+ static WebKit::WebPageProxy* platformWebPageProxyForGamepadInput();#endif- #if USE(SKIA)- Expected<Ref<WebKit::ViewSnapshot>, String> takeViewSnapshot(std::optional<WebCore::IntRect>&&);+ Expected<Ref<WebKit::ViewSnapshot>, String> takeViewSnapshot(std::optional<WebCore::IntRect>&&, bool nominalResolution);- #endifvoid updateAcceleratedSurface(uint64_t);+ WebKit::RendererBufferDescription renderBufferDescription() const;diff --git a/Source/WebKit/UIProcess/API/wpe/WebKitBrowserInspector.h b/Source/WebKit/UIProcess/API/wpe/WebKitBrowserInspector.hnew file mode 100644-index 0000000000000000000000000000000000000000..273c5105cdf1638955cea01128c9bbab3e64436c+index 0000000000000000000000000000000000000000..22baa003f1220a87d5c1012cd485a6fee1570b22--- /dev/null+++ b/Source/WebKit/UIProcess/API/wpe/WebKitBrowserInspector.h-@@ -0,0 +1,81 @@+@@ -0,0 +1,86 @@+/*+ * Copyright (C) 2019 Microsoft Corporation.+ *@@ -9669,14 +9228,19 @@ index 0000000000000000000000000000000000000000..273c5105cdf1638955cea01128c9bbab+webkit_browser_inspector_initialize_pipe (const char* defaultProxyURI,+ const char* const* ignoreHosts);+++WEBKIT_API void++webkit_browser_inspector_initialize_web_socket (unsigned port,++ const char* defaultProxyURI,++ const char* const* ignoreHosts);+++G_END_DECLS++#endifdiff --git a/Source/WebKit/UIProcess/API/wpe/WebKitWebViewBackend.cpp b/Source/WebKit/UIProcess/API/wpe/WebKitWebViewBackend.cpp-index 08e754111893d5f3c5dac7502b48ad2b3c760540..283f05d35729aee22659ab4b661686159ff9ad3b 100644+index 1e562cfa11689020bd927e57ada5f775bc92122c..0e61d0e1fae3b485686e79a9a7d3eba26391641f 100644--- a/Source/WebKit/UIProcess/API/wpe/WebKitWebViewBackend.cpp+++ b/Source/WebKit/UIProcess/API/wpe/WebKitWebViewBackend.cpp-@@ -54,6 +54,7 @@ struct _WebKitWebViewBackend {+@@ -56,6 +56,7 @@ struct _WebKitWebViewBackend {struct wpe_view_backend* backend;GDestroyNotify notifyCallback;gpointer notifyCallbackData;@@ -9684,7 +9248,7 @@ index 08e754111893d5f3c5dac7502b48ad2b3c760540..283f05d35729aee22659ab4b66168615int referenceCount { 1 };};-@@ -116,6 +117,19 @@ struct wpe_view_backend* webkit_web_view_backend_get_wpe_backend(WebKitWebViewBa+@@ -118,6 +119,19 @@ struct wpe_view_backend* webkit_web_view_backend_get_wpe_backend(WebKitWebViewBareturn viewBackend->backend;}@@ -9734,20 +9298,20 @@ index 16dcc1f69c38cd8ad630bc49d6d69feaa3aa811e..98677028c19c12c3b6d513bb5e45375a#endif /* WebKitWebViewBackend_h */diff --git a/Source/WebKit/UIProcess/API/wpe/WebKitWebViewBackendPrivate.h b/Source/WebKit/UIProcess/API/wpe/WebKitWebViewBackendPrivate.h-index 8987c95d8493e446e871545fc84306b279bb39b6..3e12d7f309f5bb76bde712b383d7c7c9bd682f26 100644+index 21131a4d26ba115f3249b227d3e1dabd42398c80..7b1a6e98f3c1fb5ef5d54f416c49ba3e6188dcf4 100644--- a/Source/WebKit/UIProcess/API/wpe/WebKitWebViewBackendPrivate.h+++ b/Source/WebKit/UIProcess/API/wpe/WebKitWebViewBackendPrivate.h-@@ -28,3 +28,5 @@ WTF_DECLARE_GREF_TRAITS(WebKitWebViewBackend)- }-+@@ -32,3 +32,5 @@ WTF_DECLARE_GREF_TRAITS(WebKitWebViewBackend)void webkitWebViewBackendUnref(WebKitWebViewBackend*);++ #endif // USE(LIBWPE)++PlatformImage webkitWebViewBackendTakeScreenshot(WebKitWebViewBackend*);diff --git a/Source/WebKit/UIProcess/Automation/WebAutomationSession.h b/Source/WebKit/UIProcess/Automation/WebAutomationSession.h-index 54577cd94e2ec622433ea371e9a7cd2a504f1027..a27b80dab0cb9fb2da75245a172d3ea3d8daca6c 100644+index cf391118d8ced9ab6d377183e754b3e886873f96..28e571afa5a241ec59f940cf806d4be3d137623a 100644--- a/Source/WebKit/UIProcess/Automation/WebAutomationSession.h+++ b/Source/WebKit/UIProcess/Automation/WebAutomationSession.h-@@ -309,6 +309,8 @@ public:+@@ -310,6 +310,8 @@ public:void didDestroyFrame(WebCore::FrameIdentifier);@@ -9756,7 +9320,7 @@ index 54577cd94e2ec622433ea371e9a7cd2a504f1027..a27b80dab0cb9fb2da75245a172d3ea3RefPtr<WebPageProxy> webPageProxyForHandle(const String&);String effectiveHandleForWebFrameProxy(const WebFrameProxy&);String handleForWebFrameID(std::optional<WebCore::FrameIdentifier>);-@@ -368,7 +370,6 @@ private:+@@ -369,7 +371,6 @@ private:// Get base64-encoded PNG data from a bitmap.static std::optional<String> platformGetBase64EncodedPNGData(WebCore::ShareableBitmap::Handle&&);@@ -9765,7 +9329,7 @@ index 54577cd94e2ec622433ea371e9a7cd2a504f1027..a27b80dab0cb9fb2da75245a172d3ea3// 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 cc393a86e0dce6398ad9c187506850eeaf12bd5a..ccaaed8903fc6a8401fa2cd215bee2a221a955a2 100644+index 3817cf179bda9613b9e1686becb4edf136a0d878..777a168267d119e3f0d48d171ee8a407714908fd 100644--- a/Source/WebKit/UIProcess/AuxiliaryProcessProxy.cpp+++ b/Source/WebKit/UIProcess/AuxiliaryProcessProxy.cpp@@ -175,7 +175,11 @@ void AuxiliaryProcessProxy::getLaunchOptions(ProcessLauncher::LaunchOptions& lau@@ -9781,10 +9345,10 @@ index cc393a86e0dce6398ad9c187506850eeaf12bd5a..ccaaed8903fc6a8401fa2cd215bee2a2platformGetLaunchOptions(launchOptions);}diff --git a/Source/WebKit/UIProcess/AuxiliaryProcessProxy.h b/Source/WebKit/UIProcess/AuxiliaryProcessProxy.h-index 5f0a7f0c9e4fc94b47a32e5cb32547592749dc13..e6e75a8de771482d5e57ce60f0f7763bf053eeac 100644+index 63ee6bf6200ef0de13beb434ffe4ffcce97a2760..7d3b0bb489753f2421575b76fb932f590ffb97d4 100644--- a/Source/WebKit/UIProcess/AuxiliaryProcessProxy.h+++ b/Source/WebKit/UIProcess/AuxiliaryProcessProxy.h-@@ -299,13 +299,16 @@ protected:+@@ -296,13 +296,16 @@ protected:InitializationActivityAndGrant initializationActivityAndGrant();@@ -9803,7 +9367,7 @@ index 5f0a7f0c9e4fc94b47a32e5cb32547592749dc13..e6e75a8de771482d5e57ce60f0f7763b// Connection::Clientdiff --git a/Source/WebKit/UIProcess/BackingStore.h b/Source/WebKit/UIProcess/BackingStore.h-index 945c62704e0b25f04e9ee4be88b21f88aeda8bd9..b57ea0f359ab586c88a7d463f2be437b780c267c 100644+index ed08cad66cd9f9726d4282eda40b7aa6f2d96c07..c71ace8ea14d50d1aa714eb9d6ab735a33e74aa3 100644--- a/Source/WebKit/UIProcess/BackingStore.h+++ b/Source/WebKit/UIProcess/BackingStore.h@@ -67,6 +67,11 @@ public:@@ -9929,6 +9493,18 @@ index 0000000000000000000000000000000000000000..cd66887de171cda7d15a8e4dc6dbff63+} // namespace WebKit++#endif // ENABLE(REMOTE_INSPECTOR)+diff --git a/Source/WebKit/UIProcess/Cocoa/SOAuthorization/SubFrameSOAuthorizationSession.h b/Source/WebKit/UIProcess/Cocoa/SOAuthorization/SubFrameSOAuthorizationSession.h+index d6458617d8c06283d0efc9a0432f0ed01c7716b9..22f56ace3b3e4e6799a4a742e8e77e6116111bc2 100644+--- a/Source/WebKit/UIProcess/Cocoa/SOAuthorization/SubFrameSOAuthorizationSession.h++++ b/Source/WebKit/UIProcess/Cocoa/SOAuthorization/SubFrameSOAuthorizationSession.h+@@ -31,6 +31,7 @@+ #include "NavigationSOAuthorizationSession.h"+ #include <WebCore/FrameIdentifier.h>+ #include <wtf/Deque.h>++#include <wtf/Markable.h>++ namespace WebKit {+diff --git a/Source/WebKit/UIProcess/Cocoa/SOAuthorization/WKSOAuthorizationDelegate.h b/Source/WebKit/UIProcess/Cocoa/SOAuthorization/WKSOAuthorizationDelegate.hindex 89d125f7742f81ead8c50f218ecb1771b8000636..baa6cf58ad502c6c033ee6293a6cc8d4ce608e7b 100644--- a/Source/WebKit/UIProcess/Cocoa/SOAuthorization/WKSOAuthorizationDelegate.h@@ -9942,7 +9518,7 @@ index 89d125f7742f81ead8c50f218ecb1771b8000636..baa6cf58ad502c6c033ee6293a6cc8d4namespace WebKit {diff --git a/Source/WebKit/UIProcess/Cocoa/UIDelegate.h b/Source/WebKit/UIProcess/Cocoa/UIDelegate.h-index 25a7c6c4def4db155ef9905913ef929c7d91acfd..afb3186629d7962540ac26e0bd69b4acc3c873b1 100644+index ef6fc3f7a8799ed657f81857ddae6dd764e1e630..5784fbd83cb53e4369590e901c02e98bd903de91 100644--- a/Source/WebKit/UIProcess/Cocoa/UIDelegate.h+++ b/Source/WebKit/UIProcess/Cocoa/UIDelegate.h@@ -105,6 +105,7 @@ private:@@ -9953,7 +9529,7 @@ index 25a7c6c4def4db155ef9905913ef929c7d91acfd..afb3186629d7962540ac26e0bd69b4acvoid presentStorageAccessConfirmDialog(const WTF::String& requestingDomain, const WTF::String& currentDomain, CompletionHandler<void(bool)>&&);void requestStorageAccessConfirm(WebPageProxy&, WebFrameProxy*, const WebCore::RegistrableDomain& requestingDomain, const WebCore::RegistrableDomain& currentDomain, std::optional<WebCore::OrganizationStorageAccessPromptQuirk>&&, CompletionHandler<void(bool)>&&) final;void decidePolicyForGeolocationPermissionRequest(WebPageProxy&, WebFrameProxy&, const FrameInfoData&, Function<void(bool)>&) final;-@@ -234,6 +235,7 @@ private:+@@ -233,6 +234,7 @@ private:bool webViewRunJavaScriptAlertPanelWithMessageInitiatedByFrameCompletionHandler : 1;bool webViewRunJavaScriptConfirmPanelWithMessageInitiatedByFrameCompletionHandler : 1;bool webViewRunJavaScriptTextInputPanelWithPromptDefaultTextInitiatedByFrameCompletionHandler : 1;@@ -9962,7 +9538,7 @@ index 25a7c6c4def4db155ef9905913ef929c7d91acfd..afb3186629d7962540ac26e0bd69b4acbool webViewRequestStorageAccessPanelForDomainUnderCurrentDomainForQuirkDomainsCompletionHandler : 1;bool webViewRunBeforeUnloadConfirmPanelWithMessageInitiatedByFrameCompletionHandler : 1;diff --git a/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm b/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm-index 0a31ce317a4ab0c83e3d735ec4108244f0418b52..b737c9fc3488373d8c65cdba103a2c2ab7d4a923 100644+index 6194164ab08094d2f1892b88acb7aa1813be65f6..0052a5a2bdc396ad458fae32aa6c239a302f85c4 100644--- a/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm+++ b/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm@@ -136,6 +136,7 @@ void UIDelegate::setDelegate(id<WKUIDelegate> delegate)@@ -9973,7 +9549,7 @@ index 0a31ce317a4ab0c83e3d735ec4108244f0418b52..b737c9fc3488373d8c65cdba103a2c2am_delegateMethods.webViewRequestStorageAccessPanelUnderFirstPartyCompletionHandler = [delegate respondsToSelector:@selector(_webView:requestStorageAccessPanelForDomain:underCurrentDomain:completionHandler:)];m_delegateMethods.webViewRequestStorageAccessPanelForDomainUnderCurrentDomainForQuirkDomainsCompletionHandler = [delegate respondsToSelector:@selector(_webView:requestStorageAccessPanelForDomain:underCurrentDomain:forQuirkDomains:completionHandler:)];m_delegateMethods.webViewRunBeforeUnloadConfirmPanelWithMessageInitiatedByFrameCompletionHandler = [delegate respondsToSelector:@selector(_webView:runBeforeUnloadConfirmPanelWithMessage:initiatedByFrame:completionHandler:)];-@@ -509,6 +510,15 @@ void UIDelegate::UIClient::runJavaScriptPrompt(WebPageProxy& page, const WTF::St+@@ -504,6 +505,15 @@ void UIDelegate::UIClient::runJavaScriptPrompt(WebPageProxy& page, const WTF::St}).get()];}@@ -9990,7 +9566,7 @@ index 0a31ce317a4ab0c83e3d735ec4108244f0418b52..b737c9fc3488373d8c65cdba103a2c2a{RefPtr uiDelegate = m_uiDelegate.get();diff --git a/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm b/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm-index d1360a8b2ae21ca5fd9088a6d5402c6e3d771cc5..b13e1c95b488c13a8097d5e0e82a63b71a9841ea 100644+index 8e48b5769f273384949ebc258555b82b43a52917..84009743aad7161ddb0edb30846dddc8d9ca7a44 100644--- a/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm+++ b/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm@@ -45,7 +45,9 @@@@ -10003,7 +9579,7 @@ index d1360a8b2ae21ca5fd9088a6d5402c6e3d771cc5..b13e1c95b488c13a8097d5e0e82a63b7#import "PlatformXRSystem.h"#import "PlaybackSessionManagerProxy.h"#import "RemoteLayerTreeCommitBundle.h"-@@ -396,11 +398,85 @@ bool WebPageProxy::scrollingUpdatesDisabledForTesting()+@@ -443,11 +445,85 @@ bool WebPageProxy::scrollingUpdatesDisabledForTesting()void WebPageProxy::startDrag(const DragItem& dragItem, ShareableBitmap::Handle&& dragImageHandle, const std::optional<NodeIdentifier>& nodeID){@@ -10012,7 +9588,7 @@ index d1360a8b2ae21ca5fd9088a6d5402c6e3d771cc5..b13e1c95b488c13a8097d5e0e82a63b7++ m_dragSelectionData = String([pasteboard name]);+ if (auto replyID = grantAccessToCurrentPasteboardData(String([pasteboard name]), [] () { }))-+ websiteDataStore().protectedNetworkProcess()->connection().waitForAsyncReplyAndDispatchImmediately<Messages::NetworkProcess::AllowFilesAccessFromWebProcess>(*replyID, 100_ms);++ protect(websiteDataStore().networkProcess())->connection().waitForAsyncReplyAndDispatchImmediately<Messages::NetworkProcess::AllowFilesAccessFromWebProcess>(*replyID, 100_ms);+ m_dragSourceOperationMask = WebCore::anyDragOperation();++ if (auto& info = dragItem.promisedAttachmentInfo) {@@ -10038,7 +9614,7 @@ index d1360a8b2ae21ca5fd9088a6d5402c6e3d771cc5..b13e1c95b488c13a8097d5e0e82a63b7+ }+if (RefPtr pageClient = this->pageClient())- pageClient->startDrag(dragItem, WTFMove(dragImageHandle), nodeID);+ pageClient->startDrag(dragItem, WTF::move(dragImageHandle), nodeID);}-#endif@@ -10090,25 +9666,13 @@ index d1360a8b2ae21ca5fd9088a6d5402c6e3d771cc5..b13e1c95b488c13a8097d5e0e82a63b7#if ENABLE(ATTACHMENT_ELEMENT)-diff --git a/Source/WebKit/UIProcess/Cocoa/WebPasteboardProxyCocoa.mm b/Source/WebKit/UIProcess/Cocoa/WebPasteboardProxyCocoa.mm-index 21f455e9186f707167780ca297c1b667d279b980..2345886719fc849fedf763e5c839c17d095aa641 100644---- a/Source/WebKit/UIProcess/Cocoa/WebPasteboardProxyCocoa.mm-+++ b/Source/WebKit/UIProcess/Cocoa/WebPasteboardProxyCocoa.mm-@@ -34,6 +34,7 @@- #import "RemotePageProxy.h"- #import "SandboxExtension.h"- #import "WebPageProxy.h"-+#import "WebPageMessages.h"- #import "WebPreferences.h"- #import "WebProcessMessages.h"- #import "WebProcessProxy.h"diff --git a/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm b/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm-index f94fa02ea9f0a58ce472170f4c672fb5f57c6b5b..1d6b298364ef6ad8245621103c72569e7aeeb80f 100644+index 2fd431350646269a959b8f58ab73aa2f619fa0b6..27522c586432885cf6a8c6805d872f57c15cde4f 100644--- a/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm+++ b/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm-@@ -456,7 +456,7 @@ ALLOW_DEPRECATED_DECLARATIONS_END+@@ -453,7 +453,7 @@ ALLOW_DEPRECATED_DECLARATIONS_ENDauto screenProperties = WebCore::collectScreenProperties();- parameters.screenProperties = WTFMove(screenProperties);+ parameters.screenProperties = WTF::move(screenProperties);#if PLATFORM(MAC)- parameters.useOverlayScrollbars = ([NSScroller preferredScrollerStyle] == NSScrollerStyleOverlay);+ parameters.useOverlayScrollbars = m_configuration->forceOverlayScrollbars() || ([NSScroller preferredScrollerStyle] == NSScrollerStyleOverlay);@@ -10127,7 +9691,7 @@ index f94fa02ea9f0a58ce472170f4c672fb5f57c6b5b..1d6b298364ef6ad8245621103c72569em_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 b0e9367b33f7bc34b956e2eee96af22feee558f3..049ddd3368f2863476f42026f545ec01675ffc92 100644+index be40fa0e3e3e8698c29f70a2b8dac324225aba97..4e6cc206ed0a25914d8df604f61746562fd9c976 100644--- a/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp+++ b/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp@@ -33,6 +33,7 @@@@ -10138,35 +9702,35 @@ index b0e9367b33f7bc34b956e2eee96af22feee558f3..049ddd3368f2863476f42026f545ec01#include "WebPageProxy.h"#include "WebPreferences.h"#include "WebProcessPool.h"-@@ -40,9 +41,15 @@+@@ -40,6 +41,15 @@#include <WebCore/Region.h>#include <optional>#include <wtf/TZoneMallocInlines.h>+#include <wtf/Vector.h>-- #if PLATFORM(GTK)++++#if PLATFORM(GTK)+#include "WebKitWebViewBasePrivate.h"- #include <gtk/gtk.h>+#include <cairo.h>+#include <skia/core/SkImage.h>+#include <skia/core/SkSurface.h>+#include <skia/core/SkCanvas.h>- #endif++#endif#if USE(GLIB_EVENT_LOOP)-@@ -182,6 +189,11 @@ void DrawingAreaProxyCoordinatedGraphics::deviceScaleFactorDidChange(CompletionH- sendWithAsyncReply(Messages::DrawingArea::SetDeviceScaleFactor(page()->deviceScaleFactor()), WTFMove(completionHandler));+ #include <wtf/glib/RunLoopSourcePriority.h>+@@ -175,6 +185,11 @@ void DrawingAreaProxyCoordinatedGraphics::deviceScaleFactorDidChange(CompletionH+ sendWithAsyncReply(Messages::DrawingArea::SetDeviceScaleFactor(page()->deviceScaleFactor()), WTF::move(completionHandler));}+void DrawingAreaProxyCoordinatedGraphics::waitForSizeUpdate(Function<void (const DrawingAreaProxyCoordinatedGraphics&)>&& callback)+{-+ m_callbacks.append(WTFMove(callback));++ m_callbacks.append(WTF::move(callback));+}+void DrawingAreaProxyCoordinatedGraphics::setBackingStoreIsDiscardable(bool isBackingStoreDiscardable){- #if !PLATFORM(WPE)-@@ -243,6 +255,44 @@ void DrawingAreaProxyCoordinatedGraphics::updateAcceleratedCompositingMode(uint6+ #if !PLATFORM(WPE) && !PLATFORM(GTK)+@@ -234,6 +249,54 @@ void DrawingAreaProxyCoordinatedGraphics::updateAcceleratedCompositingMode(uint6updateAcceleratedCompositingMode(layerTreeContext);}@@ -10175,13 +9739,11 @@ index b0e9367b33f7bc34b956e2eee96af22feee558f3..049ddd3368f2863476f42026f545ec01+{+ RefPtr<cairo_surface_t> surface;+ if (isInAcceleratedCompositingMode()) {-+ AcceleratedBackingStore* backingStore = webkitWebViewBaseGetAcceleratedBackingStore(WEBKIT_WEB_VIEW_BASE(protectedPage()->viewWidget()));++ AcceleratedBackingStore* backingStore = webkitWebViewBaseGetAcceleratedBackingStore(WEBKIT_WEB_VIEW_BASE(protect(page())->viewWidget()));+ if (!backingStore)+ return;++ surface = backingStore->surface();-+ } else if (m_backingStore) {-+ surface = m_backingStore->surface();+ }++ if (!surface)@@ -10190,10 +9752,22 @@ index b0e9367b33f7bc34b956e2eee96af22feee558f3..049ddd3368f2863476f42026f545ec01+ if (cairo_surface_get_type(surface.get()) != CAIRO_SURFACE_TYPE_IMAGE)+ return;+-+ unsigned char* data = cairo_image_surface_get_data(surface.get());-+ int width = cairo_image_surface_get_width(surface.get());-+ int height = cairo_image_surface_get_height(surface.get());-+ int stride = cairo_image_surface_get_stride(surface.get());++ // 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<cairo_t> 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,@@ -10204,14 +9778,14 @@ index b0e9367b33f7bc34b956e2eee96af22feee558f3..049ddd3368f2863476f42026f545ec01+ if (!skImage)+ return;+-+ protectedPage()->inspectorController().didPaint(WTFMove(skImage));++ protect(page())->inspectorController().didPaint(WTF::move(skImage));+}+#endif // PLATFORM(GTK)+bool DrawingAreaProxyCoordinatedGraphics::alwaysUseCompositing() const{if (!page())-@@ -310,6 +360,12 @@ void DrawingAreaProxyCoordinatedGraphics::didUpdateGeometry()+@@ -301,6 +364,12 @@ void DrawingAreaProxyCoordinatedGraphics::didUpdateGeometry()// we need to resend the new size here.if (m_lastSentSize != size())sendUpdateGeometry();@@ -10223,9 +9797,9 @@ index b0e9367b33f7bc34b956e2eee96af22feee558f3..049ddd3368f2863476f42026f545ec01+ }}- #if !PLATFORM(WPE)+ #if !PLATFORM(WPE) && !PLATFORM(GTK)diff --git a/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h b/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h-index 61ce018548600fb7e4f3cdb3ee82b444d5b2429f..4e93f979cd98c36b24a08c00193b190a8a76af85 100644+index a77e650fb857ffe42b2d199c4788310100778cd5..8a9126c359e81e17f415f2f488eccae4dc240868 100644--- a/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h+++ b/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h@@ -29,6 +29,7 @@@@ -10247,16 +9821,16 @@ index 61ce018548600fb7e4f3cdb3ee82b444d5b2429f..4e93f979cd98c36b24a08c00193b190avoid dispatchAfterEnsuringDrawing(CompletionHandler<void()>&&);-@@ -129,6 +134,7 @@ private:+@@ -131,6 +136,7 @@ private:// The last size we sent to the web process.WebCore::IntSize m_lastSentSize;+ Vector<Function<void (const DrawingAreaProxyCoordinatedGraphics&)>> m_callbacks;- #if !PLATFORM(WPE)+ #if !PLATFORM(WPE) && !PLATFORM(GTK)bool m_isBackingStoreDiscardable { true };diff --git a/Source/WebKit/UIProcess/Downloads/DownloadProxy.cpp b/Source/WebKit/UIProcess/Downloads/DownloadProxy.cpp-index f84e75be2ecfd15ad97a45cac3a4bca4ec41faf2..73ef164a9eb25ae22032c35154d0c57a69e42ee9 100644+index ce2813559a25f93b355cca6e4106515bc4c52d89..313a44ad3b2e2fdd876641b2a0500c1f7d8f11e6 100644--- a/Source/WebKit/UIProcess/Downloads/DownloadProxy.cpp+++ b/Source/WebKit/UIProcess/Downloads/DownloadProxy.cpp@@ -41,8 +41,10 @@@@ -10285,9 +9859,9 @@ index f84e75be2ecfd15ad97a45cac3a4bca4ec41faf2..73ef164a9eb25ae22032c35154d0c57a{m_downloadIsCancelled = true;if (m_dataStore) {-- protectedDataStore()->protectedNetworkProcess()->sendWithAsyncReply(Messages::NetworkProcess::CancelDownload(m_downloadID), [weakThis = WeakPtr { *this }, completionHandler = WTFMove(completionHandler)] (std::span<const uint8_t> resumeData) mutable {+- protect(protect(m_dataStore)->networkProcess())->sendWithAsyncReply(Messages::NetworkProcess::CancelDownload(m_downloadID), [weakThis = WeakPtr { *this }, completionHandler = WTF::move(completionHandler)] (std::span<const uint8_t> resumeData) mutable {+ auto* instrumentation = m_dataStore->downloadInstrumentation();-+ protectedDataStore()->protectedNetworkProcess()->sendWithAsyncReply(Messages::NetworkProcess::CancelDownload(m_downloadID), [weakThis = WeakPtr { *this }, completionHandler = WTFMove(completionHandler), instrumentation] (std::span<const uint8_t> resumeData) mutable {++ protect(protect(m_dataStore)->networkProcess())->sendWithAsyncReply(Messages::NetworkProcess::CancelDownload(m_downloadID), [weakThis = WeakPtr { *this }, completionHandler = WTF::move(completionHandler), instrumentation] (std::span<const uint8_t> resumeData) mutable {RefPtr protectedThis = weakThis.get();if (!protectedThis)return completionHandler(nullptr);@@ -10311,9 +9885,9 @@ index f84e75be2ecfd15ad97a45cac3a4bca4ec41faf2..73ef164a9eb25ae22032c35154d0c57a+ if (*m_dataStore->allowDownloadForAutomation()) {+ destination = FileSystem::pathByAppendingComponent(m_dataStore->downloadPathForAutomation(), m_uuid);+ if (auto handle = SandboxExtension::createHandle(destination, SandboxExtension::Type::ReadWrite))-+ sandboxExtensionHandle = WTFMove(*handle);++ sandboxExtensionHandle = WTF::move(*handle);+ }-+ m_client->decidePlaceholderPolicy(*this, [completionHandler = WTFMove(completionHandler), destination = WTFMove(destination), sandboxExtensionHandle = WTFMove(sandboxExtensionHandle)] (WebKit::UseDownloadPlaceholder usePlaceholder, const URL& url) mutable {++ m_client->decidePlaceholderPolicy(*this, [completionHandler = WTF::move(completionHandler), destination = WTF::move(destination), sandboxExtensionHandle = WTF::move(sandboxExtensionHandle)] (WebKit::UseDownloadPlaceholder usePlaceholder, const URL& url) mutable {+ SandboxExtension::Handle placeHolderSandboxExtensionHandle;+ Vector<uint8_t> bookmarkData;+ Vector<uint8_t> activityTokenData;@@ -10322,18 +9896,18 @@ index f84e75be2ecfd15ad97a45cac3a4bca4ec41faf2..73ef164a9eb25ae22032c35154d0c57a+ activityTokenData = activityAccessToken();+#else+ if (auto handle = SandboxExtension::createHandle(url.fileSystemPath(), SandboxExtension::Type::ReadWrite))-+ placeHolderSandboxExtensionHandle = WTFMove(*handle);++ placeHolderSandboxExtensionHandle = WTF::move(*handle);+#endif-+ completionHandler(destination, WTFMove(sandboxExtensionHandle), AllowOverwrite::Yes, WebKit::UseDownloadPlaceholder::No, url, WTFMove(placeHolderSandboxExtensionHandle), bookmarkData.span(), activityTokenData.span());++ completionHandler(destination, WTF::move(sandboxExtensionHandle), AllowOverwrite::Yes, WebKit::UseDownloadPlaceholder::No, url, WTF::move(placeHolderSandboxExtensionHandle), bookmarkData.span(), activityTokenData.span());+ });+ return;+ }+- protectedClient()->decideDestinationWithSuggestedFilename(*this, response, ResourceResponseBase::sanitizeSuggestedFilename(suggestedFilename), [this, protectedThis = Ref { *this }, completionHandler = WTFMove(completionHandler)] (AllowOverwrite allowOverwrite, String destination) mutable {+ protect(client())->decideDestinationWithSuggestedFilename(*this, response, ResourceResponseBase::sanitizeSuggestedFilename(suggestedFilename), [this, protectedThis = Ref { *this }, completionHandler = WTF::move(completionHandler)] (AllowOverwrite allowOverwrite, String destination) mutable {SandboxExtension::Handle sandboxExtensionHandle;if (!destination.isNull()) {@@ -227,6 +262,8 @@ void DownloadProxy::didFinish()- protectedClient()->didFinish(*this);+ protect(client())->didFinish(*this);if (m_downloadIsCancelled)return;+ if (auto* instrumentation = m_dataStore->downloadInstrumentation())@@ -10344,17 +9918,17 @@ index f84e75be2ecfd15ad97a45cac3a4bca4ec41faf2..73ef164a9eb25ae22032c35154d0c57a@@ -241,6 +278,8 @@ void DownloadProxy::didFail(const ResourceError& error, std::span<const uint8_t>m_legacyResumeData = createData(resumeData);- protectedClient()->didFail(*this, error, m_legacyResumeData.get());+ protect(client())->didFail(*this, error, m_legacyResumeData.get());+ if (auto* instrumentation = m_dataStore->downloadInstrumentation())+ instrumentation->downloadFinished(m_uuid, error.localizedDescription());// This can cause the DownloadProxy object to be deleted.if (RefPtr downloadProxyMap = m_downloadProxyMap.get())diff --git a/Source/WebKit/UIProcess/Downloads/DownloadProxy.h b/Source/WebKit/UIProcess/Downloads/DownloadProxy.h-index 0b5bf44fd50b6a0eaf815cb80d4f77093fadcab4..3d9841281b2541492116c813424b4ac202253b08 100644+index 2bb0d331b873d198227e896b18b1764dac69ab84..51b8a5cdca4e5dfb43b5ca8ee8800a3f1ebae7a2 100644--- a/Source/WebKit/UIProcess/Downloads/DownloadProxy.h+++ b/Source/WebKit/UIProcess/Downloads/DownloadProxy.h-@@ -167,6 +167,7 @@ private:+@@ -168,6 +168,7 @@ private:#if HAVE(MODERN_DOWNLOADPROGRESS)RefPtr<ProcessAssertion> m_assertion;#endif@@ -10363,7 +9937,7 @@ index 0b5bf44fd50b6a0eaf815cb80d4f77093fadcab4..3d9841281b2541492116c813424b4ac2} // namespace WebKitdiff --git a/Source/WebKit/UIProcess/DrawingAreaProxy.h b/Source/WebKit/UIProcess/DrawingAreaProxy.h-index 5ac89b08c0233dbb611025af9f324005d0a2ba15..ac43edcde0f3d2847141fbee5250dbbee18a7b78 100644+index f3aab33d3bce0fcf2574eaad58d9795b2de5a579..d8c78700ad256f3c6eea5bb303d9f28fd295741e 100644--- a/Source/WebKit/UIProcess/DrawingAreaProxy.h+++ b/Source/WebKit/UIProcess/DrawingAreaProxy.h@@ -96,6 +96,7 @@ public:@@ -10376,10 +9950,10 @@ index 5ac89b08c0233dbb611025af9f324005d0a2ba15..ac43edcde0f3d2847141fbee5250dbbevirtual void sizeToContentAutoSizeMaximumSizeDidChange() { }diff --git a/Source/WebKit/UIProcess/Inspector/Agents/InspectorScreencastAgent.cpp b/Source/WebKit/UIProcess/Inspector/Agents/InspectorScreencastAgent.cppnew file mode 100644-index 0000000000000000000000000000000000000000..4ff6583e19057909124c2b2aab3f444089b85584+index 0000000000000000000000000000000000000000..7f957949228527a2d647f9498e4131fdc721aa02--- /dev/null+++ b/Source/WebKit/UIProcess/Inspector/Agents/InspectorScreencastAgent.cpp-@@ -0,0 +1,343 @@+@@ -0,0 +1,287 @@+/*+ * Copyright (C) 2020 Microsoft Corporation.+ *@@ -10409,7 +9983,6 @@ index 0000000000000000000000000000000000000000..4ff6583e19057909124c2b2aab3f4440+#include "InspectorScreencastAgent.h"++#include "PageClient.h"-+#include "ScreencastEncoder.h"+#include "WebPageInspectorController.h"+#include "WebPageProxy.h"+#include "WebsiteDataStore.h"@@ -10449,6 +10022,8 @@ index 0000000000000000000000000000000000000000..4ff6583e19057909124c2b2aab3f4440++using namespace Inspector;+++WTF_MAKE_TZONE_ALLOCATED_IMPL(InspectorScreencastAgent);+++InspectorScreencastAgent::InspectorScreencastAgent(BackendDispatcher& backendDispatcher, Inspector::FrontendRouter& frontendRouter, WebPageProxy& page)+ : InspectorAgentBase("Screencast"_s)+ , m_frontendDispatcher(makeUnique<ScreencastFrontendDispatcher>(frontendRouter))@@ -10467,129 +10042,73 @@ index 0000000000000000000000000000000000000000..4ff6583e19057909124c2b2aab3f4440++void InspectorScreencastAgent::willDestroyFrontendAndBackend(DisconnectReason)+{-+ if (!m_encoder)-+ return;-+-+ // The agent may be destroyed when the callback is invoked.-+ m_encoder->finish([sessionID = m_page.websiteDataStore().sessionID(), screencastID = WTFMove(m_currentScreencastID)] {-+ if (WebPageInspectorController::observer())-+ WebPageInspectorController::observer()->didFinishScreencast(sessionID, screencastID);-+ });-+-+ m_encoder = nullptr;+}++#if USE(SKIA)+void InspectorScreencastAgent::didPaint(sk_sp<SkImage>&& surface)+{++ if (!m_screencast)++ return;++++ if (m_screencastFramesInFlight > kMaxFramesInFlight)++ return;+++ MonotonicTime timestamp = MonotonicTime::now();+ sk_sp<SkImage> image(surface);-+#if PLATFORM(WPE) || PLATFORM(WIN)+++ // Get actual image size (in device pixels).+ WebCore::IntSize displaySize(image->width(), image->height());-++ WebCore::IntSize drawingAreaSize = m_page.drawingArea()->size();+ drawingAreaSize.scale(m_page.deviceScaleFactor());-+ if (drawingAreaSize != displaySize) {++ if (drawingAreaSize != displaySize)+ return;-+ }-+#else-+ WebCore::IntSize displaySize = m_page.drawingArea()->size();-+#endif-+ // Do not WTFMove image here as it is used below-+ if (m_encoder)-+ m_encoder->encodeFrame(sk_sp<SkImage>(image), displaySize);-+ if (m_screencast) {-+ {-+ SkPixmap pixmap;-+ if (!image->peekPixels(&pixmap)) {-+ fprintf(stderr, "Failed to peek pixels from SkImage to compute hash\n");-+ return;-+ }-+ // Do not send the same frame over and over.-+ size_t len = pixmap.computeByteSize();-+ auto cryptoDigest = PAL::CryptoDigest::create(PAL::CryptoDigest::Algorithm::SHA_1);-+ cryptoDigest->addBytes(std::span(reinterpret_cast<const unsigned char*>(pixmap.addr()), len));-+ auto digest = cryptoDigest->computeHash();-+ if (m_lastFrameDigest == digest)-+ return;-+ m_lastFrameDigest = digest;-+ }-+-+ if (m_screencastFramesInFlight > kMaxFramesInFlight)-+ return;-+ // Scale image to fit width / height-+ double scale = std::min(m_screencastWidth / displaySize.width(), m_screencastHeight / displaySize.height());-+ if (scale < 1) {-+ SkBitmap dstBitmap;-+ dstBitmap.allocPixels(SkImageInfo::MakeN32Premul(displaySize.width() * scale, displaySize.height() * scale));-+ SkCanvas canvas(dstBitmap);-+ canvas.scale(scale, scale);-+ canvas.drawImage(image, 0, 0);-+ image = dstBitmap.asImage();-+ }+++ {+ SkPixmap pixmap;+ if (!image->peekPixels(&pixmap)) {-+ fprintf(stderr, "Failed to peek pixels from SkImage for JPEG encoding\n");++ fprintf(stderr, "Failed to peek pixels from SkImage to compute hash\n");+ return;+ }-+-+ SkJpegEncoder::Options options;-+ options.fQuality = 90;-+ SkDynamicMemoryWStream stream;-+ if (!SkJpegEncoder::Encode(&stream, pixmap, options)) {-+ fprintf(stderr, "Failed to encode image to JPEG\n");++ // Do not send the same frame over and over.++ size_t len = pixmap.computeByteSize();++ auto cryptoDigest = PAL::CryptoDigest::create(PAL::CryptoDigest::Algorithm::SHA_1);++ cryptoDigest->addBytes(std::span(reinterpret_cast<const unsigned char*>(pixmap.addr()), len));++ auto digest = cryptoDigest->computeHash();++ if (m_lastFrameDigest == digest)+ return;-+ }-+ sk_sp<SkData> jpegData = stream.detachAsData();-+ String result = base64EncodeToString(std::span(reinterpret_cast<const unsigned char*>(jpegData->data()), jpegData->size()));-+ ++m_screencastFramesInFlight;-+ m_frontendDispatcher->screencastFrame(result, timestamp.secondsSinceEpoch().value(), displaySize.width(), displaySize.height());++ m_lastFrameDigest = digest;+ }-+}-+#endif-+-+Inspector::Protocol::ErrorStringOr<String /* screencastID */> InspectorScreencastAgent::startVideo(const String& file, int width, int height, int toolbarHeight)-+{-+ if (m_encoder)-+ return makeUnexpected("Already recording"_s);-+-+ if (width < 10 || width > 10000 || height < 10 || height > 10000)-+ return makeUnexpected("Invalid size"_s);+-+ String errorString;-+ m_encoder = ScreencastEncoder::create(errorString, file, WebCore::IntSize(width, height));-+ if (!m_encoder)-+ return makeUnexpected(errorString);-+-+ m_currentScreencastID = createVersion4UUIDString();-+-+#if PLATFORM(MAC)-+ m_encoder->setOffsetTop(toolbarHeight);-+#endif-+-+ kickFramesStarted();-+ return { { m_currentScreencastID } };-+}++ // Scale image to fit width / height++ double scale = std::min(m_screencastWidth / displaySize.width(), m_screencastHeight / displaySize.height());++ if (scale < 1) {++ SkBitmap dstBitmap;++ dstBitmap.allocPixels(SkImageInfo::MakeN32Premul(displaySize.width() * scale, displaySize.height() * scale));++ SkCanvas canvas(dstBitmap);++ canvas.scale(scale, scale);++ canvas.drawImage(image, 0, 0);++ image = dstBitmap.asImage();++ }+-+void InspectorScreencastAgent::stopVideo(Ref<StopVideoCallback>&& callback)-+{-+ if (!m_encoder) {-+ callback->sendFailure("Not recording"_s);++ SkPixmap pixmap;++ if (!image->peekPixels(&pixmap)) {++ fprintf(stderr, "Failed to peek pixels from SkImage for JPEG encoding\n");+ return;+ }+-+ // The agent may be destroyed when the callback is invoked.-+ m_encoder->finish([sessionID = m_page.websiteDataStore().sessionID(), screencastID = WTFMove(m_currentScreencastID), callback = WTFMove(callback)] {-+ if (WebPageInspectorController::observer())-+ WebPageInspectorController::observer()->didFinishScreencast(sessionID, screencastID);-+ callback->sendSuccess();-+ });-+ m_encoder = nullptr;-+ if (!m_screencast)-+ m_framesAreGoing = false;++ SkJpegEncoder::Options options;++ options.fQuality = 90;++ SkDynamicMemoryWStream stream;++ if (!SkJpegEncoder::Encode(&stream, pixmap, options)) {++ fprintf(stderr, "Failed to encode image to JPEG\n");++ return;++ }++ sk_sp<SkData> jpegData = stream.detachAsData();++ String result = base64EncodeToString(std::span(reinterpret_cast<const unsigned char*>(jpegData->data()), jpegData->size()));++ ++m_screencastFramesInFlight;++ m_frontendDispatcher->screencastFrame(result, timestamp.secondsSinceEpoch().value(), displaySize.width(), displaySize.height());+}++#endif++Inspector::Protocol::ErrorStringOr<int /* generation */> InspectorScreencastAgent::startScreencast(int width, int height, int toolbarHeight, int quality)+{@@ -10619,8 +10138,7 @@ index 0000000000000000000000000000000000000000..4ff6583e19057909124c2b2aab3f4440+ if (!m_screencast)+ return makeUnexpected("Not screencasting"_s);+ m_screencast = false;-+ if (!m_encoder)-+ m_framesAreGoing = false;++ m_framesAreGoing = false;+ return { };+}+@@ -10638,10 +10156,11 @@ index 0000000000000000000000000000000000000000..4ff6583e19057909124c2b2aab3f4440+#if !PLATFORM(WPE)+void InspectorScreencastAgent::scheduleFrameEncoding()+{-+ if (!m_encoder && !m_screencast)++ if (!m_screencast)+ return;+-+ RunLoop::mainSingleton().dispatchAfter(Seconds(1.0 / ScreencastEncoder::fps), [agent = WeakPtr { this }]() mutable {++ const int fps = 25;++ RunLoop::mainSingleton().dispatchAfter(Seconds(1.0 / fps), [agent = WeakPtr { this }]() mutable {+ if (!agent)+ return;+ if (!agent->m_page.hasPageClient())@@ -10656,8 +10175,9 @@ index 0000000000000000000000000000000000000000..4ff6583e19057909124c2b2aab3f4440+#if PLATFORM(MAC)+void InspectorScreencastAgent::encodeFrame()+{-+ if (!m_encoder && !m_screencast)++ if (!m_screencast)+ return;+++ RetainPtr<CGImageRef> imageRef = m_page.pageClient()->takeSnapshotForAutomation();+ if (m_screencast && m_screencastFramesInFlight <= kMaxFramesInFlight) {+ MonotonicTime timestamp = MonotonicTime::now();@@ -10693,15 +10213,13 @@ index 0000000000000000000000000000000000000000..4ff6583e19057909124c2b2aab3f4440+ m_lastFrameDigest = digest;+ }+ }-+ if (m_encoder)-+ m_encoder->encodeFrame(WTFMove(imageRef));+}+#endif++#if PLATFORM(GTK)+void InspectorScreencastAgent::encodeFrame()+{-+ if (!m_encoder && !m_screencast)++ if (!m_screencast)+ return;++ if (auto* drawingArea = m_page.drawingArea())@@ -10710,629 +10228,26 @@ index 0000000000000000000000000000000000000000..4ff6583e19057909124c2b2aab3f4440+#endif++#if PLATFORM(WIN)-+void InspectorScreencastAgent::encodeFrame()-+{-+ if (!m_encoder && !m_screencast)-+ return;-+-+ if (auto* drawingArea = m_page.drawingArea())-+ static_cast<DrawingAreaProxyWC*>(drawingArea)->captureFrame();-+}-+#endif-+-+} // namespace WebKit-+-+WTF_ALLOW_UNSAFE_BUFFER_USAGE_END-diff --git a/Source/WebKit/UIProcess/Inspector/Agents/InspectorScreencastAgent.h b/Source/WebKit/UIProcess/Inspector/Agents/InspectorScreencastAgent.h-new file mode 100644-index 0000000000000000000000000000000000000000..e48ba1cc781e24afaa765661c713cef19ea2215b---- /dev/null-+++ b/Source/WebKit/UIProcess/Inspector/Agents/InspectorScreencastAgent.h-@@ -0,0 +1,106 @@-+/*-+ * Copyright (C) 2020 Microsoft Corporation.-+ *-+ * Redistribution and use in source and binary forms, with or without-+ * modification, are permitted provided that the following conditions-+ * are met:-+ * 1. Redistributions of source code must retain the above copyright-+ * notice, this list of conditions and the following disclaimer.-+ * 2. Redistributions in binary form must reproduce the above copyright-+ * notice, this list of conditions and the following disclaimer in the-+ * documentation and/or other materials provided with the distribution.-+ *-+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS-+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT-+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR-+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT-+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,-+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT-+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,-+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY-+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT-+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE-+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.-+ */-+-+#pragma once-+-+#include <JavaScriptCore/InspectorAgentBase.h>-+#include <JavaScriptCore/InspectorBackendDispatchers.h>-+#include <JavaScriptCore/InspectorFrontendDispatchers.h>-+-+#include <wtf/Forward.h>-+#include <wtf/Noncopyable.h>-+#include <wtf/WeakPtr.h>-+-+#if USE(SKIA)-+#include <skia/core/SkImage.h>-+#endif-+-+namespace Inspector {-+class BackendDispatcher;-+class FrontendChannel;-+class FrontendRouter;-+class ScreencastFrontendDispatcher;-+}-+-+namespace WebKit {-+class InspectorScreencastAgent;-+}-+-+namespace WTF {-+template<typename T> struct IsDeprecatedWeakRefSmartPointerException;-+template<> struct IsDeprecatedWeakRefSmartPointerException<WebKit::InspectorScreencastAgent> : std::true_type { };-+}-+-+namespace WebKit {-+-+class ScreencastEncoder;-+class WebPageProxy;-+-+class InspectorScreencastAgent : public Inspector::InspectorAgentBase, public Inspector::ScreencastBackendDispatcherHandler, public CanMakeWeakPtr<InspectorScreencastAgent> {-+ WTF_MAKE_NONCOPYABLE(InspectorScreencastAgent);-+ WTF_DEPRECATED_MAKE_FAST_ALLOCATED(InspectorScreencastAgent);-+public:-+ InspectorScreencastAgent(Inspector::BackendDispatcher& backendDispatcher, Inspector::FrontendRouter& frontendRouter, WebPageProxy& page);-+ ~InspectorScreencastAgent() override;-+-+ void didCreateFrontendAndBackend() override;-+ void willDestroyFrontendAndBackend(Inspector::DisconnectReason) override;-+-+#if USE(SKIA)-+ void didPaint(sk_sp<SkImage>&& surface);-+#endif-+-+ Inspector::Protocol::ErrorStringOr<String /* screencastID */> startVideo(const String& file, int width, int height, int toolbarHeight) override;-+ void stopVideo(Ref<StopVideoCallback>&&) override;-+-+ Inspector::Protocol::ErrorStringOr<int /* generation */> startScreencast(int width, int height, int toolbarHeight, int quality) override;-+ Inspector::Protocol::ErrorStringOr<void> screencastFrameAck(int generation) override;-+ Inspector::Protocol::ErrorStringOr<void> stopScreencast() override;-+-+private:-+#if !PLATFORM(WPE)-+ void scheduleFrameEncoding();-+ void encodeFrame();-+#endif-+-+ void kickFramesStarted();-+-+ std::unique_ptr<Inspector::ScreencastFrontendDispatcher> m_frontendDispatcher;-+ Ref<Inspector::ScreencastBackendDispatcher> m_backendDispatcher;-+ WebPageProxy& m_page;-+ Vector<uint8_t> m_lastFrameDigest;-+ RefPtr<ScreencastEncoder> m_encoder;-+ bool m_screencast = false;-+ bool m_framesAreGoing = false;-+ double m_screencastWidth = 0;-+ double m_screencastHeight = 0;-+ int m_screencastQuality = 0;-+ int m_screencastToolbarHeight = 0;-+ int m_screencastGeneration = 0;-+ int m_screencastFramesInFlight = 0;-+ String m_currentScreencastID;-+};-+-+} // namespace WebKit-diff --git a/Source/WebKit/UIProcess/Inspector/Agents/ScreencastEncoder.cpp b/Source/WebKit/UIProcess/Inspector/Agents/ScreencastEncoder.cpp-new file mode 100644-index 0000000000000000000000000000000000000000..177f7f7c9a117bc5028f85b766427739e2e9cbc9---- /dev/null-+++ b/Source/WebKit/UIProcess/Inspector/Agents/ScreencastEncoder.cpp-@@ -0,0 +1,398 @@-+/*-+ * Copyright (c) 2010, The WebM Project authors. All rights reserved.-+ * Copyright (c) 2013 The Chromium Authors. All rights reserved.-+ * Copyright (C) 2020 Microsoft Corporation.-+ *-+ * Redistribution and use in source and binary forms, with or without-+ * modification, are permitted provided that the following conditions-+ * are met:-+ * 1. Redistributions of source code must retain the above copyright-+ * notice, this list of conditions and the following disclaimer.-+ * 2. Redistributions in binary form must reproduce the above copyright-+ * notice, this list of conditions and the following disclaimer in the-+ * documentation and/or other materials provided with the distribution.-+ *-+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS-+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT-+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR-+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT-+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,-+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT-+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,-+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY-+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT-+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE-+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.-+ */-+-+#include "config.h"-+#include "ScreencastEncoder.h"-+-+#include "WebMFileWriter.h"-+#include <algorithm>-+#include <libyuv.h>-+#include <vpx/vp8.h>-+#include <vpx/vp8cx.h>-+#include <vpx/vpx_encoder.h>-+#include <wtf/Compiler.h>-+#include <wtf/RunLoop.h>-+#include <wtf/UniqueArray.h>-+#include <wtf/WorkQueue.h>-+#include <wtf/text/MakeString.h>-+#include <wtf/text/StringConcatenateNumbers.h>-+-+#if USE(SKIA)-+#include <skia/core/SkBitmap.h>-+#include <skia/core/SkCanvas.h>-+#include <skia/core/SkData.h>-+#include <skia/core/SkImage.h>-+#endif-+-+WTF_ALLOW_UNSAFE_BUFFER_USAGE_BEGIN-+-+using namespace WebCore;-+-+namespace WebKit {-+-+namespace {-+-+struct VpxCodecDeleter {-+ void operator()(vpx_codec_ctx_t* codec) {-+ if (codec) {-+ vpx_codec_err_t ret = vpx_codec_destroy(codec);-+ if (ret != VPX_CODEC_OK)-+ fprintf(stderr, "Failed to encode frame: %s\n", vpx_codec_error(codec));-+ }-+ }-+};-+-+using ScopedVpxCodec = std::unique_ptr<vpx_codec_ctx_t, VpxCodecDeleter>;-+-+// Number of timebase unints per one frame.-+constexpr int timeScale = 1000;-+-+// Defines the dimension of a macro block. This is used to compute the active-+// map for the encoder.-+const int kMacroBlockSize = 16;-+-+void createImage(unsigned int width, unsigned int height,-+ std::unique_ptr<vpx_image_t>& out_image,-+ std::unique_ptr<uint8_t[]>& out_image_buffer) {-+ std::unique_ptr<vpx_image_t> image(new vpx_image_t());-+ memset(image.get(), 0, sizeof(vpx_image_t));-+-+ // libvpx seems to require both to be assigned.-+ image->d_w = width;-+ image->w = width;-+ image->d_h = height;-+ image->h = height;-+-+ // I420-+ image->fmt = VPX_IMG_FMT_YV12;-+ image->x_chroma_shift = 1;-+ image->y_chroma_shift = 1;-+-+ // libyuv's fast-path requires 16-byte aligned pointers and strides, so pad-+ // the Y, U and V planes' strides to multiples of 16 bytes.-+ const int y_stride = ((image->w - 1) & ~15) + 16;-+ const int uv_unaligned_stride = y_stride >> image->x_chroma_shift;-+ const int uv_stride = ((uv_unaligned_stride - 1) & ~15) + 16;-+-+ // libvpx accesses the source image in macro blocks, and will over-read-+ // if the image is not padded out to the next macroblock: crbug.com/119633.-+ // Pad the Y, U and V planes' height out to compensate.-+ // Assuming macroblocks are 16x16, aligning the planes' strides above also-+ // macroblock aligned them.-+ static_assert(kMacroBlockSize == 16, "macroblock_size_not_16");-+ const int y_rows = ((image->h - 1) & ~(kMacroBlockSize-1)) + kMacroBlockSize;-+ const int uv_rows = y_rows >> image->y_chroma_shift;-+-+ // Allocate a YUV buffer large enough for the aligned data & padding.-+ const int buffer_size = y_stride * y_rows + 2*uv_stride * uv_rows;-+ std::unique_ptr<uint8_t[]> image_buffer(new uint8_t[buffer_size]);-+-+ // Reset image value to 128 so we just need to fill in the y plane.-+ memset(image_buffer.get(), 128, buffer_size);-+-+ // Fill in the information for |image_|.-+ unsigned char* uchar_buffer =-+ reinterpret_cast<unsigned char*>(image_buffer.get());-+ image->planes[0] = uchar_buffer;-+ image->planes[1] = image->planes[0] + y_stride * y_rows;-+ image->planes[2] = image->planes[1] + uv_stride * uv_rows;-+ image->stride[0] = y_stride;-+ image->stride[1] = uv_stride;-+ image->stride[2] = uv_stride;-+-+ out_image = std::move(image);-+ out_image_buffer = std::move(image_buffer);-+}-+-+} // namespace-+-+class ScreencastEncoder::VPXFrame {-+ WTF_MAKE_NONCOPYABLE(VPXFrame);-+ WTF_DEPRECATED_MAKE_FAST_ALLOCATED(ScreencastEncoder::VPXFrame);-+public:-+#if USE(SKIA)-+ explicit VPXFrame(sk_sp<SkImage>&& surface)-+ : m_surface(WTFMove(surface))-+ { }-+#elif PLATFORM(MAC)-+ VPXFrame(RetainPtr<CGImageRef> windowImage, int offsetTop)-+ : m_windowImage(WTFMove(windowImage))-+ , m_offsetTop(offsetTop)-+ { }-+#endif-+-+ void setDuration(Seconds duration) { m_duration = duration; }-+ Seconds duration() const { return m_duration; }-+-+ void convertToVpxImage(vpx_image_t* image)-+ {-+#if USE(SKIA)-+ // Convert the updated region to YUV ready for encoding.-+ SkImageInfo info = SkImageInfo::Make(m_surface->width(), m_surface->height(), kN32_SkColorType, kPremul_SkAlphaType);-+ int argb_stride = info.minRowBytes();-+ size_t bufferSize = info.computeByteSize(argb_stride);-+ UniqueArray<uint8_t> buffer = makeUniqueArray<uint8_t>(bufferSize);-+ uint8_t* argb_data = buffer.get();-+ if (!m_surface->readPixels(info, argb_data, argb_stride, 0, 0))-+ fprintf(stderr, "Read SkImage to ARGB buffer\n");-+#elif PLATFORM(MAC)-+ int argb_stride = image->w * 4;-+ UniqueArray<uint8_t> buffer = makeUniqueArray<uint8_t>(argb_stride * image->h);-+ uint8_t* argb_data = buffer.get();-+ ScreencastEncoder::imageToARGB(m_windowImage.get(), argb_data, image->w, image->h, m_offsetTop);-+#endif-+ const int y_stride = image->stride[0];-+ ASSERT(image->stride[1] == image->stride[2]);-+ const int uv_stride = image->stride[1];-+ uint8_t* y_data = image->planes[0];-+ uint8_t* u_data = image->planes[1];-+ uint8_t* v_data = image->planes[2];-+-+ // TODO: redraw only damaged regions?-+ libyuv::ARGBToI420(argb_data, argb_stride,-+ y_data, y_stride,-+ u_data, uv_stride,-+ v_data, uv_stride,-+ image->w, image->h);-+ }-+-+private:-+#if USE(SKIA)-+ sk_sp<SkImage> m_surface;-+#elif PLATFORM(MAC)-+ RetainPtr<CGImageRef> m_windowImage;-+ int m_offsetTop { 0 };-+#endif-+ Seconds m_duration;-+};-+-+-+class ScreencastEncoder::VPXCodec {-+public:-+ VPXCodec(ScopedVpxCodec codec, vpx_codec_enc_cfg_t cfg, FILE* file)-+ : m_encoderQueue(WorkQueue::create("Screencast encoder"_s))-+ , m_codec(WTFMove(codec))-+ , m_cfg(cfg)-+ , m_file(file)-+ , m_writer(new WebMFileWriter(file, &m_cfg))-+ {-+ createImage(cfg.g_w, cfg.g_h, m_image, m_imageBuffer);-+ }-+-+ void encodeFrameAsync(std::unique_ptr<VPXFrame>&& frame)-+ {-+ m_encoderQueue->dispatch([this, frame = WTFMove(frame)] {-+ frame->convertToVpxImage(m_image.get());-+ double frameCount = frame->duration().seconds() * fps;-+ // For long duration repeat frame at 1 fps to ensure last frame duration is short enough.-+ // TODO: figure out why simply passing duration doesn't work well.-+ for (;frameCount > 1.5; frameCount -= 1) {-+ encodeFrame(m_image.get(), timeScale);-+ }-+ encodeFrame(m_image.get(), std::max<int>(1, frameCount * timeScale));-+ });-+ }-+-+ void finishAsync(Function<void()>&& callback)-+ {-+ m_encoderQueue->dispatch([this, callback = WTFMove(callback)] {-+ finish();-+ callback();-+ });-+ }-+-+private:-+ bool encodeFrame(vpx_image_t *img, int duration)-+ {-+ vpx_codec_iter_t iter = nullptr;-+ const vpx_codec_cx_pkt_t *pkt = nullptr;-+ int flags = 0;-+ const vpx_codec_err_t res = vpx_codec_encode(m_codec.get(), img, m_pts, duration, flags, VPX_DL_REALTIME);-+ if (res != VPX_CODEC_OK) {-+ fprintf(stderr, "Failed to encode frame: %s\n", vpx_codec_error(m_codec.get()));-+ return false;-+ }-+-+ bool gotPkts = false;-+ while ((pkt = vpx_codec_get_cx_data(m_codec.get(), &iter)) != nullptr) {-+ gotPkts = true;-+-+ if (pkt->kind == VPX_CODEC_CX_FRAME_PKT) {-+ if (!m_writer->writeFrame(pkt)) {-+ fprintf(stderr, "Failed to write compressed frame\n");-+ return false;-+ }-+ ++m_frameCount;-+ m_pts += pkt->data.frame.duration;-+ }-+ }-+-+ return gotPkts;-+ }-+-+ void finish()-+ {-+ // Flush encoder.-+ while (encodeFrame(nullptr, 1))-+ ++m_frameCount;-+-+ m_writer->finish();-+ fclose(m_file);-+ }-+-+ Ref<WorkQueue> m_encoderQueue;-+ ScopedVpxCodec m_codec;-+ vpx_codec_enc_cfg_t m_cfg;-+ FILE* m_file { nullptr };-+ std::unique_ptr<WebMFileWriter> m_writer;-+ int m_frameCount { 0 };-+ int64_t m_pts { 0 };-+ std::unique_ptr<uint8_t[]> m_imageBuffer;-+ std::unique_ptr<vpx_image_t> m_image;-+};-+-+ScreencastEncoder::ScreencastEncoder(std::unique_ptr<VPXCodec>&& vpxCodec, IntSize size)-+ : m_vpxCodec(WTFMove(vpxCodec))-+ , m_size(size)-+{-+ ASSERT(!size.isZero());-+}-+-+ScreencastEncoder::~ScreencastEncoder()-+{-+}-+-+RefPtr<ScreencastEncoder> ScreencastEncoder::create(String& errorString, const String& filePath, IntSize size)-+{-+ vpx_codec_iface_t* codec_interface = vpx_codec_vp8_cx();-+ if (!codec_interface) {-+ errorString = "Codec not found."_s;-+ return nullptr;-+ }-+-+ if (size.width() <= 0 || size.height() <= 0 || (size.width() % 2) != 0 || (size.height() % 2) != 0) {-+ errorString = makeString("Invalid frame size: "_s, size.width(), "x"_s, size.height());-+ return nullptr;-+ }-+-+ vpx_codec_enc_cfg_t cfg;-+ memset(&cfg, 0, sizeof(cfg));-+ vpx_codec_err_t error = vpx_codec_enc_config_default(codec_interface, &cfg, 0);-+ if (error) {-+ errorString = makeString("Failed to get default codec config: "_s, unsafeSpan(vpx_codec_err_to_string(error)));-+ return nullptr;-+ }-+-+ cfg.g_w = size.width();-+ cfg.g_h = size.height();-+ cfg.g_timebase.num = 1;-+ cfg.g_timebase.den = fps * timeScale;-+ cfg.g_error_resilient = VPX_ERROR_RESILIENT_DEFAULT;-+-+ ScopedVpxCodec codec(new vpx_codec_ctx_t);-+ if (vpx_codec_enc_init(codec.get(), codec_interface, &cfg, 0)) {-+ errorString = makeString("Failed to initialize encoder: "_s, unsafeSpan(vpx_codec_error(codec.get())));-+ return nullptr;-+ }-+-+ FILE* file = fopen(filePath.utf8().data(), "wb");-+ if (!file) {-+ errorString = makeString("Failed to open file '"_s, filePath, "' for writing: "_s, unsafeSpan(strerror(errno)));-+ return nullptr;-+ }-+-+ std::unique_ptr<VPXCodec> vpxCodec(new VPXCodec(WTFMove(codec), cfg, file));-+ return adoptRef(new ScreencastEncoder(WTFMove(vpxCodec), size));-+}-+-+void ScreencastEncoder::flushLastFrame()-+{-+ MonotonicTime now = MonotonicTime::now();-+ if (m_lastFrameTimestamp) {-+ // If previous frame encoding failed for some rason leave the timestampt intact.-+ if (!m_lastFrame)-+ return;-+-+ Seconds seconds = now - m_lastFrameTimestamp;-+ m_lastFrame->setDuration(seconds);-+ m_vpxCodec->encodeFrameAsync(WTFMove(m_lastFrame));-+ }-+ m_lastFrameTimestamp = now;-+}-+-+#if USE(SKIA)-+void ScreencastEncoder::encodeFrame(sk_sp<SkImage>&& image, IntSize size)-+{-+ flushLastFrame();-+ // Note that in WPE drawing area size is updated asynchronously and may differ from acutal-+ // size of the surface.-+ if (size.isZero()) {-+ return;-+ }-+ SkBitmap surface;-+ surface.allocPixels(SkImageInfo::Make(m_size.width(), m_size.height(), kBGRA_8888_SkColorType, kPremul_SkAlphaType));-+ SkCanvas canvas(surface);-+ SkMatrix transform;-+ if (size.width() > m_size.width() || size.height() > m_size.height()) {-+ // If no scale is specified shrink to fit the frame.-+ double scale = std::min(static_cast<double>(m_size.width()) / size.width(),-+ static_cast<double>(m_size.height()) / size.height());-+ transform.setScale(scale, scale);-+ canvas.setMatrix(transform);-+ }-+ // Record top left part of the drawing area that fits into the frame.-+ canvas.drawImage(image, 0, 0);-+ m_lastFrame = makeUnique<VPXFrame>(surface.asImage());-+}-+#elif PLATFORM(MAC)-+void ScreencastEncoder::encodeFrame(RetainPtr<CGImageRef>&& windowImage)-+{-+ flushLastFrame();-+-+ m_lastFrame = makeUnique<VPXFrame>(WTFMove(windowImage), m_offsetTop);-+}-+#endif-+-+void ScreencastEncoder::finish(Function<void()>&& callback)-+{-+ if (!m_vpxCodec) {-+ callback();-+ return;-+ }-+-+ flushLastFrame();-+ m_vpxCodec->finishAsync([protectRef = Ref { *this }, callback = WTFMove(callback)] () mutable {-+ RunLoop::mainSingleton().dispatch([callback = WTFMove(callback)] {-+ callback();-+ });-+ });-+}-+-+-+} // namespace WebKit-+-+WTF_ALLOW_UNSAFE_BUFFER_USAGE_END-diff --git a/Source/WebKit/UIProcess/Inspector/Agents/ScreencastEncoder.h b/Source/WebKit/UIProcess/Inspector/Agents/ScreencastEncoder.h-new file mode 100644-index 0000000000000000000000000000000000000000..a414e07b64a5b6ee58a777822761c87ec05605ac---- /dev/null-+++ b/Source/WebKit/UIProcess/Inspector/Agents/ScreencastEncoder.h-@@ -0,0 +1,80 @@-+/*-+ * Copyright (C) 2020 Microsoft Corporation.-+ *-+ * Redistribution and use in source and binary forms, with or without-+ * modification, are permitted provided that the following conditions-+ * are met:-+ * 1. Redistributions of source code must retain the above copyright-+ * notice, this list of conditions and the following disclaimer.-+ * 2. Redistributions in binary form must reproduce the above copyright-+ * notice, this list of conditions and the following disclaimer in the-+ * documentation and/or other materials provided with the distribution.-+ *-+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS-+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT-+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR-+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT-+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,-+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT-+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,-+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY-+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT-+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE-+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.-+ */-+-+#pragma once-+-+#include <WebCore/IntSize.h>-+#include <wtf/Forward.h>-+#include <wtf/MonotonicTime.h>-+#include <wtf/Noncopyable.h>-+#include <wtf/ThreadSafeRefCounted.h>-+#include <wtf/WeakPtr.h>-+-+#if USE(SKIA)-+#include <skia/core/SkImage.h>-+#endif-+-+namespace WebKit {-+-+class WebPageProxy;-+-+class ScreencastEncoder : public ThreadSafeRefCounted<ScreencastEncoder> {-+ WTF_MAKE_NONCOPYABLE(ScreencastEncoder);-+ WTF_DEPRECATED_MAKE_FAST_ALLOCATED(ScreencastEncoder);-+public:-+ static constexpr int fps = 25;-+-+ static RefPtr<ScreencastEncoder> create(String& errorString, const String& filePath, WebCore::IntSize);-+-+ class VPXCodec;-+ ScreencastEncoder(std::unique_ptr<VPXCodec>&&, WebCore::IntSize);-+ ~ScreencastEncoder();-+-+#if USE(SKIA)-+ void encodeFrame(sk_sp<SkImage>&&, WebCore::IntSize);-+#elif PLATFORM(MAC)-+ void encodeFrame(RetainPtr<CGImageRef>&&);-+ void setOffsetTop(int offset) { m_offsetTop = offset;}-+#endif-+-+ void finish(Function<void()>&& callback);-+-+private:-+ void flushLastFrame();-+#if PLATFORM(MAC)-+ static void imageToARGB(CGImageRef, uint8_t* rgba_data, int width, int height, int offsetTop);-+#endif++void InspectorScreencastAgent::encodeFrame()++{++ if (!m_screencast)++ return;+-+ std::unique_ptr<VPXCodec> m_vpxCodec;-+ const WebCore::IntSize m_size;-+ MonotonicTime m_lastFrameTimestamp;-+ class VPXFrame;-+ std::unique_ptr<VPXFrame> m_lastFrame;-+#if PLATFORM(MAC)-+ int m_offsetTop { 0 };++ if (auto* drawingArea = m_page.drawingArea())++ static_cast<DrawingAreaProxyWC*>(drawingArea)->captureFrame();++}+#endif-+};++} // namespace WebKit-diff --git a/Source/WebKit/UIProcess/Inspector/Agents/WebMFileWriter.cpp b/Source/WebKit/UIProcess/Inspector/Agents/WebMFileWriter.cpp++++WTF_ALLOW_UNSAFE_BUFFER_USAGE_END+diff --git a/Source/WebKit/UIProcess/Inspector/Agents/InspectorScreencastAgent.h b/Source/WebKit/UIProcess/Inspector/Agents/InspectorScreencastAgent.hnew file mode 100644-index 0000000000000000000000000000000000000000..9b269b356e206f0252245a1497adb0d05128c9b4+index 0000000000000000000000000000000000000000..afadd2371dffab9d4b92e4245f5622828c8fded1--- /dev/null-+++ b/Source/WebKit/UIProcess/Inspector/Agents/WebMFileWriter.cpp-@@ -0,0 +1,69 @@++++ b/Source/WebKit/UIProcess/Inspector/Agents/InspectorScreencastAgent.h+@@ -0,0 +1,100 @@+/*-+ * Copyright (c) 2014 The WebM project authors. All Rights Reserved.+ * Copyright (C) 2020 Microsoft Corporation.+ *+ * Redistribution and use in source and binary forms, with or without@@ -11357,113 +10272,86 @@ index 0000000000000000000000000000000000000000..9b269b356e206f0252245a1497adb0d0+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.+ */+-+#include "config.h"-+#include "WebMFileWriter.h"-+-+#include <string>-+#include "mkvmuxer/mkvmuxerutil.h"++#pragma once+-+namespace WebKit {++#include <JavaScriptCore/InspectorAgentBase.h>++#include <JavaScriptCore/InspectorBackendDispatchers.h>++#include <JavaScriptCore/InspectorFrontendDispatchers.h>+-+WebMFileWriter::WebMFileWriter(FILE* file, vpx_codec_enc_cfg_t* cfg)-+ : m_cfg(cfg)-+ , m_writer(new mkvmuxer::MkvWriter(file))-+ , m_segment(new mkvmuxer::Segment()) {-+ m_segment->Init(m_writer.get());-+ m_segment->set_mode(mkvmuxer::Segment::kFile);-+ m_segment->OutputCues(true);++#include <wtf/Forward.h>++#include <wtf/Noncopyable.h>++#include <wtf/WeakPtr.h>+-+ mkvmuxer::SegmentInfo* info = m_segment->GetSegmentInfo();-+ std::string version = "Playwright " + std::string(vpx_codec_version_str());-+ info->set_writing_app(version.c_str());++#if USE(SKIA)++#include <skia/core/SkImage.h>++#endif+-+ // Add vp8 track.-+ m_videoTrackId = m_segment->AddVideoTrack(-+ static_cast<int>(m_cfg->g_w), static_cast<int>(m_cfg->g_h), 0);-+ if (!m_videoTrackId) {-+ fprintf(stderr, "Failed to add video track\n");-+ }++namespace Inspector {++class BackendDispatcher;++class FrontendChannel;++class FrontendRouter;++class ScreencastFrontendDispatcher;+}+-+WebMFileWriter::~WebMFileWriter() {}-+-+bool WebMFileWriter::writeFrame(const vpx_codec_cx_pkt_t* pkt) {-+ int64_t pts_ns = pkt->data.frame.pts * 1000000000ll * m_cfg->g_timebase.num /-+ m_cfg->g_timebase.den;-+ return m_segment->AddFrame(static_cast<uint8_t*>(pkt->data.frame.buf),-+ pkt->data.frame.sz, m_videoTrackId, pts_ns,-+ pkt->data.frame.flags & VPX_FRAME_IS_KEY);++namespace WebKit {++class InspectorScreencastAgent;+}+-+void WebMFileWriter::finish() {-+ m_segment->Finalize();++namespace WTF {++template<typename T> struct IsDeprecatedWeakRefSmartPointerException;++template<> struct IsDeprecatedWeakRefSmartPointerException<WebKit::InspectorScreencastAgent> : std::true_type { };+}+-+} // namespace WebKit-diff --git a/Source/WebKit/UIProcess/Inspector/Agents/WebMFileWriter.h b/Source/WebKit/UIProcess/Inspector/Agents/WebMFileWriter.h-new file mode 100644-index 0000000000000000000000000000000000000000..e2ce910f3fd7f587add552275b7e7176cf8b2723---- /dev/null-+++ b/Source/WebKit/UIProcess/Inspector/Agents/WebMFileWriter.h-@@ -0,0 +1,53 @@-+/*-+ * Copyright (C) 2020 Microsoft Corporation.-+ *-+ * Redistribution and use in source and binary forms, with or without-+ * modification, are permitted provided that the following conditions-+ * are met:-+ * 1. Redistributions of source code must retain the above copyright-+ * notice, this list of conditions and the following disclaimer.-+ * 2. Redistributions in binary form must reproduce the above copyright-+ * notice, this list of conditions and the following disclaimer in the-+ * documentation and/or other materials provided with the distribution.-+ *-+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS-+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT-+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR-+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT-+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,-+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT-+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,-+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY-+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT-+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE-+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.-+ */-+-+#pragma once++namespace WebKit {+-+#include <memory>-+#include <stdio.h>-+#include <stdlib.h>-+#include "vpx/vpx_encoder.h"++class WebPageProxy;+-+#include "mkvmuxer/mkvmuxer.h"-+#include "mkvmuxer/mkvwriter.h"++class InspectorScreencastAgent : public Inspector::InspectorAgentBase, public Inspector::ScreencastBackendDispatcherHandler, public CanMakeWeakPtr<InspectorScreencastAgent> {++ WTF_MAKE_NONCOPYABLE(InspectorScreencastAgent);++ WTF_MAKE_TZONE_ALLOCATED(InspectorScreencastAgent);++public:++ InspectorScreencastAgent(Inspector::BackendDispatcher& backendDispatcher, Inspector::FrontendRouter& frontendRouter, WebPageProxy& page);++ ~InspectorScreencastAgent() override;+-+namespace WebKit {++ void didCreateFrontendAndBackend() override;++ void willDestroyFrontendAndBackend(Inspector::DisconnectReason) override;+-+class WebMFileWriter {-+public:-+ WebMFileWriter(FILE*, vpx_codec_enc_cfg_t* cfg);-+ ~WebMFileWriter();++#if USE(SKIA)++ void didPaint(sk_sp<SkImage>&& surface);++#endif+-+ bool writeFrame(const vpx_codec_cx_pkt_t* pkt);-+ void finish();++ Inspector::Protocol::ErrorStringOr<int /* generation */> startScreencast(int width, int height, int toolbarHeight, int quality) override;++ Inspector::Protocol::ErrorStringOr<void> screencastFrameAck(int generation) override;++ Inspector::Protocol::ErrorStringOr<void> stopScreencast() override;++private:-+ vpx_codec_enc_cfg_t* m_cfg = nullptr;-+ std::unique_ptr<mkvmuxer::MkvWriter> m_writer;-+ std::unique_ptr<mkvmuxer::Segment> m_segment;-+ uint64_t m_videoTrackId = 0;++#if !PLATFORM(WPE)++ void scheduleFrameEncoding();++ void encodeFrame();++#endif++++ void kickFramesStarted();++++ std::unique_ptr<Inspector::ScreencastFrontendDispatcher> m_frontendDispatcher;++ Ref<Inspector::ScreencastBackendDispatcher> m_backendDispatcher;++ WebPageProxy& m_page;++ Vector<uint8_t> m_lastFrameDigest;++ bool m_screencast = false;++ bool m_framesAreGoing = false;++ double m_screencastWidth = 0;++ double m_screencastHeight = 0;++ int m_screencastQuality = 0;++ int m_screencastToolbarHeight = 0;++ int m_screencastGeneration = 0;++ int m_screencastFramesInFlight = 0;+};++} // namespace WebKitdiff --git a/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.cpp b/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.cpp-index ec94387154fae83a4a1f5d22e0d559c802ba365d..023b75cc64faffc0215082e10f8d070058980f85 100644+index 9816fe2f54d4f34ab6abe1ca7ac6062924693d31..30f3bb138d2c422d0f5efb2993a3f537008bbee6 100644--- a/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.cpp+++ b/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.cpp-@@ -26,16 +26,24 @@+@@ -26,17 +26,26 @@#include "config.h"#include "WebPageInspectorController.h"@@ -11474,6 +10362,7 @@ index ec94387154fae83a4a1f5d22e0d559c802ba365d..023b75cc64faffc0215082e10f8d0700+#include "InspectorDialogAgent.h"+#include "InspectorScreencastAgent.h"#include "ProvisionalPageProxy.h"++#include "WebFrameInspectorTarget.h"#include "WebFrameInspectorTargetProxy.h"#include "WebFrameProxy.h"#include "WebPageInspectorAgentBase.h"@@ -11482,13 +10371,14 @@ index ec94387154fae83a4a1f5d22e0d559c802ba365d..023b75cc64faffc0215082e10f8d0700#include "WebPageInspectorTarget.h"#include "WebPageInspectorTargetProxy.h"#include "WebPageProxy.h"+ #include "WebProcess/Inspector/WebFrameInspectorTarget.h"#include "WebsiteDataStore.h"+#include <WebCore/ResourceError.h>+#include <WebCore/WindowFeatures.h>#include <JavaScriptCore/InspectorAgentBase.h>#include <JavaScriptCore/InspectorBackendDispatcher.h>#include <JavaScriptCore/InspectorBackendDispatchers.h>-@@ -55,34 +63,115 @@ static String getTargetID(const ProvisionalPageProxy& provisionalPage)+@@ -56,6 +65,17 @@ static String getTargetID(const ProvisionalPageProxy& provisionalPage)WTF_MAKE_TZONE_ALLOCATED_IMPL(WebPageInspectorController);@@ -11506,37 +10396,24 @@ index ec94387154fae83a4a1f5d22e0d559c802ba365d..023b75cc64faffc0215082e10f8d0700WebPageInspectorController::WebPageInspectorController(WebPageProxy& inspectedPage): m_frontendRouter(FrontendRouter::create()), m_backendDispatcher(BackendDispatcher::create(m_frontendRouter.copyRef()))- , m_inspectedPage(inspectedPage)- {-- auto targetAgent = makeUniqueRef<InspectorTargetAgent>(m_frontendRouter, m_backendDispatcher);-- m_targetAgent = targetAgent.ptr();-- m_agents.append(WTFMove(targetAgent));- }-+@@ -69,16 +89,92 @@ WebPageInspectorController::WebPageInspectorController(WebPageProxy& inspectedPaWebPageInspectorController::~WebPageInspectorController() = default;--Ref<WebPageProxy> WebPageInspectorController::protectedInspectedPage()-+WeakRef<WebPageProxy> WebPageInspectorController::protectedInspectedPage()- {-- return m_inspectedPage.get();-+ return m_inspectedPage;- }-void WebPageInspectorController::init()+{+ auto targetAgent = makeUniqueRef<InspectorTargetAgent>(m_frontendRouter.get(), m_backendDispatcher.get());+ m_targetAgent = targetAgent.ptr();-+ m_agents.append(WTFMove(targetAgent));++ m_agents.append(WTF::move(targetAgent));+ auto emulationAgent = makeUniqueRef<WebPageInspectorEmulationAgent>(m_backendDispatcher.get(), m_inspectedPage);+ m_emulationAgent = emulationAgent.ptr();-+ m_agents.append(WTFMove(emulationAgent));++ m_agents.append(WTF::move(emulationAgent));+ auto inputAgent = makeUniqueRef<WebPageInspectorInputAgent>(m_backendDispatcher.get(), m_inspectedPage);+ m_inputAgent = inputAgent.ptr();-+ m_agents.append(WTFMove(inputAgent));++ m_agents.append(WTF::move(inputAgent));+ m_agents.append(makeUniqueRef<InspectorDialogAgent>(m_backendDispatcher.get(), m_frontendRouter.get(), m_inspectedPage));+ auto screencastAgent = makeUniqueRef<InspectorScreencastAgent>(m_backendDispatcher.get(), m_frontendRouter.get(), m_inspectedPage);+ m_screecastAgent = screencastAgent.ptr();-+ m_agents.append(WTFMove(screencastAgent));++ m_agents.append(WTF::move(screencastAgent));+ if (s_observer)+ s_observer->didCreateInspectorController(m_inspectedPage);+}@@ -11548,13 +10425,16 @@ index ec94387154fae83a4a1f5d22e0d559c802ba365d..023b75cc64faffc0215082e10f8d0700+ // we cannot event establish frontend connection.+ if (m_targets.contains(pageTargetId))+ return;- createWebPageInspectorTarget(pageTargetId, Inspector::InspectorTargetType::Page);+ addTarget(WebPageInspectorTargetProxy::create(protect(m_inspectedPage), pageTargetId, Inspector::InspectorTargetType::Page));++ if (m_inspectedPage->mainFrame())++ didCreateFrame(*m_inspectedPage->mainFrame());}void WebPageInspectorController::pageClosed(){+ String pageTargetId = WebPageInspectorTarget::toTargetID(m_inspectedPage->webPageIDInMainFrameProcess());-+ destroyInspectorTarget(pageTargetId);++ removeTarget(pageTargetId);+++disconnectAllFrontends();@@ -11609,7 +10489,7 @@ index ec94387154fae83a4a1f5d22e0d559c802ba365d..023b75cc64faffc0215082e10f8d0700}bool WebPageInspectorController::hasLocalFrontend() const-@@ -96,6 +185,14 @@ void WebPageInspectorController::connectFrontend(Inspector::FrontendChannel& fro+@@ -92,6 +188,14 @@ void WebPageInspectorController::connectFrontend(Inspector::FrontendChannel& frobool connectingFirstFrontend = !m_frontendRouter->hasFrontends();@@ -11624,7 +10504,7 @@ index ec94387154fae83a4a1f5d22e0d559c802ba365d..023b75cc64faffc0215082e10f8d0700m_frontendRouter->connectFrontend(frontendChannel);if (connectingFirstFrontend)-@@ -115,8 +212,10 @@ void WebPageInspectorController::disconnectFrontend(FrontendChannel& frontendCha+@@ -111,8 +215,10 @@ void WebPageInspectorController::disconnectFrontend(FrontendChannel& frontendCham_frontendRouter->disconnectFrontend(frontendChannel);bool disconnectingLastFrontend = !m_frontendRouter->hasFrontends();@@ -11636,7 +10516,7 @@ index ec94387154fae83a4a1f5d22e0d559c802ba365d..023b75cc64faffc0215082e10f8d0700Ref inspectedPage = m_inspectedPage.get();inspectedPage->didChangeInspectorFrontendCount(m_frontendRouter->frontendCount());-@@ -140,6 +239,8 @@ void WebPageInspectorController::disconnectAllFrontends()+@@ -136,6 +242,8 @@ void WebPageInspectorController::disconnectAllFrontends()// Disconnect any remaining remote frontends.m_frontendRouter->disconnectAllFrontends();@@ -11645,7 +10525,7 @@ index ec94387154fae83a4a1f5d22e0d559c802ba365d..023b75cc64faffc0215082e10f8d0700Ref inspectedPage = m_inspectedPage.get();inspectedPage->didChangeInspectorFrontendCount(m_frontendRouter->frontendCount());-@@ -168,6 +269,66 @@ void WebPageInspectorController::setIndicating(bool indicating)+@@ -164,11 +272,117 @@ void WebPageInspectorController::setIndicating(bool indicating)}#endif@@ -11655,20 +10535,20 @@ index ec94387154fae83a4a1f5d22e0d559c802ba365d..023b75cc64faffc0215082e10f8d0700+ if (!m_frontendRouter->hasFrontends())+ return;+-+ m_screecastAgent->didPaint(WTFMove(surface));++ m_screecastAgent->didPaint(WTF::move(surface));+}+#endif+++void WebPageInspectorController::navigate(WebCore::ResourceRequest&& request, WebFrameProxy* frame, NavigationHandler&& completionHandler)+{-+ auto navigation = m_inspectedPage->loadRequestForInspector(WTFMove(request), frame);++ auto navigation = m_inspectedPage->loadRequestForInspector(WTF::move(request), frame);+ if (!navigation) {+ completionHandler("Failed to navigate"_s, { });+ return;+ }+-+ m_pendingNavigations.set(navigation->navigationID(), WTFMove(completionHandler));++ m_pendingNavigations.set(navigation->navigationID(), WTF::move(completionHandler));+}++void WebPageInspectorController::didReceivePolicyDecision(WebCore::PolicyAction action, std::optional<WebCore::NavigationIdentifier> navigationID)@@ -11709,11 +10589,9 @@ index ec94387154fae83a4a1f5d22e0d559c802ba365d..023b75cc64faffc0215082e10f8d0700+ s_observer->didFailProvisionalLoad(m_inspectedPage, navigationID, error.localizedDescription());+}+- void WebPageInspectorController::createWebPageInspectorTarget(const String& targetId, Inspector::InspectorTargetType type)+ void WebPageInspectorController::sendMessageToInspectorFrontend(const String& targetId, const String& message){- addTarget(WebPageInspectorTargetProxy::create(protectedInspectedPage(), targetId, type));-@@ -192,6 +353,52 @@ void WebPageInspectorController::sendMessageToInspectorFrontend(const String& ta- checkedTargetAgent()->sendMessageFromTargetToFrontend(targetId, message);+ protect(m_targetAgent)->sendMessageFromTargetToFrontend(targetId, message);}+void WebPageInspectorController::setPauseOnStart(bool shouldPause)@@ -11759,29 +10637,31 @@ index ec94387154fae83a4a1f5d22e0d559c802ba365d..023b75cc64faffc0215082e10f8d0700+{+ auto* target = m_targets.get(WebPageInspectorTarget::toTargetID(m_inspectedPage->webPageIDInMainFrameProcess()));+ ASSERT(target);-+ target->setResumeCallback(WTFMove(callback));++ target->setResumeCallback(WTF::move(callback));+}+bool WebPageInspectorController::shouldPauseLoading(const ProvisionalPageProxy& provisionalPage) const{if (!m_frontendRouter->hasFrontends())-@@ -211,7 +418,7 @@ void WebPageInspectorController::setContinueLoadingCallback(const ProvisionalPag+@@ -188,7 +402,9 @@ void WebPageInspectorController::setContinueLoadingCallback(const ProvisionalPagvoid WebPageInspectorController::didCreateProvisionalPage(ProvisionalPageProxy& provisionalPage){- addTarget(WebPageInspectorTargetProxy::create(provisionalPage, getTargetID(provisionalPage), Inspector::InspectorTargetType::Page));+ addTarget(WebPageInspectorTargetProxy::create(provisionalPage, getTargetID(provisionalPage)));++ if (provisionalPage.mainFrame())++ didCreateFrame(*provisionalPage.mainFrame());}void WebPageInspectorController::willDestroyProvisionalPage(const ProvisionalPageProxy& provisionalPage)diff --git a/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.h b/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.h-index 43345234f9bbcdfac9c532e6b7e972002ef59eff..2a6418236f1ab9848c6e2828937bd4e14a9ebe9c 100644+index 009322b020c98cd1b3dd82c2ea144878f4ca6c30..d113975dcb1908a96fbd9a939be475a703570be5 100644--- a/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.h+++ b/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.h-@@ -27,20 +27,40 @@-+@@ -28,20 +28,40 @@#include "InspectorTargetProxy.h"#include "ProvisionalPageProxy.h"+ #include "UIProcess/WebFrameProxy.h"+#include "ProcessTerminationReason.h"#include <JavaScriptCore/InspectorAgentRegistry.h>#include <JavaScriptCore/InspectorTargetAgent.h>@@ -11819,7 +10699,7 @@ index 43345234f9bbcdfac9c532e6b7e972002ef59eff..2a6418236f1ab9848c6e2828937bd4e1}namespace WebKit {-@@ -49,6 +69,23 @@ class InspectorBrowserAgent;+@@ -50,6 +70,22 @@ class InspectorBrowserAgent;class ProvisionalPageProxy;struct WebPageAgentContext;@@ -11834,7 +10714,6 @@ index 43345234f9bbcdfac9c532e6b7e972002ef59eff..2a6418236f1ab9848c6e2828937bd4e1+ virtual void willDestroyInspectorController(WebPageProxy&) = 0;+ virtual void didFailProvisionalLoad(WebPageProxy&, WebCore::NavigationIdentifier, const String& error) = 0;+ virtual void willCreateNewPage(WebPageProxy&, const WebCore::WindowFeatures&, const URL&) = 0;-+ virtual void didFinishScreencast(const PAL::SessionID& sessionID, const String& screencastID) = 0;++protected:+ virtual ~WebPageInspectorControllerObserver() = default;@@ -11843,7 +10722,7 @@ index 43345234f9bbcdfac9c532e6b7e972002ef59eff..2a6418236f1ab9848c6e2828937bd4e1class WebPageInspectorController {WTF_MAKE_TZONE_ALLOCATED(WebPageInspectorController);WTF_MAKE_NONCOPYABLE(WebPageInspectorController);-@@ -57,7 +94,21 @@ public:+@@ -58,7 +94,21 @@ public:~WebPageInspectorController();void init();@@ -11865,7 +10744,7 @@ index 43345234f9bbcdfac9c532e6b7e972002ef59eff..2a6418236f1ab9848c6e2828937bd4e1bool hasLocalFrontend() const;-@@ -70,12 +121,28 @@ public:+@@ -71,9 +121,25 @@ public:#if ENABLE(REMOTE_INSPECTOR)void setIndicating(bool);#endif@@ -11880,9 +10759,6 @@ index 43345234f9bbcdfac9c532e6b7e972002ef59eff..2a6418236f1ab9848c6e2828937bd4e1++ void didFailProvisionalLoadForFrame(WebCore::NavigationIdentifier navigationID, const WebCore::ResourceError& error);- void createWebPageInspectorTarget(const String& targetId, Inspector::InspectorTargetType);- void createWebFrameInspectorTarget(WebFrameProxy&, const String& targetId);- void destroyInspectorTarget(const String& targetId);void sendMessageToInspectorFrontend(const String& targetId, const String& message);+ void setPauseOnStart(bool);@@ -11894,16 +10770,7 @@ index 43345234f9bbcdfac9c532e6b7e972002ef59eff..2a6418236f1ab9848c6e2828937bd4e1bool shouldPauseLoading(const ProvisionalPageProxy&) const;void setContinueLoadingCallback(const ProvisionalPageProxy&, WTF::Function<void()>&&);-@@ -90,7 +157,7 @@ public:- void browserExtensionsDisabled(HashSet<String>&&);-- private:-- Ref<WebPageProxy> protectedInspectedPage();-+ WeakRef<WebPageProxy> protectedInspectedPage();- CheckedPtr<Inspector::InspectorTargetAgent> checkedTargetAgent() { return m_targetAgent; }- WebPageAgentContext webPageAgentContext();- void createLazyAgents();-@@ -106,9 +173,16 @@ private:+@@ -105,9 +171,16 @@ private:CheckedPtr<Inspector::InspectorTargetAgent> m_targetAgent;HashMap<String, std::unique_ptr<InspectorTargetProxy>> m_targets;@@ -11921,7 +10788,7 @@ index 43345234f9bbcdfac9c532e6b7e972002ef59eff..2a6418236f1ab9848c6e2828937bd4e1} // namespace WebKitdiff --git a/Source/WebKit/UIProcess/Inspector/WebPageInspectorTargetProxy.cpp b/Source/WebKit/UIProcess/Inspector/WebPageInspectorTargetProxy.cpp-index 947a4447a396e492a41579fbfdc208e323aa3669..134d267b970d730d30b9b6c7838e9c4b1d715de7 100644+index 87072046c40465cfd162f9d87f7040d865fdafa4..4925473a5bd83438fa36e964810ac61fd6ea81d5 100644--- a/Source/WebKit/UIProcess/Inspector/WebPageInspectorTargetProxy.cpp+++ b/Source/WebKit/UIProcess/Inspector/WebPageInspectorTargetProxy.cpp@@ -59,6 +59,11 @@ std::unique_ptr<WebPageInspectorTargetProxy> WebPageInspectorTargetProxy::create@@ -11969,10 +10836,10 @@ index 947a4447a396e492a41579fbfdc208e323aa3669..134d267b970d730d30b9b6c7838e9c4b{return !!m_provisionalPage;diff --git a/Source/WebKit/UIProcess/Inspector/WebPageInspectorTargetProxy.h b/Source/WebKit/UIProcess/Inspector/WebPageInspectorTargetProxy.h-index 6d9cb376ca283266fbd206ef1c69168d83c7a864..b1a4f8a09be5f3b1dfd88ab2653e3cd104e970af 100644+index 619c7e0ed8c3d36120e9c2c5f7d55be0d9b2906b..a36aa3a97fe484e7ecca78d3e88a21a4f82f6923 100644--- a/Source/WebKit/UIProcess/Inspector/WebPageInspectorTargetProxy.h+++ b/Source/WebKit/UIProcess/Inspector/WebPageInspectorTargetProxy.h-@@ -43,6 +43,7 @@ class WebPageInspectorTargetProxy final : public InspectorTargetProxy {+@@ -44,6 +44,7 @@ class WebPageInspectorTargetProxy final : public InspectorTargetProxy {public:static std::unique_ptr<WebPageInspectorTargetProxy> create(WebPageProxy&, const String& targetId, Inspector::InspectorTargetType);static std::unique_ptr<WebPageInspectorTargetProxy> create(ProvisionalPageProxy&, const String& targetId, Inspector::InspectorTargetType);@@ -11980,7 +10847,7 @@ index 6d9cb376ca283266fbd206ef1c69168d83c7a864..b1a4f8a09be5f3b1dfd88ab2653e3cd1WebPageInspectorTargetProxy(WebPageProxy&, const String& targetId, Inspector::InspectorTargetType);void didCommitProvisionalTarget() override;-@@ -51,8 +52,13 @@ public:+@@ -52,8 +53,13 @@ public:void connect(Inspector::FrontendChannel::ConnectionType) override;void disconnect() override;void sendMessageToTargetBackend(const String&) override;@@ -11994,73 +10861,12 @@ index 6d9cb376ca283266fbd206ef1c69168d83c7a864..b1a4f8a09be5f3b1dfd88ab2653e3cd1WeakRef<WebPageProxy> m_page;WeakPtr<ProvisionalPageProxy> m_provisionalPage;};-diff --git a/Source/WebKit/UIProcess/Inspector/mac/ScreencastEncoderMac.mm b/Source/WebKit/UIProcess/Inspector/mac/ScreencastEncoderMac.mm-new file mode 100644-index 0000000000000000000000000000000000000000..6a04ee480bc3a8270a7de20b1cd0da718242b4c1---- /dev/null-+++ b/Source/WebKit/UIProcess/Inspector/mac/ScreencastEncoderMac.mm-@@ -0,0 +1,55 @@-+/*-+ * Copyright (C) 2020 Microsoft Corporation.-+ *-+ * Redistribution and use in source and binary forms, with or without-+ * modification, are permitted provided that the following conditions-+ * are met:-+ * 1. Redistributions of source code must retain the above copyright-+ * notice, this list of conditions and the following disclaimer.-+ * 2. Redistributions in binary form must reproduce the above copyright-+ * notice, this list of conditions and the following disclaimer in the-+ * documentation and/or other materials provided with the distribution.-+ *-+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS-+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT-+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR-+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT-+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,-+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT-+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,-+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY-+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT-+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE-+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.-+ */-+-+#include "config.h"-+#include "ScreencastEncoder.h"-+-+#include <algorithm>-+#include <CoreGraphics/CoreGraphics.h>-+#include <wtf/RetainPtr.h>-+-+namespace WebKit {-+-+void ScreencastEncoder::imageToARGB(CGImageRef image, uint8_t* argb_data, int width, int height, int offsetTop)-+{-+ size_t bitsPerComponent = 8;-+ size_t bytesPerPixel = 4;-+ size_t bytesPerRow = bytesPerPixel * width;-+ RetainPtr<CGColorSpaceRef> colorSpace = adoptCF(CGColorSpaceCreateDeviceRGB());-+ RetainPtr<CGContextRef> context = adoptCF(CGBitmapContextCreate(argb_data, width, height, bitsPerComponent, bytesPerRow, colorSpace.get(), (CGBitmapInfo)kCGImageAlphaNoneSkipFirst | kCGBitmapByteOrder32Little));-+ double imageWidth = CGImageGetWidth(image);-+ double imageHeight = CGImageGetHeight(image);-+ double pageHeight = imageHeight - offsetTop;-+ double ratio = 1;-+ if (imageWidth > width || pageHeight > height) {-+ ratio = std::min(width / imageWidth, height / pageHeight);-+ }-+ imageWidth *= ratio;-+ imageHeight *= ratio;-+ pageHeight *= ratio;-+ CGContextDrawImage(context.get(), CGRectMake(0, height - pageHeight, imageWidth, imageHeight), image);-+}-+-+} // namespace WebKitdiff --git a/Source/WebKit/UIProcess/InspectorDialogAgent.cpp b/Source/WebKit/UIProcess/InspectorDialogAgent.cppnew file mode 100644-index 0000000000000000000000000000000000000000..1c1a7640e41edfc9faf85e2bcd63e7eafbc4dc50+index 0000000000000000000000000000000000000000..53bf0625a4e6af2f4387b9a516604d5e6219cfef--- /dev/null+++ b/Source/WebKit/UIProcess/InspectorDialogAgent.cpp-@@ -0,0 +1,88 @@+@@ -0,0 +1,90 @@+/*+ * Copyright (C) 2019 Microsoft Corporation.+ *@@ -12099,6 +10905,8 @@ index 0000000000000000000000000000000000000000..1c1a7640e41edfc9faf85e2bcd63e7ea++using namespace Inspector;+++WTF_MAKE_TZONE_ALLOCATED_IMPL(InspectorDialogAgent);+++InspectorDialogAgent::InspectorDialogAgent(Inspector::BackendDispatcher& backendDispatcher, Inspector::FrontendRouter& frontendRouter, WebPageProxy& page)+ : InspectorAgentBase("Dialog"_s)+ , m_frontendDispatcher(makeUnique<DialogFrontendDispatcher>(frontendRouter))@@ -12151,7 +10959,7 @@ index 0000000000000000000000000000000000000000..1c1a7640e41edfc9faf85e2bcd63e7ea+} // namespace WebKitdiff --git a/Source/WebKit/UIProcess/InspectorDialogAgent.h b/Source/WebKit/UIProcess/InspectorDialogAgent.hnew file mode 100644-index 0000000000000000000000000000000000000000..7f5e7e87c2c1f76c5c3046cb5393d808d419a32f+index 0000000000000000000000000000000000000000..26775d9cfe30d220b14c1b2355a9baf9e6eca815--- /dev/null+++ b/Source/WebKit/UIProcess/InspectorDialogAgent.h@@ -0,0 +1,70 @@@@ -12203,7 +11011,7 @@ index 0000000000000000000000000000000000000000..7f5e7e87c2c1f76c5c3046cb5393d808++class InspectorDialogAgent : public Inspector::InspectorAgentBase, public Inspector::DialogBackendDispatcherHandler {+ WTF_MAKE_NONCOPYABLE(InspectorDialogAgent);-+ WTF_DEPRECATED_MAKE_FAST_ALLOCATED(InspectorDialogAgent);++ WTF_MAKE_TZONE_ALLOCATED(InspectorDialogAgent);+public:+ InspectorDialogAgent(Inspector::BackendDispatcher& backendDispatcher, Inspector::FrontendRouter& frontendRouter, WebPageProxy& page);+ ~InspectorDialogAgent() override;@@ -12227,10 +11035,10 @@ index 0000000000000000000000000000000000000000..7f5e7e87c2c1f76c5c3046cb5393d808+} // namespace WebKitdiff --git a/Source/WebKit/UIProcess/InspectorPlaywrightAgent.cpp b/Source/WebKit/UIProcess/InspectorPlaywrightAgent.cppnew file mode 100644-index 0000000000000000000000000000000000000000..13e45ef13e4d43dce84a8847bde2518af300a4d0+index 0000000000000000000000000000000000000000..f2bc9c6bbdf5ff20f8617070e62e247ec437f22a--- /dev/null+++ b/Source/WebKit/UIProcess/InspectorPlaywrightAgent.cpp-@@ -0,0 +1,1040 @@+@@ -0,0 +1,1033 @@+/*+ * Copyright (C) 2019 Microsoft Corporation.+ *@@ -12397,7 +11205,7 @@ index 0000000000000000000000000000000000000000..13e45ef13e4d43dce84a8847bde2518a+ auto provider = makeUnique<OverridenGeolocationProvider>();+ browserContext->geolocationProvider = *provider;+ auto* geoManager = browserContext->processPool->supplement<WebGeolocationManagerProxy>();-+ geoManager->setProvider(WTFMove(provider));++ geoManager->setProvider(WTF::move(provider));+}++String toBrowserContextIDProtocolString(const PAL::SessionID& sessionID)@@ -12515,9 +11323,9 @@ index 0000000000000000000000000000000000000000..13e45ef13e4d43dce84a8847bde2518a+ WTF_DEPRECATED_MAKE_FAST_ALLOCATED(InspectorPlaywrightAgent::BrowserContextDeletion);+public:+ BrowserContextDeletion(std::unique_ptr<BrowserContext>&& context, size_t numberOfPages, Ref<DeleteContextCallback>&& callback)-+ : m_browserContext(WTFMove(context))++ : m_browserContext(WTF::move(context))+ , m_numberOfPages(numberOfPages)-+ , m_callback(WTFMove(callback)) { }++ , m_callback(WTF::move(callback)) { }++ void didDestroyPage(const WebPageProxy& page)+ {@@ -12655,7 +11463,7 @@ index 0000000000000000000000000000000000000000..13e45ef13e4d43dce84a8847bde2518a+ page.inspectorController().connectFrontend(*pageProxyChannel);+ // Always pause new targets if controlled remotely.+ page.inspectorController().setPauseOnStart(true);-+ m_pageProxyChannels.set(pageProxyID, WTFMove(pageProxyChannel));++ m_pageProxyChannels.set(pageProxyID, WTF::move(pageProxyChannel));+ page.setFullScreenManagerClientOverride(makeUnique<PlaywrightFullScreenManagerProxyClient>(page));+}+@@ -12707,14 +11515,6 @@ index 0000000000000000000000000000000000000000..13e45ef13e4d43dce84a8847bde2518a+ getEnabledWindowFeatures(features));+}+-+void InspectorPlaywrightAgent::didFinishScreencast(const PAL::SessionID& sessionID, const String& screencastID)-+{-+ if (!m_isEnabled)-+ return;-+-+ m_frontendDispatcher->screencastFinished(screencastID);-+}-++static WebsiteDataStore* findDefaultWebsiteDataStore() {+ WebsiteDataStore* result = nullptr;+ WebsiteDataStore::forEachWebsiteDataStore([&result] (WebsiteDataStore& dataStore) {@@ -12743,7 +11543,7 @@ index 0000000000000000000000000000000000000000..13e45ef13e4d43dce84a8847bde2518a+ // Add default context to the map so that we can easily find it for+ // created/deleted pages.+ PAL::SessionID sessionID = context->dataStore->sessionID();-+ m_browserContexts.set(toBrowserContextIDProtocolString(sessionID), WTFMove(context));++ m_browserContexts.set(toBrowserContextIDProtocolString(sessionID), WTF::move(context));+ }++ WebsiteDataStore::forEachWebsiteDataStore([this] (WebsiteDataStore& dataStore) {@@ -12752,7 +11552,7 @@ index 0000000000000000000000000000000000000000..13e45ef13e4d43dce84a8847bde2518a+ for (Ref pool : WebProcessPool::allProcessPools()) {+ for (Ref process : pool->processes()) {+ for (Ref page : process->pages())-+ didCreateInspectorController(WTFMove(page));++ didCreateInspectorController(WTF::move(page));+ }+ }+ return { };@@ -12796,7 +11596,7 @@ index 0000000000000000000000000000000000000000..13e45ef13e4d43dce84a8847bde2518a++void InspectorPlaywrightAgent::close(Ref<CloseCallback>&& callback)+{-+ closeImpl([callback = WTFMove(callback)] (String error) {++ closeImpl([callback = WTF::move(callback)] (String error) {+ if (!callback->isActive())+ return;+ if (error.isNull())@@ -12815,7 +11615,7 @@ index 0000000000000000000000000000000000000000..13e45ef13e4d43dce84a8847bde2518a+ // all existing Web Processes wether in a pool or not.+ for (Ref process : WebProcessProxy::allProcessesForInspector()) {+ for (Ref page : process->pages())-+ pages.append(WTFMove(page));++ pages.append(WTF::move(page));+ }+ for (Ref page : pages)+ page->closePage();@@ -12826,7 +11626,7 @@ index 0000000000000000000000000000000000000000..13e45ef13e4d43dce84a8847bde2518a+ return;+ }+-+ m_defaultContext->dataStore->syncLocalStorage([this, callback = WTFMove(callback)] () {++ m_defaultContext->dataStore->syncLocalStorage([this, callback = WTF::move(callback)] () {+ if (m_client == nullptr) {+ callback("no platform delegate to close browser"_s);+ } else {@@ -12844,14 +11644,14 @@ index 0000000000000000000000000000000000000000..13e45ef13e4d43dce84a8847bde2518a+ if (!browserContext)+ return makeUnexpected(errorString);+-+ browserContext->enableStoragePartitioning = WTFMove(enableStoragePartitioning);++ browserContext->enableStoragePartitioning = WTF::move(enableStoragePartitioning);+ // Ensure network process.+ browserContext->dataStore->networkProcess();+ browserContext->dataStore->setDownloadInstrumentation(this);+ setGeolocationProvider(browserContext.get());+ PAL::SessionID sessionID = browserContext->dataStore->sessionID();+ String browserContextID = toBrowserContextIDProtocolString(sessionID);-+ m_browserContexts.set(browserContextID, WTFMove(browserContext));++ m_browserContexts.set(browserContextID, WTF::move(browserContext));+ return browserContextID;+}+@@ -12875,7 +11675,7 @@ index 0000000000000000000000000000000000000000..13e45ef13e4d43dce84a8847bde2518a+ if (pages.isEmpty()) {+ callback->sendSuccess();+ } else {-+ m_browserContextDeletions.set(browserContextID, makeUnique<BrowserContextDeletion>(WTFMove(contextHolder), pages.size(), WTFMove(callback)));++ m_browserContextDeletions.set(browserContextID, makeUnique<BrowserContextDeletion>(WTF::move(contextHolder), pages.size(), WTF::move(callback)));+ for (auto* page : pages)+ page->closePage();+ }@@ -12946,7 +11746,7 @@ index 0000000000000000000000000000000000000000..13e45ef13e4d43dce84a8847bde2518a+ }+ }+-+ pageProxyChannel->page().inspectorController().navigate(WTFMove(resourceRequest), frame, [callback = WTFMove(callback)](const String& error, Markable<WebCore::NavigationIdentifier> navigationID) {++ pageProxyChannel->page().inspectorController().navigate(WTF::move(resourceRequest), frame, [callback = WTF::move(callback)](const String& error, Markable<WebCore::NavigationIdentifier> navigationID) {+ if (!error.isEmpty()) {+ callback->sendFailure(error);+ return;@@ -12976,7 +11776,7 @@ index 0000000000000000000000000000000000000000..13e45ef13e4d43dce84a8847bde2518a+ }++ auto sandboxExtensionHandles = SandboxExtension::createReadOnlyHandlesForFiles("InspectorPlaywrightAgent::grantFileReadAccess"_s, files);-+ pageProxyChannel->page().legacyMainFrameProcess().send(Messages::WebPage::ExtendSandboxForFilesFromOpenPanel(WTFMove(sandboxExtensionHandles)), pageProxyChannel->page().webPageIDInMainFrameProcess());++ pageProxyChannel->page().legacyMainFrameProcess().send(Messages::WebPage::ExtendSandboxForFilesFromOpenPanel(WTF::move(sandboxExtensionHandles)), pageProxyChannel->page().webPageIDInMainFrameProcess());+#endif+ return { };+}@@ -12992,7 +11792,7 @@ index 0000000000000000000000000000000000000000..13e45ef13e4d43dce84a8847bde2518a++ bool nominalResolution = omitDeviceScaleFactor.has_value() && *omitDeviceScaleFactor;+ WebCore::IntRect clip(x, y, width, height);-+ m_client->takePageScreenshot(pageProxyChannel->page(), WTFMove(clip), nominalResolution, [callback = WTFMove(callback)](const String& error, const String& data) {++ m_client->takePageScreenshot(pageProxyChannel->page(), WTF::move(clip), nominalResolution, [callback = WTF::move(callback)](const String& error, const String& data) {+ if (error.isEmpty())+ callback->sendSuccess(data);+ else@@ -13034,14 +11834,14 @@ index 0000000000000000000000000000000000000000..13e45ef13e4d43dce84a8847bde2518a+ }++ browserContext->dataStore->cookieStore().cookies(-+ [callback = WTFMove(callback)](const Vector<WebCore::Cookie>& allCookies) {++ [callback = WTF::move(callback)](const Vector<WebCore::Cookie>& allCookies) {+ if (!callback->isActive())+ return;+ auto cookies = JSON::ArrayOf<Inspector::Protocol::Playwright::Cookie>::create();++ for (const auto& cookie : allCookies)+ cookies->addItem(buildObjectForCookie(cookie));-+ callback->sendSuccess(WTFMove(cookies));++ callback->sendSuccess(WTF::move(cookies));+ });+}+@@ -13096,11 +11896,11 @@ index 0000000000000000000000000000000000000000..13e45ef13e4d43dce84a8847bde2518a+ cookie.sameSite = WebCore::Cookie::SameSitePolicy::Lax;+#endif+ }-+ cookies.append(WTFMove(cookie));++ cookies.append(WTF::move(cookie));+ }+-+ browserContext->dataStore->cookieStore().setCookies(WTFMove(cookies),-+ [callback = WTFMove(callback)]() {++ browserContext->dataStore->cookieStore().setCookies(WTF::move(cookies),++ [callback = WTF::move(callback)]() {+ if (!callback->isActive())+ return;+ callback->sendSuccess();@@ -13116,7 +11916,7 @@ index 0000000000000000000000000000000000000000..13e45ef13e4d43dce84a8847bde2518a+ }++ browserContext->dataStore->cookieStore().deleteAllCookies(-+ [callback = WTFMove(callback)]() {++ [callback = WTF::move(callback)]() {+ if (!callback->isActive())+ return;+ callback->sendSuccess();@@ -13139,7 +11939,7 @@ index 0000000000000000000000000000000000000000..13e45ef13e4d43dce84a8847bde2518a+ items.append(language);+ }+-+ browserContext->processPool->configuration().setOverrideLanguages(WTFMove(items));++ browserContext->processPool->configuration().setOverrideLanguages(WTF::move(items));+ return { };+}+@@ -13233,9 +12033,10 @@ index 0000000000000000000000000000000000000000..13e45ef13e4d43dce84a8847bde2518a+ callback->sendSuccess();+ return;+ }-+ auto browserContext = getExistingBrowserContext(browserContextID);-+ if (!browserContext) {-+ callback->sendSuccess();++ String errorString;++ auto browserContext = lookupBrowserContext(errorString, browserContextID);++ if (!errorString.isEmpty()) {++ callback->sendFailure(errorString);+ return;+ }+ browserContext->dataStore->removeData(WebKit::WebsiteDataType::MemoryCache, -WallTime::infinity(), [callback] {@@ -13273,10 +12074,10 @@ index 0000000000000000000000000000000000000000..13e45ef13e4d43dce84a8847bde2518a+#endif // ENABLE(REMOTE_INSPECTOR)diff --git a/Source/WebKit/UIProcess/InspectorPlaywrightAgent.h b/Source/WebKit/UIProcess/InspectorPlaywrightAgent.hnew file mode 100644-index 0000000000000000000000000000000000000000..23cf8d2dbcb21b21f3ffedbd5ef369c796cae34a+index 0000000000000000000000000000000000000000..1e31698788ab79bc3807b9f29fa2ebc026374909--- /dev/null+++ b/Source/WebKit/UIProcess/InspectorPlaywrightAgent.h-@@ -0,0 +1,141 @@+@@ -0,0 +1,140 @@+/*+ * Copyright (C) 2019 Microsoft Corporation.+ *@@ -13365,7 +12166,6 @@ index 0000000000000000000000000000000000000000..23cf8d2dbcb21b21f3ffedbd5ef369c7+ void willDestroyInspectorController(WebPageProxy&) override;+ void didFailProvisionalLoad(WebPageProxy&, WebCore::NavigationIdentifier navigationID, const String& error) override;+ void willCreateNewPage(WebPageProxy&, const WebCore::WindowFeatures&, const URL&) override;-+ void didFinishScreencast(const PAL::SessionID& sessionID, const String& screencastID) override;++ // PlaywrightDispatcherHandler+ Inspector::Protocol::ErrorStringOr<void> enable() override;@@ -13499,7 +12299,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 b16dfdb4a9d5d30a0e7e4185261646c2f2b598eb..eb2498f8d174b574c5ae9015d2080b6f08714d4d 100644+index de3aaa8c032a92a2afa52ec033ee51027c3c1d23..9fa579c2602f31726ff9ba0ba58cfdc316be6427 100644--- a/Source/WebKit/UIProcess/Launcher/glib/ProcessLauncherGLib.cpp+++ b/Source/WebKit/UIProcess/Launcher/glib/ProcessLauncherGLib.cpp@@ -164,6 +164,13 @@ void ProcessLauncher::launchProcess()@@ -13555,7 +12355,7 @@ index 6723ee0d9943be07bc8ad09d2b678838aca968df..0d7fb3c7b1a4c877a2ff2f2189d12c7dBOOL 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 c82d6a51075936f8c5256b34931386e9f4d7ed9f..43d78e1d5e9aa84c59ebe1c3f6cfca8df46e552e 100644+index 08425c2e4cb83c19430a5253e6ed0d0cf42e5b7a..573231a61d48a0cc5c16bce0b4dbc0611db0ae69 100644--- a/Source/WebKit/UIProcess/Media/RemoteMediaSessionManagerProxy.cpp+++ b/Source/WebKit/UIProcess/Media/RemoteMediaSessionManagerProxy.cpp@@ -30,6 +30,7 @@@@ -13567,7 +12367,7 @@ index c82d6a51075936f8c5256b34931386e9f4d7ed9f..43d78e1d5e9aa84c59ebe1c3f6cfca8d#include "RemoteMediaSessionProxy.h"#include "RemoteMediaSessionState.h"diff --git a/Source/WebKit/UIProcess/PageClient.h b/Source/WebKit/UIProcess/PageClient.h-index de05b5599f14d5ffc3f0dda05c4bb3a6cc7748aa..43b365085d657edf55d98eba0aabcc1e05bb7714 100644+index 02627105c3825bcab2753dd73f33e600b3585876..8a1bde61436904b12acc00cf1705214221ebcabd 100644--- a/Source/WebKit/UIProcess/PageClient.h+++ b/Source/WebKit/UIProcess/PageClient.h@@ -77,6 +77,11 @@@@ -13582,18 +12382,19 @@ index de05b5599f14d5ffc3f0dda05c4bb3a6cc7748aa..43b365085d657edf55d98eba0aabcc1eOBJC_CLASS AVPlayerViewController;OBJC_CLASS CALayer;OBJC_CLASS NSFileWrapper;-@@ -395,7 +400,14 @@ public:+@@ -398,7 +403,15 @@ public:virtual void selectionDidChange() = 0;#endif--#if PLATFORM(COCOA) || PLATFORM(GTK) || (PLATFORM(WPE) && USE(SKIA))+-#if PLATFORM(COCOA) || PLATFORM(GTK) || PLATFORM(WPE)+// Paywright begin+#if PLATFORM(COCOA)+ virtual RetainPtr<CGImageRef> takeSnapshotForAutomation() = 0;-+#elif PLATFORM(GTK) || (PLATFORM(WPE) && USE(SKIA))++#elif PLATFORM(GTK) || PLATFORM(WPE)+ virtual RefPtr<ViewSnapshot> takeViewSnapshot(std::optional<WebCore::IntRect>&&, bool nominalResolution = false) = 0;+#endif+// Paywright end+++#if PLATFORM(COCOA)virtual RefPtr<ViewSnapshot> takeViewSnapshot(std::optional<WebCore::IntRect>&&) = 0;#endif@@ -13731,7 +12532,7 @@ index 0000000000000000000000000000000000000000..f855bb5ff6e91cc3383fb9a96d32392f++#endif // ENABLE(FULLSCREEN_API)diff --git a/Source/WebKit/UIProcess/ProvisionalFrameProxy.cpp b/Source/WebKit/UIProcess/ProvisionalFrameProxy.cpp-index 39a815b0819e99e9575d8f3deec07affd2e9c404..5c9196627dd1bcdbf80fb41c09d77fb21bb2fa44 100644+index 67b2f5cb03c1af0da00b92e8eae5ad038167009a..6fe8fe64135d6722f56a07810f9891eb292585f5 100644--- a/Source/WebKit/UIProcess/ProvisionalFrameProxy.cpp+++ b/Source/WebKit/UIProcess/ProvisionalFrameProxy.cpp@@ -25,6 +25,7 @@@@ -13743,18 +12544,21 @@ index 39a815b0819e99e9575d8f3deec07affd2e9c404..5c9196627dd1bcdbf80fb41c09d77fb2#include "FrameProcess.h"#include "ProvisionalFrameCreationParameters.h"diff --git a/Source/WebKit/UIProcess/ProvisionalPageProxy.h b/Source/WebKit/UIProcess/ProvisionalPageProxy.h-index 17fbb07fee4057b5066e051723ec3249af7ba23b..ab5ed59333ed74d2ef48bfe06e02804b81759239 100644+index ab1cd48c4b3e821a1582241afd6d7b64dac7494d..a6e61edca183d7b88af6ef737fbd70822addaf92 100644--- a/Source/WebKit/UIProcess/ProvisionalPageProxy.h+++ b/Source/WebKit/UIProcess/ProvisionalPageProxy.h-@@ -34,6 +34,7 @@+@@ -32,8 +32,10 @@+ #include "ProcessThrottler.h"+ #include "SandboxExtension.h"#include "WebFramePolicyListenerProxy.h"++#include "WebPageProxy.h"#include "WebPageProxyIdentifier.h"#include "WebPageProxyMessageReceiverRegistration.h"+#include "WebsiteDataStore.h"#include <WebCore/DiagnosticLoggingClient.h>#include <WebCore/FrameIdentifier.h>#include <WebCore/FrameLoaderClient.h>-@@ -74,7 +75,6 @@ class WebBackForwardListItem;+@@ -74,7 +76,6 @@ class WebBackForwardListItem;class WebFrameProxy;class WebPageProxy;class WebProcessProxy;@@ -13764,7 +12568,7 @@ index 17fbb07fee4057b5066e051723ec3249af7ba23b..ab5ed59333ed74d2ef48bfe06e02804bstruct NavigationActionData;diff --git a/Source/WebKit/UIProcess/RemoteInspectorPipe.cpp b/Source/WebKit/UIProcess/RemoteInspectorPipe.cppnew file mode 100644-index 0000000000000000000000000000000000000000..2d2e6bb485c9a95b871d9545b8720cfd061dd789+index 0000000000000000000000000000000000000000..a5fe95e4019e5b2b4e510174111166fb36089e9a--- /dev/null+++ b/Source/WebKit/UIProcess/RemoteInspectorPipe.cpp@@ -0,0 +1,229 @@@@ -13978,7 +12782,7 @@ index 0000000000000000000000000000000000000000..2d2e6bb485c9a95b871d9545b8720cfd++ if (end > start) {+ String message = String::fromUTF8({ line.mutableSpan().data() + start, end - start });-+ RunLoop::mainSingleton().dispatch([this, message = WTFMove(message)] {++ RunLoop::mainSingleton().dispatch([this, message = WTF::move(message)] {+ if (!m_terminated)+ m_playwrightAgent.dispatchMessageFromFrontend(message);+ });@@ -14081,7 +12885,7 @@ index 7ef986965d3fda34b4f09279c62bdad40712ab12..5e0bc508f72bbbd0bcb4bb1254782028namespace WebKit {diff --git a/Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteScrollingTreeMac.mm b/Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteScrollingTreeMac.mm-index 50879098a2b8679c2a79c2ca5486d118e0f084fc..3a48021b401bf11f1af32e0b818c361092729da1 100644+index df8b4f48b760487aa2e4bbb611b824002a8d8231..0fdf9c69df946a0215f7b3de58d2f5aac8e71c1b 100644--- a/Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteScrollingTreeMac.mm+++ b/Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteScrollingTreeMac.mm@@ -46,6 +46,7 @@@@ -14110,7 +12914,7 @@ index 3f6cd845733e2e8f5e25c318e7ab54f77032d4cf..e4399bfd734a28ef5df5ec855b7c78b4class RemotePagePlaybackSessionManagerProxy : public IPC::MessageReceiver, public RefCounted<RemotePagePlaybackSessionManagerProxy> {diff --git a/Source/WebKit/UIProcess/RemotePageProxy.cpp b/Source/WebKit/UIProcess/RemotePageProxy.cpp-index f59a65a43000a670649dc24c4bb5c0964b841601..57a006bb3c4325420f8e595b6a4f43ac371d1dfa 100644+index 1a8feec76715cf4210de81b36bc70213a3b44669..f48336d489711583cb5f9ecea8f0b22a7cf4a1f6 100644--- a/Source/WebKit/UIProcess/RemotePageProxy.cpp+++ b/Source/WebKit/UIProcess/RemotePageProxy.cpp@@ -37,6 +37,7 @@@@ -14120,8 +12924,8 @@ index f59a65a43000a670649dc24c4bb5c0964b841601..57a006bb3c4325420f8e595b6a4f43ac+#include "RemotePagePlaybackSessionManagerProxy.h"#include "RemotePageScreenOrientationManagerProxy.h"#include "RemotePageVisitedLinkStoreRegistration.h"- #include "UserMediaProcessManager.h"-@@ -55,12 +56,14 @@+ #include "RemotePageWebDeviceOrientationUpdateProviderProxy.h"+@@ -56,6 +57,7 @@#include <WebCore/RemoteUserInputEventData.h>#include <wtf/TZoneMallocInlines.h>@@ -14129,31 +12933,45 @@ index f59a65a43000a670649dc24c4bb5c0964b841601..57a006bb3c4325420f8e595b6a4f43ac#if ENABLE(FULLSCREEN_API)#include "WebFullScreenManagerProxy.h"#endif-- #if ENABLE(VIDEO_PRESENTATION_MODE)- #include "RemotePageVideoPresentationManagerProxy.h"-+#include "VideoPresentationManagerProxy.h"- #endif-- #if PLATFORM(IOS_FAMILY) && ENABLE(DEVICE_ORIENTATION)diff --git a/Source/WebKit/UIProcess/WebContextMenuProxy.h b/Source/WebKit/UIProcess/WebContextMenuProxy.h-index 697a350812e1bf73dd44cc3d723a6a291f9d59d1..a8e1edd710d88f48632d51fd05aa964732d727d3 100644+index e3dac51d347635bd88d486a6fda9123df5f80150..f9fa5a7c64ca30ed2db8f09fb0186f85a5eeec4d 100644--- a/Source/WebKit/UIProcess/WebContextMenuProxy.h+++ b/Source/WebKit/UIProcess/WebContextMenuProxy.h-@@ -49,6 +49,7 @@ public:+@@ -51,6 +51,7 @@ public:void deref() const final { RefCounted::deref(); }virtual void show();+ virtual void hide() {}WebPageProxy* page() const { return m_page.get(); }- RefPtr<WebPageProxy> protectedPage() const;+ const FrameInfoData& frameInfo() const { return m_frameInfo; }+diff --git a/Source/WebKit/UIProcess/WebFrameProxy.cpp b/Source/WebKit/UIProcess/WebFrameProxy.cpp+index 231a519e2b2bf7f4a38aac0958f0d49840ab8a86..8232f6f5b0e348dddc09ae54e1b927cef337c69a 100644+--- a/Source/WebKit/UIProcess/WebFrameProxy.cpp++++ b/Source/WebKit/UIProcess/WebFrameProxy.cpp+@@ -127,7 +127,6 @@ WebFrameProxy::WebFrameProxy(WebPageProxy& page, FrameProcess& process, FrameIde+ allFrames().set(frameID, *this);+ WebProcessPool::statistics().wkFrameCount++;++- page.inspectorController().didCreateFrame(*this);++ protect(m_frameProcess)->incrementFrameCount();+ }+@@ -513,6 +512,8 @@ void WebFrameProxy::didCreateSubframe(WebCore::FrameIdentifier frameID, String&&+ if (RefPtr session = page->activeAutomationSession())+ session->didCreateFrame(child);+ #endif++++ page->inspectorController().didCreateFrame(*this);+ }++ void WebFrameProxy::prepareForProvisionalLoadInProcess(WebProcessProxy& process, API::Navigation& navigation, BrowsingContextGroup& group, std::optional<SecurityOriginData> effectiveOrigin, CompletionHandler<void(WebCore::PageIdentifier)>&& completionHandler)diff --git a/Source/WebKit/UIProcess/WebPageInspectorEmulationAgent.cpp b/Source/WebKit/UIProcess/WebPageInspectorEmulationAgent.cppnew file mode 100644-index 0000000000000000000000000000000000000000..058b9a31fc23cc36a228ef63cc89a80ccf3fa62e+index 0000000000000000000000000000000000000000..cc495bff7d10aeb071ba30002d292b82e26d51b7--- /dev/null+++ b/Source/WebKit/UIProcess/WebPageInspectorEmulationAgent.cpp-@@ -0,0 +1,159 @@+@@ -0,0 +1,161 @@+/*+ * Copyright (C) 2019 Microsoft Corporation.+ *@@ -14194,6 +13012,8 @@ index 0000000000000000000000000000000000000000..058b9a31fc23cc36a228ef63cc89a80c++using namespace Inspector;+++WTF_MAKE_TZONE_ALLOCATED_IMPL(WebPageInspectorEmulationAgent);+++WebPageInspectorEmulationAgent::WebPageInspectorEmulationAgent(BackendDispatcher& backendDispatcher, WebPageProxy& page)+ : InspectorAgentBase("Emulation"_s)+ , m_backendDispatcher(EmulationBackendDispatcher::create(backendDispatcher, this))@@ -14230,17 +13050,17 @@ index 0000000000000000000000000000000000000000..058b9a31fc23cc36a228ef63cc89a80c+ m_page.setCustomDeviceScaleFactor(deviceScaleFactor.value(), [] { });+ m_page.setUseFixedLayout(fixedlayout);+ if (!m_page.pageClient()->isActiveViewVisible() && m_page.configuration().relatedPage()) {-+ m_commandsToRunWhenShown.append([this, width, height, callback = WTFMove(callback)]() mutable {-+ setSize(width, height, WTFMove(callback));++ m_commandsToRunWhenShown.append([this, width, height, callback = WTF::move(callback)]() mutable {++ setSize(width, height, WTF::move(callback));+ });+ } else {-+ setSize(width, height, WTFMove(callback));++ setSize(width, height, WTF::move(callback));+ }+}++void WebPageInspectorEmulationAgent::setSize(int width, int height, Ref<SetDeviceMetricsOverrideCallback>&& callback)+{-+ platformSetSize(width, height, [callback = WTFMove(callback)](const String& error) {++ platformSetSize(width, height, [callback = WTF::move(callback)](const String& error) {+ if (error.isEmpty())+ callback->sendSuccess();+ else@@ -14267,7 +13087,7 @@ index 0000000000000000000000000000000000000000..058b9a31fc23cc36a228ef63cc89a80c++Inspector::Protocol::ErrorStringOr<void> WebPageInspectorEmulationAgent::setActiveAndFocused(std::optional<bool>&& active)+{-+ m_page.setActiveForAutomation(WTFMove(active));++ m_page.setActiveForAutomation(WTF::move(active));+ return { };+}+@@ -14281,7 +13101,7 @@ index 0000000000000000000000000000000000000000..058b9a31fc23cc36a228ef63cc89a80c++ set.add(name);+ }-+ m_permissions.set(origin, WTFMove(set));++ m_permissions.set(origin, WTF::move(set));+ m_page.setPermissionsForAutomation(m_permissions);+ return { };+}@@ -14296,7 +13116,7 @@ index 0000000000000000000000000000000000000000..058b9a31fc23cc36a228ef63cc89a80c+Inspector::Protocol::ErrorStringOr<void> WebPageInspectorEmulationAgent::setOrientationOverride(std::optional<int>&& angle)+{+#if ENABLE(ORIENTATION_EVENTS)-+ m_page.setOrientationOverride(WTFMove(angle));++ m_page.setOrientationOverride(WTF::move(angle));+ return { };+#else+ UNUSED_PARAM(angle);@@ -14315,7 +13135,7 @@ index 0000000000000000000000000000000000000000..058b9a31fc23cc36a228ef63cc89a80c+} // namespace WebKitdiff --git a/Source/WebKit/UIProcess/WebPageInspectorEmulationAgent.h b/Source/WebKit/UIProcess/WebPageInspectorEmulationAgent.hnew file mode 100644-index 0000000000000000000000000000000000000000..14db923537ba3cad1961a748ae5e1d66c7c9322c+index 0000000000000000000000000000000000000000..8c772fb1b67ec7d83cbe2394d8ab04787a4412a8--- /dev/null+++ b/Source/WebKit/UIProcess/WebPageInspectorEmulationAgent.h@@ -0,0 +1,76 @@@@ -14366,7 +13186,7 @@ index 0000000000000000000000000000000000000000..14db923537ba3cad1961a748ae5e1d66++class WebPageInspectorEmulationAgent : public Inspector::InspectorAgentBase, public Inspector::EmulationBackendDispatcherHandler {+ WTF_MAKE_NONCOPYABLE(WebPageInspectorEmulationAgent);-+ WTF_DEPRECATED_MAKE_FAST_ALLOCATED(WebPageInspectorEmulationAgent);++ WTF_MAKE_TZONE_ALLOCATED(WebPageInspectorEmulationAgent);+public:+ WebPageInspectorEmulationAgent(Inspector::BackendDispatcher& backendDispatcher, WebPageProxy& page);+ ~WebPageInspectorEmulationAgent() override;@@ -14397,10 +13217,10 @@ index 0000000000000000000000000000000000000000..14db923537ba3cad1961a748ae5e1d66+} // namespace WebKitdiff --git a/Source/WebKit/UIProcess/WebPageInspectorInputAgent.cpp b/Source/WebKit/UIProcess/WebPageInspectorInputAgent.cppnew file mode 100644-index 0000000000000000000000000000000000000000..68aa4d902c1d12e0f7c6d932a3115532f8dc270f+index 0000000000000000000000000000000000000000..c52e077d89c8531adf8bc184cd237cb5d2bc0bc3--- /dev/null+++ b/Source/WebKit/UIProcess/WebPageInspectorInputAgent.cpp-@@ -0,0 +1,394 @@+@@ -0,0 +1,396 @@+/*+ * Copyright (C) 2019 Microsoft Corporation.+ *@@ -14446,6 +13266,8 @@ index 0000000000000000000000000000000000000000..68aa4d902c1d12e0f7c6d932a3115532++using namespace Inspector;+++WTF_MAKE_TZONE_ALLOCATED_IMPL(WebPageInspectorInputAgent);+++namespace {++template<class T>@@ -14460,7 +13282,7 @@ index 0000000000000000000000000000000000000000..68aa4d902c1d12e0f7c6d932a3115532++ void append(Ref<T>&& callback)+ {-+ m_callbacks.append(WTFMove(callback));++ m_callbacks.append(WTF::move(callback));+ }++ void sendSuccess()@@ -14600,7 +13422,7 @@ index 0000000000000000000000000000000000000000..68aa4d902c1d12e0f7c6d932a3115532+ return;+ }+-+ m_keyboardCallbacks->append(WTFMove(callback));++ m_keyboardCallbacks->append(WTF::move(callback));+ platformDispatchKeyEvent(+ eventType,+ text,@@ -14665,7 +13487,7 @@ index 0000000000000000000000000000000000000000..68aa4d902c1d12e0f7c6d932a3115532+ int eventDeltaY = 0;+ if (deltaY)+ eventDeltaY = *deltaY;-+ m_mouseCallbacks->append(WTFMove(callback));++ m_mouseCallbacks->append(WTF::move(callback));++ // Convert css coordinates to view coordinates (dip).+ double totalScale = m_page.pageScaleFactor() * m_page.viewScaleFactor() * m_page.pageZoomFactor();@@ -14682,7 +13504,7 @@ index 0000000000000000000000000000000000000000..68aa4d902c1d12e0f7c6d932a3115532+ UNUSED_VARIABLE(eventType);+ UNUSED_VARIABLE(eventButton);+ UNUSED_VARIABLE(eventClickCount);-+ platformDispatchMouseEvent(type, x, y, WTFMove(modifiers), button, WTFMove(clickCount), eventButtons);++ platformDispatchMouseEvent(type, x, y, WTF::move(modifiers), button, WTF::move(clickCount), eventButtons);+#elif PLATFORM(GTK) || PLATFORM(WPE) || PLATFORM(WIN)+ MonotonicTime timestamp = MonotonicTime::now();+ NativeWebMouseEvent event(@@ -14756,7 +13578,7 @@ index 0000000000000000000000000000000000000000..68aa4d902c1d12e0f7c6d932a3115532+ touchPoints.append(WebPlatformTouchPoint(id, state, position, position, radius, rotationAngle, force));+ }+-+ WebTouchEvent touchEvent({WebEventType::TouchStart, eventModifiers, MonotonicTime::now()}, WTFMove(touchPoints), {}, {});++ WebTouchEvent touchEvent({WebEventType::TouchStart, eventModifiers, MonotonicTime::now()}, WTF::move(touchPoints), {}, {});+ m_page.legacyMainFrameProcess().sendWithAsyncReply(Messages::WebPage::TouchEvent(touchEvent), [callback] (std::optional<WebEventType> eventType, bool) {+ if (!eventType) {+ callback->sendFailure("Failed to dispatch touch event."_s);@@ -14778,7 +13600,7 @@ index 0000000000000000000000000000000000000000..68aa4d902c1d12e0f7c6d932a3115532+ float eventDeltaY = 0.0f;+ if (deltaY)+ eventDeltaY = *deltaY;-+ m_wheelCallbacks->append(WTFMove(callback));++ m_wheelCallbacks->append(WTF::move(callback));++ // Convert css coordinates to view coordinates (dip).+ double totalScale = m_page.pageScaleFactor() * m_page.viewScaleFactor() * m_page.pageZoomFactor();@@ -14797,7 +13619,7 @@ index 0000000000000000000000000000000000000000..68aa4d902c1d12e0f7c6d932a3115532+} // namespace WebKitdiff --git a/Source/WebKit/UIProcess/WebPageInspectorInputAgent.h b/Source/WebKit/UIProcess/WebPageInspectorInputAgent.hnew file mode 100644-index 0000000000000000000000000000000000000000..1430b24f8d4b992ccd637ef6ff6a27e961e914de+index 0000000000000000000000000000000000000000..fb0cd51d362dfd8af2370f43ecb8835c96450f21--- /dev/null+++ b/Source/WebKit/UIProcess/WebPageInspectorInputAgent.h@@ -0,0 +1,87 @@@@ -14849,7 +13671,7 @@ index 0000000000000000000000000000000000000000..1430b24f8d4b992ccd637ef6ff6a27e9++class WebPageInspectorInputAgent : public Inspector::InspectorAgentBase, public Inspector::InputBackendDispatcherHandler {+ WTF_MAKE_NONCOPYABLE(WebPageInspectorInputAgent);-+ WTF_DEPRECATED_MAKE_FAST_ALLOCATED(WebPageInspectorInputAgent);++ WTF_MAKE_TZONE_ALLOCATED(WebPageInspectorInputAgent);+public:+ WebPageInspectorInputAgent(Inspector::BackendDispatcher& backendDispatcher, WebPageProxy& page);+ ~WebPageInspectorInputAgent() override;@@ -14889,10 +13711,10 @@ index 0000000000000000000000000000000000000000..1430b24f8d4b992ccd637ef6ff6a27e9++} // namespace WebKitdiff --git a/Source/WebKit/UIProcess/WebPageProxy.cpp b/Source/WebKit/UIProcess/WebPageProxy.cpp-index d0b4b0e0264fb5b5e795ad17754d6f667452cb9d..2d01d2e9d787112a4b399653b0e178cf411590ca 100644+index 688b610a5776d8854c30924b1fb03940754e2d72..1386f07187519b3612b5219d209ac1bac51d3a85 100644--- a/Source/WebKit/UIProcess/WebPageProxy.cpp+++ b/Source/WebKit/UIProcess/WebPageProxy.cpp-@@ -214,6 +214,7 @@+@@ -218,6 +218,7 @@#include <WebCore/CaptureDeviceManager.h>#include <WebCore/CaptureDeviceWithCapabilities.h>#include <WebCore/ChromeClient.h>@@ -14900,15 +13722,15 @@ index d0b4b0e0264fb5b5e795ad17754d6f667452cb9d..2d01d2e9d787112a4b399653b0e178cf#include <WebCore/CompositionHighlight.h>#include <WebCore/CrossSiteNavigationDataTransfer.h>#include <WebCore/CryptoKey.h>-@@ -226,6 +227,7 @@+@@ -230,6 +231,7 @@#include <WebCore/DigitalCredentialsProtocols.h>#include <WebCore/DigitalCredentialsRequestData.h>#include <WebCore/DigitalCredentialsResponseData.h>+#include <WebCore/DiagnosticLoggingResultType.h>#include <WebCore/DragController.h>#include <WebCore/DragData.h>- #include <WebCore/ElementContext.h>-@@ -250,6 +252,7 @@+ #include <WebCore/DragEventTargetData.h>+@@ -257,6 +259,7 @@#include <WebCore/ModalContainerTypes.h>#include <WebCore/NotImplemented.h>#include <WebCore/OrganizationStorageAccessPromptQuirk.h>@@ -14916,7 +13738,7 @@ index d0b4b0e0264fb5b5e795ad17754d6f667452cb9d..2d01d2e9d787112a4b399653b0e178cf#include <WebCore/PerformanceLoggingClient.h>#include <WebCore/PermissionDescriptor.h>#include <WebCore/PermissionState.h>-@@ -259,10 +262,12 @@+@@ -266,10 +269,12 @@#include <WebCore/Quirks.h>#include <WebCore/RealtimeMediaSourceCenter.h>#include <WebCore/ReferrerPolicy.h>@@ -14927,9 +13749,9 @@ index d0b4b0e0264fb5b5e795ad17754d6f667452cb9d..2d01d2e9d787112a4b399653b0e178cf#include <WebCore/RunJavaScriptParameters.h>+#include <WebCore/ScreenOrientationType.h>#include <WebCore/SecurityOrigin.h>+ #include <WebCore/SecurityOriginData.h>#include <WebCore/SerializedCryptoKeyWrap.h>- #include <WebCore/SerializedScriptValue.h>-@@ -351,7 +356,7 @@+@@ -363,7 +368,7 @@#include "ViewSnapshotStore.h"#endif@@ -14938,7 +13760,25 @@ index d0b4b0e0264fb5b5e795ad17754d6f667452cb9d..2d01d2e9d787112a4b399653b0e178cf#include <WebCore/SelectionData.h>#endif-@@ -1054,6 +1059,10 @@ WebPageProxy::~WebPageProxy()+@@ -495,6 +500,17 @@ static constexpr Seconds tryCloseTimeoutDelay = 50_ms;+ static constexpr Seconds audibleActivityClearDelay = 10_s;+ #endif+++static WebCore::ScreenOrientationType toScreenOrientationType(int angle)++{++ if (angle == -90)++ return WebCore::ScreenOrientationType::LandscapeSecondary;++ if (angle == 180)++ return WebCore::ScreenOrientationType::PortraitSecondary;++ if (angle == 90)++ return WebCore::ScreenOrientationType::LandscapePrimary;++ return WebCore::ScreenOrientationType::PortraitPrimary;++}+++ #if PLATFORM(COCOA)+ static WorkQueue& sharedFileQueueSingleton()+ {+@@ -1071,6 +1087,10 @@ WebPageProxy::~WebPageProxy()ASSERT(webPageProxyMap().get(m_identifier) == this);webPageProxyMap().remove(m_identifier);@@ -14948,58 +13788,67 @@ index d0b4b0e0264fb5b5e795ad17754d6f667452cb9d..2d01d2e9d787112a4b399653b0e178cf+#endif}- Ref<WebPageProxy> WebPageProxy::Internals::protectedPage() const-@@ -1635,7 +1644,7 @@ void WebPageProxy::didAttachToRunningProcess()+ void WebPageProxy::addAllMessageReceivers()+@@ -1625,7 +1645,7 @@ void WebPageProxy::didAttachToRunningProcess()#if ENABLE(FULLSCREEN_API)ASSERT(!m_fullScreenManager);-- m_fullScreenManager = WebFullScreenManagerProxy::create(*this, protectedPageClient()->checkedFullScreenManagerProxyClient().get());-+ m_fullScreenManager = WebFullScreenManagerProxy::create(*this, m_fullScreenManagerClientOverride ? *m_fullScreenManagerClientOverride : protectedPageClient()->checkedFullScreenManagerProxyClient().get());+- m_fullScreenManager = WebFullScreenManagerProxy::create(*this, protect(protect(pageClient())->fullScreenManagerProxyClient()).get());++ m_fullScreenManager = WebFullScreenManagerProxy::create(*this, m_fullScreenManagerClientOverride ? *m_fullScreenManagerClientOverride : protect(protect(pageClient())->fullScreenManagerProxyClient()).get());#endif#if ENABLE(VIDEO_PRESENTATION_MODE)ASSERT(!m_playbackSessionManager);-@@ -1799,6 +1808,7 @@ void WebPageProxy::initializeWebPage(const Site& site, WebCore::SandboxFlags eff+@@ -1664,7 +1684,7 @@ void WebPageProxy::didAttachToRunningProcess()+ #endif++ #if !PLATFORM(IOS_FAMILY)+- auto currentOrientation = WebCore::naturalScreenOrientationType();++ auto currentOrientation = m_deviceOrientationOverride ? toScreenOrientationType(*m_deviceOrientationOverride) : WebCore::naturalScreenOrientationType();+ #else+ auto currentOrientation = toScreenOrientationType(m_deviceOrientation);+ #endif+@@ -1797,6 +1817,7 @@ void WebPageProxy::initializeWebPage(const Site& site, WebCore::SandboxFlags effif (preferences->siteIsolationEnabled())browsingContextGroup->addPage(*this);- process->send(Messages::WebProcess::CreateWebPage(m_webPageID, creationParameters(process, *protectedDrawingArea(), m_mainFrame->frameID(), std::nullopt)), 0);+ 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();-@@ -2121,6 +2131,21 @@ Ref<WebProcessProxy> WebPageProxy::ensureProtectedRunningProcess()+@@ -2123,6 +2144,21 @@ Ref<WebProcessProxy> WebPageProxy::ensureProtectedRunningProcess()return ensureRunningProcess();}+RefPtr<API::Navigation> WebPageProxy::loadRequestForInspector(WebCore::ResourceRequest&& request, WebFrameProxy* frame)+{+ if (!frame || frame == mainFrame())-+ return loadRequest(WTFMove(request), WebCore::ShouldOpenExternalURLsPolicy::ShouldNotAllow);++ return loadRequest(WTF::move(request), WebCore::ShouldOpenExternalURLsPolicy::ShouldNotAllow);++ auto navigation = m_navigationState->createLoadRequestNavigation(legacyMainFrameProcess().coreProcessIdentifier(), ResourceRequest(request), m_backForwardList->currentItem());+ LoadParameters loadParameters;+ loadParameters.navigationID = navigation->navigationID();-+ loadParameters.request = WTFMove(request);++ loadParameters.request = WTF::move(request);+ loadParameters.shouldOpenExternalURLsPolicy = WebCore::ShouldOpenExternalURLsPolicy::ShouldNotAllow;+ loadParameters.shouldTreatAsContinuingLoad = ShouldTreatAsContinuingLoad::No;-+ m_legacyMainFrameProcess->send(Messages::WebPage::LoadRequestInFrameForInspector(WTFMove(loadParameters), frame->frameID()), m_webPageID);++ m_legacyMainFrameProcess->send(Messages::WebPage::LoadRequestInFrameForInspector(WTF::move(loadParameters), frame->frameID()), m_webPageID);+ return navigation;+}+- RefPtr<API::Navigation> WebPageProxy::loadRequest(WebCore::ResourceRequest&& request, ShouldOpenExternalURLsPolicy shouldOpenExternalURLsPolicy, IsPerformingHTTPFallback isPerformingHTTPFallback, std::unique_ptr<NavigationActionData>&& lastNavigationAction, API::Object* userData, bool isRequestFromClientOrUserInput)+ RefPtr<API::Navigation> WebPageProxy::loadRequest(WebCore::ResourceRequest&& request, ShouldOpenExternalURLsPolicy shouldOpenExternalURLsPolicy, NavigationUpgradeToHTTPSBehavior navigationUpgradeToHTTPSBehavior, std::unique_ptr<NavigationActionData>&& lastNavigationAction, API::Object* userData, bool isRequestFromClientOrUserInput){if (m_isClosed)-@@ -2242,11 +2267,29 @@ void WebPageProxy::loadRequestWithNavigationShared(Ref<WebProcessProxy>&& proces+@@ -2246,11 +2282,29 @@ void WebPageProxy::loadRequestWithNavigationShared(Ref<WebProcessProxy>&& procesnavigation->setIsLoadedWithNavigationShared(true);protectedProcess->markProcessAsRecentlyUsed();- if (!protectedProcess->isLaunching() || !url.protocolIsFile())-- protectedProcess->send(Messages::WebPage::LoadRequest(WTFMove(loadParameters)), webPageID);+- protectedProcess->send(Messages::WebPage::LoadRequest(WTF::move(loadParameters)), webPageID);++ // Pause loading for new window navigation.+ Function<void()> continuation = [+ weakThis = WeakPtr { protectedThis },+ weakProcess = WeakPtr { protectedProcess },-+ loadParameters = WTFMove(loadParameters),++ loadParameters = WTF::move(loadParameters),+ webPageID,+ url+ ]() mutable {@@ -15008,28 +13857,28 @@ index d0b4b0e0264fb5b5e795ad17754d6f667452cb9d..2d01d2e9d787112a4b399653b0e178cf+ if (!innerProtectedProcess || !innerProtectedThis)+ return;+ if (!innerProtectedProcess->isLaunching() || !url.protocolIsFile())-+ innerProtectedProcess->send(Messages::WebPage::LoadRequest(WTFMove(loadParameters)), webPageID);++ innerProtectedProcess->send(Messages::WebPage::LoadRequest(WTF::move(loadParameters)), webPageID);+ else-+ innerProtectedProcess->send(Messages::WebPage::LoadRequestWaitingForProcessLaunch(WTFMove(loadParameters), innerProtectedThis->internals().pageLoadState.resourceDirectoryURL(), innerProtectedThis->identifier(), true), webPageID);++ innerProtectedProcess->send(Messages::WebPage::LoadRequestWaitingForProcessLaunch(WTF::move(loadParameters), innerProtectedThis->internals().pageLoadState.resourceDirectoryURL(), innerProtectedThis->identifier(), true), webPageID);+ innerProtectedProcess->startResponsivenessTimer();+ };+ if (protectedThis->m_inspectorController->shouldPauseLoadRequest())-+ protectedThis->m_inspectorController->setContinueLoadingCallback(WTFMove(continuation));++ protectedThis->m_inspectorController->setContinueLoadingCallback(WTF::move(continuation));else-- protectedProcess->send(Messages::WebPage::LoadRequestWaitingForProcessLaunch(WTFMove(loadParameters), protectedThis->pageLoadState().resourceDirectoryURL(), protectedThis->identifier(), true), webPageID);+- protectedProcess->send(Messages::WebPage::LoadRequestWaitingForProcessLaunch(WTF::move(loadParameters), protectedThis->pageLoadState().resourceDirectoryURL(), protectedThis->identifier(), true), webPageID);- protectedProcess->startResponsivenessTimer();+ continuation();});}-@@ -2809,6 +2852,63 @@ RefPtr<WebAutomationSession> WebPageProxy::activeAutomationSession() const+@@ -2798,6 +2852,53 @@ RefPtr<WebAutomationSession> WebPageProxy::activeAutomationSession() constreturn m_configuration->processPool().automationSession();}+void WebPageProxy::setAuthCredentialsForAutomation(std::optional<WebCore::Credential>&& credentials, std::optional<URL>&& origin)+{-+ m_credentialsForAutomation = WTFMove(credentials);-+ m_authOriginForAutomation = WTFMove(origin);++ m_credentialsForAutomation = WTF::move(credentials);++ m_authOriginForAutomation = WTF::move(origin);+}++void WebPageProxy::setPermissionsForAutomation(const UncheckedKeyHashMap<String, HashSet<String>>& permissions)@@ -15037,23 +13886,13 @@ index d0b4b0e0264fb5b5e795ad17754d6f667452cb9d..2d01d2e9d787112a4b399653b0e178cf+ m_permissionsForAutomation = permissions;+}+-+static inline WebCore::ScreenOrientationType toScreenOrientationType(int angle)-+{-+ if (angle == -90)-+ return WebCore::ScreenOrientationType::LandscapeSecondary;-+ if (angle == 180)-+ return WebCore::ScreenOrientationType::PortraitSecondary;-+ if (angle == 90)-+ return WebCore::ScreenOrientationType::LandscapePrimary;-+ return WebCore::ScreenOrientationType::PortraitPrimary;-+}-++void WebPageProxy::setOrientationOverride(std::optional<int>&& angle)+{-+ auto deviceOrientation = toScreenOrientationType(angle.value_or(0));++ m_deviceOrientationOverride = WTF::move(angle);++ auto deviceOrientation = toScreenOrientationType(m_deviceOrientationOverride.value_or(0));+ if (m_screenOrientationManager)+ m_screenOrientationManager->setCurrentOrientation(deviceOrientation);-+ m_legacyMainFrameProcess->send(Messages::WebPage::SetDeviceOrientation(angle.value_or(0)), webPageIDInMainFrameProcess());++ m_legacyMainFrameProcess->send(Messages::WebPage::SetDeviceOrientation(m_deviceOrientationOverride.value_or(0)), webPageIDInMainFrameProcess());+}++std::optional<bool> WebPageProxy::permissionForAutomation(const String& origin, const String& permission) const@@ -15083,10 +13922,10 @@ index d0b4b0e0264fb5b5e795ad17754d6f667452cb9d..2d01d2e9d787112a4b399653b0e178cf+WTF_ALLOW_UNSAFE_BUFFER_USAGE_END+}+- void WebPageProxy::createInspectorTarget(IPC::Connection& connection, const String& targetId, Inspector::InspectorTargetType type)+ void WebPageProxy::sendMessageToInspectorFrontend(const String& targetId, const String& message){- MESSAGE_CHECK_BASE(!targetId.isEmpty(), connection);-@@ -3098,6 +3198,24 @@ void WebPageProxy::updateActivityState(OptionSet<ActivityState> flagsToUpdate)+ m_inspectorController->sendMessageToInspectorFrontend(targetId, message);+@@ -3075,6 +3176,24 @@ void WebPageProxy::updateActivityState(OptionSet<ActivityState> flagsToUpdate)bool wasVisible = isViewVisible();RefPtr pageClient = this->pageClient();internals().activityState.remove(flagsToUpdate);@@ -15111,7 +13950,7 @@ index d0b4b0e0264fb5b5e795ad17754d6f667452cb9d..2d01d2e9d787112a4b399653b0e178cfif (flagsToUpdate & ActivityState::IsFocused && pageClient->isViewFocused())internals().activityState.add(ActivityState::IsFocused);if (flagsToUpdate & ActivityState::WindowIsActive && pageClient->isViewWindowActive())-@@ -3867,7 +3985,7 @@ void WebPageProxy::performDragOperation(DragData& dragData, const String& dragSt+@@ -3863,7 +3982,7 @@ void WebPageProxy::performDragOperation(DragData& dragData, const String& dragStif (!hasRunningProcess())return;@@ -15119,8 +13958,8 @@ index d0b4b0e0264fb5b5e795ad17754d6f667452cb9d..2d01d2e9d787112a4b399653b0e178cf+#if PLATFORM(GTK) || PLATFORM(WPE)URL url { dragData.asURL() };if (url.protocolIsFile())- protectedLegacyMainFrameProcess()->assumeReadAccessToBaseURL(*this, url.string(), [] { });-@@ -3895,6 +4013,8 @@ void WebPageProxy::performDragControllerAction(DragControllerAction action, Drag+ protect(legacyMainFrameProcess())->assumeReadAccessToBaseURL(*this, url.string(), [] { });+@@ -3906,6 +4025,8 @@ void WebPageProxy::performDragControllerAction(DragControllerAction action, Dragif (!hasRunningProcess())return;@@ -15129,16 +13968,16 @@ index d0b4b0e0264fb5b5e795ad17754d6f667452cb9d..2d01d2e9d787112a4b399653b0e178cfauto completionHandler = [this, protectedThis = Ref { *this }, action, dragData] (std::optional<WebCore::DragOperation> dragOperation, WebCore::DragHandlingMethod dragHandlingMethod, bool mouseIsOverFileInput, unsigned numberOfItemsToBeAccepted, const IntRect& insertionRect, const IntRect& editableElementRect, std::optional<WebCore::RemoteUserInputEventData> remoteUserInputEventData) mutable {if (!m_pageClient)return;-@@ -3906,7 +4026,7 @@ void WebPageProxy::performDragControllerAction(DragControllerAction action, Drag+@@ -3917,7 +4038,7 @@ void WebPageProxy::performDragControllerAction(DragControllerAction action, DragdragData.setClientPosition(roundedIntPoint(remoteUserInputEventData->transformedPoint));performDragControllerAction(action, dragData, remoteUserInputEventData->targetFrameID);};-#if PLATFORM(GTK)+#if PLATFORM(GTK) || PLATFORM(WPE)ASSERT(dragData.platformData());- sendWithAsyncReplyToProcessContainingFrame(frameID, Messages::WebPage::PerformDragControllerAction(action, dragData.clientPosition(), dragData.globalPosition(), dragData.draggingSourceOperationMask(), *dragData.platformData(), dragData.flags()), WTFMove(completionHandler));+ sendWithAsyncReplyToProcessContainingFrame(frameID, Messages::WebPage::PerformDragControllerAction(action, dragData.clientPosition(), dragData.globalPosition(), dragData.draggingSourceOperationMask(), *dragData.platformData(), dragData.flags()), WTF::move(completionHandler));#else-@@ -3941,17 +4061,36 @@ void WebPageProxy::didPerformDragControllerAction(std::optional<WebCore::DragOpe+@@ -3952,17 +4073,36 @@ void WebPageProxy::didPerformDragControllerAction(std::optional<WebCore::DragOpesetDragCaretRect(insertionRect);if (RefPtr pageClient = this->pageClient())pageClient->didPerformDragControllerAction();@@ -15151,16 +13990,16 @@ index d0b4b0e0264fb5b5e795ad17754d6f667452cb9d..2d01d2e9d787112a4b399653b0e178cfvoid WebPageProxy::startDrag(SelectionData&& selectionData, OptionSet<WebCore::DragOperation> dragOperationMask, std::optional<ShareableBitmap::Handle>&& dragImageHandle, IntPoint&& dragImageHotspot){+ if (m_interceptDrags) {-+ m_dragSelectionData = WTFMove(selectionData);++ m_dragSelectionData = WTF::move(selectionData);+ m_dragSourceOperationMask = dragOperationMask;+ } else {#if PLATFORM(GTK)- if (RefPtr pageClient = this->pageClient()) {-- RefPtr dragImage = dragImageHandle ? ShareableBitmap::create(WTFMove(*dragImageHandle)) : nullptr;-- pageClient->startDrag(WTFMove(selectionData), dragOperationMask, WTFMove(dragImage), WTFMove(dragImageHotspot));+- RefPtr dragImage = dragImageHandle ? ShareableBitmap::create(WTF::move(*dragImageHandle)) : nullptr;+- pageClient->startDrag(WTF::move(selectionData), dragOperationMask, WTF::move(dragImage), WTF::move(dragImageHotspot));+ if (RefPtr pageClient = this->pageClient()) {-+ RefPtr dragImage = dragImageHandle ? ShareableBitmap::create(WTFMove(*dragImageHandle)) : nullptr;-+ pageClient->startDrag(WTFMove(selectionData), dragOperationMask, WTFMove(dragImage), WTFMove(dragImageHotspot));++ RefPtr dragImage = dragImageHandle ? ShareableBitmap::create(WTF::move(*dragImageHandle)) : nullptr;++ pageClient->startDrag(WTF::move(selectionData), dragOperationMask, WTF::move(dragImage), WTF::move(dragImageHotspot));+ }+#endif}@@ -15172,13 +14011,13 @@ index d0b4b0e0264fb5b5e795ad17754d6f667452cb9d..2d01d2e9d787112a4b399653b0e178cf+void WebPageProxy::startDrag(WebCore::DragDataMap&& dragDataMap)+{+ if (m_interceptDrags) {-+ m_dragSelectionData = WTFMove(dragDataMap);++ m_dragSelectionData = WTF::move(dragDataMap);+ m_dragSourceOperationMask = WebCore::anyDragOperation();+ }didStartDrag();}#endif-@@ -3972,6 +4111,24 @@ void WebPageProxy::dragEnded(const IntPoint& clientPosition, const IntPoint& glo+@@ -3983,6 +4123,24 @@ void WebPageProxy::dragEnded(const IntPoint& clientPosition, const IntPoint& glosetDragCaretRect({ });}@@ -15203,7 +14042,7 @@ index d0b4b0e0264fb5b5e795ad17754d6f667452cb9d..2d01d2e9d787112a4b399653b0e178cfvoid WebPageProxy::didStartDrag(){if (!hasRunningProcess())-@@ -3979,6 +4136,26 @@ void WebPageProxy::didStartDrag()+@@ -3990,6 +4148,26 @@ void WebPageProxy::didStartDrag()discardQueuedMouseEvents();send(Messages::WebPage::DidStartDrag());@@ -15230,7 +14069,7 @@ index d0b4b0e0264fb5b5e795ad17754d6f667452cb9d..2d01d2e9d787112a4b399653b0e178cf}void WebPageProxy::dragCancelled()-@@ -4159,26 +4336,47 @@ void WebPageProxy::processNextQueuedMouseEvent()+@@ -4170,26 +4348,47 @@ void WebPageProxy::processNextQueuedMouseEvent()auto eventType = event->type();startResponsivenessTimerForMouseEvent(*targetFrame, eventType);@@ -15263,8 +14102,8 @@ index d0b4b0e0264fb5b5e795ad17754d6f667452cb9d..2d01d2e9d787112a4b399653b0e178cf- LOG_WITH_STREAM(MouseHandling, stream << "UIProcess: sent mouse event " << eventType << " (queue size " << internals().mouseEventQueue.size() << ", coalesced events size " << internals().coalescedMouseEvents.size() << ")");+ LOG_WITH_STREAM(MouseHandling, stream << "UIProcess: sent mouse event " << eventType << " (queue size " << internals().mouseEventQueue.size() << ", coalesced events size " << internals().coalescedMouseEvents.size() << ")");-- sendMouseEvent(targetFrame->frameID(), eventWithCoalescedEvents, WTFMove(sandboxExtensions));-+ sendMouseEvent(m_mainFrame->frameID(), eventWithCoalescedEvents, WTFMove(sandboxExtensions));+- sendMouseEvent(targetFrame->frameID(), eventWithCoalescedEvents, WTF::move(sandboxExtensions));++ sendMouseEvent(m_mainFrame->frameID(), eventWithCoalescedEvents, WTF::move(sandboxExtensions));- internals().coalescedMouseEvents.clear();+ internals().coalescedMouseEvents.clear();@@ -15280,7 +14119,7 @@ index d0b4b0e0264fb5b5e795ad17754d6f667452cb9d..2d01d2e9d787112a4b399653b0e178cf+ if (m_currentDragOperation && m_dragSourceOperationMask.containsAny(m_currentDragOperation.value())) {+ SandboxExtension::Handle sandboxExtensionHandle;+ Vector<SandboxExtension::Handle> sandboxExtensionsForUpload;-+ performDragOperation(dragData, ""_s, WTFMove(sandboxExtensionHandle), WTFMove(sandboxExtensionsForUpload));++ performDragOperation(dragData, ""_s, WTF::move(sandboxExtensionHandle), WTF::move(sandboxExtensionsForUpload));+ }+ m_dragSelectionData = std::nullopt;+ dragEnded(roundedIntPoint(event->position()), roundedIntPoint(event->globalPosition()), m_dragSourceOperationMask);@@ -15290,7 +14129,7 @@ index d0b4b0e0264fb5b5e795ad17754d6f667452cb9d..2d01d2e9d787112a4b399653b0e178cf}#if ENABLE(MAC_GESTURE_EVENTS)-@@ -4402,6 +4600,8 @@ void WebPageProxy::wheelEventHandlingCompleted(bool wasHandled)+@@ -4413,6 +4612,8 @@ void WebPageProxy::wheelEventHandlingCompleted(bool wasHandled)if (RefPtr automationSession = m_configuration->processPool().automationSession())automationSession->wheelEventsFlushedForPage(*this);@@ -15299,7 +14138,7 @@ index d0b4b0e0264fb5b5e795ad17754d6f667452cb9d..2d01d2e9d787112a4b399653b0e178cf}void WebPageProxy::cacheWheelEventScrollingAccelerationCurve(const NativeWebWheelEvent& nativeWheelEvent)-@@ -4545,7 +4745,7 @@ static TrackingType mergeTrackingTypes(TrackingType a, TrackingType b)+@@ -4556,7 +4757,7 @@ static TrackingType mergeTrackingTypes(TrackingType a, TrackingType b)void WebPageProxy::updateTouchEventTracking(const WebTouchEvent& touchStartEvent){@@ -15308,7 +14147,7 @@ index d0b4b0e0264fb5b5e795ad17754d6f667452cb9d..2d01d2e9d787112a4b399653b0e178cffor (auto& touchPoint : touchStartEvent.touchPoints()) {auto location = touchPoint.locationInRootView();auto update = [this, location](TrackingType& trackingType, EventTrackingRegions::EventType eventType) {-@@ -5338,6 +5538,7 @@ Ref<WebPageProxy> WebPageProxy::navigationOriginatingPage(const FrameInfoData& f+@@ -5377,6 +5578,7 @@ Ref<WebPageProxy> WebPageProxy::navigationOriginatingPage(const FrameInfoData& fvoid WebPageProxy::receivedPolicyDecision(PolicyAction action, API::Navigation* navigation, std::optional<std::pair<Ref<API::WebsitePolicies>, Ref<WebProcessProxy>>>&& websitePoliciesAndProcess, Ref<API::NavigationAction>&& navigationAction, WillContinueLoadInNewProcess willContinueLoadInNewProcess, std::optional<SandboxExtension::Handle> sandboxExtensionHandle, std::optional<PolicyDecisionConsoleMessage>&& consoleMessage, CompletionHandler<void(PolicyDecision&&)>&& completionHandler){@@ -15316,7 +14155,7 @@ index d0b4b0e0264fb5b5e795ad17754d6f667452cb9d..2d01d2e9d787112a4b399653b0e178cfif (!hasRunningProcess())return completionHandler(PolicyDecision { });-@@ -6357,6 +6558,7 @@ void WebPageProxy::viewScaleFactorDidChange(IPC::Connection& connection, double+@@ -6416,6 +6618,7 @@ void WebPageProxy::viewScaleFactorDidChange(IPC::Connection& connection, doubleMESSAGE_CHECK_BASE(scaleFactorIsValid(scaleFactor), connection);if (!legacyMainFrameProcess().hasConnection(connection))return;@@ -15324,7 +14163,7 @@ index d0b4b0e0264fb5b5e795ad17754d6f667452cb9d..2d01d2e9d787112a4b399653b0e178cfforEachWebContentProcess([&] (auto& process, auto pageID) {if (&process == &legacyMainFrameProcess())-@@ -7141,6 +7343,7 @@ void WebPageProxy::didDestroyNavigationShared(Ref<WebProcessProxy>&& process, We+@@ -7200,6 +7403,7 @@ void WebPageProxy::didDestroyNavigationShared(Ref<WebProcessProxy>&& process, WeRefPtr protectedPageClient { pageClient() };m_navigationState->didDestroyNavigation(process->coreProcessIdentifier(), navigationID);@@ -15332,16 +14171,16 @@ index d0b4b0e0264fb5b5e795ad17754d6f667452cb9d..2d01d2e9d787112a4b399653b0e178cf}void WebPageProxy::didStartProvisionalLoadForFrame(IPC::Connection& connection, FrameIdentifier frameID, FrameInfoData&& frameInfo, ResourceRequest&& request, std::optional<WebCore::NavigationIdentifier> navigationID, URL&& url, URL&& unreachableURL, const UserData& userData, WallTime timestamp)-@@ -7509,6 +7712,8 @@ void WebPageProxy::didFailProvisionalLoadForFrameShared(Ref<WebProcessProxy>&& p+@@ -7569,6 +7773,8 @@ void WebPageProxy::didFailProvisionalLoadForFrameShared(Ref<WebProcessProxy>&& pm_failingProvisionalLoadURL = { };+ m_inspectorController->didFailProvisionalLoadForFrame(*navigationID, error);+// If the provisional page's load fails then we destroy the provisional page.- if (m_provisionalPage && m_provisionalPage->mainFrame() == &frame && (willContinueLoading == WillContinueLoading::No || protectedPreferences()->siteIsolationEnabled()))+ if (m_provisionalPage && m_provisionalPage->mainFrame() == &frame && (willContinueLoading == WillContinueLoading::No || protect(preferences())->siteIsolationEnabled()))m_provisionalPage = nullptr;-@@ -9142,6 +9347,8 @@ void WebPageProxy::createNewPage(IPC::Connection& connection, WindowFeatures&& w+@@ -9269,6 +9475,8 @@ void WebPageProxy::createNewPage(IPC::Connection& connection, WindowFeatures&& wif (RefPtr page = originatingFrameInfo->page())openerAppInitiatedState = page->lastNavigationWasAppInitiated();@@ -15350,15 +14189,15 @@ index d0b4b0e0264fb5b5e795ad17754d6f667452cb9d..2d01d2e9d787112a4b399653b0e178cfauto completionHandler = [this,protectedThis = Ref { *this },-@@ -9229,6 +9436,7 @@ void WebPageProxy::createNewPage(IPC::Connection& connection, WindowFeatures&& w+@@ -9356,6 +9564,7 @@ void WebPageProxy::createNewPage(IPC::Connection& connection, WindowFeatures&& wconfiguration->setInitialReferrerPolicy(effectiveReferrerPolicy);- configuration->setWindowFeatures(WTFMove(windowFeatures));+ configuration->setWindowFeatures(WTF::move(windowFeatures));configuration->setOpenedMainFrameName(openedMainFrameName);+ configuration->setOpenerPageForInspector(*this);if (RefPtr openerFrame = WebFrameProxy::webFrame(originatingFrameInfoData.frameID); navigationActionData.hasOpener && openerFrame) {configuration->setRelatedPage(*this);-@@ -9261,6 +9469,7 @@ void WebPageProxy::createNewPage(IPC::Connection& connection, WindowFeatures&& w+@@ -9391,6 +9600,7 @@ void WebPageProxy::createNewPage(IPC::Connection& connection, WindowFeatures&& wvoid WebPageProxy::showPage(){m_uiClient->showPage(this);@@ -15366,7 +14205,7 @@ index d0b4b0e0264fb5b5e795ad17754d6f667452cb9d..2d01d2e9d787112a4b399653b0e178cf}bool WebPageProxy::hasOpenedPage() const-@@ -9414,6 +9623,10 @@ void WebPageProxy::closePage()+@@ -9534,6 +9744,10 @@ void WebPageProxy::closePage()if (isClosed())return;@@ -15377,34 +14216,34 @@ index d0b4b0e0264fb5b5e795ad17754d6f667452cb9d..2d01d2e9d787112a4b399653b0e178cfWEBPAGEPROXY_RELEASE_LOG(Process, "closePage:");if (RefPtr pageClient = this->pageClient())pageClient->clearAllEditCommands();-@@ -9452,6 +9665,8 @@ void WebPageProxy::runJavaScriptAlert(IPC::Connection& connection, FrameIdentifi- }-- runModalJavaScriptDialog(WTFMove(frame), WTFMove(frameInfo), WTFMove(message), [reply = WTFMove(reply)](WebPageProxy& page, WebFrameProxy* frame, FrameInfoData&& frameInfo, String&& message, CompletionHandler<void()>&& completion) mutable {-+ if (page.m_inspectorDialogAgent)-+ page.m_inspectorDialogAgent->javascriptDialogOpening("alert"_s, message);- page.m_uiClient->runJavaScriptAlert(page, WTFMove(message), frame, WTFMove(frameInfo), [reply = WTFMove(reply), completion = WTFMove(completion)]() mutable {- reply();- completion();-@@ -9474,6 +9689,8 @@ void WebPageProxy::runJavaScriptConfirm(IPC::Connection& connection, FrameIdenti+@@ -9573,6 +9787,8 @@ void WebPageProxy::runJavaScriptAlert(IPC::Connection& connection, FrameIdentifi++ auto showModal = [protectedThis = Ref { *this }](RefPtr<WebFrameProxy>&& frame, FrameInfoData&& frameInfo, String&& message, CompletionHandler<void()>&& reply) mutable {+ protectedThis->runModalJavaScriptDialog(WTF::move(frame), WTF::move(frameInfo), WTF::move(message), [reply = WTF::move(reply)](WebPageProxy& page, WebFrameProxy* frame, FrameInfoData&& frameInfo, String&& message, CompletionHandler<void()>&& completion) mutable {++ if (page.m_inspectorDialogAgent)++ page.m_inspectorDialogAgent->javascriptDialogOpening("alert"_s, message);+ page.m_uiClient->runJavaScriptAlert(page, WTF::move(message), frame, WTF::move(frameInfo), [reply = WTF::move(reply), completion = WTF::move(completion)]() mutable {+ reply();+ completion();+@@ -9606,6 +9822,8 @@ void WebPageProxy::runJavaScriptConfirm(IPC::Connection& connection, FrameIdentiif (RefPtr automationSession = configuration().processPool().automationSession())automationSession->willShowJavaScriptDialog(*this, message, std::nullopt);}+ if (m_inspectorDialogAgent)+ m_inspectorDialogAgent->javascriptDialogOpening("confirm"_s, message);- runModalJavaScriptDialog(WTFMove(frame), WTFMove(frameInfo), WTFMove(message), [reply = WTFMove(reply)](WebPageProxy& page, WebFrameProxy* frame, FrameInfoData&& frameInfo, String&& message, CompletionHandler<void()>&& completion) mutable {- page.m_uiClient->runJavaScriptConfirm(page, WTFMove(message), frame, WTFMove(frameInfo), [reply = WTFMove(reply), completion = WTFMove(completion)](bool result) mutable {-@@ -9498,6 +9715,8 @@ void WebPageProxy::runJavaScriptPrompt(IPC::Connection& connection, FrameIdentif+ auto showModal = [protectedThis = Ref { *this }](RefPtr<WebFrameProxy>&& frame, FrameInfoData&& frameInfo, String&& message, CompletionHandler<void(bool)>&& reply) mutable {+ protectedThis->runModalJavaScriptDialog(WTF::move(frame), WTF::move(frameInfo), WTF::move(message), [reply = WTF::move(reply)](WebPageProxy& page, WebFrameProxy* frame, FrameInfoData&& frameInfo, String&& message, CompletionHandler<void()>&& completion) mutable {+@@ -9642,6 +9860,8 @@ void WebPageProxy::runJavaScriptPrompt(IPC::Connection& connection, FrameIdentifif (RefPtr automationSession = configuration().processPool().automationSession())automationSession->willShowJavaScriptDialog(*this, message, defaultValue);}+ if (m_inspectorDialogAgent)+ m_inspectorDialogAgent->javascriptDialogOpening("prompt"_s, message, defaultValue);- runModalJavaScriptDialog(WTFMove(frame), WTFMove(frameInfo), WTFMove(message), [reply = WTFMove(reply), defaultValue= WTFMove(defaultValue)](WebPageProxy& page, WebFrameProxy* frame, FrameInfoData&& frameInfo, String&& message, CompletionHandler<void()>&& completion) mutable {- page.m_uiClient->runJavaScriptPrompt(page, WTFMove(message), WTFMove(defaultValue), frame, WTFMove(frameInfo), [reply = WTFMove(reply), completion = WTFMove(completion)](auto& result) mutable {-@@ -9634,6 +9853,8 @@ void WebPageProxy::runBeforeUnloadConfirmPanel(IPC::Connection& connection, Fram+ auto showModal = [protectedThis = Ref { *this }](RefPtr<WebFrameProxy>&& frame, FrameInfoData&& frameInfo, String&& message, String&& defaultValue, CompletionHandler<void(const String&)>&& reply) mutable {+ protectedThis->runModalJavaScriptDialog(WTF::move(frame), WTF::move(frameInfo), WTF::move(message), [reply = WTF::move(reply), defaultValue = WTF::move(defaultValue)](WebPageProxy& page, WebFrameProxy* frame, FrameInfoData&& frameInfo, String&& message, CompletionHandler<void()>&& completion) mutable {+@@ -9766,6 +9986,8 @@ void WebPageProxy::runBeforeUnloadConfirmPanel(IPC::Connection& connection, Framreturn;}}@@ -15413,19 +14252,19 @@ index d0b4b0e0264fb5b5e795ad17754d6f667452cb9d..2d01d2e9d787112a4b399653b0e178cf// Since runBeforeUnloadConfirmPanel() can spin a nested run loop we need to turn off the responsiveness timer and the tryClose timer.webProcess->stopResponsivenessTimer();-@@ -10292,6 +10513,11 @@ void WebPageProxy::resourceLoadDidCompleteWithError(ResourceLoadInfo&& loadInfo,+@@ -10425,6 +10647,11 @@ void WebPageProxy::resourceLoadDidCompleteWithError(ResourceLoadInfo&& loadInfo,}#if ENABLE(FULLSCREEN_API)+void WebPageProxy::setFullScreenManagerClientOverride(std::unique_ptr<WebFullScreenManagerProxyClient>&& client)+{-+ m_fullScreenManagerClientOverride = WTFMove(client);++ m_fullScreenManagerClientOverride = WTF::move(client);+}+WebFullScreenManagerProxy* WebPageProxy::fullScreenManager(){return m_fullScreenManager.get();-@@ -10436,6 +10662,17 @@ void WebPageProxy::requestDOMPasteAccess(IPC::Connection& connection, DOMPasteAc+@@ -10557,6 +10784,17 @@ void WebPageProxy::requestDOMPasteAccess(IPC::Connection& connection, DOMPasteAc}}@@ -15440,10 +14279,10 @@ index d0b4b0e0264fb5b5e795ad17754d6f667452cb9d..2d01d2e9d787112a4b399653b0e178cf+ return;+ }+- protectedPageClient()->requestDOMPasteAccess(pasteAccessCategory, requiresInteraction, elementRect, originIdentifier, WTFMove(completionHandler));+ protect(pageClient())->requestDOMPasteAccess(pasteAccessCategory, requiresInteraction, elementRect, originIdentifier, WTF::move(completionHandler));}-@@ -11365,6 +11602,8 @@ void WebPageProxy::mouseEventHandlingCompleted(std::optional<WebEventType> event+@@ -11527,6 +11765,8 @@ void WebPageProxy::mouseEventHandlingCompleted(std::optional<WebEventType> eventif (RefPtr automationSession = configuration().processPool().automationSession())automationSession->mouseEventsFlushedForPage(*this);didFinishProcessingAllPendingMouseEvents();@@ -15452,7 +14291,7 @@ index d0b4b0e0264fb5b5e795ad17754d6f667452cb9d..2d01d2e9d787112a4b399653b0e178cf}}-@@ -11422,6 +11661,7 @@ void WebPageProxy::keyEventHandlingCompleted(std::optional<WebEventType> eventTy+@@ -11584,6 +11824,7 @@ void WebPageProxy::keyEventHandlingCompleted(std::optional<WebEventType> eventTyif (!canProcessMoreKeyEvents) {if (RefPtr automationSession = configuration().processPool().automationSession())automationSession->keyboardEventsFlushedForPage(*this);@@ -15460,8 +14299,8 @@ index d0b4b0e0264fb5b5e795ad17754d6f667452cb9d..2d01d2e9d787112a4b399653b0e178cf}}-@@ -11866,7 +12106,10 @@ void WebPageProxy::dispatchProcessDidTerminate(WebProcessProxy& process, Process- protectedBrowsingContextGroup()->processDidTerminate(*this, process);+@@ -12028,7 +12269,10 @@ void WebPageProxy::dispatchProcessDidTerminate(WebProcessProxy& process, Process+ protect(browsingContextGroup())->processDidTerminate(*this, process);}- bool handledByClient = false;@@ -15472,16 +14311,17 @@ index d0b4b0e0264fb5b5e795ad17754d6f667452cb9d..2d01d2e9d787112a4b399653b0e178cfif (m_loaderClient)handledByClient = reason != ProcessTerminationReason::RequestedByClient && m_loaderClient->processDidCrash(*this);else-@@ -12532,6 +12775,8 @@ WebPageCreationParameters WebPageProxy::creationParameters(WebProcessProxy& proc- parameters.httpsUpgradeEnabled = preferences->upgradeKnownHostsToHTTPSEnabled() ? m_configuration->httpsUpgradeEnabled() : false;+@@ -12692,6 +12936,9 @@ WebPageCreationParameters WebPageProxy::creationParameters(WebProcessProxy& procparameters.allowPostingLegacySynchronousMessages = m_configuration->allowPostingLegacySynchronousMessages();+ parameters.backgroundTextExtractionEnabled = m_configuration->backgroundTextExtractionEnabled();++ parameters.deviceOrientationOverride = m_deviceOrientationOverride;+ parameters.shouldPauseInInspectorWhenShown = m_inspectorController->shouldPauseInInspectorWhenShown();-+++#if ENABLE(APP_HIGHLIGHTS)parameters.appHighlightsVisible = appHighlightsVisibility() ? HighlightVisibility::Visible : HighlightVisibility::Hidden;#endif-@@ -12707,8 +12952,47 @@ void WebPageProxy::allowGamepadAccess()+@@ -12867,8 +13114,47 @@ void WebPageProxy::allowGamepadAccess()#endif // ENABLE(GAMEPAD)@@ -15529,7 +14369,7 @@ index d0b4b0e0264fb5b5e795ad17754d6f667452cb9d..2d01d2e9d787112a4b399653b0e178cfif (negotiatedLegacyTLS == NegotiatedLegacyTLS::Yes) {m_navigationClient->shouldAllowLegacyTLS(*this, authenticationChallenge.get(), [this, protectedThis = Ref { *this }, authenticationChallenge] (bool shouldAllowLegacyTLS) {if (shouldAllowLegacyTLS)-@@ -12804,6 +13088,12 @@ void WebPageProxy::requestGeolocationPermissionForFrame(IPC::Connection& connect+@@ -12964,6 +13250,12 @@ void WebPageProxy::requestGeolocationPermissionForFrame(IPC::Connection& connectrequest->deny();};@@ -15542,7 +14382,7 @@ index d0b4b0e0264fb5b5e795ad17754d6f667452cb9d..2d01d2e9d787112a4b399653b0e178cf// 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-@@ -12870,6 +13160,12 @@ void WebPageProxy::queryPermission(const ClientOrigin& clientOrigin, const Permi+@@ -13072,6 +13364,12 @@ void WebPageProxy::queryPermission(const ClientOrigin& clientOrigin, const PermishouldChangeDeniedToPrompt = false;if (sessionID().isEphemeral()) {@@ -15555,7 +14395,7 @@ index d0b4b0e0264fb5b5e795ad17754d6f667452cb9d..2d01d2e9d787112a4b399653b0e178cfcompletionHandler(shouldChangeDeniedToPrompt ? PermissionState::Prompt : PermissionState::Denied);return;}-@@ -12884,6 +13180,12 @@ void WebPageProxy::queryPermission(const ClientOrigin& clientOrigin, const Permi+@@ -13086,6 +13384,12 @@ void WebPageProxy::queryPermission(const ClientOrigin& clientOrigin, const Permireturn;}@@ -15569,7 +14409,7 @@ index d0b4b0e0264fb5b5e795ad17754d6f667452cb9d..2d01d2e9d787112a4b399653b0e178cfcompletionHandler(shouldChangeDeniedToPrompt ? PermissionState::Prompt : PermissionState::Denied);return;diff --git a/Source/WebKit/UIProcess/WebPageProxy.h b/Source/WebKit/UIProcess/WebPageProxy.h-index 9cb985c53f034ad4d70ca524d81fd00101b5e0a1..313378d78a0f329308097c203cf1973964b75f92 100644+index 7a8a7b2bb8582944cf13dfb090419806ff8a9cb5..d781bf1304aefc891f669fe2159d42d570b0b886 100644--- a/Source/WebKit/UIProcess/WebPageProxy.h+++ b/Source/WebKit/UIProcess/WebPageProxy.h@@ -28,6 +28,7 @@@@ -15578,10 +14418,10 @@ index 9cb985c53f034ad4d70ca524d81fd00101b5e0a1..313378d78a0f329308097c203cf19739#include "APIObject.h"+#include "APIWebsitePolicies.h"#include "MessageReceiver.h"- #include <WebCore/LayerHostingContextIdentifier.h>#include <wtf/ApproximateTime.h>-@@ -40,6 +41,20 @@- #include <wtf/RunLoop.h>+ #include <wtf/CheckedRef.h>+@@ -41,6 +42,20 @@+ #include <wtf/SwiftBridging.h>#include <wtf/UniqueRef.h>#include <wtf/WeakHashSet.h>+#include "InspectorDialogAgent.h"@@ -15599,9 +14439,9 @@ index 9cb985c53f034ad4d70ca524d81fd00101b5e0a1..313378d78a0f329308097c203cf19739+#include <WebCore/SelectionData.h>+#endif- namespace API {- class Attachment;-@@ -117,6 +132,7 @@ class DragData;+ #if USE(COORDINATED_GRAPHICS) && HAVE(DISPLAY_LINK)+ #include "DisplayLinkObserverID.h"+@@ -128,6 +143,7 @@ class DragData;class Exception;class FloatPoint;class FloatQuad;@@ -15609,7 +14449,7 @@ index 9cb985c53f034ad4d70ca524d81fd00101b5e0a1..313378d78a0f329308097c203cf19739class FloatRect;class FloatSize;class FontAttributeChanges;-@@ -788,6 +804,8 @@ public:+@@ -816,6 +832,8 @@ public:RefPtr<WebAutomationSession> activeAutomationSession() const;WebPageInspectorController& inspectorController() { return m_inspectorController.get(); }@@ -15618,15 +14458,15 @@ index 9cb985c53f034ad4d70ca524d81fd00101b5e0a1..313378d78a0f329308097c203cf19739#if PLATFORM(IOS_FAMILY)void showInspectorIndication();-@@ -822,6 +840,7 @@ public:+@@ -848,6 +866,7 @@ public:bool hasSleepDisabler() const;#if ENABLE(FULLSCREEN_API)+ void setFullScreenManagerClientOverride(std::unique_ptr<WebFullScreenManagerProxyClient>&&);WebFullScreenManagerProxy* fullScreenManager();- RefPtr<WebFullScreenManagerProxy> protectedFullScreenManager();void setFullScreenClientForTesting(std::unique_ptr<WebKit::WebFullScreenManagerProxyClient>&&);-@@ -921,6 +940,12 @@ public:++@@ -951,6 +970,12 @@ public:void setPageLoadStateObserver(RefPtr<PageLoadStateObserverBase>&&);@@ -15639,30 +14479,31 @@ index 9cb985c53f034ad4d70ca524d81fd00101b5e0a1..313378d78a0f329308097c203cf19739void initializeWebPage(const WebCore::Site&, WebCore::SandboxFlags, WebCore::ReferrerPolicy);void setDrawingArea(RefPtr<DrawingAreaProxy>&&);-@@ -952,6 +977,8 @@ public:- RefPtr<API::Navigation> loadRequest(WebCore::ResourceRequest&&, WebCore::ShouldOpenExternalURLsPolicy, WebCore::IsPerformingHTTPFallback);- RefPtr<API::Navigation> loadRequest(WebCore::ResourceRequest&&, WebCore::ShouldOpenExternalURLsPolicy, WebCore::IsPerformingHTTPFallback, std::unique_ptr<NavigationActionData>&&, API::Object* userData = nullptr, bool isRequestFromClientOrUserInput = true);+@@ -982,6 +1007,8 @@ public:+ RefPtr<API::Navigation> loadRequest(WebCore::ResourceRequest&&, WebCore::ShouldOpenExternalURLsPolicy, WebCore::NavigationUpgradeToHTTPSBehavior);+ RefPtr<API::Navigation> loadRequest(WebCore::ResourceRequest&&, WebCore::ShouldOpenExternalURLsPolicy, WebCore::NavigationUpgradeToHTTPSBehavior, std::unique_ptr<NavigationActionData>&&, API::Object* userData = nullptr, bool isRequestFromClientOrUserInput = true);+ RefPtr<API::Navigation> loadRequestForInspector(WebCore::ResourceRequest&&, WebFrameProxy*);+RefPtr<API::Navigation> loadFile(const String& fileURL, const String& resourceDirectoryURL, bool isAppInitiated = true, API::Object* userData = nullptr);RefPtr<API::Navigation> loadData(Ref<WebCore::SharedBuffer>&&, const String& MIMEType, const String& encoding, const String& baseURL, API::Object* userData = nullptr);RefPtr<API::Navigation> loadData(Ref<WebCore::SharedBuffer>&&, const String& MIMEType, const String& encoding, const String& baseURL, API::Object* userData, WebCore::ShouldOpenExternalURLsPolicy);-@@ -1045,6 +1072,7 @@ public:+@@ -1077,6 +1104,7 @@ public:+ void restoreSelectionInFocusedEditableElement();PageClient* pageClient() const;- RefPtr<PageClient> protectedPageClient() const;+ bool hasPageClient() const { return !!m_pageClient; }void setViewNeedsDisplay(const WebCore::Region&);- void requestScroll(const WebCore::FloatPoint& scrollPosition, const WebCore::IntPoint& scrollOrigin, WebCore::ScrollIsAnimated);-@@ -1712,10 +1740,13 @@ public:+ void requestScroll(const WebCore::FloatPoint& scrollPosition, const WebCore::IntPoint& scrollOrigin, WebCore::ScrollIsAnimated, WebCore::InterruptScrollAnimation);+@@ -1749,11 +1777,14 @@ public:void didStartDrag();void dragCancelled();void setDragCaretRect(const WebCore::IntRect&);+ void setInterceptDrags(bool shouldIntercept);+ bool cancelDragIfNeeded();#if PLATFORM(COCOA)+ void propagateDragAndDrop(DragEventForwardingData&&, const String&, WebCore::DragData&&);void startDrag(const WebCore::DragItem&, WebCore::ShareableBitmapHandle&& dragImageHandle, const std::optional<WebCore::NodeIdentifier>&);void setPromisedDataForImage(IPC::Connection&, const String& pasteboardName, WebCore::SharedMemoryHandle&& imageHandle, const String& filename, const String& extension,const String& title, const String& url, const String& visibleURL, WebCore::SharedMemoryHandle&& archiveHandle, const String& originIdentifier);@@ -15670,7 +14511,7 @@ index 9cb985c53f034ad4d70ca524d81fd00101b5e0a1..313378d78a0f329308097c203cf19739#endif#if PLATFORM(GTK) || PLATFORM(WPE)void startDrag(WebCore::SelectionData&&, OptionSet<WebCore::DragOperation>, std::optional<WebCore::ShareableBitmapHandle>&& dragImage, WebCore::IntPoint&& dragImageHotspot);-@@ -1723,6 +1754,9 @@ public:+@@ -1761,6 +1792,9 @@ public:#if ENABLE(MODEL_PROCESS)void modelDragEnded(const WebCore::NodeIdentifier);#endif@@ -15680,7 +14521,7 @@ index 9cb985c53f034ad4d70ca524d81fd00101b5e0a1..313378d78a0f329308097c203cf19739#endifvoid processDidBecomeUnresponsive(WebProcessProxy&);-@@ -1968,6 +2002,7 @@ public:+@@ -2007,6 +2041,7 @@ public:void setViewportSizeForCSSViewportUnits(const WebCore::FloatSize&);WebCore::FloatSize viewportSizeForCSSViewportUnits() const;@@ -15688,7 +14529,7 @@ index 9cb985c53f034ad4d70ca524d81fd00101b5e0a1..313378d78a0f329308097c203cf19739void didReceiveAuthenticationChallengeProxy(Ref<AuthenticationChallengeProxy>&&, NegotiatedLegacyTLS);void negotiatedLegacyTLS();void didNegotiateModernTLS(const URL&);-@@ -2001,6 +2036,8 @@ public:+@@ -2040,6 +2075,8 @@ public:// TODO Replace RefPtr with Expected for error reporting https://webkit.org/b/300271RefPtr<ViewSnapshot> takeViewSnapshot(std::optional<WebCore::IntRect>&&);RefPtr<ViewSnapshot> takeViewSnapshot(std::optional<WebCore::IntRect>&&, ForceSoftwareCapturingViewportSnapshot);@@ -15697,26 +14538,29 @@ index 9cb985c53f034ad4d70ca524d81fd00101b5e0a1..313378d78a0f329308097c203cf19739#endifvoid serializeAndWrapCryptoKey(IPC::Connection&, WebCore::CryptoKeyData&&, CompletionHandler<void(std::optional<Vector<uint8_t>>&&)>&&);-@@ -3100,6 +3137,7 @@ private:+@@ -3136,6 +3173,7 @@ private:RefPtr<API::Navigation> launchProcessForReload();void requestNotificationPermission(const String& originString, CompletionHandler<void(bool allowed)>&&);+ std::optional<bool> permissionForAutomation(const String& origin, const String& permission) const;- void didChangeContentSize(const WebCore::IntSize&);- void didChangeIntrinsicContentSize(const WebCore::IntSize&);-@@ -3623,8 +3661,10 @@ private:+ #if ENABLE(WEB_ARCHIVE)+ bool shouldAlwaysPromptForPermission(WebCore::PermissionName) const;+@@ -3669,11 +3707,13 @@ private:String m_openedMainFrameName;RefPtr<WebInspectorUIProxy> m_inspector;+ InspectorDialogAgent* m_inspectorDialogAgent { nullptr };+ Deque<std::pair<WebUndoStepID, UndoOrRedo>> m_pendingUndoRedo;+ uint32_t m_undoVersion { 0 };+#if ENABLE(FULLSCREEN_API)+ std::unique_ptr<WebFullScreenManagerProxyClient> m_fullScreenManagerClientOverride;RefPtr<WebFullScreenManagerProxy> m_fullScreenManager;std::unique_ptr<API::FullscreenClient> m_fullscreenClient;#endif-@@ -3826,6 +3866,22 @@ private:+@@ -3875,6 +3915,22 @@ private:std::optional<WebCore::DragOperation> m_currentDragOperation;bool m_currentDragIsOverFileInput { false };unsigned m_currentDragNumberOfFilesToBeAccepted { 0 };@@ -15739,19 +14583,20 @@ index 9cb985c53f034ad4d70ca524d81fd00101b5e0a1..313378d78a0f329308097c203cf19739#endifbool m_mainFrameHasHorizontalScrollbar { false };-@@ -3996,6 +4052,10 @@ private:+@@ -4045,6 +4101,11 @@ private:RefPtr<API::Object> messageBody;};Vector<InjectedBundleMessage> m_pendingInjectedBundleMessages;+ std::optional<WebCore::Credential> m_credentialsForAutomation;+ std::optional<URL> m_authOriginForAutomation;+ UncheckedKeyHashMap<String, HashSet<String>> m_permissionsForAutomation;++ std::optional<int> m_deviceOrientationOverride;+ std::optional<bool> m_activeForAutomation;#if PLATFORM(IOS_FAMILY) && ENABLE(DEVICE_ORIENTATION)RefPtr<WebDeviceOrientationUpdateProviderProxy> m_webDeviceOrientationUpdateProviderProxy;diff --git a/Source/WebKit/UIProcess/WebPageProxy.messages.in b/Source/WebKit/UIProcess/WebPageProxy.messages.in-index 899d02516e622698c1d9398cbc3a79ad047baa8c..62e5fa6143c099dabcd7532db76f52d65a749101 100644+index 70c42df56c678ae01f366f3d5ac3012d7b92a760..a3cf4f8fe954a44c7b06fa5e7f57ffe8df9a6ceb 100644--- a/Source/WebKit/UIProcess/WebPageProxy.messages.in+++ b/Source/WebKit/UIProcess/WebPageProxy.messages.in@@ -35,6 +35,7 @@ messages -> WebPageProxy {@@ -15762,7 +14607,7 @@ index 899d02516e622698c1d9398cbc3a79ad047baa8c..62e5fa6143c099dabcd7532db76f52d6DidReceiveEventIPC(enum:uint32_t WebKit::WebEventType eventType, bool handled, struct std::optional<WebCore::RemoteUserInputEventData> remoteUserInputEventData)SetCursor(WebCore::Cursor cursor)-@@ -336,6 +337,10 @@ messages -> WebPageProxy {+@@ -343,6 +344,10 @@ messages -> WebPageProxy {StartDrag(WebCore::SelectionData selectionData, OptionSet<WebCore::DragOperation> dragOperationMask, std::optional<WebCore::ShareableBitmapHandle> dragImage, WebCore::IntPoint dragImageHotspot)#endif@@ -15774,7 +14619,7 @@ index 899d02516e622698c1d9398cbc3a79ad047baa8c..62e5fa6143c099dabcd7532db76f52d6WillReceiveEditDragSnapshot()DidReceiveEditDragSnapshot(RefPtr<WebCore::TextIndicator> textIndicator)diff --git a/Source/WebKit/UIProcess/WebProcessCache.cpp b/Source/WebKit/UIProcess/WebProcessCache.cpp-index 3b1429adbb2443b5341ccf3b694d817a3242bade..703a9d5543f1d0c84b38e73edd2c393be3016415 100644+index 302e7346a5607d06ef0467fae67f38a116144184..568eaa02fdb313a2c4f25be9f61e695d33ed87ba 100644--- a/Source/WebKit/UIProcess/WebProcessCache.cpp+++ b/Source/WebKit/UIProcess/WebProcessCache.cpp@@ -120,6 +120,10 @@ bool WebProcessCache::canCacheProcess(WebProcessProxy& process) const@@ -15789,15 +14634,15 @@ index 3b1429adbb2443b5341ccf3b694d817a3242bade..703a9d5543f1d0c84b38e73edd2c393b}diff --git a/Source/WebKit/UIProcess/WebProcessPool.cpp b/Source/WebKit/UIProcess/WebProcessPool.cpp-index e2900f2e299cba3e390ed5a6eb72b4064ef54d40..217a64185a7e9d7bdf397ea86b6dbb771e9557cd 100644+index fee48b818c8c467c76d7a2969f50f59b91251166..28c0e7d660aaa3b54d3970e2b34db4f4129f12d4 100644--- a/Source/WebKit/UIProcess/WebProcessPool.cpp+++ b/Source/WebKit/UIProcess/WebProcessPool.cpp@@ -431,10 +431,10 @@ void WebProcessPool::setAutomationClient(std::unique_ptr<API::AutomationClient>&void WebProcessPool::setOverrideLanguages(Vector<String>&& languages){-- WebKit::setOverrideLanguages(WTFMove(languages));-+ m_configuration->setOverrideLanguages(WTFMove(languages));+- WebKit::setOverrideLanguages(WTF::move(languages));++ m_configuration->setOverrideLanguages(WTF::move(languages));LOG_WITH_STREAM(Language, stream << "WebProcessPool is setting OverrideLanguages: " << languages);- sendToAllProcesses(Messages::WebProcess::UserPreferredLanguagesChanged(overrideLanguages()));@@ -15817,7 +14662,7 @@ index e2900f2e299cba3e390ed5a6eb72b4064ef54d40..217a64185a7e9d7bdf397ea86b6dbb77void WebProcessPool::fullKeyboardAccessModeChanged(bool fullKeyboardAccessEnabled){-@@ -1004,7 +1005,7 @@ void WebProcessPool::initializeNewWebProcess(WebProcessProxy& process, WebsiteDa+@@ -1011,7 +1012,7 @@ void WebProcessPool::initializeNewWebProcess(WebProcessProxy& process, WebsiteDa#endifparameters.cacheModel = LegacyGlobalSettings::singleton().cacheModel();@@ -15826,8 +14671,109 @@ index e2900f2e299cba3e390ed5a6eb72b4064ef54d40..217a64185a7e9d7bdf397ea86b6dbb77LOG_WITH_STREAM(Language, stream << "WebProcessPool is initializing a new web process with overrideLanguages: " << parameters.overrideLanguages);parameters.urlSchemesRegisteredAsSecure = copyToVector(LegacyGlobalSettings::singleton().schemesToRegisterAsSecure());+@@ -1084,7 +1085,7 @@ void WebProcessPool::initializeNewWebProcess(WebProcessProxy& process, WebsiteDa+ if (!injectedBundleInitializationUserData)+ injectedBundleInitializationUserData = m_injectedBundleInitializationUserData;+ parameters.initializationUserData = UserData(process.transformObjectsToHandles(injectedBundleInitializationUserData.get()));+-+++ if (websiteDataStore)+ parameters.websiteDataStoreParameters = webProcessDataStoreParameters(process, *websiteDataStore);++@@ -1178,14 +1179,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) {+- SandboxExtension::Handle sampleLogSandboxHandle;++ SandboxExtension::Handle sampleLogSandboxHandle;+ WallTime now = WallTime::now();+ auto sampleLogFilePath = makeString("WebProcess"_s, now.secondsSinceEpoch().secondsAs<uint64_t>(), "pid"_s, process.processID());+ if (auto handleAndFilePath = SandboxExtension::createHandleForTemporaryFile(sampleLogFilePath, SandboxExtension::Type::ReadWrite)) {+ sampleLogSandboxHandle = WTF::move(handleAndFilePath->first);+ sampleLogFilePath = WTF::move(handleAndFilePath->second);+ }+-+++ process.send(Messages::WebProcess::StartMemorySampler(WTF::move(sampleLogSandboxHandle), sampleLogFilePath, m_memorySamplerInterval), 0);+ }++@@ -1380,9 +1381,9 @@ Ref<WebPageProxy> WebProcessPool::createWebPage(PageClient& pageClient, Ref<API:+ }++ Ref userContentController = pageConfiguration->userContentController();+-+++ ASSERT(process);+-+++ process->setAllowTestOnlyIPC(pageConfiguration->allowTestOnlyIPC());++ auto page = process->createWebPage(pageClient, WTF::move(pageConfiguration));+@@ -1767,18 +1768,18 @@ void WebProcessPool::setEnhancedAccessibility(bool flag)+ {+ sendToAllProcesses(Messages::WebProcess::SetEnhancedAccessibility(flag));+ }+-+++ void WebProcessPool::startMemorySampler(const double interval)+-{++{+ // For new WebProcesses we will also want to start the Memory Sampler+ m_memorySamplerEnabled = true;+ m_memorySamplerInterval = interval;+-+++ // For UIProcess+ #if ENABLE(MEMORY_SAMPLER)+ WebMemorySampler::singleton()->start(interval);+ #endif+-+++ for (auto& process : m_processes) {+ if (!process->canSendMessage())+ continue;+@@ -1797,10 +1798,10 @@ void WebProcessPool::startMemorySampler(const double interval)+ }++ void WebProcessPool::stopMemorySampler()+-{++{+ // For WebProcess+ m_memorySamplerEnabled = false;+-+++ // For UIProcess+ #if ENABLE(MEMORY_SAMPLER)+ WebMemorySampler::singleton()->stop();+@@ -1852,7 +1853,7 @@ void WebProcessPool::setAutomationSession(RefPtr<WebAutomationSession>&& automat+ {+ if (RefPtr previousSession = m_automationSession)+ previousSession->setProcessPool(nullptr);+-+++ m_automationSession = WTF::move(automationSession);++ #if ENABLE(REMOTE_INSPECTOR)+@@ -2415,7 +2416,7 @@ std::tuple<Ref<WebProcessProxy>, RefPtr<SuspendedPageProxy>, ASCIILiteral> WebPr+ }++ auto reason = "Navigation is cross-site"_s;+-+++ if (m_configuration->alwaysKeepAndReuseSwappedProcesses()) {+ LOG(ProcessSwapping, "(ProcessSwapping) Considering re-use of a previously cached process for domain %s", targetSite.domain().string().utf8().data());++@@ -2520,7 +2521,7 @@ void WebProcessPool::setDomainsWithUserInteraction(HashSet<WebCore::RegistrableD+ }++ void WebProcessPool::setDomainsWithCrossPageStorageAccess(HashMap<TopFrameDomain, Vector<SubResourceDomain>>&& domains, CompletionHandler<void()>&& completionHandler)+-{++{+ Ref callbackAggregator = CallbackAggregator::create(WTF::move(completionHandler));++ for (Ref process : processes())diff --git a/Source/WebKit/UIProcess/WebProcessProxy.cpp b/Source/WebKit/UIProcess/WebProcessProxy.cpp-index bf0f768de3854bbeee47c8667d2130741cc03289..070d4318a76dccd7a005a36e770709b07c4f96bf 100644+index e29052953675da1ad140f2dd485f7f41c8b5a1d1..8f422f122082809ab716bba4d8deab04eb47a49f 100644--- a/Source/WebKit/UIProcess/WebProcessProxy.cpp+++ b/Source/WebKit/UIProcess/WebProcessProxy.cpp@@ -215,6 +215,11 @@ Vector<Ref<WebProcessProxy>> WebProcessProxy::allProcesses()@@ -15842,8 +14788,8 @@ index bf0f768de3854bbeee47c8667d2130741cc03289..070d4318a76dccd7a005a36e770709b0RefPtr<WebProcessProxy> WebProcessProxy::processForIdentifier(ProcessIdentifier identifier){return allProcessMap().get(identifier);-@@ -561,6 +566,26 @@ void WebProcessProxy::getLaunchOptions(ProcessLauncher::LaunchOptions& launchOpt- if (WebKit::isInspectorProcessPool(protectedProcessPool()))+@@ -564,6 +569,26 @@ void WebProcessProxy::getLaunchOptions(ProcessLauncher::LaunchOptions& launchOpt+ if (WebKit::isInspectorProcessPool(protect(processPool())))launchOptions.extraInitializationData.add<HashTranslatorASCIILiteral>("inspector-process"_s, "1"_s);+ /* playwright revert fb205fb, 50f8fee */@@ -15870,10 +14816,10 @@ index bf0f768de3854bbeee47c8667d2130741cc03289..070d4318a76dccd7a005a36e770709b0if (isPrewarmed())diff --git a/Source/WebKit/UIProcess/WebProcessProxy.h b/Source/WebKit/UIProcess/WebProcessProxy.h-index 62f97606fe069680a2ea36d0c746b02515f662c5..38414fff9749671ac1a4d88328707822d4a09df4 100644+index 1b7181721762e1a28ab0d0688c5a35dfd4fb9ee3..49b5e50f3932a9fa2c57585e70cd9e4065079480 100644--- a/Source/WebKit/UIProcess/WebProcessProxy.h+++ b/Source/WebKit/UIProcess/WebProcessProxy.h-@@ -198,6 +198,7 @@ public:+@@ -208,6 +208,7 @@ public:static void forWebPagesWithOrigin(PAL::SessionID, const WebCore::SecurityOriginData&, NOESCAPE const Function<void(WebPageProxy&)>&);static Vector<std::pair<WebCore::ProcessIdentifier, WebCore::RegistrableDomain>> allowedFirstPartiesForCookies();@@ -15882,7 +14828,7 @@ index 62f97606fe069680a2ea36d0c746b02515f662c5..38414fff9749671ac1a4d88328707822void initializeWebProcess(WebProcessCreationParameters&&);diff --git a/Source/WebKit/UIProcess/WebURLSchemeTask.cpp b/Source/WebKit/UIProcess/WebURLSchemeTask.cpp-index 44c8399606f4bbf6cf7f84763b3d9b9c07f8dff7..a53f6a8d84eb45288a0cedc75f34646e486c84df 100644+index 39ea73a0da8bf68156f3e17ab4b575d25b4962a5..4b3567e34f588104f6dd76cb38fcd0ba158cd9c2 100644--- a/Source/WebKit/UIProcess/WebURLSchemeTask.cpp+++ b/Source/WebKit/UIProcess/WebURLSchemeTask.cpp@@ -33,6 +33,7 @@@@ -15894,10 +14840,10 @@ index 44c8399606f4bbf6cf7f84763b3d9b9c07f8dff7..a53f6a8d84eb45288a0cedc75f34646e#include "WebURLSchemeHandlerIdentifier.h"#include <WebCore/ResourceLoaderIdentifier.h>diff --git a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp-index fdc795d4b32f5a8f901700d797d73e3a1b170e3b..bf14d3c543549ae12861604b87ae14dc4d00166c 100644+index c9c6418e3b4c9fea5c21dae27d21300986bfdbce..1f0ad46549bacd791b83d3ab98a6bae17b72b1c6 100644--- a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp+++ b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp-@@ -323,15 +323,10 @@ SOAuthorizationCoordinator& WebsiteDataStore::soAuthorizationCoordinator(const W+@@ -314,15 +314,10 @@ SOAuthorizationCoordinator& WebsiteDataStore::soAuthorizationCoordinator(const Wstatic Ref<NetworkProcessProxy> networkProcessForSession(PAL::SessionID sessionID){@@ -15916,7 +14862,7 @@ index fdc795d4b32f5a8f901700d797d73e3a1b170e3b..bf14d3c543549ae12861604b87ae14dc#elseUNUSED_PARAM(sessionID);return NetworkProcessProxy::ensureDefaultNetworkProcess();-@@ -2124,6 +2119,15 @@ void WebsiteDataStore::setCacheModelSynchronouslyForTesting(CacheModel cacheMode+@@ -2116,6 +2111,15 @@ void WebsiteDataStore::setCacheModelSynchronouslyForTesting(CacheModel cacheModeprocessPool->setCacheModelSynchronouslyForTesting(cacheModel);}@@ -15932,8 +14878,8 @@ index fdc795d4b32f5a8f901700d797d73e3a1b170e3b..bf14d3c543549ae12861604b87ae14dcVector<WebsiteDataStoreParameters> WebsiteDataStore::parametersFromEachWebsiteDataStore(){return WTF::map(allDataStores(), [](auto& entry) {-@@ -2558,6 +2562,12 @@ void WebsiteDataStore::originDirectoryForTesting(WebCore::ClientOrigin&& origin,- protectedNetworkProcess()->websiteDataOriginDirectoryForTesting(m_sessionID, WTFMove(origin), type, WTFMove(completionHandler));+@@ -2535,6 +2539,12 @@ void WebsiteDataStore::originDirectoryForTesting(WebCore::ClientOrigin&& origin,+ protect(networkProcess())->websiteDataOriginDirectoryForTesting(m_sessionID, WTF::move(origin), type, WTF::move(completionHandler));}+void WebsiteDataStore::setDownloadForAutomation(std::optional<bool> allow, const String& downloadPath)@@ -15946,7 +14892,7 @@ index fdc795d4b32f5a8f901700d797d73e3a1b170e3b..bf14d3c543549ae12861604b87ae14dcvoid WebsiteDataStore::hasAppBoundSession(CompletionHandler<void(bool)>&& completionHandler) const{diff --git a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h-index e0afaafced524352fc1b9cea74a2b8f04a314889..532ace70a24215725c75c4b45b1608ab57327249 100644+index 865a19833f9b6e849fa3c38578a1ae52d723499a..c7e3aacb258241b85be1405a58bf07cb8355103d 100644--- a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h+++ b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h@@ -102,6 +102,7 @@ class DeviceIdHashSaltStorage;@@ -15991,7 +14937,7 @@ index e0afaafced524352fc1b9cea74a2b8f04a314889..532ace70a24215725c75c4b45b1608abvoid setNetworkProxySettings(WebCore::SoupNetworkProxySettings&&);const WebCore::SoupNetworkProxySettings& networkProxySettings() const { return m_networkProxySettings; }void setCookiePersistentStorage(const String&, SoupCookiePersistentStorageType);-@@ -429,6 +441,12 @@ public:+@@ -425,6 +437,12 @@ public:static const String& defaultBaseDataDirectory();#endif@@ -16004,7 +14950,7 @@ index e0afaafced524352fc1b9cea74a2b8f04a314889..532ace70a24215725c75c4b45b1608abvoid resetQuota(CompletionHandler<void()>&&);void resetStoragePersistedState(CompletionHandler<void()>&&);#if PLATFORM(IOS_FAMILY)-@@ -645,7 +663,9 @@ private:+@@ -641,7 +659,9 @@ private:#if USE(SOUP)bool m_persistentCredentialStorageEnabled { true };@@ -16015,7 +14961,7 @@ index e0afaafced524352fc1b9cea74a2b8f04a314889..532ace70a24215725c75c4b45b1608abWebCore::SoupNetworkProxySettings m_networkProxySettings;String m_cookiePersistentStoragePath;SoupCookiePersistentStorageType m_cookiePersistentStorageType { SoupCookiePersistentStorageType::SQLite };-@@ -672,6 +692,10 @@ private:+@@ -668,6 +688,10 @@ private:const RefPtr<API::HTTPCookieStore> m_cookieStore;RefPtr<NetworkProcessProxy> m_networkProcess;@@ -16026,8 +14972,20 @@ index e0afaafced524352fc1b9cea74a2b8f04a314889..532ace70a24215725c75c4b45b1608ab#if HAVE(APP_SSO)const std::unique_ptr<SOAuthorizationCoordinator> m_soAuthorizationCoordinator;#endif+diff --git a/Source/WebKit/UIProcess/cairo/BackingStoreCairo.cpp b/Source/WebKit/UIProcess/cairo/BackingStoreCairo.cpp+index b7a4f8afd5c88971efa47613d5a2ade8fc7acf60..eab188385a65f42378b0a294ca18c05b9e6166d6 100644+--- a/Source/WebKit/UIProcess/cairo/BackingStoreCairo.cpp++++ b/Source/WebKit/UIProcess/cairo/BackingStoreCairo.cpp+@@ -31,6 +31,7 @@+ #if USE(CAIRO)++ #include "UpdateInfo.h"++#include "WebPageProxy.h"+ #include <WebCore/CairoUtilities.h>+ #include <WebCore/GraphicsContextCairo.h>+ #include <WebCore/IntRect.h>diff --git a/Source/WebKit/UIProcess/geoclue/GeoclueGeolocationProvider.cpp b/Source/WebKit/UIProcess/geoclue/GeoclueGeolocationProvider.cpp-index de9b08ac0588999d167cf97dc172ee35a8f8ab56..bab2b6ca88d666f16be6c1c32d05be5e02b88119 100644+index b79d617e64cbfb9d6e8faa811a0bf2890e75fe05..1b022935348aa29760e13c6ceaa2a97cca21977e 100644--- a/Source/WebKit/UIProcess/geoclue/GeoclueGeolocationProvider.cpp+++ b/Source/WebKit/UIProcess/geoclue/GeoclueGeolocationProvider.cpp@@ -114,6 +114,14 @@ void GeoclueGeolocationProvider::stop()@@ -16068,12 +15026,235 @@ index 96bf77411e2e1f4c835f56b409dc179977d197ee..512af5ffce511711b502248e34e49e45UpdateNotifyFunction m_updateNotifyFunction;LocationProviderSource m_sourceType { LocationProviderSource::Unknown };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+--- /dev/null++++ b/Source/WebKit/UIProcess/glib/BrowserInspectorWebSocketServer.cpp+@@ -0,0 +1,172 @@++/*++ * Copyright (C) 2026 Microsoft Corporation.++ *++ * Redistribution and use in source and binary forms, with or without++ * modification, are permitted provided that the following conditions++ * are met:++ * 1. Redistributions of source code must retain the above copyright++ * notice, this list of conditions and the following disclaimer.++ * 2. Redistributions in binary form must reproduce the above copyright++ * notice, this list of conditions and the following disclaimer in the++ * documentation and/or other materials provided with the distribution.++ *++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS++ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT++ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR++ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT++ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,++ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT++ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE++ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.++ */++++#include "config.h"++#include "BrowserInspectorWebSocketServer.h"++++#if ENABLE(REMOTE_INSPECTOR)++++#include "InspectorPlaywrightAgent.h"++#include "InspectorPlaywrightAgentClient.h"++#include "WebKit2Initialize.h"++#include <glib-object.h>++#include <libsoup/soup-websocket-connection.h>++#include <libsoup/soup.h>++#include <wtf/glib/GRefPtr.h>++#include <wtf/NeverDestroyed.h>++++namespace WebKit {++++namespace {++++class WebSocketFrontendChannel : public Inspector::FrontendChannel {++ WTF_DEPRECATED_MAKE_FAST_ALLOCATED(WebSocketFrontendChannel);++public:++ explicit WebSocketFrontendChannel(SoupWebsocketConnection* connection)++ : m_connection(connection)++ {++ }++++ ~WebSocketFrontendChannel() override = default;++++private:++ ConnectionType connectionType() const override++ {++ return ConnectionType::Remote;++ }++++ void sendMessageToFrontend(const String& message) override++ {++ soup_websocket_connection_send_text(m_connection.get(), message.utf8().data());++ }++++ GRefPtr<SoupWebsocketConnection> m_connection;++};++++class BrowserInspectorWebSocketServer {++public:++ BrowserInspectorWebSocketServer(std::unique_ptr<InspectorPlaywrightAgentClient> client, GRefPtr<SoupServer> soupServer)++ : m_playwrightAgent(std::move(client))++ , m_soupServer(std::move(soupServer))++ {++ soup_server_add_websocket_handler(m_soupServer.get(), nullptr, nullptr, nullptr, &BrowserInspectorWebSocketServer::handleWebSocketConnection, this, nullptr);++ }++++private:++ static void handleWebSocketConnection(SoupServer*, SoupServerMessage*, const char* path, SoupWebsocketConnection* connection, gpointer userData)++ {++ auto server = static_cast<BrowserInspectorWebSocketServer*>(userData);++ if (!server->handleWebSocketConnection(connection)) {++ soup_websocket_connection_close(connection, SOUP_WEBSOCKET_CLOSE_POLICY_VIOLATION, "WebSocket connection already established");++ return;++ }++++ g_signal_connect(connection, "closed", G_CALLBACK(+[](SoupWebsocketConnection* connection, gpointer userData) {++ auto server = static_cast<BrowserInspectorWebSocketServer*>(userData);++ server->handleConnectionClosed(connection);++ }), server);++++ g_signal_connect(connection, "message", G_CALLBACK(+[] (SoupWebsocketConnection*, SoupWebsocketDataType messageType, GBytes* message, gpointer userData) {++ auto server = static_cast<BrowserInspectorWebSocketServer*>(userData);++ server->handleWebSocketMessage(messageType, message);++ }), server);++ }++++++ void handleConnectionClosed(SoupWebsocketConnection* connection)++ {++ if (m_frontendChannel) {++ m_playwrightAgent.disconnectFrontend();++ m_frontendChannel.reset();++ }++ }++++ void handleWebSocketMessage(SoupWebsocketDataType messageType, GBytes* message)++ {++ if (messageType != SOUP_WEBSOCKET_DATA_TEXT) {++ fprintf(stderr, "WebSocket message received non-text message: %d\n", messageType);++ return;++ }++++ gsize messageSize;++ gconstpointer messageData = g_bytes_get_data(message, &messageSize);++ String messageString = String::fromUTF8(std::span<const char8_t>(static_cast<const char8_t*>(messageData), messageSize));++ fprintf(stderr, "WebSocket message received: %s\n", messageString.utf8().data());++ m_playwrightAgent.dispatchMessageFromFrontend(messageString);++ }++++ bool handleWebSocketConnection(SoupWebsocketConnection* connection)++ {++ if (m_frontendChannel) {++ fprintf(stderr, "WebSocket connection already established\n");++ return false;++ }++ m_frontendChannel = std::make_unique<WebSocketFrontendChannel>(connection);++ m_playwrightAgent.connectFrontend(*m_frontendChannel);++ return true;++ }++++ InspectorPlaywrightAgent m_playwrightAgent;++ GRefPtr<SoupServer> m_soupServer;++ std::unique_ptr<WebSocketFrontendChannel> m_frontendChannel;++};++++} // namespace++++void initializeBrowserInspectorWebSocket(unsigned port, std::unique_ptr<InspectorPlaywrightAgentClient> client)++{++ // Initialize main loop before creating inspector agent and starting the server.++ WebKit::InitializeWebKit2();++++ GRefPtr<SoupServer> soupServer = adoptGRef(soup_server_new("server-header", "WebKit-Playwright-WSS", nullptr));++++ GUniqueOutPtr<GError> error;++ const SoupServerListenOptions options = static_cast<SoupServerListenOptions>(0);++ if (!soup_server_listen_local(soupServer.get(), port, options, &error.outPtr())) {++ fprintf(stderr, "Failed to start WebSocket server at port %u: %s\n", port, error->message);++ return;++ }++++ int actualPort = port;++ if (!actualPort) {++ GSList* uris = soup_server_get_uris(soupServer.get());++ g_assert_nonnull(uris);++ GUri* uri = static_cast<GUri*>(uris->data);++ actualPort = g_uri_get_port(uri);++ g_slist_free_full(uris, reinterpret_cast<GDestroyNotify>(g_uri_unref));++ }++ if (actualPort == -1) {++ fprintf(stderr, "Failed to start WebSocket server\n");++ return;++ }++++ static NeverDestroyed<BrowserInspectorWebSocketServer> server(std::move(client), std::move(soupServer));++++ fprintf(stderr, "Playwright listening on ws://localhost:%d\n", actualPort);++}++++} // namespace WebKit++++#endif // ENABLE(REMOTE_INSPECTOR)+diff --git a/Source/WebKit/UIProcess/glib/BrowserInspectorWebSocketServer.h b/Source/WebKit/UIProcess/glib/BrowserInspectorWebSocketServer.h+new file mode 100644+index 0000000000000000000000000000000000000000..bd30f58d2d4afe85060eabf3bb178c20c0c73828+--- /dev/null++++ b/Source/WebKit/UIProcess/glib/BrowserInspectorWebSocketServer.h+@@ -0,0 +1,39 @@++/*++ * Copyright (C) 2026 Microsoft Corporation.++ *++ * Redistribution and use in source and binary forms, with or without++ * modification, are permitted provided that the following conditions++ * are met:++ * 1. Redistributions of source code must retain the above copyright++ * notice, this list of conditions and the following disclaimer.++ * 2. Redistributions in binary form must reproduce the above copyright++ * notice, this list of conditions and the following disclaimer in the++ * documentation and/or other materials provided with the distribution.++ *++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS++ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT++ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR++ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT++ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,++ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT++ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE++ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.++ */++++#pragma once++++#if ENABLE(REMOTE_INSPECTOR)++++namespace WebKit {++++class InspectorPlaywrightAgentClient;++++void initializeBrowserInspectorWebSocket(unsigned port, std::unique_ptr<InspectorPlaywrightAgentClient> client);++++} // namespace WebKit++++#endif // ENABLE(REMOTE_INSPECTOR)++diff --git a/Source/WebKit/UIProcess/glib/InspectorPlaywrightAgentClientGLib.cpp b/Source/WebKit/UIProcess/glib/InspectorPlaywrightAgentClientGLib.cppnew file mode 100644-index 0000000000000000000000000000000000000000..dfda89e6c74393d552d81bbb6d3c1ef877a32b31+index 0000000000000000000000000000000000000000..e5a8e68580d8ba7ad968d1736220793711214988--- /dev/null+++ b/Source/WebKit/UIProcess/glib/InspectorPlaywrightAgentClientGLib.cpp-@@ -0,0 +1,169 @@+@@ -0,0 +1,165 @@+/*+ * Copyright (C) 2019 Microsoft Corporation.+ *@@ -16119,10 +15300,6 @@ index 0000000000000000000000000000000000000000..dfda89e6c74393d552d81bbb6d3c1ef8+#include <wtf/text/StringView.h>+#include <wtf/text/WTFString.h>+-+#if USE(SKIA)-+#include <WebCore/ImageBufferUtilitiesSkia.h>-+#endif-++namespace WebKit {++static WebCore::SoupNetworkProxySettings parseRawProxySettings(const String& proxyServer, const char* const* ignoreHosts)@@ -16146,7 +15323,7 @@ index 0000000000000000000000000000000000000000..dfda89e6c74393d552d81bbb6d3c1ef8+ for (String token : tokens) {+ CString cstr = token.utf8();+ ignoreHosts.append(cstr.data());-+ protectTokens.append(WTFMove(cstr));++ protectTokens.append(WTF::move(cstr));+ }+ }+ ignoreHosts.append(nullptr);@@ -16207,11 +15384,11 @@ index 0000000000000000000000000000000000000000..dfda89e6c74393d552d81bbb6d3c1ef8+ browserContext->processPool = &webkitWebContextGetProcessPool(context.get());+ browserContext->dataStore = &webkitWebsiteDataManagerGetDataStore(data_manager.get());+ PAL::SessionID sessionID = browserContext.get()->dataStore->sessionID();-+ m_idToContext.set(sessionID, WTFMove(context));++ m_idToContext.set(sessionID, WTF::move(context));++ if (!proxyServer.isEmpty()) {+ WebCore::SoupNetworkProxySettings contextProxySettings = parseProxySettings(proxyServer, proxyBypassList);-+ browserContext->dataStore->setNetworkProxySettings(WTFMove(contextProxySettings));++ browserContext->dataStore->setNetworkProxySettings(WTF::move(contextProxySettings));+ } else {+ browserContext->dataStore->setNetworkProxySettings(WebCore::SoupNetworkProxySettings(m_proxySettings));+ }@@ -16225,9 +15402,9 @@ index 0000000000000000000000000000000000000000..dfda89e6c74393d552d81bbb6d3c1ef8++void InspectorPlaywrightAgentClientGlib::takePageScreenshot(WebPageProxy& page, WebCore::IntRect&& clip, bool nominalResolution, CompletionHandler<void(const String&, const String&)>&& completionHandler)+{-+ page.callAfterNextPresentationUpdate([protectedPage = Ref{ page }, clip = WTFMove(clip), nominalResolution, completionHandler = WTFMove(completionHandler)]() mutable {++ page.callAfterNextPresentationUpdate([protectedPage = Ref{ page }, clip = WTF::move(clip), nominalResolution, completionHandler = WTF::move(completionHandler)]() mutable {+#if PLATFORM(GTK) || (PLATFORM(WPE) && USE(SKIA))-+ RefPtr<ViewSnapshot> viewSnapshot = protectedPage->pageClient()->takeViewSnapshot(WTFMove(clip), nominalResolution);++ RefPtr<ViewSnapshot> viewSnapshot = protectedPage->pageClient()->takeViewSnapshot(WTF::move(clip), nominalResolution);+ if (viewSnapshot) {+ std::optional<String> data = WebAutomationSession::platformGetBase64EncodedPNGData(*viewSnapshot);+ if (data) {@@ -16311,10 +15488,10 @@ index 0000000000000000000000000000000000000000..68bc7b610703bfcd3eff0d1c032092f6++#endif // ENABLE(REMOTE_INSPECTOR)diff --git a/Source/WebKit/UIProcess/glib/WebProcessPoolGLib.cpp b/Source/WebKit/UIProcess/glib/WebProcessPoolGLib.cpp-index 212f082e04070610eda84021d673b7c7a95aabf8..7d6219192016964ea6a5f6d380f2ee6f3dd2ced0 100644+index 250f6c755a363c4755bcfbb29c5bf5f37913a752..486052a0943c71207557b99544f6173f0925ade7 100644--- a/Source/WebKit/UIProcess/glib/WebProcessPoolGLib.cpp+++ b/Source/WebKit/UIProcess/glib/WebProcessPoolGLib.cpp-@@ -126,6 +126,8 @@ static OptionSet<AvailableInputDevices> availableInputDevices()+@@ -127,6 +127,8 @@ static OptionSet<AvailableInputDevices> availableInputDevices()return toAvailableInputDevices(gdk_seat_get_capabilities(seat));}#endif@@ -16324,10 +15501,10 @@ index 212f082e04070610eda84021d673b7c7a95aabf8..7d6219192016964ea6a5f6d380f2ee6freturn AvailableInputDevices::Touchscreen;#elsediff --git a/Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.cpp b/Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.cpp-index 7a8478ed880bdb584b54c250b250f2805000f4aa..5d7b63ba6fbb5426f5746b36ef6ccfa4bb6c9592 100644+index cf23273b830c15058fe057ff205e9bfc5b6fa146..dd5778518cacc50877bd3d1aa389d7093a7eb4c3 100644--- a/Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.cpp+++ b/Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.cpp-@@ -848,4 +848,30 @@ RefPtr<NativeImage> AcceleratedBackingStore::bufferAsNativeImageForTesting() con+@@ -822,4 +822,30 @@ RefPtr<NativeImage> AcceleratedBackingStore::bufferAsNativeImageForTesting() conreturn m_committedBuffer->asNativeImageForTesting();}@@ -16359,7 +15536,7 @@ index 7a8478ed880bdb584b54c250b250f2805000f4aa..5d7b63ba6fbb5426f5746b36ef6ccfa4+} // namespace WebKitdiff --git a/Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.h b/Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.h-index e325f39cd985793451911f3623d712da5ef5d6ae..c1f8ffa0930d492e383c3c8f2be43a5d98d8f8ea 100644+index 1ade1dec8e7865d1c782c3704d02c12ff1c386ff..74519f7efae955e7ec1ffa824ab9c1589ec9808f 100644--- a/Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.h+++ b/Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.h@@ -41,6 +41,7 @@@@ -16378,7 +15555,7 @@ index e325f39cd985793451911f3623d712da5ef5d6ae..c1f8ffa0930d492e383c3c8f2be43a5dprivate:explicit AcceleratedBackingStore(WebPageProxy&);-@@ -249,6 +251,10 @@ private:+@@ -250,6 +252,10 @@ private:RefPtr<Buffer> m_committedBuffer;Rects m_pendingDamageRects;HashMap<uint64_t, RefPtr<Buffer>> m_buffers;@@ -16454,7 +15631,7 @@ index 31ebf8480d842db47e17bdb4639a3cd5e934ea49..bdffaeb1b97fe54f58086a62e7b641ebGtkFontRendering fontRendering;diff --git a/Source/WebKit/UIProcess/gtk/WebPageInspectorEmulationAgentGtk.cpp b/Source/WebKit/UIProcess/gtk/WebPageInspectorEmulationAgentGtk.cppnew file mode 100644-index 0000000000000000000000000000000000000000..735f6e2175b6da2d1802b6154af027e907153545+index 0000000000000000000000000000000000000000..5dd29805ed464ae7641b44193caca700fa9f8a1e--- /dev/null+++ b/Source/WebKit/UIProcess/gtk/WebPageInspectorEmulationAgentGtk.cpp@@ -0,0 +1,108 @@@@ -16543,7 +15720,7 @@ index 0000000000000000000000000000000000000000..735f6e2175b6da2d1802b6154af027e9+ // Default size for new windows from browser_window_init in Tools/MiniBrowser/gtk/BrowserWindow.c.+ (windowAllocation.width == 1024 && windowAllocation.height == 768);+ // The callback can only be called if the page is still alive, so we can safely capture `this`.-+ drawingArea->waitForSizeUpdate([this, callback = WTFMove(callback), didNotHaveInitialAllocation, viewSize](const DrawingAreaProxyCoordinatedGraphics& drawingArea) mutable {++ drawingArea->waitForSizeUpdate([this, callback = WTF::move(callback), didNotHaveInitialAllocation, viewSize](const DrawingAreaProxyCoordinatedGraphics& drawingArea) mutable {+ if (viewSize == drawingArea.size()) {+ callback(String());+ return;@@ -16551,7 +15728,7 @@ index 0000000000000000000000000000000000000000..735f6e2175b6da2d1802b6154af027e9+ if (didNotHaveInitialAllocation) {+ // In gtk4 resize request may be lost (overridden by default one) if the window is not yet+ // allocated when we are changing the size, so we try again.-+ platformSetSize(viewSize.width(), viewSize.height(), WTFMove(callback));++ platformSetSize(viewSize.width(), viewSize.height(), WTF::move(callback));+ return;+ }+ callback("Failed to resize window"_s);@@ -16568,7 +15745,7 @@ index 0000000000000000000000000000000000000000..735f6e2175b6da2d1802b6154af027e9+} // namespace WebKitdiff --git a/Source/WebKit/UIProcess/gtk/WebPageInspectorInputAgentGtk.cpp b/Source/WebKit/UIProcess/gtk/WebPageInspectorInputAgentGtk.cppnew file mode 100644-index 0000000000000000000000000000000000000000..bf7d792f5fd7a96b090970cb4177c113e3265870+index 0000000000000000000000000000000000000000..40355b2c69d7a94e924451b5fe1c0b96ff025663--- /dev/null+++ b/Source/WebKit/UIProcess/gtk/WebPageInspectorInputAgentGtk.cpp@@ -0,0 +1,76 @@@@ -16643,7 +15820,7 @@ index 0000000000000000000000000000000000000000..bf7d792f5fd7a96b090970cb4177c113+ isSystemKey,+ modifiers,+ timestamp,-+ WTFMove(commands));++ WTF::move(commands));+ m_page.handleKeyboardEvent(event);+}+@@ -16699,7 +15876,7 @@ index 0000000000000000000000000000000000000000..4c30302b5bd7d7f989da63375f1b4eb9++} // namespace WebKitdiff --git a/Source/WebKit/UIProcess/gtk/WebPasteboardProxyGtk.cpp b/Source/WebKit/UIProcess/gtk/WebPasteboardProxyGtk.cpp-index 4ea79c717a8ad579d92942cd7ffdcaebcbb981cd..b1e7fd66413b5dae487f7db52f6ad31aa5afe7f2 100644+index baeb21c5cee36343d37fdf552cc36b26b2d5213e..d9efcdf56227966efafe53ba82c98673a47a9959 100644--- a/Source/WebKit/UIProcess/gtk/WebPasteboardProxyGtk.cpp+++ b/Source/WebKit/UIProcess/gtk/WebPasteboardProxyGtk.cpp@@ -85,8 +85,10 @@ void WebPasteboardProxy::setPrimarySelectionOwner(WebFrameProxy* frame)@@ -16793,7 +15970,7 @@ index 0000000000000000000000000000000000000000..edb4581e8f1f484976a9081d37cb61e5+} // namespace APIdiff --git a/Source/WebKit/UIProcess/mac/InspectorPlaywrightAgentClientMac.mm b/Source/WebKit/UIProcess/mac/InspectorPlaywrightAgentClientMac.mmnew file mode 100644-index 0000000000000000000000000000000000000000..a4b23bf4cf7c4cb6ef9d25d4121b20a611809479+index 0000000000000000000000000000000000000000..d8dbc62b3ec8cd0588e8c22b9e4cf2fda0c9d03f--- /dev/null+++ b/Source/WebKit/UIProcess/mac/InspectorPlaywrightAgentClientMac.mm@@ -0,0 +1,96 @@@@ -16879,7 +16056,7 @@ index 0000000000000000000000000000000000000000..a4b23bf4cf7c4cb6ef9d25d4121b20a6+void InspectorPlaywrightAgentClientMac::takePageScreenshot(WebPageProxy& page, WebCore::IntRect&& clipRect, bool, CompletionHandler<void(const String&, const String&)>&& completionHandler)+{+ int toolbarHeight = headless_ ? 0 : 59;-+ page.callAfterNextPresentationUpdate([protectedPage = Ref { page }, toolbarHeight, clipRect = WTFMove(clipRect), completionHandler = WTFMove(completionHandler)]() mutable {++ page.callAfterNextPresentationUpdate([protectedPage = Ref { page }, toolbarHeight, clipRect = WTF::move(clipRect), completionHandler = WTF::move(completionHandler)]() mutable {+ RetainPtr<CGImageRef> imageRef = protectedPage->pageClient()->takeSnapshotForAutomation();+ if (!imageRef) {+ completionHandler("Could not take view snapshot"_s, emptyString());@@ -16942,7 +16119,7 @@ index 0000000000000000000000000000000000000000..8adbd51bfecad2a273117588bf50f8f7++#endifdiff --git a/Source/WebKit/UIProcess/mac/PageClientImplMac.h b/Source/WebKit/UIProcess/mac/PageClientImplMac.h-index 3dc019bb84020d4ea0ce5d50294fa5f13a400ebc..e7c4d9d1d637b73c11785d627414bc0232a5a9ca 100644+index 50915547582917bb455e037a702f3d5c5ab2e34b..f1f8670b0c86e3f356c90d3802a7e16ad309f81c 100644--- a/Source/WebKit/UIProcess/mac/PageClientImplMac.h+++ b/Source/WebKit/UIProcess/mac/PageClientImplMac.h@@ -31,9 +31,11 @@@@ -16966,7 +16143,7 @@ index 3dc019bb84020d4ea0ce5d50294fa5f13a400ebc..e7c4d9d1d637b73c11785d627414bc02PageClientImpl(NSView *, WKWebView *);virtual ~PageClientImpl();-@@ -176,6 +180,9 @@ private:+@@ -177,6 +181,9 @@ private:void updateAcceleratedCompositingMode(const LayerTreeContext&) override;void didFirstLayerFlush(const LayerTreeContext&) override;@@ -16976,7 +16153,7 @@ index 3dc019bb84020d4ea0ce5d50294fa5f13a400ebc..e7c4d9d1d637b73c11785d627414bc02RefPtr<ViewSnapshot> takeViewSnapshot(std::optional<WebCore::IntRect>&&) override;RefPtr<ViewSnapshot> takeViewSnapshot(std::optional<WebCore::IntRect>&&, ForceSoftwareCapturingViewportSnapshot) override;void wheelEventWasNotHandledByWebCore(const NativeWebWheelEvent&) override;-@@ -227,6 +234,10 @@ private:+@@ -228,6 +235,10 @@ private:void beganExitFullScreen(const WebCore::IntRect& initialFrame, const WebCore::IntRect& finalFrame, CompletionHandler<void()>&&) override;#endif@@ -16988,12 +16165,12 @@ index 3dc019bb84020d4ea0ce5d50294fa5f13a400ebc..e7c4d9d1d637b73c11785d627414bc02void 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 6e190b00ba5d7f222ed7d9310f9a40ce6a031e30..eca0abc5dbd6ba7fbe1a200e3bc3b9ae66193c38 100644+index 1ed5dcc1b743cdc5013f6ace7d61dfcf33301d06..33f31f4e18aad7617c506cf2d4d5bf7a83a09b22 100644--- a/Source/WebKit/UIProcess/mac/PageClientImplMac.mm+++ b/Source/WebKit/UIProcess/mac/PageClientImplMac.mm-@@ -108,6 +108,13 @@ namespace WebKit {+@@ -112,6 +112,13 @@ using namespace WebCore;- using namespace WebCore;+ WTF_MAKE_TZONE_ALLOCATED_IMPL(PageClientImpl);+static bool _headless = false;+@@ -17005,7 +16182,7 @@ index 6e190b00ba5d7f222ed7d9310f9a40ce6a031e30..eca0abc5dbd6ba7fbe1a200e3bc3b9aePageClientImpl::PageClientImpl(NSView *view, WKWebView *webView): PageClientImplCocoa(webView), m_view(view)-@@ -167,6 +174,9 @@ NSWindow *PageClientImpl::activeWindow() const+@@ -171,6 +178,9 @@ NSWindow *PageClientImpl::activeWindow() constbool PageClientImpl::isViewWindowActive(){@@ -17015,7 +16192,7 @@ index 6e190b00ba5d7f222ed7d9310f9a40ce6a031e30..eca0abc5dbd6ba7fbe1a200e3bc3b9aeASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));RetainPtr activeViewWindow = activeWindow();return activeViewWindow.get().isKeyWindow || (activeViewWindow && [NSApp keyWindow] == activeViewWindow.get());-@@ -174,6 +184,9 @@ bool PageClientImpl::isViewWindowActive()+@@ -178,6 +188,9 @@ bool PageClientImpl::isViewWindowActive()bool PageClientImpl::isViewFocused(){@@ -17025,7 +16202,7 @@ index 6e190b00ba5d7f222ed7d9310f9a40ce6a031e30..eca0abc5dbd6ba7fbe1a200e3bc3b9ae// 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())-@@ -197,6 +210,9 @@ void PageClientImpl::makeFirstResponder()+@@ -201,6 +214,9 @@ void PageClientImpl::makeFirstResponder()bool PageClientImpl::isViewVisible(NSView *view, NSWindow *viewWindow){@@ -17035,35 +16212,35 @@ index 6e190b00ba5d7f222ed7d9310f9a40ce6a031e30..eca0abc5dbd6ba7fbe1a200e3bc3b9aeauto windowIsOccluded = [&]()->bool {return m_impl && m_impl->windowOcclusionDetectionEnabled() && (viewWindow.occlusionState & NSWindowOcclusionStateVisible) != NSWindowOcclusionStateVisible;};-@@ -288,7 +304,8 @@ void PageClientImpl::didRelaunchProcess()+@@ -299,7 +315,8 @@ void PageClientImpl::didRelaunchProcess()void PageClientImpl::preferencesDidChange(){-- checkedImpl()->preferencesDidChange();+- protect(m_impl)->preferencesDidChange();+ if (CheckedPtr impl = m_impl.get())+ impl->preferencesDidChange();}void PageClientImpl::toolTipChanged(const String& oldToolTip, const String& newToolTip)-@@ -507,6 +524,8 @@ IntRect PageClientImpl::rootViewToAccessibilityScreen(const IntRect& rect)+@@ -523,6 +540,8 @@ IntRect PageClientImpl::rootViewToAccessibilityScreen(const IntRect& rect)void PageClientImpl::doneWithKeyEvent(const NativeWebKeyboardEvent& event, bool eventWasHandled){+ if (!event.nativeEvent())+ return;- checkedImpl()->doneWithKeyEvent(RetainPtr { event.nativeEvent() }.get(), eventWasHandled);+ protect(m_impl)->doneWithKeyEvent(RetainPtr { event.nativeEvent() }.get(), eventWasHandled);}-@@ -526,6 +545,8 @@ void PageClientImpl::computeHasVisualSearchResults(const URL& imageURL, Shareabl+@@ -542,6 +561,8 @@ void PageClientImpl::computeHasVisualSearchResults(const URL& imageURL, ShareablRefPtr<WebPopupMenuProxy> PageClientImpl::createPopupMenuProxy(WebPageProxy& page){+ if (_headless)+ return nullptr;- return WebPopupMenuProxyMac::create(m_view.get().get(), page.checkedPopupMenuClient().get());+ return WebPopupMenuProxyMac::create(m_view.get().get(), protect(page.popupMenuClient()));}-@@ -651,6 +672,12 @@ CALayer *PageClientImpl::footerBannerLayer() const+@@ -667,6 +688,12 @@ CALayer *PageClientImpl::footerBannerLayer() constreturn m_impl->footerBannerLayer();}@@ -17075,8 +16252,8 @@ index 6e190b00ba5d7f222ed7d9310f9a40ce6a031e30..eca0abc5dbd6ba7fbe1a200e3bc3b9ae+RefPtr<ViewSnapshot> PageClientImpl::takeViewSnapshot(std::optional<WebCore::IntRect>&&){- return checkedImpl()->takeViewSnapshot();-@@ -865,6 +892,13 @@ void PageClientImpl::beganExitFullScreen(const IntRect& initialFrame, const IntR+ return protect(m_impl)->takeViewSnapshot();+@@ -884,6 +911,13 @@ void PageClientImpl::beganExitFullScreen(const IntRect& initialFrame, const IntR#endif // ENABLE(FULLSCREEN_API)@@ -17089,15 +16266,15 @@ index 6e190b00ba5d7f222ed7d9310f9a40ce6a031e30..eca0abc5dbd6ba7fbe1a200e3bc3b9ae+void PageClientImpl::navigationGestureDidBegin(){- checkedImpl()->dismissContentRelativeChildWindowsWithAnimation(true);-@@ -1045,6 +1079,9 @@ void PageClientImpl::requestScrollToRect(const WebCore::FloatRect& targetRect, c+ protect(m_impl)->dismissContentRelativeChildWindowsWithAnimation(true);+@@ -1064,6 +1098,9 @@ void PageClientImpl::requestScrollToRect(const WebCore::FloatRect& targetRect, cbool PageClientImpl::windowIsFrontWindowUnderMouse(const NativeWebMouseEvent& event){+ // Simulated event.+ if (!event.nativeEvent())+ return false;- return checkedImpl()->windowIsFrontWindowUnderMouse(RetainPtr { event.nativeEvent() }.get());+ return protect(m_impl)->windowIsFrontWindowUnderMouse(RetainPtr { event.nativeEvent() }.get());}diff --git a/Source/WebKit/UIProcess/mac/SecItemShimProxy.messages.in b/Source/WebKit/UIProcess/mac/SecItemShimProxy.messages.in@@ -17124,7 +16301,7 @@ index f46895285dbc84c624537a194814c18f771a0c08..29ef9e5afa13b8d2b47b7f2dd4ce3784}+#endifdiff --git a/Source/WebKit/UIProcess/mac/WKTextAnimationManagerMac.mm b/Source/WebKit/UIProcess/mac/WKTextAnimationManagerMac.mm-index ff8d60fe011fe881ea552a1e66cbc9a6fa2bbb19..23a98f7dfd2be5317e22a9d97f5290fddcaf9d72 100644+index 6cfc616d5492bd12f7516ff2d6a67e77705f42b0..fd2e2a98b1db2c469a7f18fb2b7cbfbdc8ea3a8b 100644--- a/Source/WebKit/UIProcess/mac/WKTextAnimationManagerMac.mm+++ b/Source/WebKit/UIProcess/mac/WKTextAnimationManagerMac.mm@@ -35,6 +35,7 @@@@ -17136,10 +16313,10 @@ index ff8d60fe011fe881ea552a1e66cbc9a6fa2bbb19..23a98f7dfd2be5317e22a9d97f5290fd@interface WKTextAnimationTypeEffectData : NSObjectdiff --git a/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.h b/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.h-index 22ec84f21f3b2d18740356cfb72ebad813ffd17b..880e1dbde6430b93a701e5d7977eb8e8854b964f 100644+index 0aacf596ab1b3a080661bbdb3581893f4cd2d311..25e26ea53096bf13ec8dd8c0796c1ec3adfb700a 100644--- a/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.h+++ b/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.h-@@ -87,6 +87,7 @@ private:+@@ -86,6 +86,7 @@ private:void show() override;void showContextMenuWithItems(Vector<Ref<WebContextMenuItem>>&&) override;void useContextMenuItems(Vector<Ref<WebContextMenuItem>>&&) override;@@ -17148,10 +16325,10 @@ index 22ec84f21f3b2d18740356cfb72ebad813ffd17b..880e1dbde6430b93a701e5d7977eb8e8bool showAfterPostProcessingContextData();diff --git a/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm b/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm-index 95986aa1bfcfd2e1ce0a9de1ff6a3a2dd78a2ba1..7cfad9352724976f4fb58e66ecb3195b11b16a5a 100644+index 90afb16340db0c2f3946dd8ad720d180af5b472c..9ff4b816525f39c43c72c297a726e5b0a66b65c3 100644--- a/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm+++ b/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm-@@ -535,6 +535,12 @@ RetainPtr<NSMenuItem> WebContextMenuProxyMac::createShareMenuItem(ShareMenuItemT+@@ -534,6 +534,12 @@ RetainPtr<NSMenuItem> WebContextMenuProxyMac::createShareMenuItem(ShareMenuItemT}#endif@@ -17216,10 +16393,10 @@ index 0000000000000000000000000000000000000000..6113f4cd60a5d72b8ead61176cb43200+} // namespace WebKitdiff --git a/Source/WebKit/UIProcess/mac/WebPageInspectorInputAgentMac.mm b/Source/WebKit/UIProcess/mac/WebPageInspectorInputAgentMac.mmnew file mode 100644-index 0000000000000000000000000000000000000000..2db75618ed4a975cc158dd21a9744a78f696a7ae+index 0000000000000000000000000000000000000000..e49fbb17708b557074f1df851717adaef1e9e916--- /dev/null+++ b/Source/WebKit/UIProcess/mac/WebPageInspectorInputAgentMac.mm-@@ -0,0 +1,135 @@+@@ -0,0 +1,141 @@+/*+ * Copyright (C) 2019 Microsoft Corporation.+ *@@ -17296,7 +16473,7 @@ index 0000000000000000000000000000000000000000..2db75618ed4a975cc158dd21a9744a78+ upEventType = NSEventTypeLeftMouseUp;+ } else if (button == "middle"_s) {+ downEventType = NSEventTypeOtherMouseDown;-+ dragEventType = NSEventTypeLeftMouseDragged;++ dragEventType = NSEventTypeOtherMouseDragged;+ upEventType = NSEventTypeOtherMouseUp;+ } else if (button == "right"_s) {+ downEventType = NSEventTypeRightMouseDown;@@ -17319,7 +16496,13 @@ index 0000000000000000000000000000000000000000..2db75618ed4a975cc158dd21a9744a78+ return;+ }+-+ NativeWebMouseEvent nativeEvent(event, nil, [window contentView]);++ if (button == "middle"_s) {++ CGEventRef cgEvent = [event CGEvent];++ CGEventSetIntegerValueField(cgEvent, kCGMouseEventButtonNumber, kCGMouseButtonCenter);++ event = [NSEvent eventWithCGEvent:cgEvent];++ }++++ NativeWebMouseEvent nativeEvent(event, nil, [window contentView], WebKit::WebMouseEventInputSource::Hardware);+ nativeEvent.playwrightSetButtons(buttons);+ m_page.handleMouseEvent(nativeEvent);+}@@ -17335,7 +16518,7 @@ index 0000000000000000000000000000000000000000..2db75618ed4a975cc158dd21a9744a78+ macCommands.append(WebCore::KeypressCommand("insertText:"_s, text));+ if (!macCommands.isEmpty())+ if (auto replyID = m_page.grantAccessToCurrentPasteboardData(NSPasteboardNameGeneral, [] () { }))-+ m_page.websiteDataStore().protectedNetworkProcess()->connection().waitForAsyncReplyAndDispatchImmediately<Messages::NetworkProcess::AllowFilesAccessFromWebProcess>(*replyID, 100_ms);++ protect(m_page.websiteDataStore().networkProcess())->connection().waitForAsyncReplyAndDispatchImmediately<Messages::NetworkProcess::AllowFilesAccessFromWebProcess>(*replyID, 100_ms);+ NativeWebKeyboardEvent event(+ type,+ text,@@ -17350,7 +16533,7 @@ index 0000000000000000000000000000000000000000..2db75618ed4a975cc158dd21a9744a78+ isSystemKey,+ modifiers,+ timestamp,-+ WTFMove(macCommands));++ WTF::move(macCommands));+ m_page.handleKeyboardEvent(event);+}+@@ -17404,18 +16587,18 @@ index 0000000000000000000000000000000000000000..c58e17e9095c73eb9670ca55e5465b0d++#endifdiff --git a/Source/WebKit/UIProcess/mac/WebViewImpl.h b/Source/WebKit/UIProcess/mac/WebViewImpl.h-index 0a479b522e0c9ab77e02fb1b82dc6d56bbdfac8b..b73180a12d982df3d513de29182919d242b039af 100644+index d126a49ff1409f870e4af4fc389d5a191177d112..8497af03a2cc32e9d76827dab1115dfda6fbb606 100644--- a/Source/WebKit/UIProcess/mac/WebViewImpl.h+++ b/Source/WebKit/UIProcess/mac/WebViewImpl.h-@@ -34,6 +34,7 @@- #include "PDFPluginIdentifier.h"+@@ -39,6 +39,7 @@#include "WKLayoutMode.h"+ #include "WebMouseEvent.h"#include <WebCore/DOMPasteAccess.h>+#include <WebCore/FrameIdentifier.h>#include <WebCore/FocusDirection.h>#include <WebCore/HTMLMediaElementIdentifier.h>#include <WebCore/KeypressCommand.h>-@@ -591,6 +592,9 @@ public:+@@ -606,6 +607,9 @@ public:void provideDataForPasteboard(NSPasteboard *, NSString *type);NSArray *namesOfPromisedFilesDroppedAtDestination(NSURL *dropDestination);@@ -17426,10 +16609,10 @@ index 0a479b522e0c9ab77e02fb1b82dc6d56bbdfac8b..b73180a12d982df3d513de29182919d2RefPtr<ViewSnapshot> takeViewSnapshot(ForceSoftwareCapturingViewportSnapshot);void saveBackForwardSnapshotForCurrentItem();diff --git a/Source/WebKit/UIProcess/mac/WebViewImpl.mm b/Source/WebKit/UIProcess/mac/WebViewImpl.mm-index a2cb92081fd69ea05e18a304d1cb7b02fd35a36d..71375fa5de95775ea7c20ec745ce3d634b15ead0 100644+index ba090c4c4473c56592d5681f348bb5774ff05cc8..58bd1d87e363ec0706747c2b2571d3584a4efca9 100644--- a/Source/WebKit/UIProcess/mac/WebViewImpl.mm+++ b/Source/WebKit/UIProcess/mac/WebViewImpl.mm-@@ -2519,6 +2519,11 @@ WebCore::DestinationColorSpace WebViewImpl::colorSpace()+@@ -2571,6 +2571,11 @@ WebCore::DestinationColorSpace WebViewImpl::colorSpace()if (!m_colorSpace)m_colorSpace = [NSColorSpace sRGBColorSpace];}@@ -17441,7 +16624,7 @@ index a2cb92081fd69ea05e18a304d1cb7b02fd35a36d..71375fa5de95775ea7c20ec745ce3d63ASSERT(m_colorSpace);return WebCore::DestinationColorSpace { [m_colorSpace CGColorSpace] };-@@ -4831,6 +4836,17 @@ static RetainPtr<CGImageRef> takeWindowSnapshot(CGSWindowID windowID, bool captu+@@ -4944,6 +4949,17 @@ static RetainPtr<CGImageRef> takeWindowSnapshot(CGSWindowID windowID, bool captureturn WebCore::cgWindowListCreateImage(CGRectNull, kCGWindowListOptionIncludingWindow, windowID, imageOptions);}@@ -17460,7 +16643,7 @@ index a2cb92081fd69ea05e18a304d1cb7b02fd35a36d..71375fa5de95775ea7c20ec745ce3d63{return takeViewSnapshot(ForceSoftwareCapturingViewportSnapshot::No);diff --git a/Source/WebKit/UIProcess/wc/DrawingAreaProxyWC.cpp b/Source/WebKit/UIProcess/wc/DrawingAreaProxyWC.cpp-index 37876a0c8c31193d1312ada7d34852e256df18a9..9c891ef5f00c03f3ae6786260a840d4e3a502e6c 100644+index 2a5f7ebbd13e88c0141fb1a1b5212bafcedff04d..77bf2c0a74f5263dc85281b3eb261875b13ca332 100644--- a/Source/WebKit/UIProcess/wc/DrawingAreaProxyWC.cpp+++ b/Source/WebKit/UIProcess/wc/DrawingAreaProxyWC.cpp@@ -35,6 +35,7 @@@@ -17485,7 +16668,7 @@ index 37876a0c8c31193d1312ada7d34852e256df18a9..9c891ef5f00c03f3ae6786260a840d4e+ auto image = surface->makeImageSnapshot();+ if (!image)+ return;-+ page()->inspectorController().didPaint(WTFMove(image));++ page()->inspectorController().didPaint(WTF::move(image));+}+} // namespace WebKit@@ -17506,7 +16689,7 @@ index 5ede972f4b6efe213ccdd866ef77594acfcbf162..67f66b7c685eea3478b6386e1ec449d9diff --git a/Source/WebKit/UIProcess/win/InspectorPlaywrightAgentClientWin.cpp b/Source/WebKit/UIProcess/win/InspectorPlaywrightAgentClientWin.cppnew file mode 100644-index 0000000000000000000000000000000000000000..4f54a9445e5a7ecdb750c5c521da4f397776e633+index 0000000000000000000000000000000000000000..01d4c66fc3c471ecf58a66e18512fc78d4465d8b--- /dev/null+++ b/Source/WebKit/UIProcess/win/InspectorPlaywrightAgentClientWin.cpp@@ -0,0 +1,89 @@@@ -17586,8 +16769,8 @@ index 0000000000000000000000000000000000000000..4f54a9445e5a7ecdb750c5c521da4f39+ m_configureDataStore(toAPI(browserContext->dataStore.get()));+ if (!proxyServer.isEmpty()) {+ URL proxyURL = URL(URL(), proxyServer);-+ WebCore::CurlProxySettings settings(WTFMove(proxyURL), String(proxyBypassList));-+ browserContext->dataStore->setNetworkProxySettings(WTFMove(settings));++ WebCore::CurlProxySettings settings(WTF::move(proxyURL), String(proxyBypassList));++ browserContext->dataStore->setNetworkProxySettings(WTF::move(settings));+ }+ return browserContext;+}@@ -17708,10 +16891,10 @@ index 0000000000000000000000000000000000000000..135a60361fa8fbf907382625e7c8dd4e++} // namespace WebKitdiff --git a/Source/WebKit/UIProcess/win/WebContextMenuProxyWin.cpp b/Source/WebKit/UIProcess/win/WebContextMenuProxyWin.cpp-index ed40616a49301967dc1c824f68cc57f628357c64..598e812dcfb1d4927841489086386834a2fbe0d5 100644+index 8017b507ce2f0d67922035b1d41b9898f5dddb8c..7e40f52a0e878aeaa0aa38199b432377a6dc4cfd 100644--- a/Source/WebKit/UIProcess/win/WebContextMenuProxyWin.cpp+++ b/Source/WebKit/UIProcess/win/WebContextMenuProxyWin.cpp-@@ -115,5 +115,11 @@ WebContextMenuProxyWin::~WebContextMenuProxyWin()+@@ -114,5 +114,11 @@ WebContextMenuProxyWin::~WebContextMenuProxyWin()::DestroyMenu(m_menu);}@@ -17724,17 +16907,17 @@ index ed40616a49301967dc1c824f68cc57f628357c64..598e812dcfb1d4927841489086386834} // namespace WebKit#endif // ENABLE(CONTEXT_MENUS)diff --git a/Source/WebKit/UIProcess/win/WebContextMenuProxyWin.h b/Source/WebKit/UIProcess/win/WebContextMenuProxyWin.h-index e7f71156d7a897ab477d0d7f167b2c2992cdb161..325d8813afff13d86a4892a8e99738f19c2729ac 100644+index ad633673cb4f1c5979aee23c0c3fd32f1b7421a2..2204867f7d2d6c756f17c968c1767ee667aca8c7 100644--- a/Source/WebKit/UIProcess/win/WebContextMenuProxyWin.h+++ b/Source/WebKit/UIProcess/win/WebContextMenuProxyWin.h-@@ -49,6 +49,7 @@ public:+@@ -47,6 +47,7 @@ public:private:WebContextMenuProxyWin(WebPageProxy&, FrameInfoData&&, ContextMenuContextData&&, const UserData&);void showContextMenuWithItems(Vector<Ref<WebContextMenuItem>>&&) override;+ void hide() override;HMENU m_menu;- FrameInfoData m_frameInfo;+ };diff --git a/Source/WebKit/UIProcess/win/WebPageInspectorEmulationAgentWin.cpp b/Source/WebKit/UIProcess/win/WebPageInspectorEmulationAgentWin.cppnew file mode 100644index 0000000000000000000000000000000000000000..df55ee613ec085cb85ed12b45deff3a1b046861c@@ -17903,10 +17086,10 @@ index 0000000000000000000000000000000000000000..5b3222e904d3f56d8606b1f1158b2947++} // namespace WebKitdiff --git a/Source/WebKit/UIProcess/win/WebView.cpp b/Source/WebKit/UIProcess/win/WebView.cpp-index 22124ffc5c0daf37be6ac7d115d587925613b4cd..83fbf4182132b87c0b90416e5cd83372e6c2b99f 100644+index a78299e7e0227ed5637458a0917b3c6ee07a2f8d..5ad41f2b68b4d79f0a50ea3298df34a94064dfee 100644--- a/Source/WebKit/UIProcess/win/WebView.cpp+++ b/Source/WebKit/UIProcess/win/WebView.cpp-@@ -569,7 +569,7 @@ LRESULT WebView::onSizeEvent(HWND hwnd, UINT, WPARAM, LPARAM lParam, bool& handl+@@ -570,7 +570,7 @@ LRESULT WebView::onSizeEvent(HWND hwnd, UINT, WPARAM, LPARAM lParam, bool& handlfloat intrinsicDeviceScaleFactor = deviceScaleFactorForWindow(hwnd);if (m_page)m_page->setIntrinsicDeviceScaleFactor(intrinsicDeviceScaleFactor);@@ -17916,10 +17099,10 @@ index 22124ffc5c0daf37be6ac7d115d587925613b4cd..83fbf4182132b87c0b90416e5cd83372if (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 af0d7afa0f864569115e07aa8064f8dc8cd1e575..fd2dcb14baf9abbae650b068694341c65aa54667 100644+index c2cd4dae5b49952c6cde889c8cc1df048722b5de..ab01cc4fb26a421c6959c2c29a77dca268718bf2 100644--- a/Source/WebKit/UIProcess/wpe/AcceleratedBackingStore.cpp+++ b/Source/WebKit/UIProcess/wpe/AcceleratedBackingStore.cpp-@@ -190,7 +190,7 @@ static Expected<SkImageInfo, String> getImageInfoFromBuffer(const GRefPtr<WPEBu+@@ -231,7 +231,7 @@ static Expected<SkImageInfo, String> getImageInfoFromBuffer(const GRefPtr<WPEBureturn makeUnexpected("Failed to extract snapshot pixel information"_s);}@@ -17928,7 +17111,7 @@ index af0d7afa0f864569115e07aa8064f8dc8cd1e575..fd2dcb14baf9abbae650b068694341c6{GUniqueOutPtr<GError> error;GBytes* pixels = wpe_buffer_import_to_pixels(buffer.get(), &error.outPtr());-@@ -208,33 +208,39 @@ static Expected<Ref<ViewSnapshot>, String> saveBufferSnapshot(const GRefPtr<WPEB+@@ -249,33 +249,39 @@ static Expected<Ref<ViewSnapshot>, String> saveBufferSnapshot(const GRefPtr<WPEBif (!info)return makeUnexpected(info.error());@@ -17949,7 +17132,7 @@ index af0d7afa0f864569115e07aa8064f8dc8cd1e575..fd2dcb14baf9abbae650b068694341c6- }, bytes.leakRef());+ float deviceScale = m_view.page().deviceScaleFactor();+ if (!clipRect && (!nominalResolution || deviceScale == 1))-+ return { ViewSnapshot::create(WTFMove(fullScreenshot)) };++ return { ViewSnapshot::create(WTF::move(fullScreenshot)) };- if (!image)- return makeUnexpected("Failed to create snapshot image"_s);@@ -17960,7 +17143,7 @@ index af0d7afa0f864569115e07aa8064f8dc8cd1e575..fd2dcb14baf9abbae650b068694341c6+ clipRect->scale(deviceScale);+ }-- return { ViewSnapshot::create(WTFMove(image)) };+- return { ViewSnapshot::create(WTF::move(image)) };+ SkBitmap bitmap;+ bitmap.allocPixels(SkImageInfo::Make(size.width(), size.height(), kN32_SkColorType, kPremul_SkAlphaType));+ SkCanvas canvas(bitmap);@@ -17972,7 +17155,7 @@ index af0d7afa0f864569115e07aa8064f8dc8cd1e575..fd2dcb14baf9abbae650b068694341c6+ if (nominalResolution)+ canvas.scale(1/deviceScale, 1/deviceScale);+ canvas.drawImage(fullScreenshot, 0, 0);-+ return { ViewSnapshot::create(WTFMove(bitmap.asImage())) };++ return { ViewSnapshot::create(WTF::move(bitmap.asImage())) };}-Expected<Ref<ViewSnapshot>, String> AcceleratedBackingStore::takeSnapshot(std::optional<WebCore::IntRect>&& clipRect)@@ -17981,24 +17164,24 @@ index af0d7afa0f864569115e07aa8064f8dc8cd1e575..fd2dcb14baf9abbae650b068694341c6if (!m_committedBuffer && !m_pendingBuffer) [[unlikely]]return makeUnexpected("No buffer to create snapshot from"_s);-- return saveBufferSnapshot(m_committedBuffer ? m_committedBuffer : m_pendingBuffer, WTFMove(clipRect));-+ return saveBufferSnapshot(m_committedBuffer ? m_committedBuffer : m_pendingBuffer, WTFMove(clipRect), nominalResolution);+- return saveBufferSnapshot(m_committedBuffer ? m_committedBuffer : m_pendingBuffer, WTF::move(clipRect));++ return saveBufferSnapshot(m_committedBuffer ? m_committedBuffer : m_pendingBuffer, WTF::move(clipRect), nominalResolution);}- #endif+ void AcceleratedBackingStore::renderPendingBuffer()diff --git a/Source/WebKit/UIProcess/wpe/AcceleratedBackingStore.h b/Source/WebKit/UIProcess/wpe/AcceleratedBackingStore.h-index ebbc2be4d45a4f3eb507eec2d3f5aa0aa360352a..f856be5e83d61b2883453f9f6fef66aba015b968 100644+index b1fb18805e67b336dd162a089d91bd3ff32f93e2..1c155698788c429f1fe1eb155a22a99090e16d7f 100644--- a/Source/WebKit/UIProcess/wpe/AcceleratedBackingStore.h+++ b/Source/WebKit/UIProcess/wpe/AcceleratedBackingStore.h-@@ -69,7 +69,7 @@ public:+@@ -72,7 +72,7 @@ public:+void updateSurfaceID(uint64_t);- #if USE(SKIA)- Expected<Ref<ViewSnapshot>, String> takeSnapshot(std::optional<WebCore::IntRect>&&);+ Expected<Ref<ViewSnapshot>, String> takeSnapshot(std::optional<WebCore::IntRect>&&, bool nominalResolution);- #endifRendererBufferDescription bufferDescription() const;+diff --git a/Source/WebKit/UIProcess/wpe/WebColorPickerWPE.cpp b/Source/WebKit/UIProcess/wpe/WebColorPickerWPE.cppnew file mode 100644index 0000000000000000000000000000000000000000..7df77e30c2e7303dc6aaad560434e5b8e35f4f3c@@ -18360,7 +17543,7 @@ index 0000000000000000000000000000000000000000..0c0e3fce33b06ee72c4c29d2a4abe964+#endif // ENABLE(DATE_AND_TIME_INPUT_TYPES)diff --git a/Source/WebKit/UIProcess/wpe/WebPageInspectorEmulationAgentWPE.cpp b/Source/WebKit/UIProcess/wpe/WebPageInspectorEmulationAgentWPE.cppnew file mode 100644-index 0000000000000000000000000000000000000000..182398f24909cbc42cac897d66546991f46c1d5d+index 0000000000000000000000000000000000000000..493c44f0051a748d6570070f8b169e0e781370f4--- /dev/null+++ b/Source/WebKit/UIProcess/wpe/WebPageInspectorEmulationAgentWPE.cpp@@ -0,0 +1,53 @@@@ -18409,7 +17592,7 @@ index 0000000000000000000000000000000000000000..182398f24909cbc42cac897d66546991+ struct wpe_view_backend* backend = m_page.viewBackend();+ wpe_view_backend_dispatch_set_size(backend, viewSize.width(), viewSize.height());+ if (auto* drawingArea = static_cast<DrawingAreaProxyCoordinatedGraphics*>(m_page.drawingArea())) {-+ drawingArea->waitForSizeUpdate([callback = WTFMove(callback)](const DrawingAreaProxyCoordinatedGraphics&) mutable {++ drawingArea->waitForSizeUpdate([callback = WTF::move(callback)](const DrawingAreaProxyCoordinatedGraphics&) mutable {+ callback(String());+ });+ } else@@ -18540,10 +17723,10 @@ index 9b688ad328317fea4fd96ce66e9714bad8f0f937..402a36a9c565e13ec298aa7f014f0d92} // namespace WebKitdiff --git a/Source/WebKit/WebKit.xcodeproj/project.pbxproj b/Source/WebKit/WebKit.xcodeproj/project.pbxproj-index 9f68d20085a8e97b7fb8e189435eab5c67e72024..a5a5567f9bcd4d5ef2038450e24ff31b70f5225c 100644+index e18ecd2461bf060154fb5b5fe8c56d1cec7e12b9..291667a66f39db18c6108910cb6c71ecdbadf87c 100644--- a/Source/WebKit/WebKit.xcodeproj/project.pbxproj+++ b/Source/WebKit/WebKit.xcodeproj/project.pbxproj-@@ -1515,6 +1515,7 @@+@@ -1555,6 +1555,7 @@5CABDC8722C40FED001EDE8E /* APIMessageListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CABDC8322C40FA7001EDE8E /* APIMessageListener.h */; };5CADDE05215046BD0067D309 /* WKWebProcess.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C74300E21500492004BFA17 /* WKWebProcess.h */; settings = {ATTRIBUTES = (Private, ); }; };5CAECB6627465AE400AB78D0 /* UnifiedSource115.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5CAECB5E27465AE300AB78D0 /* UnifiedSource115.cpp */; };@@ -18551,7 +17734,7 @@ index 9f68d20085a8e97b7fb8e189435eab5c67e72024..a5a5567f9bcd4d5ef2038450e24ff31b5CAF7AA726F93AB00003F19E /* adattributiond.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5CAF7AA526F93A950003F19E /* adattributiond.cpp */; };5CAFDE452130846300B1F7E1 /* _WKInspector.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CAFDE422130843500B1F7E1 /* _WKInspector.h */; settings = {ATTRIBUTES = (Private, ); }; };5CAFDE472130846A00B1F7E1 /* _WKInspectorInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CAFDE442130843600B1F7E1 /* _WKInspectorInternal.h */; };-@@ -2308,6 +2309,18 @@+@@ -2358,6 +2359,18 @@DF0C5F28252ECB8E00D921DB /* WKDownload.h in Headers */ = {isa = PBXBuildFile; fileRef = DF0C5F24252ECB8D00D921DB /* WKDownload.h */; settings = {ATTRIBUTES = (Public, ); }; };DF0C5F2A252ECB8E00D921DB /* WKDownloadDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = DF0C5F26252ECB8E00D921DB /* WKDownloadDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };DF0C5F2B252ED44000D921DB /* WKDownloadInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = DF0C5F25252ECB8E00D921DB /* WKDownloadInternal.h */; };@@ -18570,7 +17753,7 @@ index 9f68d20085a8e97b7fb8e189435eab5c67e72024..a5a5567f9bcd4d5ef2038450e24ff31bDF462E0F23F22F5500EFF35F /* WKHTTPCookieStorePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = DF462E0E23F22F5300EFF35F /* WKHTTPCookieStorePrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };DF462E1223F338BE00EFF35F /* WKContentWorldPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = DF462E1123F338AD00EFF35F /* WKContentWorldPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };DF7A231C291B088D00B98DF3 /* WKSnapshotConfigurationPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = DF7A231B291B088D00B98DF3 /* WKSnapshotConfigurationPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };-@@ -2412,6 +2425,8 @@+@@ -2463,6 +2476,8 @@E5BEF6822130C48000F31111 /* WebDataListSuggestionsDropdownIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = E5BEF6802130C47F00F31111 /* WebDataListSuggestionsDropdownIOS.h */; };E5CB07DC20E1678F0022C183 /* WKFormColorControl.h in Headers */ = {isa = PBXBuildFile; fileRef = E5CB07DA20E1678F0022C183 /* WKFormColorControl.h */; };E5CBA76427A318E100DF7858 /* UnifiedSource120.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E5CBA75F27A3187800DF7858 /* UnifiedSource120.cpp */; };@@ -18579,17 +17762,16 @@ index 9f68d20085a8e97b7fb8e189435eab5c67e72024..a5a5567f9bcd4d5ef2038450e24ff31bE5CBA76527A318E100DF7858 /* UnifiedSource118.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E5CBA76127A3187900DF7858 /* UnifiedSource118.cpp */; };E5CBA76627A318E100DF7858 /* UnifiedSource116.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E5CBA76327A3187B00DF7858 /* UnifiedSource116.cpp */; };E5CBA76727A318E100DF7858 /* UnifiedSource119.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E5CBA76027A3187900DF7858 /* UnifiedSource119.cpp */; };-@@ -2457,6 +2472,9 @@+@@ -2508,6 +2523,8 @@F3EEEE592DB318270038CC1D /* BidiBrowserAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = F3EEEE572DB318270038CC1D /* BidiBrowserAgent.h */; };F3EEEE5A2DB318270038CC1D /* BidiBrowserAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F3EEEE582DB318270038CC1D /* BidiBrowserAgent.cpp */; };F404455C2D5CFB56000E587E /* AppKitSoftLink.h in Headers */ = {isa = PBXBuildFile; fileRef = F404455A2D5CFB56000E587E /* AppKitSoftLink.h */; };-+ F303B849249A8D640031DE5C /* ScreencastEncoder.h in Headers */ = {isa = PBXBuildFile; fileRef = F303B848249A8D3A0031DE5C /* ScreencastEncoder.h */; };+ F33C7AC7249AD79C0018BE41 /* libwebrtc.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F33C7AC6249AD79C0018BE41 /* libwebrtc.dylib */; };+ F3867F0A24607D4E008F0F31 /* InspectorScreencastAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = F3867F0424607D2B008F0F31 /* InspectorScreencastAgent.h */; };F409BA181E6E64BC009DA28E /* WKDragDestinationAction.h in Headers */ = {isa = PBXBuildFile; fileRef = F409BA171E6E64B3009DA28E /* WKDragDestinationAction.h */; settings = {ATTRIBUTES = (Private, ); }; };F40C3B712AB401C5007A3567 /* WKDatePickerPopoverController.h in Headers */ = {isa = PBXBuildFile; fileRef = F40C3B6F2AB40167007A3567 /* WKDatePickerPopoverController.h */; };F41145682CD939E0004CDBD1 /* _WKTouchEventGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = F41145652CD939E0004CDBD1 /* _WKTouchEventGenerator.h */; settings = {ATTRIBUTES = (Private, ); }; };-@@ -6570,6 +6588,7 @@+@@ -6669,6 +6686,7 @@5CABDC8522C40FCC001EDE8E /* WKMessageListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKMessageListener.h; sourceTree = "<group>"; };5CABE07A28F60E8A00D83FD9 /* WebPushMessage.serialization.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebPushMessage.serialization.in; sourceTree = "<group>"; };5CADDE0D2151AA010067D309 /* AuthenticationChallengeDisposition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AuthenticationChallengeDisposition.h; sourceTree = "<group>"; };@@ -18597,7 +17779,7 @@ index 9f68d20085a8e97b7fb8e189435eab5c67e72024..a5a5567f9bcd4d5ef2038450e24ff31b5CAECB5E27465AE300AB78D0 /* UnifiedSource115.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = UnifiedSource115.cpp; sourceTree = "<group>"; };5CAF7AA426F93A750003F19E /* adattributiond */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = adattributiond; sourceTree = BUILT_PRODUCTS_DIR; };5CAF7AA526F93A950003F19E /* adattributiond.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = adattributiond.cpp; sourceTree = "<group>"; };-@@ -8367,6 +8386,19 @@+@@ -8486,6 +8504,19 @@DF0C5F24252ECB8D00D921DB /* WKDownload.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKDownload.h; sourceTree = "<group>"; };DF0C5F25252ECB8E00D921DB /* WKDownloadInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKDownloadInternal.h; sourceTree = "<group>"; };DF0C5F26252ECB8E00D921DB /* WKDownloadDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKDownloadDelegate.h; sourceTree = "<group>"; };@@ -18617,7 +17799,7 @@ index 9f68d20085a8e97b7fb8e189435eab5c67e72024..a5a5567f9bcd4d5ef2038450e24ff31bDF462E0E23F22F5300EFF35F /* WKHTTPCookieStorePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKHTTPCookieStorePrivate.h; sourceTree = "<group>"; };DF462E1123F338AD00EFF35F /* WKContentWorldPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKContentWorldPrivate.h; sourceTree = "<group>"; };DF58C6311371AC5800F9A37C /* NativeWebWheelEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeWebWheelEvent.h; sourceTree = "<group>"; };-@@ -8552,6 +8584,8 @@+@@ -8674,6 +8705,8 @@E5CBA76127A3187900DF7858 /* UnifiedSource118.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = UnifiedSource118.cpp; sourceTree = "<group>"; };E5CBA76227A3187900DF7858 /* UnifiedSource117.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = UnifiedSource117.cpp; sourceTree = "<group>"; };E5CBA76327A3187B00DF7858 /* UnifiedSource116.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = UnifiedSource116.cpp; sourceTree = "<group>"; };@@ -18626,22 +17808,17 @@ index 9f68d20085a8e97b7fb8e189435eab5c67e72024..a5a5567f9bcd4d5ef2038450e24ff31bE5DEFA6726F8F42600AB68DB /* PhotosUISPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PhotosUISPI.h; sourceTree = "<group>"; };E838FCAF2DE90BF800703353 /* ISO18013MobileDocumentRequest+Extras.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ISO18013MobileDocumentRequest+Extras.swift"; sourceTree = "<group>"; };E88885662DC914C400C572B8 /* WKISO18013Request.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WKISO18013Request.h; sourceTree = "<group>"; };-@@ -8615,6 +8649,14 @@+@@ -8738,6 +8771,9 @@F404455A2D5CFB56000E587E /* AppKitSoftLink.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppKitSoftLink.h; sourceTree = "<group>"; };F404455B2D5CFB56000E587E /* AppKitSoftLink.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = AppKitSoftLink.mm; sourceTree = "<group>"; };F4063DDE2D71481E00F3FE6E /* LLVMProfiling.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LLVMProfiling.h; sourceTree = "<group>"; };-+ F303B847249A8D3A0031DE5C /* ScreencastEncoder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScreencastEncoder.cpp; sourceTree = "<group>"; };-+ F303B848249A8D3A0031DE5C /* ScreencastEncoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScreencastEncoder.h; sourceTree = "<group>"; };-+ F31E2DA424C76E4B004B2775 /* WebMFileWriter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebMFileWriter.cpp; sourceTree = "<group>"; };-+ F31E2DA524C76E4C004B2775 /* WebMFileWriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebMFileWriter.h; sourceTree = "<group>"; };+ F33C7AC6249AD79C0018BE41 /* libwebrtc.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; path = libwebrtc.dylib; sourceTree = BUILT_PRODUCTS_DIR; };+ F3867F0324607D2B008F0F31 /* InspectorScreencastAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorScreencastAgent.cpp; sourceTree = "<group>"; };+ F3867F0424607D2B008F0F31 /* InspectorScreencastAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorScreencastAgent.h; sourceTree = "<group>"; };-+ F3970344249BD4CE003E1A22 /* ScreencastEncoderMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ScreencastEncoderMac.mm; sourceTree = "<group>"; };F409BA171E6E64B3009DA28E /* WKDragDestinationAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKDragDestinationAction.h; sourceTree = "<group>"; };F40C3B6F2AB40167007A3567 /* WKDatePickerPopoverController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WKDatePickerPopoverController.h; sourceTree = "<group>"; };F40C3B702AB40167007A3567 /* WKDatePickerPopoverController.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = WKDatePickerPopoverController.mm; sourceTree = "<group>"; };-@@ -9131,6 +9173,7 @@+@@ -9277,6 +9313,7 @@3766F9EE189A1241003CF19B /* JavaScriptCore.framework in Frameworks */,3766F9F1189A1254003CF19B /* libicucore.dylib in Frameworks */,7B9FC5BB28A5233B007570E7 /* libWebKitPlatform.a in Frameworks */,@@ -18649,7 +17826,7 @@ index 9f68d20085a8e97b7fb8e189435eab5c67e72024..a5a5567f9bcd4d5ef2038450e24ff31b3766F9EF189A1244003CF19B /* QuartzCore.framework in Frameworks */,37694525184FC6B600CDE21F /* Security.framework in Frameworks */,37BEC4DD1948FC6A008B4286 /* WebCore.framework in Frameworks */,-@@ -12480,6 +12523,7 @@+@@ -12636,6 +12673,7 @@99788ACA1F421DCA00C08000 /* _WKAutomationSessionConfiguration.mm */,990D28A81C6404B000986977 /* _WKAutomationSessionDelegate.h */,990D28AF1C65203900986977 /* _WKAutomationSessionInternal.h */,@@ -18657,7 +17834,7 @@ index 9f68d20085a8e97b7fb8e189435eab5c67e72024..a5a5567f9bcd4d5ef2038450e24ff31b5C4609E222430E4C009943C2 /* _WKContentRuleListAction.h */,5C4609E322430E4D009943C2 /* _WKContentRuleListAction.mm */,5C4609E422430E4D009943C2 /* _WKContentRuleListActionInternal.h */,-@@ -13921,6 +13965,7 @@+@@ -14115,6 +14153,7 @@E34B110C27C46BC6006D2F2E /* libWebCoreTestShim.dylib */,E34B110F27C46D09006D2F2E /* libWebCoreTestSupport.dylib */,DDE992F4278D06D900F60D26 /* libWebKitAdditions.a */,@@ -18665,28 +17842,16 @@ index 9f68d20085a8e97b7fb8e189435eab5c67e72024..a5a5567f9bcd4d5ef2038450e24ff31b57A9FF15252C6AEF006A2040 /* libWTF.a */,5750F32A2032D4E500389347 /* LocalAuthentication.framework */,570DAAB0230273D200E8FC04 /* NearField.framework */,-@@ -14521,6 +14566,12 @@+@@ -14715,6 +14754,8 @@children = (9197940423DBC4BB00257892 /* InspectorBrowserAgent.cpp */,9197940323DBC4BB00257892 /* InspectorBrowserAgent.h */,+ F3867F0324607D2B008F0F31 /* InspectorScreencastAgent.cpp */,+ F3867F0424607D2B008F0F31 /* InspectorScreencastAgent.h */,-+ F303B847249A8D3A0031DE5C /* ScreencastEncoder.cpp */,-+ F303B848249A8D3A0031DE5C /* ScreencastEncoder.h */,-+ F31E2DA424C76E4B004B2775 /* WebMFileWriter.cpp */,-+ F31E2DA524C76E4C004B2775 /* WebMFileWriter.h */,);path = Agents;sourceTree = "<group>";-@@ -14529,6 +14580,7 @@- isa = PBXGroup;- children = (- A5D3504D1D78F0D2005124A9 /* RemoteWebInspectorUIProxyMac.mm */,-+ F3970344249BD4CE003E1A22 /* ScreencastEncoderMac.mm */,- 1CA8B935127C774E00576C2B /* WebInspectorUIProxyMac.mm */,- 99A7ACE326012919006D57FD /* WKInspectorResourceURLSchemeHandler.h */,- 99A7ACE42601291A006D57FD /* WKInspectorResourceURLSchemeHandler.mm */,-@@ -15300,6 +15352,7 @@+@@ -15509,6 +15550,7 @@E1513C65166EABB200149FCB /* AuxiliaryProcessProxy.h */,46A2B6061E5675A200C3DEDA /* BackgroundProcessResponsivenessTimer.cpp */,46A2B6071E5675A200C3DEDA /* BackgroundProcessResponsivenessTimer.h */,@@ -18694,7 +17859,7 @@ index 9f68d20085a8e97b7fb8e189435eab5c67e72024..a5a5567f9bcd4d5ef2038450e24ff31b5C6D69352AC3935D0099BDAF /* BrowsingContextGroup.cpp */,5C6D69362AC3935D0099BDAF /* BrowsingContextGroup.h */,5CA98549210BEB5A0057EB6B /* BrowsingWarning.h */,-@@ -15330,6 +15383,8 @@+@@ -15539,6 +15581,8 @@BC06F43912DBCCFB002D78DE /* GeolocationPermissionRequestProxy.cpp */,BC06F43812DBCCFB002D78DE /* GeolocationPermissionRequestProxy.h */,2DD5A72A1EBF09A7009BA597 /* HiddenPageThrottlingAutoIncreasesCounter.h */,@@ -18703,7 +17868,7 @@ index 9f68d20085a8e97b7fb8e189435eab5c67e72024..a5a5567f9bcd4d5ef2038450e24ff31b5CEABA2B2333251400797797 /* LegacyGlobalSettings.cpp */,5CEABA2A2333247700797797 /* LegacyGlobalSettings.h */,31607F3819627002009B87DA /* LegacySessionStateCoding.h */,-@@ -15360,6 +15415,7 @@+@@ -15569,6 +15613,7 @@4683569B21E81CC7006E27A3 /* ProvisionalPageProxy.cpp */,4683569A21E81CC7006E27A3 /* ProvisionalPageProxy.h */,411B89CB27B2B89600F9EBD3 /* QueryPermissionResultCallback.h */,@@ -18711,7 +17876,7 @@ index 9f68d20085a8e97b7fb8e189435eab5c67e72024..a5a5567f9bcd4d5ef2038450e24ff31b5CCB54DC2A4FEA6A0005FAA8 /* RemotePageDrawingAreaProxy.cpp */,5CCB54DB2A4FEA6A0005FAA8 /* RemotePageDrawingAreaProxy.h */,FABBBC802D35AC6800820017 /* RemotePageFullscreenManagerProxy.cpp */,-@@ -15471,6 +15527,8 @@+@@ -15687,6 +15732,8 @@BC7B6204129A0A6700D174A4 /* WebPageGroup.h */,2D9EA3101A96D9EB002D2807 /* WebPageInjectedBundleClient.cpp */,2D9EA30E1A96CBFF002D2807 /* WebPageInjectedBundleClient.h */,@@ -18720,7 +17885,7 @@ index 9f68d20085a8e97b7fb8e189435eab5c67e72024..a5a5567f9bcd4d5ef2038450e24ff31b9B7F8A502C785725000057F3 /* WebPageLoadTiming.h */,BC111B0B112F5E4F00337BAB /* WebPageProxy.cpp */,BC032DCB10F4389F0058C15A /* WebPageProxy.h */,-@@ -15660,6 +15718,7 @@+@@ -15881,6 +15928,7 @@BC646C1911DD399F006455B0 /* WKBackForwardListItemRef.h */,BC646C1611DD399F006455B0 /* WKBackForwardListRef.cpp */,BC646C1711DD399F006455B0 /* WKBackForwardListRef.h */,@@ -18728,7 +17893,7 @@ index 9f68d20085a8e97b7fb8e189435eab5c67e72024..a5a5567f9bcd4d5ef2038450e24ff31bBCB9E24A1120E15C00A137E0 /* WKContext.cpp */,BCB9E2491120E15C00A137E0 /* WKContext.h */,1AE52F9319201F6B00A1FA37 /* WKContextConfigurationRef.cpp */,-@@ -16247,6 +16306,8 @@+@@ -16474,6 +16522,8 @@07EF07592745A8160066EA04 /* DisplayCaptureSessionManager.h */,07EF07582745A8160066EA04 /* DisplayCaptureSessionManager.mm */,7AFA6F682A9F57C50055322A /* DisplayLinkMac.cpp */,@@ -18737,7 +17902,7 @@ index 9f68d20085a8e97b7fb8e189435eab5c67e72024..a5a5567f9bcd4d5ef2038450e24ff31b1AFDE65B1954E8D500C48FFA /* LegacySessionStateCoding.cpp */,0FCB4E5818BBE3D9000FCFC9 /* PageClientImplMac.h */,0FCB4E5918BBE3D9000FCFC9 /* PageClientImplMac.mm */,-@@ -16270,6 +16331,9 @@+@@ -16497,6 +16547,9 @@E568B92120A3AC6A00E3C856 /* WebDataListSuggestionsDropdownMac.mm */,E55CD20124D09F1F0042DB9C /* WebDateTimePickerMac.h */,E55CD20224D09F1F0042DB9C /* WebDateTimePickerMac.mm */,@@ -18747,7 +17912,7 @@ index 9f68d20085a8e97b7fb8e189435eab5c67e72024..a5a5567f9bcd4d5ef2038450e24ff31bBC857E8512B71EBB00EDEB2E /* WebPageProxyMac.mm */,BC5750951268F3C6006F0F12 /* WebPopupMenuProxyMac.h */,BC5750961268F3C6006F0F12 /* WebPopupMenuProxyMac.mm */,-@@ -17388,6 +17452,7 @@+@@ -17625,6 +17678,7 @@99788ACB1F421DDA00C08000 /* _WKAutomationSessionConfiguration.h in Headers */,990D28AC1C6420CF00986977 /* _WKAutomationSessionDelegate.h in Headers */,990D28B11C65208D00986977 /* _WKAutomationSessionInternal.h in Headers */,@@ -18755,7 +17920,7 @@ index 9f68d20085a8e97b7fb8e189435eab5c67e72024..a5a5567f9bcd4d5ef2038450e24ff31bCD89ACBD2EA696A300C76423 /* _WKCaptionStyleMenuController.h in Headers */,97C476282ECD33A6004D1492 /* _WKCaptionStyleMenuControllerInternal.h in Headers */,5C4609E7224317B4009943C2 /* _WKContentRuleListAction.h in Headers */,-@@ -17706,6 +17771,7 @@+@@ -17944,6 +17998,7 @@E170876C16D6CA6900F99226 /* BlobRegistryProxy.h in Headers */,4F601432155C5AA2001FBDE0 /* BlockingResponseMap.h in Headers */,1A5705111BE410E600874AF1 /* BlockSPI.h in Headers */,@@ -18763,7 +17928,7 @@ index 9f68d20085a8e97b7fb8e189435eab5c67e72024..a5a5567f9bcd4d5ef2038450e24ff31b5CA9854A210BEB640057EB6B /* BrowsingWarning.h in Headers */,A7E69BCC2B2117A100D43D3F /* BufferAndBackendInfo.h in Headers */,BC3065FA1259344E00E71278 /* CacheModel.h in Headers */,-@@ -17899,7 +17965,11 @@+@@ -18146,7 +18201,11 @@BC14DF77120B5B7900826C0C /* InjectedBundleScriptWorld.h in Headers */,CE550E152283752200D28791 /* InsertTextOptions.h in Headers */,9197940523DBC4BB00257892 /* InspectorBrowserAgent.h in Headers */,@@ -18773,25 +17938,17 @@ index 9f68d20085a8e97b7fb8e189435eab5c67e72024..a5a5567f9bcd4d5ef2038450e24ff31b+ D71A94322370E025002C4D9E /* InspectorPlaywrightAgentClientMac.h in Headers */,+ F3867F0A24607D4E008F0F31 /* InspectorScreencastAgent.h in Headers */,A5E391FD2183C1F800C8FB31 /* InspectorTargetProxy.h in Headers */,- C5BCE5DF1C50766A00CDE3FA /* InteractionInformationAtPosition.h in Headers */,- 2D4D2C811DF60BF3002EB10C /* InteractionInformationRequest.h in Headers */,-@@ -18170,6 +18240,7 @@- CDAC20C923FC2F750021DEE3 /* RemoteCDMInstanceSessionIdentifier.h in Headers */,+ 07AE8FBD2F3BC4F300A4C0CA /* InteractionInformationAtPosition.h in Headers */,+ 07AE8FC22F3BC58200A4C0CA /* InteractionInformationRequest.h in Headers */,+@@ -18429,6 +18488,7 @@+ 07E065142F19E01000ECDA2E /* RemoteGPU.h in Headers */,0F6E7C532C4C386800F1DB85 /* RemoteGraphicsContextMessages.h in Headers */,F451C0FE2703B263002BA03B /* RemoteGraphicsContextProxy.h in Headers */,+ D71A943A2370F061002C4D9E /* RemoteInspectorPipe.h in Headers */,2D47B56D1810714E003A3AEE /* RemoteLayerBackingStore.h in Headers */,2DDF731518E95060004F5A66 /* RemoteLayerBackingStoreCollection.h in Headers */,5F4D67D682584880B7E5A569 /* RemoteLayerTreeCommitBundle.h in Headers */,-@@ -18233,6 +18304,7 @@- E1E552C516AE065F004ED653 /* SandboxInitializationParameters.h in Headers */,- E36FF00327F36FBD004BE21A /* SandboxStateVariables.h in Headers */,- 7BAB111025DD02B3008FC479 /* ScopedActiveMessageReceiveQueue.h in Headers */,-+ F303B849249A8D640031DE5C /* ScreencastEncoder.h in Headers */,- 6D4DF20C2D824242001F964C /* ScreenTimeWebsiteDataSupport.h in Headers */,- 463BB93A2B9D08D80098C5C3 /* ScriptMessageHandlerIdentifier.h in Headers */,- F4E28A362C923814008120DD /* ScriptTrackingPrivacyFilter.h in Headers */,-@@ -18610,6 +18682,8 @@+@@ -18875,6 +18935,8 @@939EF87029D112EE00F23AEE /* WebPageInlines.h in Headers */,9197940823DBC4CB00257892 /* WebPageInspectorAgentBase.h in Headers */,A513F5402154A5D700662841 /* WebPageInspectorController.h in Headers */,@@ -18800,26 +17957,57 @@ index 9f68d20085a8e97b7fb8e189435eab5c67e72024..a5a5567f9bcd4d5ef2038450e24ff31bA543E30C215C8A8D00279CD9 /* WebPageInspectorTarget.h in Headers */,A543E307215AD13700279CD9 /* WebPageInspectorTargetFrontendChannel.h in Headers */,F30EE4712E72226700935B60 /* WebPageInspectorTargetProxy.h in Headers */,-@@ -21451,6 +21525,7 @@+@@ -21728,6 +21790,7 @@522F792928D50EBB0069B45B /* HidService.mm in Sources */,2749F6442146561B008380BF /* InjectedBundleNodeHandle.cpp in Sources */,2749F6452146561E008380BF /* InjectedBundleRangeHandle.cpp in Sources */,+ D7EB04E72372A73B00F744CE /* InspectorPlaywrightAgentClientMac.mm in Sources */,- 5CF250AF2EE06491006A7172 /* IPCTesterReceiverSwift.swift in Sources */,- 5C448C662EE06E11008931C7 /* IPCTesterReceiverSwiftMessageReceiver.swift in Sources */,- 1C0F05BE2CFA5D2E007D1F62 /* JSWebExtensionAPIUnified.mm in Sources */,-@@ -21802,6 +21877,9 @@+ 074D6A652F385435006089F6 /* IntRectCG.swift in Sources */,+ 5CF250AF2EE06491006A7172 /* IPCTesterReceiver.swift in Sources */,+ 5C448C662EE06E11008931C7 /* IPCTesterReceiverMessageReceiver.swift in Sources */,+@@ -22092,6 +22155,9 @@078B04A02CF18EAB00B453A6 /* WebPage+NavigationPreferences.swift in Sources */,071467782DFE84E500F77867 /* WebPage+Transferable.swift in Sources */,07CB79962CE9435700199C49 /* WebPage.swift in Sources */,+ D79902B1236E9404005D6F7E /* WebPageInspectorEmulationAgentMac.mm in Sources */,+ D79902B3236E9404005D6F7E /* WebPageInspectorInputAgentMac.mm in Sources */,+ D79902B2236E9404005D6F7E /* WebPageInspectorTargetProxyMac.mm in Sources */,+ 0715310F2F3037C100B56C0E /* WebPageProxy.swift in Sources */,7CE9CE101FA0767A000177DE /* WebPageUpdatePreferences.cpp in Sources */,079A4DA12D72CC0D00CA387F /* WebPageWebView.swift in Sources */,- 7CEB00DD1FA69ABE0065473B /* WebPreferencesFeatures.cpp in Sources */,+diff --git a/Source/WebKit/WebProcess/Inspector/WebFrameInspectorTarget.cpp b/Source/WebKit/WebProcess/Inspector/WebFrameInspectorTarget.cpp+index a3a319b35af0882aaeb949b4e767334d9c264e0e..e81e2d903ceba50de27afeb4f04e3962f406630a 100644+--- a/Source/WebKit/WebProcess/Inspector/WebFrameInspectorTarget.cpp++++ b/Source/WebKit/WebProcess/Inspector/WebFrameInspectorTarget.cpp+@@ -90,4 +90,13 @@ String WebFrameInspectorTarget::toTargetID(WebCore::FrameIdentifier frameID)+ return makeString("frame-"_s, frameID.toUInt64());+ }+++void WebFrameInspectorTarget::didCreateSubframe(WebFrame& frame)++{++ if (!m_channel)++ return;++++ // Auto connect to the subframe if the parent frame is inspected.++ frame.connectInspector(static_cast<Inspector::FrontendChannel*>(m_channel.get())->connectionType());++}+++ } // namespace WebKit+diff --git a/Source/WebKit/WebProcess/Inspector/WebFrameInspectorTarget.h b/Source/WebKit/WebProcess/Inspector/WebFrameInspectorTarget.h+index eab417970287a2f342363bd42105c36bce74f2ba..6ae3babddbe7f375b8bf8f400c9e6fe6016a1345 100644+--- a/Source/WebKit/WebProcess/Inspector/WebFrameInspectorTarget.h++++ b/Source/WebKit/WebProcess/Inspector/WebFrameInspectorTarget.h+@@ -55,6 +55,8 @@ public:++ static String toTargetID(WebCore::FrameIdentifier);+++ void didCreateSubframe(WebFrame&);+++ private:+ Ref<WebFrame> protectedFrame();+diff --git a/Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp b/Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp-index eab2e2b933f812643aa2577c06370969dc2e90cf..33350236fc188d4d8553cce43dfae47029293ca5 100644+index 3937a61ef643ea8cf1648f63da8f03879ec77bd6..3bb2ec9a1b2093477779b3d000e57f83aac25eee 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@@ -18857,7 +18045,7 @@ index eab2e2b933f812643aa2577c06370969dc2e90cf..33350236fc188d4d8553cce43dfae470}WEBLOADERSTRATEGY_RELEASE_LOG_FORWARDABLE(WEBLOADERSTRATEGY_SCHEDULELOAD);-@@ -429,7 +438,7 @@ static void addParametersShared(const LocalFrame* frame, NetworkResourceLoadPara+@@ -431,7 +440,7 @@ static void addParametersShared(const LocalFrame* frame, NetworkResourceLoadParaparameters.linkPreconnectEarlyHintsEnabled = mainFrame->settings().linkPreconnectEarlyHintsEnabled();}@@ -18866,7 +18054,7 @@ index eab2e2b933f812643aa2577c06370969dc2e90cf..33350236fc188d4d8553cce43dfae470{auto identifier = *resourceLoader.identifier();-@@ -441,10 +450,10 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceL+@@ -443,10 +452,10 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceL&& resourceLoader.frameLoader()->notifier().isInitialRequestIdentifier(identifier)? MainFrameMainResource::Yes : MainFrameMainResource::No;if (!page->allowsLoadFromURL(request.url(), mainFrameMainResource)) {@@ -18879,7 +18067,7 @@ index eab2e2b933f812643aa2577c06370969dc2e90cf..33350236fc188d4d8553cce43dfae470}}-@@ -454,14 +463,6 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceL+@@ -456,14 +465,6 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceLLOG(NetworkScheduling, "(WebProcess) WebLoaderStrategy::scheduleLoad, url '%s' will be scheduled with the NetworkProcess with priority %d, storedCredentialsPolicy %i", resourceLoader.url().string().latin1().data(), static_cast<int>(resourceLoader.request().priority()), (int)storedCredentialsPolicy);@@ -18894,7 +18082,16 @@ index eab2e2b933f812643aa2577c06370969dc2e90cf..33350236fc188d4d8553cce43dfae470loadParameters.identifier = identifier;loadParameters.parentPID = legacyPresentingApplicationPID();loadParameters.contentSniffingPolicy = contentSniffingPolicy;-@@ -545,14 +546,11 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceL+@@ -498,7 +499,7 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceL++ if (resourceLoader.options().crossOriginEmbedderPolicy)+ loadParameters.crossOriginEmbedderPolicy = *resourceLoader.options().crossOriginEmbedderPolicy;+-+++ auto* webFrameLoaderClient = frame ? dynamicDowncast<WebLocalFrameLoaderClient>(frame->loader().client()) : nullptr;+ RefPtr webFrame = webFrameLoaderClient ? &webFrameLoaderClient->webFrame() : nullptr;++@@ -549,14 +550,11 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceLif (loadParameters.options.mode != FetchOptions::Mode::Navigate) {ASSERT(loadParameters.sourceOrigin);@@ -18911,8 +18108,8 @@ index eab2e2b933f812643aa2577c06370969dc2e90cf..33350236fc188d4d8553cce43dfae470+ loadParameters.shouldRestrictHTTPResponseAccess = true;loadParameters.isMainFrameNavigation = isMainFrameNavigation;- if (loadParameters.isMainFrameNavigation && document)-@@ -606,6 +604,25 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceL+ if (loadParameters.isMainFrameNavigation && document) {+@@ -621,6 +619,25 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceLif (CachedResourceHandle handle = resourceLoader.cachedResource())loadParameters.isInitiatorPrefetch = handle->type() == CachedResource::Type::LinkPrefetch;@@ -18938,16 +18135,16 @@ index eab2e2b933f812643aa2577c06370969dc2e90cf..33350236fc188d4d8553cce43dfae470std::optional<NetworkResourceLoadIdentifier> existingNetworkResourceLoadIdentifierToResume;if (loadParameters.isMainFrameNavigation)existingNetworkResourceLoadIdentifierToResume = std::exchange(m_existingNetworkResourceLoadIdentifierToResume, std::nullopt);-@@ -621,7 +638,7 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceL+@@ -636,7 +653,7 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceL}auto loader = WebResourceLoader::create(resourceLoader, trackingParameters);-- m_webResourceLoaders.set(identifier, WTFMove(loader));-+ m_webResourceLoaders.set(*resourceLoader.identifier(), WTFMove(loader));+- m_webResourceLoaders.set(identifier, WTF::move(loader));++ m_webResourceLoaders.set(*resourceLoader.identifier(), WTF::move(loader));}void WebLoaderStrategy::scheduleInternallyFailedLoad(WebCore::ResourceLoader& resourceLoader)-@@ -1039,7 +1056,7 @@ void WebLoaderStrategy::didFinishPreconnection(WebCore::ResourceLoaderIdentifier+@@ -1056,7 +1073,7 @@ void WebLoaderStrategy::didFinishPreconnection(WebCore::ResourceLoaderIdentifierbool WebLoaderStrategy::isOnLine() const{@@ -18956,7 +18153,7 @@ index eab2e2b933f812643aa2577c06370969dc2e90cf..33350236fc188d4d8553cce43dfae470}void WebLoaderStrategy::addOnlineStateChangeListener(Function<void(bool)>&& listener)-@@ -1065,6 +1082,11 @@ void WebLoaderStrategy::isResourceLoadFinished(CachedResource& resource, Complet+@@ -1082,6 +1099,11 @@ void WebLoaderStrategy::isResourceLoadFinished(CachedResource& resource, Completvoid WebLoaderStrategy::setOnLineState(bool isOnLine){@@ -18968,7 +18165,7 @@ index eab2e2b933f812643aa2577c06370969dc2e90cf..33350236fc188d4d8553cce43dfae470if (m_isOnLine == isOnLine)return;-@@ -1073,6 +1095,12 @@ void WebLoaderStrategy::setOnLineState(bool isOnLine)+@@ -1090,6 +1112,12 @@ void WebLoaderStrategy::setOnLineState(bool isOnLine)listener(isOnLine);}@@ -18982,7 +18179,7 @@ index eab2e2b933f812643aa2577c06370969dc2e90cf..33350236fc188d4d8553cce43dfae470{WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::SetCaptureExtraNetworkLoadMetricsEnabled(enabled), 0);diff --git a/Source/WebKit/WebProcess/Network/WebLoaderStrategy.h b/Source/WebKit/WebProcess/Network/WebLoaderStrategy.h-index 7cdc69f27b25457f07b3f7cbba75290f995538bb..e4b1ab52e259f24a2cf5403c4dd9e694b2b086e7 100644+index 84563e315081cc3a2dbfc9eee47e8aad2ed91a7a..5c3115694d82289e3ec1c228eecec2852a2b1b5e 100644--- a/Source/WebKit/WebProcess/Network/WebLoaderStrategy.h+++ b/Source/WebKit/WebProcess/Network/WebLoaderStrategy.h@@ -26,6 +26,7 @@@@ -19012,12 +18209,12 @@ index 7cdc69f27b25457f07b3f7cbba75290f995538bb..e4b1ab52e259f24a2cf5403c4dd9e694} // namespace WebKitdiff --git a/Source/WebKit/WebProcess/Network/WebResourceLoader.cpp b/Source/WebKit/WebProcess/Network/WebResourceLoader.cpp-index 01cc8797d5091e4c912a3261ce95b9b87aad9939..fa83d1c0bfcb1d75d469d48c740978db05267aae 100644+index 3d392a8e4914fbc000c736a50cb3ec89df49ac21..b97d6c1edea5cd8b291ffb469b4ff5b4bf07f39f 100644--- a/Source/WebKit/WebProcess/Network/WebResourceLoader.cpp+++ b/Source/WebKit/WebProcess/Network/WebResourceLoader.cpp-@@ -203,9 +203,6 @@ void WebResourceLoader::didReceiveResponse(ResourceResponse&& response, PrivateR+@@ -236,9 +236,6 @@ void WebResourceLoader::didReceiveResponse(ResourceResponse&& response, PrivateR- coreLoader->didReceiveResponse(ResourceResponse { inspectorResponse }, [this, protectedThis = Ref { *this }, interceptedRequestIdentifier, policyDecisionCompletionHandler = WTFMove(policyDecisionCompletionHandler), overrideData = WTFMove(overrideData)]() mutable {+ coreLoader->didReceiveResponse(ResourceResponse { inspectorResponse }, [this, protectedThis = Ref { *this }, interceptedRequestIdentifier, policyDecisionCompletionHandler = WTF::move(policyDecisionCompletionHandler), overrideData = WTF::move(overrideData)]() mutable {RefPtr coreLoader = m_coreLoader;- if (policyDecisionCompletionHandler)- policyDecisionCompletionHandler();@@ -19025,7 +18222,7 @@ index 01cc8797d5091e4c912a3261ce95b9b87aad9939..fa83d1c0bfcb1d75d469d48c740978dbif (!m_coreLoader || !coreLoader->identifier()) {m_interceptController.continueResponse(interceptedRequestIdentifier);return;-@@ -222,6 +219,8 @@ void WebResourceLoader::didReceiveResponse(ResourceResponse&& response, PrivateR+@@ -255,6 +252,8 @@ void WebResourceLoader::didReceiveResponse(ResourceResponse&& response, PrivateR}});});@@ -19035,10 +18232,10 @@ index 01cc8797d5091e4c912a3261ce95b9b87aad9939..fa83d1c0bfcb1d75d469d48c740978db}diff --git a/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp b/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp-index 9d4ff34fe5befc7a5326164eb281cd630b79ed02..a8b84973f73d4b68029b3d4e940f91d666456b02 100644+index 7031747251e5de30568d9eea2981b444877763ee..a7f3687cbfe7085faec75f7138658d4f49b3f537 100644--- a/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp+++ b/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp-@@ -508,6 +508,9 @@ void WebChromeClient::addMessageToConsole(MessageSource source, MessageLevel lev+@@ -500,6 +500,9 @@ void WebChromeClient::addMessageToConsole(MessageSource source, MessageLevel levif (!page)return;@@ -19049,11 +18246,11 @@ index 9d4ff34fe5befc7a5326164eb281cd630b79ed02..a8b84973f73d4b68029b3d4e940f91d6page->injectedBundleUIClient().willAddMessageToConsole(page.get(), source, level, message, lineNumber, columnNumber, sourceID);#endifdiff --git a/Source/WebKit/WebProcess/WebCoreSupport/WebDragClient.cpp b/Source/WebKit/WebProcess/WebCoreSupport/WebDragClient.cpp-index 771f8c77b51976e3aa332fa10befd9fd5b258edc..f46b5bf3a6d5a1cb832b602e0c024dbde808b7b9 100644+index 81e673e5b8eda7af88955b2e3e768aaa7ae5718f..9e0817c626dd576cd6c6e2fc79a95a4ec725c2d3 100644--- a/Source/WebKit/WebProcess/WebCoreSupport/WebDragClient.cpp+++ b/Source/WebKit/WebProcess/WebCoreSupport/WebDragClient.cpp@@ -53,7 +53,7 @@ OptionSet<DragSourceAction> WebDragClient::dragSourceActionMaskForPoint(const In- return protectedPage()->allowedDragSourceActions();+ return protect(m_page.get())->allowedDragSourceActions();}-#if !PLATFORM(COCOA) && !PLATFORM(GTK) && !PLATFORM(WPE)@@ -19062,7 +18259,7 @@ index 771f8c77b51976e3aa332fa10befd9fd5b258edc..f46b5bf3a6d5a1cb832b602e0c024dbd{}diff --git a/Source/WebKit/WebProcess/WebCoreSupport/WebUserMediaClient.cpp b/Source/WebKit/WebProcess/WebCoreSupport/WebUserMediaClient.cpp-index f0e2863e578c60cfc0ddc98a50b45061fad1fc0b..81e59abd8c5201d0550bff3ad8ecf284765cfc40 100644+index 23fdfa0d3d98fc703324372684208e5c4b190dbd..529870b21ab6f2ecd41eaea822186b325d7e1ff7 100644--- a/Source/WebKit/WebProcess/WebCoreSupport/WebUserMediaClient.cpp+++ b/Source/WebKit/WebProcess/WebCoreSupport/WebUserMediaClient.cpp@@ -26,6 +26,7 @@@@ -19074,10 +18271,10 @@ index f0e2863e578c60cfc0ddc98a50b45061fad1fc0b..81e59abd8c5201d0550bff3ad8ecf284#include <WebCore/UserMediaRequest.h>#include <wtf/TZoneMallocInlines.h>diff --git a/Source/WebKit/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm b/Source/WebKit/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm-index 49f5744bedb68860258cf8afeafcbac752837ced..d5292168d55655ffe0e1c11f7907fb2f51fc8f0c 100644+index 75066a132de26b5af0e753cf84ba924d075cd2b9..2df20e9af41d0d71065d49a93228669744787b1d 100644--- a/Source/WebKit/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm+++ b/Source/WebKit/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm-@@ -130,7 +130,8 @@ static WebCore::CachedImage* cachedImage(Element& element)+@@ -131,7 +131,8 @@ static WebCore::CachedImage* cachedImage(Element& element)void WebDragClient::declareAndWriteDragImage(const String& pasteboardName, Element& element, const URL& url, const String& label, LocalFrame*){@@ -19151,8 +18348,44 @@ index 0000000000000000000000000000000000000000..741ef5b11fe8718529105339cda0fab5+}; // namespace WebKit.++#endif // ENABLE(DRAG_SUPPORT)+diff --git a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/AcceleratedSurface.h b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/AcceleratedSurface.h+index 1c63d62650122bc0265f4b319dfb15a18f899158..5ba9cbc7779f8dd7483576d4357bab57b3df8963 100644+--- a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/AcceleratedSurface.h++++ b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/AcceleratedSurface.h+@@ -119,7 +119,7 @@ public:+ #endif+ }++-#if PLATFORM(GTK) || ENABLE(WPE_PLATFORM)++#if PLATFORM(GTK) || PLATFORM(WPE)+ bool usesGL() const { return m_swapChain.type() != SwapChain::Type::SharedMemoryWithoutGL; }+ #endif++@@ -354,7 +354,7 @@ private:++ enum class Type {+ Invalid,+-#if PLATFORM(GTK) || ENABLE(WPE_PLATFORM)++#if PLATFORM(GTK) || PLATFORM(WPE)+ #if USE(GBM) || OS(ANDROID)+ EGLImage,+ #endif+diff --git a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/NonCompositedFrameRenderer.cpp b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/NonCompositedFrameRenderer.cpp+index ea6f2b51641370c2c83cee836b5d949dbd8ce699..99435111df34247a014a7c2b6315495416822a6a 100644+--- a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/NonCompositedFrameRenderer.cpp++++ b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/NonCompositedFrameRenderer.cpp+@@ -141,7 +141,8 @@ void NonCompositedFrameRenderer::display()+ m_surface->willRenderFrame(scaledSize);++ auto* canvas = m_surface->canvas();+- RELEASE_ASSERT(canvas);++ if (!canvas)++ return;++ if (m_context)+ PlatformDisplay::sharedDisplay().skiaGLContext()->makeContextCurrent();diff --git a/Source/WebKit/WebProcess/WebPage/DrawingArea.cpp b/Source/WebKit/WebProcess/WebPage/DrawingArea.cpp-index 04f3e2cebec36db9487ee5b5d4f33eb2ca8db3b8..4677b87d3cdfdc98e4b10747bf483df3ec1feec0 100644+index 6f35eaf3781acc43b46f42bc8de7e15b375a8c75..087fd2b2360784eceb8610cc305268303310112b 100644--- a/Source/WebKit/WebProcess/WebPage/DrawingArea.cpp+++ b/Source/WebKit/WebProcess/WebPage/DrawingArea.cpp@@ -27,6 +27,7 @@@@ -19164,7 +18397,7 @@ index 04f3e2cebec36db9487ee5b5d4f33eb2ca8db3b8..4677b87d3cdfdc98e4b10747bf483df3#include "WebPage.h"#include "WebPageCreationParameters.h"diff --git a/Source/WebKit/WebProcess/WebPage/WebCookieJar.cpp b/Source/WebKit/WebProcess/WebPage/WebCookieJar.cpp-index 868a836e964d3a24a74e5e6b853c537dfed7c08a..079590ce32193a80be7ca467397c2e79ac0079b7 100644+index 6abba16c7c9d87d269be9a30c834413260ce0e93..d38799151daac158688fc4e0acbe69d5e7d60f79 100644--- a/Source/WebKit/WebProcess/WebPage/WebCookieJar.cpp+++ b/Source/WebKit/WebProcess/WebPage/WebCookieJar.cpp@@ -43,6 +43,7 @@@@ -19201,11 +18434,25 @@ index a7ad18fc1201e5de2cc1528539a765599ecfc41e..ebea233bc54ab6e56fb7093ff63e2368private:WebCookieJar();+diff --git a/Source/WebKit/WebProcess/WebPage/WebFrame.cpp b/Source/WebKit/WebProcess/WebPage/WebFrame.cpp+index 6af6ac22464070b3787dad277ddfeef0b3466fa1..2e9228d1c82ec1c4097ab2273052f74bc3910103 100644+--- a/Source/WebKit/WebProcess/WebPage/WebFrame.cpp++++ b/Source/WebKit/WebProcess/WebPage/WebFrame.cpp+@@ -175,6 +175,9 @@ Ref<WebFrame> WebFrame::createSubframe(WebPage& page, WebFrame& parent, const At+ ASSERT(ownerElement.document().frame());+ coreFrame->init();+++ if (parent.m_inspectorTarget)++ parent.m_inspectorTarget->didCreateSubframe(frame);+++ return frame;+ }+diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.cpp b/Source/WebKit/WebProcess/WebPage/WebPage.cpp-index 740461ddc23b7a7083b051270d8f21b7e276c206..691e00eed87e680e3799675a1721b412daa3b023 100644+index c7119d1c990988fef393581236cc13838661ff55..84a3589afc555d2c9fc1ac52140b1f12b352c768 100644--- a/Source/WebKit/WebProcess/WebPage/WebPage.cpp+++ b/Source/WebKit/WebProcess/WebPage/WebPage.cpp-@@ -256,6 +256,7 @@+@@ -259,6 +259,7 @@#include <WebCore/HitTestResult.h>#include <WebCore/ImageAnalysisQueue.h>#include <WebCore/ImageOverlay.h>@@ -19213,10 +18460,12 @@ index 740461ddc23b7a7083b051270d8f21b7e276c206..691e00eed87e680e3799675a1721b412#include <WebCore/JSDOMExceptionHandling.h>#include <WebCore/JSNode.h>#include <WebCore/KeyboardEvent.h>-@@ -1205,6 +1206,12 @@ WebPage::WebPage(PageIdentifier pageID, WebPageCreationParameters&& parameters)- setLinkDecorationFilteringData(WTFMove(parameters.linkDecorationFilteringData));- setAllowedQueryParametersForAdvancedPrivacyProtections(WTFMove(parameters.allowedQueryParametersForAdvancedPrivacyProtections));+@@ -1208,6 +1209,14 @@ WebPage::WebPage(PageIdentifier pageID, WebPageCreationParameters&& parameters)+ setLinkDecorationFilteringData(WTF::move(parameters.linkDecorationFilteringData));+ setAllowedQueryParametersForAdvancedPrivacyProtections(WTF::move(parameters.allowedQueryParametersForAdvancedPrivacyProtections));#endif++ if (parameters.deviceOrientationOverride)++ page->setOverrideOrientation(parameters.deviceOrientationOverride);+ // For popup windows WebPage::Show() maybe called in the next lines from the constructor,+ // at which point the page is not in the WebProcess's map yet and it is not safe to+ // dispatch nested message loop and receive IPC messages. To mitigate that, the actual@@ -19226,7 +18475,7 @@ index 740461ddc23b7a7083b051270d8f21b7e276c206..691e00eed87e680e3799675a1721b412if (parameters.windowFeatures) {page->applyWindowFeatures(*parameters.windowFeatures);page->chrome().show();-@@ -2150,6 +2157,22 @@ void WebPage::loadDidCommitInAnotherProcess(WebCore::FrameIdentifier frameID, st+@@ -2186,6 +2195,22 @@ void WebPage::loadDidCommitInAnotherProcess(WebCore::FrameIdentifier frameID, stframe->loadDidCommitInAnotherProcess(layerHostingContextIdentifier);}@@ -19241,15 +18490,15 @@ index 740461ddc23b7a7083b051270d8f21b7e276c206..691e00eed87e680e3799675a1721b412+ // FIXME: use m_pendingNavigationID instead?+ m_pendingFrameNavigationID = loadParameters.navigationID;+-+ FrameLoadRequest frameLoadRequest { *frame->coreLocalFrame(), WTFMove(loadParameters.request) };-+ frame->coreLocalFrame()->loader().load(WTFMove(frameLoadRequest));++ FrameLoadRequest frameLoadRequest { *frame->coreLocalFrame(), WTF::move(loadParameters.request) };++ frame->coreLocalFrame()->loader().load(WTF::move(frameLoadRequest));+ ASSERT(!m_pendingFrameNavigationID);+}+void WebPage::loadRequest(LoadParameters&& loadParameters){WEBPAGE_RELEASE_LOG_FORWARDABLE(Loading, WEBPAGE_LOADREQUEST, loadParameters.navigationID ? loadParameters.navigationID->toUInt64() : 0, static_cast<unsigned>(loadParameters.shouldTreatAsContinuingLoad), loadParameters.request.isAppInitiated(), loadParameters.existingNetworkResourceLoadIdentifierToResume ? loadParameters.existingNetworkResourceLoadIdentifierToResume->toUInt64() : 0);-@@ -2350,7 +2373,9 @@ void WebPage::stopLoading()+@@ -2372,7 +2397,9 @@ void WebPage::stopLoading()void WebPage::stopLoadingDueToProcessSwap(){SetForScope isStoppingLoadingDueToProcessSwap(m_isStoppingLoadingDueToProcessSwap, true);@@ -19259,7 +18508,7 @@ index 740461ddc23b7a7083b051270d8f21b7e276c206..691e00eed87e680e3799675a1721b412}bool WebPage::defersLoading() const-@@ -2926,7 +2951,7 @@ void WebPage::viewportPropertiesDidChange(const ViewportArguments& viewportArgum+@@ -2945,7 +2972,7 @@ void WebPage::viewportPropertiesDidChange(const ViewportArguments& viewportArgum#if PLATFORM(IOS_FAMILY)if (m_viewportConfiguration.setViewportArguments(viewportArguments))viewportConfigurationChanged();@@ -19268,8 +18517,8 @@ index 740461ddc23b7a7083b051270d8f21b7e276c206..691e00eed87e680e3799675a1721b412// Adjust view dimensions when using fixed layout.RefPtr localMainFrame = this->localMainFrame();RefPtr view = localMainFrame ? localMainFrame->view() : nullptr;-@@ -3734,6 +3759,13 @@ void WebPage::flushDeferredIntersectionObservations()- protectedCorePage()->flushDeferredIntersectionObservations();+@@ -3749,6 +3776,13 @@ void WebPage::flushDeferredIntersectionObservations()+ protect(corePage())->flushDeferredIntersectionObservations();}+#if ENABLE(ORIENTATION_EVENTS)@@ -19282,7 +18531,7 @@ index 740461ddc23b7a7083b051270d8f21b7e276c206..691e00eed87e680e3799675a1721b412void WebPage::flushDeferredDidReceiveMouseEvent(){if (auto info = std::exchange(m_deferredDidReceiveMouseEvent, std::nullopt))-@@ -4004,6 +4036,97 @@ void WebPage::touchEvent(const WebTouchEvent& touchEvent, CompletionHandler<void+@@ -4019,6 +4053,100 @@ void WebPage::touchEvent(const WebTouchEvent& touchEvent, CompletionHandler<voidcompletionHandler(touchEvent.type(), handled);}@@ -19308,7 +18557,7 @@ index 740461ddc23b7a7083b051270d8f21b7e276c206..691e00eed87e680e3799675a1721b412+ WebPlatformTouchPoint::State state = WebPlatformTouchPoint::State::Pressed;+ touchPoints.append(WebPlatformTouchPoint(id, state, screenPosition, position, radius, rotationAngle, force));+-+ WebTouchEvent touchEvent({WebEventType::TouchStart, eventModifiers, MonotonicTime::now()}, WTFMove(touchPoints), {}, {});++ WebTouchEvent touchEvent({WebEventType::TouchStart, eventModifiers, MonotonicTime::now()}, WTF::move(touchPoints), {}, {});++ CurrentEvent currentEvent(touchEvent);+ handled = handleTouchEvent(m_page->mainFrame().frameID(), touchEvent, m_page.get()).value_or(false);@@ -19318,7 +18567,7 @@ index 740461ddc23b7a7083b051270d8f21b7e276c206..691e00eed87e680e3799675a1721b412+ WebPlatformTouchPoint::State state = WebPlatformTouchPoint::State::Released;+ touchPoints.append(WebPlatformTouchPoint(id, state, screenPosition, position, radius, rotationAngle, force));+-+ WebTouchEvent touchEvent({WebEventType::TouchEnd, eventModifiers, MonotonicTime::now()}, WTFMove(touchPoints), {}, {});++ WebTouchEvent touchEvent({WebEventType::TouchEnd, eventModifiers, MonotonicTime::now()}, WTF::move(touchPoints), {}, {});++ CurrentEvent currentEvent(touchEvent);+ handled = handleTouchEvent(m_page->mainFrame().frameID(), touchEvent, m_page.get()).value_or(false) || handled;@@ -19330,7 +18579,7 @@ index 740461ddc23b7a7083b051270d8f21b7e276c206..691e00eed87e680e3799675a1721b412+ if (!localMainFrame)+ return;+-+ Node* nodeRespondingToClick = localMainFrame->nodeRespondingToClickEvents(position, adjustedPoint);++ RefPtr nodeRespondingToClick = localMainFrame->nodeRespondingToClickEvents(position, adjustedPoint);+ Frame* frameRespondingToClick = nodeRespondingToClick ? nodeRespondingToClick->document().frame() : nullptr;+ IntPoint adjustedIntPoint = roundedIntPoint(adjustedPoint);+ if (!frameRespondingToClick) {@@ -19350,7 +18599,8 @@ index 740461ddc23b7a7083b051270d8f21b7e276c206..691e00eed87e680e3799675a1721b412+ modifiers,+ MonotonicTime::now(),+ force,-+ syntheticClickType++ syntheticClickType,++ MouseEventInputSource::Hardware+ ));+ localMainFrame->eventHandler().handleMousePressEvent(PlatformMouseEvent(+ adjustedIntPoint,@@ -19361,7 +18611,8 @@ index 740461ddc23b7a7083b051270d8f21b7e276c206..691e00eed87e680e3799675a1721b412+ modifiers,+ MonotonicTime::now(),+ force,-+ syntheticClickType++ syntheticClickType,++ MouseEventInputSource::Hardware+ ));+ localMainFrame->eventHandler().handleMouseReleaseEvent(PlatformMouseEvent(+ adjustedIntPoint,@@ -19372,7 +18623,8 @@ index 740461ddc23b7a7083b051270d8f21b7e276c206..691e00eed87e680e3799675a1721b412+ modifiers,+ MonotonicTime::now(),+ force,-+ syntheticClickType++ syntheticClickType,++ MouseEventInputSource::Hardware+ ));+ }+ completionHandler();@@ -19380,8 +18632,8 @@ index 740461ddc23b7a7083b051270d8f21b7e276c206..691e00eed87e680e3799675a1721b412#endifvoid WebPage::cancelPointer(WebCore::PointerID pointerId, const WebCore::IntPoint& documentPoint)-@@ -4099,6 +4222,16 @@ void WebPage::sendMessageToTargetBackend(const String& message)- ensureInspectorTarget().sendMessageToTargetBackend(message);+@@ -4119,6 +4247,16 @@ void WebPage::sendMessageToTargetBackend(const String& message)+ ensureInspectorTarget()->sendMessageToTargetBackend(message);}+void WebPage::resumeInspectorIfPausedInNewWindow()@@ -19397,7 +18649,7 @@ index 740461ddc23b7a7083b051270d8f21b7e276c206..691e00eed87e680e3799675a1721b412void WebPage::insertNewlineInQuotedContent(){RefPtr frame = corePage()->focusController().focusedOrMainFrame();-@@ -4334,6 +4467,7 @@ void WebPage::setMainFrameDocumentVisualUpdatesAllowed(bool allowed)+@@ -4354,6 +4492,7 @@ void WebPage::setMainFrameDocumentVisualUpdatesAllowed(bool allowed)void WebPage::show(){send(Messages::WebPageProxy::ShowPage());@@ -19405,7 +18657,7 @@ index 740461ddc23b7a7083b051270d8f21b7e276c206..691e00eed87e680e3799675a1721b412}void WebPage::setIsTakingSnapshotsForApplicationSuspension(bool isTakingSnapshotsForApplicationSuspension)-@@ -5419,7 +5553,7 @@ RefPtr<NotificationPermissionRequestManager> WebPage::protectedNotificationPermi+@@ -5416,7 +5555,7 @@ NotificationPermissionRequestManager* WebPage::notificationPermissionRequestMana#if ENABLE(DRAG_SUPPORT)@@ -19414,7 +18666,7 @@ index 740461ddc23b7a7083b051270d8f21b7e276c206..691e00eed87e680e3799675a1721b412void WebPage::performDragControllerAction(DragControllerAction action, const IntPoint& clientPosition, const IntPoint& globalPosition, OptionSet<DragOperation> draggingSourceOperationMask, SelectionData&& selectionData, OptionSet<DragApplicationFlags> flags, CompletionHandler<void(std::optional<DragOperation>, DragHandlingMethod, bool, unsigned, IntRect, IntRect, std::optional<RemoteUserInputEventData>)>&& completionHandler){if (!m_page)-@@ -7703,6 +7837,10 @@ void WebPage::didCommitLoad(WebFrame* frame)+@@ -7771,6 +7910,10 @@ void WebPage::didCommitLoad(WebFrame* frame)if (frame && frame->isMainFrame())m_networkResourceRequestIdentifiersForPageLoadTiming.clear();@@ -19425,7 +18677,7 @@ index 740461ddc23b7a7083b051270d8f21b7e276c206..691e00eed87e680e3799675a1721b412}void WebPage::didFinishDocumentLoad(WebFrame& frame)-@@ -8017,6 +8155,9 @@ Ref<DocumentLoader> WebPage::createDocumentLoader(LocalFrame& frame, ResourceReq+@@ -8090,6 +8233,9 @@ Ref<DocumentLoader> WebPage::createDocumentLoader(LocalFrame& frame, ResourceReqm_allowsContentJavaScriptFromMostRecentNavigation = m_internals->pendingWebsitePolicies->allowsContentJavaScript;WebsitePoliciesData::applyToDocumentLoader(*std::exchange(m_internals->pendingWebsitePolicies, std::nullopt), documentLoader);}@@ -19436,10 +18688,10 @@ index 740461ddc23b7a7083b051270d8f21b7e276c206..691e00eed87e680e3799675a1721b412return documentLoader;diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.h b/Source/WebKit/WebProcess/WebPage/WebPage.h-index 3a54cff7826fc9d9a8055fd67909a9c8ac75d5ea..d8f4f83c19c5954a9fe2428574234e28f8ab0c0f 100644+index 34a420895a1f98ef79ab84353983019d78d98acd..309fba05cb41f57a84bc33da6480cff63bd267f3 100644--- a/Source/WebKit/WebProcess/WebPage/WebPage.h+++ b/Source/WebKit/WebProcess/WebPage/WebPage.h-@@ -47,6 +47,7 @@+@@ -48,6 +48,7 @@#include <WebCore/NodeIdentifier.h>#include <WebCore/NowPlayingMetadataObserver.h>#include <WebCore/OwnerPermissionsPolicyData.h>@@ -19447,7 +18699,7 @@ index 3a54cff7826fc9d9a8055fd67909a9c8ac75d5ea..d8f4f83c19c5954a9fe2428574234e28#include <WebCore/PageIdentifier.h>#include <WebCore/PageOverlay.h>#include <WebCore/PlatformLayerIdentifier.h>-@@ -1344,11 +1345,11 @@ public:+@@ -1368,11 +1369,11 @@ public:void clearSelection();void restoreSelectionInFocusedEditableElement();@@ -19459,9 +18711,9 @@ index 3a54cff7826fc9d9a8055fd67909a9c8ac75d5ea..d8f4f83c19c5954a9fe2428574234e28-#if ENABLE(DRAG_SUPPORT) && !PLATFORM(GTK)+#if ENABLE(DRAG_SUPPORT) && !PLATFORM(GTK) && !PLATFORM(WPE)void performDragControllerAction(std::optional<WebCore::FrameIdentifier>, DragControllerAction, WebCore::DragData&&, CompletionHandler<void(std::optional<WebCore::DragOperation>, WebCore::DragHandlingMethod, bool, unsigned, WebCore::IntRect, WebCore::IntRect, std::optional<WebCore::RemoteUserInputEventData>)>&&);- void performDragOperation(WebCore::DragData&&, SandboxExtensionHandle&&, Vector<SandboxExtensionHandle>&&, CompletionHandler<void(bool)>&&);+ void performDragOperation(std::optional<WebCore::FrameIdentifier>, WebCore::DragData&&, SandboxExtension::Handle&&, Vector<SandboxExtension::Handle>&&, CompletionHandler<void(DragOperationResult dragOperationResult)>&&);#endif-@@ -1366,6 +1367,9 @@ public:+@@ -1390,6 +1391,9 @@ public:#if ENABLE(MODEL_PROCESS)void modelDragEnded(WebCore::NodeIdentifier);#endif@@ -19471,7 +18723,7 @@ index 3a54cff7826fc9d9a8055fd67909a9c8ac75d5ea..d8f4f83c19c5954a9fe2428574234e28#endif#if ENABLE(MODEL_PROCESS)-@@ -1467,8 +1471,11 @@ public:+@@ -1491,8 +1495,11 @@ public:void gestureEvent(WebCore::FrameIdentifier, const WebGestureEvent&, CompletionHandler<void(std::optional<WebEventType>, bool, std::optional<WebCore::RemoteUserInputEventData>)>&&);#endif@@ -19484,7 +18736,7 @@ index 3a54cff7826fc9d9a8055fd67909a9c8ac75d5ea..d8f4f83c19c5954a9fe2428574234e28void dynamicViewportSizeUpdate(const DynamicViewportSizeUpdate&);bool scaleWasSetByUIProcess() const { return m_scaleWasSetByUIProcess; }void willStartUserTriggeredZooming();-@@ -1629,6 +1636,8 @@ public:+@@ -1657,6 +1664,8 @@ public:void connectInspector(Inspector::FrontendChannel::ConnectionType);void disconnectInspector();void sendMessageToTargetBackend(const String& message);@@ -19493,7 +18745,7 @@ index 3a54cff7826fc9d9a8055fd67909a9c8ac75d5ea..d8f4f83c19c5954a9fe2428574234e28void insertNewlineInQuotedContent();-@@ -2066,6 +2075,7 @@ public:+@@ -2099,6 +2108,7 @@ public:void showContextMenuFromFrame(const FrameInfoData&, const ContextMenuContextData&, const UserData&);#endifvoid loadRequest(LoadParameters&&);@@ -19501,7 +18753,7 @@ index 3a54cff7826fc9d9a8055fd67909a9c8ac75d5ea..d8f4f83c19c5954a9fe2428574234e28void setObscuredContentInsets(const WebCore::FloatBoxExtent&);-@@ -2292,6 +2302,7 @@ private:+@@ -2319,6 +2329,7 @@ private:void updatePotentialTapSecurityOrigin(const WebTouchEvent&, bool wasHandled);#elif ENABLE(TOUCH_EVENTS)void touchEvent(const WebTouchEvent&, CompletionHandler<void(std::optional<WebEventType>, bool)>&&);@@ -19509,7 +18761,7 @@ index 3a54cff7826fc9d9a8055fd67909a9c8ac75d5ea..d8f4f83c19c5954a9fe2428574234e28#endifvoid cancelPointer(WebCore::PointerID, const WebCore::IntPoint&);-@@ -3079,6 +3090,7 @@ private:+@@ -3125,6 +3136,7 @@ private:bool m_isAppNapEnabled { true };Markable<WebCore::NavigationIdentifier> m_pendingNavigationID;@@ -19518,12 +18770,12 @@ index 3a54cff7826fc9d9a8055fd67909a9c8ac75d5ea..d8f4f83c19c5954a9fe2428574234e28bool 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 57b4b5e79115300c5896664c45f137c395e566df..837f5df525f6ee9d26fb1adb2824d0b62a6ec0fb 100644+index 6ddebd242df4b2332f38be56d8adb2091cba529f..159fad2888f5e605229c36243594551ec7cb4514 100644--- a/Source/WebKit/WebProcess/WebPage/WebPage.messages.in+++ b/Source/WebKit/WebProcess/WebPage/WebPage.messages.in-@@ -61,10 +61,13 @@ messages -> WebPage WantsAsyncDispatchMessage {- MouseEvent(WebCore::FrameIdentifier frameID, WebKit::WebMouseEvent event, std::optional<Vector<WebKit::SandboxExtensionHandle>> sandboxExtensions)- SetLastKnownMousePosition(WebCore::FrameIdentifier frameID, WebCore::IntPoint eventPoint, WebCore::IntPoint globalPoint);+@@ -70,10 +70,13 @@ messages -> WebPage WantsAsyncDispatchMessage {+ RequestPositionInformation(struct WebKit::InteractionInformationRequest request)+ #endif+#if ENABLE(ORIENTATION_EVENTS)+ SetDeviceOrientation(WebCore::IntDegrees deviceOrientation)@@ -19536,7 +18788,7 @@ index 57b4b5e79115300c5896664c45f137c395e566df..837f5df525f6ee9d26fb1adb2824d0b6SetOverrideViewportArguments(struct std::optional<WebCore::ViewportArguments> arguments)DynamicViewportSizeUpdate(struct WebKit::DynamicViewportSizeUpdate target)-@@ -159,6 +162,7 @@ messages -> WebPage WantsAsyncDispatchMessage {+@@ -167,6 +170,7 @@ messages -> WebPage WantsAsyncDispatchMessage {ConnectInspector(Inspector::FrontendChannel::ConnectionType connectionType)DisconnectInspector()SendMessageToTargetBackend(String message)@@ -19544,7 +18796,7 @@ index 57b4b5e79115300c5896664c45f137c395e566df..837f5df525f6ee9d26fb1adb2824d0b6#if ENABLE(REMOTE_INSPECTOR)SetIndicating(bool indicating);-@@ -169,6 +173,7 @@ messages -> WebPage WantsAsyncDispatchMessage {+@@ -177,6 +181,7 @@ messages -> WebPage WantsAsyncDispatchMessage {#endif#if !ENABLE(IOS_TOUCH_EVENTS) && ENABLE(TOUCH_EVENTS)TouchEvent(WebKit::WebTouchEvent event) -> (enum:uint32_t std::optional<WebKit::WebEventType> eventType, bool handled)@@ -19552,7 +18804,7 @@ index 57b4b5e79115300c5896664c45f137c395e566df..837f5df525f6ee9d26fb1adb2824d0b6#endifCancelPointer(WebCore::PointerID pointerId, WebCore::IntPoint documentPoint)-@@ -194,6 +199,7 @@ messages -> WebPage WantsAsyncDispatchMessage {+@@ -203,6 +208,7 @@ messages -> WebPage WantsAsyncDispatchMessage {LoadDataInFrame(std::span<const uint8_t> data, String MIMEType, String encodingName, URL baseURL, WebCore::FrameIdentifier frameID)LoadRequest(struct WebKit::LoadParameters loadParameters)LoadDidCommitInAnotherProcess(WebCore::FrameIdentifier frameID, std::optional<WebCore::LayerHostingContextIdentifier> layerHostingContextIdentifier)@@ -19560,7 +18812,7 @@ index 57b4b5e79115300c5896664c45f137c395e566df..837f5df525f6ee9d26fb1adb2824d0b6LoadRequestWaitingForProcessLaunch(struct WebKit::LoadParameters loadParameters, URL resourceDirectoryURL, WebKit::WebPageProxyIdentifier pageID, bool checkAssumedReadAccessToResourceURL)LoadData(struct WebKit::LoadParameters loadParameters)LoadSimulatedRequestAndResponse(struct WebKit::LoadParameters loadParameters, WebCore::ResourceResponse simulatedResponse)-@@ -357,10 +363,10 @@ messages -> WebPage WantsAsyncDispatchMessage {+@@ -369,10 +375,10 @@ messages -> WebPage WantsAsyncDispatchMessage {RemoveLayerForFindOverlay() -> ()# Drag and drop.@@ -19571,9 +18823,9 @@ index 57b4b5e79115300c5896664c45f137c395e566df..837f5df525f6ee9d26fb1adb2824d0b6-#if !PLATFORM(GTK) && ENABLE(DRAG_SUPPORT)+#if !PLATFORM(GTK) && !PLATFORM(WPE) && ENABLE(DRAG_SUPPORT)PerformDragControllerAction(std::optional<WebCore::FrameIdentifier> frameID, enum:uint8_t WebKit::DragControllerAction action, WebCore::DragData dragData) -> (enum:uint8_t std::optional<WebCore::DragOperation> dragOperation, enum:uint8_t WebCore::DragHandlingMethod dragHandlingMethod, bool mouseIsOverFileInput, unsigned numberOfItemsToBeAccepted, WebCore::IntRect insertionRect, WebCore::IntRect editableElementRect, struct std::optional<WebCore::RemoteUserInputEventData> remoteUserInputEventData)- PerformDragOperation(WebCore::DragData dragData, WebKit::SandboxExtensionHandle sandboxExtensionHandle, Vector<WebKit::SandboxExtensionHandle> sandboxExtensionsForUpload) -> (bool handled)+ PerformDragOperation(std::optional<WebCore::FrameIdentifier> frameID, WebCore::DragData dragData, WebKit::SandboxExtensionHandle sandboxExtensionHandle, Vector<WebKit::SandboxExtensionHandle> sandboxExtensionsForUpload) -> (WebKit::DragOperationResult dragOperationResult)#endif-@@ -380,6 +386,10 @@ messages -> WebPage WantsAsyncDispatchMessage {+@@ -392,6 +398,10 @@ messages -> WebPage WantsAsyncDispatchMessage {ModelDragEnded(WebCore::NodeIdentifier nodeID)#endif@@ -19585,7 +18837,7 @@ index 57b4b5e79115300c5896664c45f137c395e566df..837f5df525f6ee9d26fb1adb2824d0b6RequestDragStart(std::optional<WebCore::FrameIdentifier> remoteFrameID, WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, OptionSet<WebCore::DragSourceAction> allowedActionsMask) -> (struct WebKit::DragInitiationResult result)RequestAdditionalItemsForDragSession(std::optional<WebCore::FrameIdentifier> rootFrameID, WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, OptionSet<WebCore::DragSourceAction> allowedActionsMask) -> (struct WebKit::DragInitiationResult result)diff --git a/Source/WebKit/WebProcess/WebPage/glib/WebPageGLib.cpp b/Source/WebKit/WebProcess/WebPage/glib/WebPageGLib.cpp-index 009d2e5e07544e5d8e39802a388559f1a98d6d52..1ae313228a3b3b61c67b796934fa89702bd13f89 100644+index 8ab01cf5bd5c7cb0323ca1d952ab07ce028e0295..1c6dd7af74f5efb7785c77370296f7307f9a4162 100644--- a/Source/WebKit/WebProcess/WebPage/glib/WebPageGLib.cpp+++ b/Source/WebKit/WebProcess/WebPage/glib/WebPageGLib.cpp@@ -222,16 +222,23 @@ String WebPage::platformUserAgent(const URL& url) const@@ -19623,10 +18875,10 @@ index 009d2e5e07544e5d8e39802a388559f1a98d6d52..1ae313228a3b3b61c67b796934fa8970const 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 ae77b6bd5630584813a80333224c606625d6b28a..377871a91d4dd4e588858135a522c52a0a7515c4 100644+index 9873086f33d9c9bf075fa93fd3ae991a9ddad632..fdae4deb4521c377d2c1d0e66c4a50bb9a8a3dd9 100644--- a/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm+++ b/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm-@@ -705,21 +705,37 @@ String WebPage::platformUserAgent(const URL&) const+@@ -708,21 +708,37 @@ String WebPage::platformUserAgent(const URL&) constbool WebPage::hoverSupportedByPrimaryPointingDevice() const{@@ -19715,10 +18967,10 @@ index d32f7d2dd108647aeba05007a371b8c7381232a7..00da787b3ac4d312006a92475701c133}diff --git a/Source/WebKit/WebProcess/WebProcess.cpp b/Source/WebKit/WebProcess/WebProcess.cpp-index b851f0f615e2c13a004abd15d576f969812e7b5e..6d87836a917ff55977c84386e7ceaa7999934368 100644+index 96e4c8a6dd8104469a322b39d88df3d5904fddb1..0394f7aee646b8df4a5d50b79ec07eeac470e4db 100644--- a/Source/WebKit/WebProcess/WebProcess.cpp+++ b/Source/WebKit/WebProcess/WebProcess.cpp-@@ -96,6 +96,7 @@+@@ -95,6 +95,7 @@#include "WebsiteData.h"#include "WebsiteDataStoreParameters.h"#include "WebsiteDataType.h"@@ -19726,7 +18978,7 @@ index b851f0f615e2c13a004abd15d576f969812e7b5e..6d87836a917ff55977c84386e7ceaa79#include <JavaScriptCore/JSLock.h>#include <JavaScriptCore/MemoryStatistics.h>#include <JavaScriptCore/WasmFaultSignalHandler.h>-@@ -413,6 +414,14 @@ void WebProcess::initializeProcess(const AuxiliaryProcessInitializationParameter+@@ -412,6 +413,14 @@ void WebProcess::initializeProcess(const AuxiliaryProcessInitializationParameter{JSC::Options::AllowUnfinalizedAccessScope scope;JSC::Options::allowNonSPTagging() = false;@@ -19741,7 +18993,7 @@ index b851f0f615e2c13a004abd15d576f969812e7b5e..6d87836a917ff55977c84386e7ceaa79JSC::Options::notifyOptionsChanged();}-@@ -420,6 +429,8 @@ void WebProcess::initializeProcess(const AuxiliaryProcessInitializationParameter+@@ -419,6 +428,8 @@ void WebProcess::initializeProcess(const AuxiliaryProcessInitializationParameterplatformInitializeProcess(parameters);updateCPULimit();@@ -19750,7 +19002,7 @@ index b851f0f615e2c13a004abd15d576f969812e7b5e..6d87836a917ff55977c84386e7ceaa79}void WebProcess::initializeConnection(IPC::Connection* connection)-@@ -1056,6 +1067,7 @@ void WebProcess::createWebPage(PageIdentifier pageID, WebPageCreationParameters&+@@ -1040,6 +1051,7 @@ void WebProcess::createWebPage(PageIdentifier pageID, WebPageCreationParameters&m_hasPendingAccessibilityUnsuspension = false;accessibilityRelayProcessSuspended(false);}@@ -19759,10 +19011,10 @@ index b851f0f615e2c13a004abd15d576f969812e7b5e..6d87836a917ff55977c84386e7ceaa79Awaitable<unsigned> WebProcess::countWebPagesForTesting()diff --git a/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm b/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm-index 9889f7db1fa35661da131a5fec15c6a549e0489f..256e46b2a7cd5be1c1939f8e9c331ca4f2e68f2a 100644+index 78783661a5997d86630cacb10bee23a50ec1297a..fe1aa080e76badf5953c6a7a58211a6bb6102ee3 100644--- a/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm+++ b/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm-@@ -4222,7 +4222,7 @@ ALLOW_DEPRECATED_DECLARATIONS_END+@@ -4207,7 +4207,7 @@ ALLOW_DEPRECATED_DECLARATIONS_END_private->handlingMouseDownEvent = NO;}@@ -19772,10 +19024,10 @@ index 9889f7db1fa35661da131a5fec15c6a549e0489f..256e46b2a7cd5be1c1939f8e9c331ca4- (void)touch:(WebEvent *)event{diff --git a/Source/WebKitLegacy/mac/WebView/WebView.mm b/Source/WebKitLegacy/mac/WebView/WebView.mm-index d94313e75baa25f656fe991d07d0005501ac4de2..715ab4cfd21c38a00f3187c7b8a50af24857a901 100644+index 6f2b7774cb172ebee4b1c6eddbb3d6dd9b623b9e..ff4618101c4eaadb55fedfa7e0feb321868e2625 100644--- a/Source/WebKitLegacy/mac/WebView/WebView.mm+++ b/Source/WebKitLegacy/mac/WebView/WebView.mm-@@ -3931,7 +3931,7 @@ + (void)_doNotStartObservingNetworkReachability+@@ -3976,7 +3976,7 @@ + (void)_doNotStartObservingNetworkReachability}#endif // PLATFORM(IOS_FAMILY)@@ -19784,7 +19036,7 @@ index d94313e75baa25f656fe991d07d0005501ac4de2..715ab4cfd21c38a00f3187c7b8a50af2- (NSArray *)_touchEventRegions{-@@ -3973,7 +3973,7 @@ - (NSArray *)_touchEventRegions+@@ -4018,7 +4018,7 @@ - (NSArray *)_touchEventRegions}).autorelease();}@@ -19793,41 +19045,8 @@ index d94313e75baa25f656fe991d07d0005501ac4de2..715ab4cfd21c38a00f3187c7b8a50af2// 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/FindLibVPX.cmake b/Source/cmake/FindLibVPX.cmake-new file mode 100644-index 0000000000000000000000000000000000000000..a9db9ec38d05e36517414248237e885b25109647---- /dev/null-+++ b/Source/cmake/FindLibVPX.cmake-@@ -0,0 +1,27 @@-+# Find LibVPX-+-+find_package(PkgConfig QUIET)-+if (PkgConfig_FOUND)-+ pkg_check_modules(PC_LIBVPX REQUIRED vpx)-+endif ()-+-+find_path(LIBVPX_INCLUDE_DIRS-+ NAMES vpx/vp8.h-+ HINTS ${PC_LIBVPX_INCLUDEDIR}-+ ${PC_LIBVPX_INCLUDE_DIRS}-+)-+-+find_library(LIBVPX_LIBRARIES-+ NAMES vpx-+ HINTS ${PC_LIBVPX_LIBDIR}-+ ${PC_LIBVPX_LIBRARY_DIRS}-+)-+-+include(FindPackageHandleStandardArgs)-+FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibVPX REQUIRED_VARS LIBVPX_INCLUDE_DIRS LIBVPX_LIBRARIES-+ VERSION_VAR PC_LIBVPX_VERSION)-+-+mark_as_advanced(-+ LIBVPX_INCLUDE_DIRS-+ LIBVPX_LIBRARIES-+)diff --git a/Source/cmake/OptionsGTK.cmake b/Source/cmake/OptionsGTK.cmake-index 1d12a308ae6ea762a8ec9903475db63dd4041cc3..d3398fc4b3c83f48c5b14dbce74dc61d5e5db444 100644+index 9e6347c784e45e4a8a1f96930746e8d7002146a9..d77c306921f013f14b4d49f7f875fee0cac45e0d 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")@@ -19841,18 +19060,7 @@ index 1d12a308ae6ea762a8ec9903475db63dd4041cc3..d3398fc4b3c83f48c5b14dbce74dc61dfind_package(Cairo 1.16.0 REQUIRED)find_package(LibGcrypt 1.7.0 REQUIRED)find_package(Soup3 3.0.0 REQUIRED)-@@ -25,6 +29,10 @@ find_package(ZLIB REQUIRED)- find_package(WebP REQUIRED COMPONENTS demux)- find_package(ATSPI 2.5.3)--+# Playwright begin-+find_package(LibVPX REQUIRED)-+# Playwright end-+- include(GStreamerDefinitions)- include(FindGLibCompileResources)--@@ -69,6 +77,10 @@ WEBKIT_OPTION_DEFINE(USE_SYSTEM_UNIFDEF "Whether to use a system-provided unifde+@@ -68,6 +72,10 @@ WEBKIT_OPTION_DEFINE(USE_SYSTEM_UNIFDEF "Whether to use a system-provided unifdeWEBKIT_OPTION_DEPEND(USE_SYSTEM_SYSPROF_CAPTURE USE_SYSPROF_CAPTURE)@@ -19863,7 +19071,7 @@ index 1d12a308ae6ea762a8ec9903475db63dd4041cc3..d3398fc4b3c83f48c5b14dbce74dc61dSET_AND_EXPOSE_TO_BUILD(ENABLE_DEVELOPER_MODE ${DEVELOPER_MODE})if (DEVELOPER_MODE)WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_API_TESTS PRIVATE ON)-@@ -150,6 +162,21 @@ endif ()+@@ -143,6 +151,21 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(USE_LIBRICE PRIVATE ON)WEBKIT_OPTION_DEPEND(ENABLE_GPU_PROCESS USE_GBM)@@ -19886,10 +19094,10 @@ index 1d12a308ae6ea762a8ec9903475db63dd4041cc3..d3398fc4b3c83f48c5b14dbce74dc61dWEBKIT_OPTION_DEPEND(ENABLE_WEBXR ENABLE_GAMEPAD)diff --git a/Source/cmake/OptionsWPE.cmake b/Source/cmake/OptionsWPE.cmake-index 27d81cbe5d5726b95c5d1e62cbd2dafdd0fc74da..a2dc7bef80b1e4144e6ee12d427c54a73d89459a 100644+index 66ad374b5814b3964426d38e5fe4d11b0ca0c27d..7f15e1305568a85fd96532cc75e9470c068911bf 100644--- a/Source/cmake/OptionsWPE.cmake+++ b/Source/cmake/OptionsWPE.cmake-@@ -34,6 +34,9 @@ else ()+@@ -33,6 +33,9 @@ else ()set(ENABLE_MEDIA_SESSION_DEFAULT ON)endif ()@@ -19899,9 +19107,9 @@ index 27d81cbe5d5726b95c5d1e62cbd2dafdd0fc74da..a2dc7bef80b1e4144e6ee12d427c54a7WEBKIT_OPTION_BEGIN()SET_AND_EXPOSE_TO_BUILD(ENABLE_DEVELOPER_MODE ${DEVELOPER_MODE})-@@ -96,6 +99,22 @@ else ()- WEBKIT_OPTION_DEFAULT_PORT_VALUE(USE_SKIA PRIVATE OFF)- endif ()+@@ -89,6 +92,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})+# Playwright begin.+WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MINIBROWSER PUBLIC ON)@@ -19922,8 +19130,8 @@ index 27d81cbe5d5726b95c5d1e62cbd2dafdd0fc74da..a2dc7bef80b1e4144e6ee12d427c54a7# 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(USE_QT6 ENABLE_WPE_PLATFORM)- WEBKIT_OPTION_DEPEND(USE_SKIA_OPENTYPE_SVG USE_SKIA)+@@ -126,6 +145,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)+# Playwright begin.@@ -19935,21 +19143,10 @@ index 27d81cbe5d5726b95c5d1e62cbd2dafdd0fc74da..a2dc7bef80b1e4144e6ee12d427c54a7WEBKIT_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 38684436bf8272f2e6d05681e7b1cb257479e877..20007a8425728241a8b039570c61dd2be703b818 100644+index e24293987e34c12c1911db9d204dfb90d8b65a6c..59792bbeaaf8051a558201e914f6ce433a7ede05 100644--- a/Source/cmake/OptionsWin.cmake+++ b/Source/cmake/OptionsWin.cmake-@@ -55,6 +55,10 @@ find_package(ZLIB 1.2.11 REQUIRED)- find_package(LibPSL 0.20.2 REQUIRED)- find_package(WebP REQUIRED COMPONENTS demux)--+# Playwright begin-+find_package(LibVPX REQUIRED)-+# Playwright end-+- WEBKIT_OPTION_BEGIN()-- # FIXME: Most of these options should not be public.-@@ -113,6 +117,14 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_FTPDIR PRIVATE OFF)+@@ -111,6 +111,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)@@ -19965,7 +19162,7 @@ index 38684436bf8272f2e6d05681e7b1cb257479e877..20007a8425728241a8b039570c61dd2bset(USE_ANGLE_EGL ON)diff --git a/Source/cmake/WebKitCompilerFlags.cmake b/Source/cmake/WebKitCompilerFlags.cmake-index 2cb9e7da0c16dfc28c3ed9ea237b223750a08146..be9ddc750abb770840862b07f728f82d80bc9772 100644+index 54330d4ab44a5ac52c4f176688ec119f086e0b26..d4631e5943486bb9b14e403d9700bcf58bf8821e 100644--- a/Source/cmake/WebKitCompilerFlags.cmake+++ b/Source/cmake/WebKitCompilerFlags.cmake@@ -122,7 +122,7 @@ macro(WEBKIT_ADD_TARGET_CXX_FLAGS _target)@@ -20166,14 +19363,15 @@ index 1fd07efb828b85b6d8def6c6cd92a0c11debfe1b..da9fac7975d477857ead2adb1d67108dtypedef struct _BrowserWindow BrowserWindow;diff --git a/Tools/MiniBrowser/gtk/main.c b/Tools/MiniBrowser/gtk/main.c-index d3fbb968ee463f86c64fecb855b46c8634b4b72d..d4c449878e9d35dc3767ef72fac60293e1668db7 100644+index 3805d7e287ae5f7bb2ecb22f9d2e1b1a8457fd1e..89ca9c3a4c100fc1f9e40c0e4ee38c2d8fc11d50 100644--- a/Tools/MiniBrowser/gtk/main.c+++ b/Tools/MiniBrowser/gtk/main.c-@@ -65,9 +65,14 @@ static char* timeZone;+@@ -65,9 +65,15 @@ static char* timeZone;static gboolean enableITP;static gboolean exitAfterLoad;static gboolean webProcessCrashed;+static gboolean inspectorPipe;++static gint remoteDebuggingPort = -1;+static gboolean headless;+static gboolean noStartupWindow;+static const char *userDataDir;@@ -20184,18 +19382,19 @@ index d3fbb968ee463f86c64fecb855b46c8634b4b72d..d4c449878e9d35dc3767ef72fac60293#if !GTK_CHECK_VERSION(3, 98, 0)static gboolean enableSandbox;-@@ -172,6 +177,10 @@ static const GOptionEntry commandLineOptions[] =+@@ -172,6 +178,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" },+ { "inspector-pipe", 0, 0, G_OPTION_ARG_NONE, &inspectorPipe, "Open pipe connection to the remote inspector", NULL },++ { "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", NULL },+ { "headless", 0, 0, G_OPTION_ARG_NONE, &headless, "Noop headless operation", NULL },+ { "no-startup-window", 0, 0, G_OPTION_ARG_NONE, &noStartupWindow, "Do not open default page", NULL },{ G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &uriArguments, 0, "[URL…]" },{ 0, 0, 0, 0, 0, 0, 0 }};-@@ -729,6 +738,56 @@ static void filterSavedCallback(WebKitUserContentFilterStore *store, GAsyncResul+@@ -728,6 +739,64 @@ static void filterSavedCallback(WebKitUserContentFilterStore *store, GAsyncResulg_main_loop_quit(data->mainLoop);}@@ -20245,19 +19444,29 @@ index d3fbb968ee463f86c64fecb855b46c8634b4b72d..d4c449878e9d35dc3767ef72fac60293+{+ WebKitBrowserInspector* browserInspector = webkit_browser_inspector_get_default();+ g_signal_connect(browserInspector, "create-new-page", G_CALLBACK(createNewPage), NULL);-++++ webkit_browser_inspector_initialize_pipe(proxy, ignoreHosts);+}++++static void configureBrowserInspectorPort()++{++ WebKitBrowserInspector* browserInspector = webkit_browser_inspector_get_default();++ g_signal_connect(browserInspector, "create-new-page", G_CALLBACK(createNewPage), NULL);++++ webkit_browser_inspector_initialize_web_socket(remoteDebuggingPort, proxy, ignoreHosts);++}+static void startup(GApplication *application){const char *actionAccels[] = {-@@ -787,17 +846,30 @@ static void setupDarkMode(GtkSettings *settings)+@@ -786,17 +855,32 @@ static void setupDarkMode(GtkSettings *settings)static void activate(GApplication *application, WebKitSettings *webkitSettings){+ if (inspectorPipe)+ configureBrowserInspectorPipe();++ else if (remoteDebuggingPort != -1)++ configureBrowserInspectorPort();++ if (noStartupWindow) {+ keepApplicationAliveUntilQuit(application);@@ -20280,14 +19489,14 @@ index d3fbb968ee463f86c64fecb855b46c8634b4b72d..d4c449878e9d35dc3767ef72fac60293+ g_free(dataDirectory);+ g_free(cacheDirectory);+ cookiesFile = g_build_filename(userDataDir, "cookies.txt", NULL);-+ } else if (inspectorPipe || privateMode || automationMode) {++ } else if (inspectorPipe || remoteDebuggingPort != -1 || privateMode || automationMode) {networkSession = webkit_network_session_new_ephemeral();- else {+ } else {char *dataDirectory = g_build_filename(g_get_user_data_dir(), "webkitgtk-" WEBKITGTK_API_VERSION, "MiniBrowser", NULL);char *cacheDirectory = g_build_filename(g_get_user_cache_dir(), "webkitgtk-" WEBKITGTK_API_VERSION, "MiniBrowser", NULL);networkSession = webkit_network_session_new(dataDirectory, cacheDirectory);-@@ -805,6 +877,8 @@ static void activate(GApplication *application, WebKitSettings *webkitSettings)+@@ -804,6 +888,8 @@ static void activate(GApplication *application, WebKitSettings *webkitSettings)g_free(cacheDirectory);}@@ -20296,7 +19505,7 @@ index d3fbb968ee463f86c64fecb855b46c8634b4b72d..d4c449878e9d35dc3767ef72fac60293webkit_network_session_set_itp_enabled(networkSession, enableITP);if (!automationMode) {-@@ -839,9 +913,12 @@ static void activate(GApplication *application, WebKitSettings *webkitSettings)+@@ -838,9 +924,12 @@ static void activate(GApplication *application, WebKitSettings *webkitSettings)}#elseWebKitWebsiteDataManager *manager;@@ -20304,14 +19513,14 @@ index d3fbb968ee463f86c64fecb855b46c8634b4b72d..d4c449878e9d35dc3767ef72fac60293+ 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 {+ } else {char *dataDirectory = g_build_filename(g_get_user_data_dir(), "webkitgtk-" WEBKITGTK_API_VERSION, "MiniBrowser", NULL);char *cacheDirectory = 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);-@@ -891,6 +968,7 @@ static void activate(GApplication *application, WebKitSettings *webkitSettings)+@@ -890,6 +979,7 @@ static void activate(GApplication *application, WebKitSettings *webkitSettings)// Enable the favicon database.webkit_web_context_set_favicon_database_directory(webContext, NULL);#endif@@ -20319,7 +19528,7 @@ index d3fbb968ee463f86c64fecb855b46c8634b4b72d..d4c449878e9d35dc3767ef72fac60293webkit_web_context_register_uri_scheme(webContext, BROWSER_ABOUT_SCHEME, (WebKitURISchemeRequestCallback)aboutURISchemeRequestCallback, NULL, NULL);-@@ -955,9 +1033,7 @@ static void activate(GApplication *application, WebKitSettings *webkitSettings)+@@ -954,9 +1044,7 @@ static void activate(GApplication *application, WebKitSettings *webkitSettings)if (exitAfterLoad)exitAfterWebViewLoadFinishes(webView, application);}@@ -20330,7 +19539,7 @@ index d3fbb968ee463f86c64fecb855b46c8634b4b72d..d4c449878e9d35dc3767ef72fac60293}} else {WebKitWebView *webView = createBrowserTab(mainWindow, webkitSettings, userContentManager, defaultWebsitePolicies);-@@ -1007,7 +1083,7 @@ int main(int argc, char *argv[])+@@ -1006,7 +1094,7 @@ int main(int argc, char *argv[])g_option_context_add_group(context, gst_init_get_option_group());#endif@@ -20339,7 +19548,7 @@ index d3fbb968ee463f86c64fecb855b46c8634b4b72d..d4c449878e9d35dc3767ef72fac60293webkit_settings_set_enable_developer_extras(webkitSettings, TRUE);webkit_settings_set_enable_webgl(webkitSettings, TRUE);webkit_settings_set_enable_media_stream(webkitSettings, TRUE);-@@ -1059,9 +1135,11 @@ int main(int argc, char *argv[])+@@ -1058,9 +1146,11 @@ int main(int argc, char *argv[])}GtkApplication *application = gtk_application_new("org.webkitgtk.MiniBrowser", G_APPLICATION_NON_UNIQUE);@@ -20352,10 +19561,10 @@ index d3fbb968ee463f86c64fecb855b46c8634b4b72d..d4c449878e9d35dc3767ef72fac60293g_clear_object(&interfaceSettings);diff --git a/Tools/MiniBrowser/wpe/main.cpp b/Tools/MiniBrowser/wpe/main.cpp-index 4a459bca1786c10cfc1796f6ca39d0a84ecc2322..112645111701019e415c82840e2a18c99420cabf 100644+index 5e8a7ea42ad74a655c26cf827f01d0a23a3533c8..db2af373497474273452057ee193c3ae8337aa65 100644--- a/Tools/MiniBrowser/wpe/main.cpp+++ b/Tools/MiniBrowser/wpe/main.cpp-@@ -52,6 +52,9 @@ static gboolean headlessMode;+@@ -55,6 +55,9 @@ static gboolean headlessMode;static gboolean privateMode;static gboolean automationMode;static gboolean ignoreTLSErrors;@@ -20365,7 +19574,7 @@ index 4a459bca1786c10cfc1796f6ca39d0a84ecc2322..112645111701019e415c82840e2a18c9static const char* contentFilter;static const char* cookiesFile;static const char* cookiesPolicy;-@@ -130,6 +133,9 @@ static const GOptionEntry commandLineOptions[] =+@@ -139,6 +142,9 @@ static const GOptionEntry commandLineOptions[] =#endif{ "size", 's', 0, G_OPTION_ARG_CALLBACK, reinterpret_cast<gpointer>(parseWindowSize), "Specify the window size to use, e.g. --size=\"800x600\"", nullptr },{ "version", 'v', 0, G_OPTION_ARG_NONE, &printVersion, "Print the WPE version", nullptr },@@ -20375,7 +19584,7 @@ index 4a459bca1786c10cfc1796f6ca39d0a84ecc2322..112645111701019e415c82840e2a18c9{ G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &uriArguments, nullptr, "[URL]" },{ nullptr, 0, 0, G_OPTION_ARG_NONE, nullptr, nullptr, nullptr }};-@@ -316,15 +322,38 @@ static void filterSavedCallback(WebKitUserContentFilterStore *store, GAsyncResul+@@ -329,15 +335,38 @@ static void filterSavedCallback(WebKitUserContentFilterStore *store, GAsyncResulg_main_loop_quit(data->mainLoop);}@@ -20414,18 +19623,13 @@ index 4a459bca1786c10cfc1796f6ca39d0a84ecc2322..112645111701019e415c82840e2a18c9++static WebKitWebView* createWebViewImpl(WebKitWebView* webView, WebKitWebContext *webContext, gpointer user_data){+ #if defined(USE_LIBWPE) && USE_LIBWPEauto backend = createViewBackend(defaultWindowWidthLegacyAPI, defaultWindowHeightLegacyAPI);- WebKitWebViewBackend* viewBackend = nullptr;-@@ -339,12 +368,27 @@ static WebKitWebView* createWebView(WebKitWebView* webView, WebKitNavigationActi- }, backend.release());+@@ -354,14 +383,31 @@ static WebKitWebView* createWebView(WebKitWebView* webView, WebKitNavigationActi}+ #endif- auto* newWebView = WEBKIT_WEB_VIEW(g_object_new(WEBKIT_TYPE_WEB_VIEW,-- "backend", viewBackend,-- "related-view", webView,-- "settings", webkit_web_view_get_settings(webView),-- "user-content-manager", webkit_web_view_get_user_content_manager(webView),-- nullptr));+// Playwright begin+ if (headlessMode) {+ webkit_web_view_backend_set_screenshot_callback(viewBackend,@@ -20437,12 +19641,21 @@ index 4a459bca1786c10cfc1796f6ca39d0a84ecc2322..112645111701019e415c82840e2a18c9+ WebKitWebView* newWebView;+ if (webView) {+ newWebView = WEBKIT_WEB_VIEW(g_object_new(WEBKIT_TYPE_WEB_VIEW,+ #if defined(USE_LIBWPE) && USE_LIBWPE+- "backend", viewBackend,+ "backend", viewBackend,+ #endif+- "related-view", webView,+- "settings", webkit_web_view_get_settings(webView),+- "user-content-manager", webkit_web_view_get_user_content_manager(webView),+- nullptr));+ "related-view", webView,+ nullptr));+ } else {+ newWebView = WEBKIT_WEB_VIEW(g_object_new(WEBKIT_TYPE_WEB_VIEW,++#if defined(USE_LIBWPE) && USE_LIBWPE+ "backend", viewBackend,++#endif+ "web-context", webContext,+ "is-controlled-by-automation", TRUE,+ nullptr));@@ -20450,7 +19663,7 @@ index 4a459bca1786c10cfc1796f6ca39d0a84ecc2322..112645111701019e415c82840e2a18c9#if ENABLE_WPE_PLATFORMif (auto* wpeView = webkit_web_view_get_wpe_view(newWebView)) {-@@ -356,9 +400,13 @@ static WebKitWebView* createWebView(WebKitWebView* webView, WebKitNavigationActi+@@ -373,9 +419,13 @@ static WebKitWebView* createWebView(WebKitWebView* webView, WebKitNavigationActig_signal_connect(newWebView, "create", G_CALLBACK(createWebView), user_data);g_signal_connect(newWebView, "close", G_CALLBACK(webViewClose), user_data);@@ -20466,10 +19679,10 @@ index 4a459bca1786c10cfc1796f6ca39d0a84ecc2322..112645111701019e415c82840e2a18c9return newWebView;}-@@ -446,13 +494,105 @@ void loadConfigFile(WPESettings* settings)- }+@@ -455,16 +505,108 @@ void loadConfigFile(WPESettings* settings)#endif+ #if defined(USE_LIBWPE) && USE_LIBWPE+static WebKitWebView* createWebView(WebKitWebView* webView, WebKitNavigationAction*, gpointer user_data)+{+ return createWebViewImpl(webView, nullptr, user_data);@@ -20554,6 +19767,9 @@ index 4a459bca1786c10cfc1796f6ca39d0a84ecc2322..112645111701019e415c82840e2a18c9+}+static void activate(GApplication* application, WPEToolingBackends::ViewBackend* backend)+ #else+ static void activate(GApplication* application, gpointer)+ #endif{g_application_hold(application);+ if (noStartupWindow)@@ -20569,11 +19785,11 @@ index 4a459bca1786c10cfc1796f6ca39d0a84ecc2322..112645111701019e415c82840e2a18c9+ networkSession = webkit_network_session_new_ephemeral();+ } else {+ networkSession = webkit_network_session_new(nullptr, nullptr);-+ }++ }webkit_network_session_set_itp_enabled(networkSession, enableITP);if (proxy) {-@@ -479,10 +619,18 @@ static void activate(GApplication* application, WPEToolingBackends::ViewBackend*+@@ -491,10 +633,18 @@ static void activate(GApplication* application, gpointer)webkit_cookie_manager_set_persistent_storage(cookieManager, cookiesFile, storageType);}}@@ -20594,15 +19810,15 @@ index 4a459bca1786c10cfc1796f6ca39d0a84ecc2322..112645111701019e415c82840e2a18c9webkit_website_data_manager_set_itp_enabled(manager, enableITP);if (proxy) {-@@ -513,6 +661,7 @@ static void activate(GApplication* application, WPEToolingBackends::ViewBackend*+@@ -525,6 +675,7 @@ static void activate(GApplication* application, gpointer)}#endif+ persistentWebContext = webContext;- WebKitUserContentManager* userContentManager = nullptr;+ g_autoptr(WebKitUserContentManager) userContentManager = nullptr;if (contentFilter) {- GFile* contentFilterFile = g_file_new_for_commandline_arg(contentFilter);-@@ -591,6 +740,15 @@ static void activate(GApplication* application, WPEToolingBackends::ViewBackend*+ g_autoptr(GFile) contentFilterFile = g_file_new_for_commandline_arg(contentFilter);+@@ -607,6 +758,15 @@ static void activate(GApplication* application, gpointer)"autoplay", WEBKIT_AUTOPLAY_ALLOW,nullptr);@@ -20616,9 +19832,9 @@ index 4a459bca1786c10cfc1796f6ca39d0a84ecc2322..112645111701019e415c82840e2a18c9+// Playwright end+auto* webView = WEBKIT_WEB_VIEW(g_object_new(WEBKIT_TYPE_WEB_VIEW,+ #if defined(USE_LIBWPE) && USE_LIBWPE"backend", viewBackend,- "web-context", webContext,-@@ -642,12 +800,16 @@ static void activate(GApplication* application, WPEToolingBackends::ViewBackend*+@@ -662,12 +822,16 @@ static void activate(GApplication* application, gpointer)}#endif@@ -20637,7 +19853,7 @@ index 4a459bca1786c10cfc1796f6ca39d0a84ecc2322..112645111701019e415c82840e2a18c9g_hash_table_add(openViews, webView);WebKitColor color;-@@ -655,16 +817,11 @@ static void activate(GApplication* application, WPEToolingBackends::ViewBackend*+@@ -675,16 +839,11 @@ static void activate(GApplication* application, gpointer)webkit_web_view_set_background_color(webView, &color);if (uriArguments) {@@ -20659,14 +19875,18 @@ index 4a459bca1786c10cfc1796f6ca39d0a84ecc2322..112645111701019e415c82840e2a18c9webkit_web_view_load_uri(webView, "https://wpewebkit.org");g_object_unref(webContext);-@@ -755,8 +912,14 @@ int main(int argc, char *argv[])- }+@@ -779,12 +938,18 @@ int main(int argc, char *argv[])}+ #endif+ openViews = g_hash_table_new_full(nullptr, nullptr, g_object_unref, nullptr);+GApplication* application = g_application_new("org.wpewebkit.MiniBrowser", G_APPLICATION_NON_UNIQUE);+ #if defined(USE_LIBWPE) && USE_LIBWPEg_signal_connect(application, "activate", G_CALLBACK(activate), backend.release());+ #else+ g_signal_connect(application, "activate", G_CALLBACK(activate), nullptr);+ #endif++ if (inspectorPipe)+ configureBrowserInspector(application);@@ -20687,10 +19907,10 @@ index 1067b31bc989748dfcc5502209d36d001b9b239e..7629263fb8bc93dca6dfc01c75eed8d2+ add_subdirectory(Playwright/win)+endif ()diff --git a/Tools/WebKitTestRunner/CMakeLists.txt b/Tools/WebKitTestRunner/CMakeLists.txt-index 9e53f459e444b9c10fc5248f0e8059df6c1e0041..c17c875a7dd3ca05c4489578ab32378bca45a7c9 100644+index 5b1f93a1d3bbe655ce8e97fb2c729bcf8b2ecaac..836895f798897c352eae48c8cb2d9bede6c4b088 100644--- a/Tools/WebKitTestRunner/CMakeLists.txt+++ b/Tools/WebKitTestRunner/CMakeLists.txt-@@ -95,6 +95,10 @@ set(TestRunnerInjectedBundle_PRIVATE_LIBRARIES+@@ -93,6 +93,10 @@ set(TestRunnerInjectedBundle_PRIVATE_LIBRARIES)set(TestRunnerInjectedBundle_FRAMEWORKS ${WebKitTestRunner_FRAMEWORKS})@@ -20702,10 +19922,10 @@ index 9e53f459e444b9c10fc5248f0e8059df6c1e0041..c17c875a7dd3ca05c4489578ab32378b"${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 c81c7460c35a74b24138f7a4a69c9eb2abb35d9f..7c5b13da913ac75b4ef82db86064f6516e9e868a 100644+index c86d950020f3e7e96d500a120122556b6486f0c6..def22c2a225d3f19b30015a84c20f1522e582c65 100644--- a/Tools/WebKitTestRunner/TestController.cpp+++ b/Tools/WebKitTestRunner/TestController.cpp-@@ -771,6 +771,7 @@ PlatformWebView* TestController::createOtherPlatformWebView(PlatformWebView* par+@@ -777,6 +777,7 @@ PlatformWebView* TestController::createOtherPlatformWebView(PlatformWebView* parnullptr, // requestStorageAccessConfirmnullptr, // shouldAllowDeviceOrientationAndMotionAccessnullptr, // runWebAuthenticationPanel@@ -20713,7 +19933,7 @@ index c81c7460c35a74b24138f7a4a69c9eb2abb35d9f..7c5b13da913ac75b4ef82db86064f651nullptr, // decidePolicyForSpeechRecognitionPermissionRequestnullptr, // decidePolicyForMediaKeySystemPermissionRequestnullptr, // queryPermission-@@ -1251,6 +1252,7 @@ void TestController::createWebViewWithOptions(const TestOptions& options)+@@ -1257,6 +1258,7 @@ void TestController::createWebViewWithOptions(const TestOptions& options)nullptr, // requestStorageAccessConfirmshouldAllowDeviceOrientationAndMotionAccess,runWebAuthenticationPanel,@@ -20722,10 +19942,10 @@ index c81c7460c35a74b24138f7a4a69c9eb2abb35d9f..7c5b13da913ac75b4ef82db86064f651decidePolicyForMediaKeySystemPermissionRequest,queryPermission,diff --git a/Tools/WebKitTestRunner/mac/EventSenderProxy.mm b/Tools/WebKitTestRunner/mac/EventSenderProxy.mm-index e95cdaf07836f70d18a0a96ca89c8b490d2ddddc..0d72b7b16a5519c049dbd383f8acbb8daab2e5a6 100644+index b39b3b2d74ea040b150a0ee73313f661bc60a3bc..f6490bc2a39d27f35d2aa6a4e2449ba70b4a30aa 100644--- a/Tools/WebKitTestRunner/mac/EventSenderProxy.mm+++ b/Tools/WebKitTestRunner/mac/EventSenderProxy.mm-@@ -963,4 +963,51 @@ void EventSenderProxy::waitForPendingMouseEvents()+@@ -968,4 +968,51 @@ void EventSenderProxy::waitForPendingMouseEvents()}}@@ -20823,36 +20043,31 @@ index 8df87f54f63ebf9f7adbff626a12ef7079fff3d3..30ab6e8a0ca264cdebe673b806f125bb</meson>diff --git a/Tools/wpe/backends/fdo/HeadlessViewBackendFdo.cpp b/Tools/wpe/backends/fdo/HeadlessViewBackendFdo.cpp-index df22308266c6f69d24a60905f8d05e4e80f21b9b..2d0838070dc10793418cbb648b095a5ffa76f1b8 100644+index 6186d81869dbbb346ec5a62f2bbba88e2320d5e7..25b5615339b74cd56042b89f723993023cbb58ca 100644--- a/Tools/wpe/backends/fdo/HeadlessViewBackendFdo.cpp+++ b/Tools/wpe/backends/fdo/HeadlessViewBackendFdo.cpp-@@ -210,32 +210,30 @@ void HeadlessViewBackend::updateSnapshot(PlatformBuffer exportedBuffer)+@@ -175,28 +175,27 @@ void HeadlessViewBackend::updateSnapshot(PlatformBuffer exportedBuffer)return;}-+uint32_t width = std::max(0, wl_shm_buffer_get_width(shmBuffer));-+uint32_t height = std::max(0, wl_shm_buffer_get_height(shmBuffer));-+if (!width || !height) {-+ fprintf(stderr, "HeadlessViewBackend::updateSnapshot shmBuffer is empty: %ux%u\n", width, height);-+ return;-+}-+- #if defined(USE_CAIRO) && USE_CAIRO-- uint32_t bufferStride = cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, m_width);-+ uint32_t bufferStride = cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, width);- #elif defined(USE_SKIA) && USE_SKIA- auto info = SkImageInfo::MakeN32Premul(m_width, m_height, SkColorSpace::MakeSRGB());++ uint32_t width = std::max(0, wl_shm_buffer_get_width(shmBuffer));++ uint32_t height = std::max(0, wl_shm_buffer_get_height(shmBuffer));++ if (!width || !height) {++ fprintf(stderr, "HeadlessViewBackend::updateSnapshot shmBuffer is empty: %ux%u\n", width, height);++ return;++ }+++ auto info = SkImageInfo::MakeN32Premul(width, height, SkColorSpace::MakeSRGB());uint32_t bufferStride = info.minRowBytes();- #endif- uint8_t* buffer = new uint8_t[bufferStride * m_height];- memset(buffer, 0, bufferStride * m_height);--+ uint32_t stride = std::max(0, wl_shm_buffer_get_stride(shmBuffer));+ if (bufferStride != stride) {+ fprintf(stderr, "bufferStride != stride: %u != %u\n", bufferStride, stride);+ return;+ }++ uint8_t* buffer = new uint8_t[bufferStride * height];{- uint32_t width = std::min<uint32_t>(m_width, std::max(0, wl_shm_buffer_get_width(shmBuffer)));@@ -20875,15 +20090,6 @@ index df22308266c6f69d24a60905f8d05e4e80f21b9b..2d0838070dc10793418cbb648b095a5fwl_shm_buffer_end_access(shmBuffer);}-@@ -244,7 +242,7 @@ void HeadlessViewBackend::updateSnapshot(PlatformBuffer exportedBuffer)- cairo_surface_destroy(m_snapshot);-- m_snapshot = cairo_image_surface_create_for_data(buffer, CAIRO_FORMAT_ARGB32,-- m_width, m_height, cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, m_width));-+ width, height, cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, width));-- static cairo_user_data_key_t bufferKey;- cairo_surface_set_user_data(m_snapshot, &bufferKey, buffer,diff --git a/WebKit.xcworkspace/contents.xcworkspacedata b/WebKit.xcworkspace/contents.xcworkspacedataindex 5d6492124eb520ce2b25f5c62775438103050ed3..1c0ea8a3258b5676b81fb00360e2c0589cc93e18 100644--- a/WebKit.xcworkspace/contents.xcworkspacedata@@ -20923,28 +20129,3 @@ index 68732987fc02d863415360d066bc2a45d16ec39a..f4f924cb859034306361e9e55cdf31c6<BuildActionEntrybuildForTesting = "YES"buildForRunning = "YES"-diff --git a/vcpkg.json b/vcpkg.json-index 259c46a415a84439b622d34f9ee3431e351401ba..e5ef6f3e0bc7ec64e2b714de783a2181c409fdad 100644---- a/vcpkg.json-+++ b/vcpkg.json-@@ -1,7 +1,8 @@- {- "name": "webkit",- "dependencies": [-- "icu"-+ "icu",-+ "libvpx"- ],- "features": {- "avif": {-@@ -101,6 +102,10 @@- {- "name": "ngtcp2",- "version": "1.12.0"-+ },-+ {-+ "name": "libvpx",-+ "version": "1.13.1#3"- }- ]- }