chore: update browser patches as of Jan 11, 2023 (#21068)

This commit is contained in:
Andrey Lushnikov 2023-02-21 11:46:10 -08:00 коммит произвёл GitHub
Родитель 147e388ec3
Коммит 1cf1f53076
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
6 изменённых файлов: 1001 добавлений и 768 удалений

Просмотреть файл

@ -157,8 +157,19 @@ class FrameTree {
allFramesInBrowsingContextGroup(group) {
const frames = [];
for (const frameTree of (group.__jugglerFrameTrees || []))
frames.push(...frameTree.frames());
for (const frameTree of (group.__jugglerFrameTrees || [])) {
for (const frame of frameTree.frames()) {
try {
// Try accessing docShell and domWindow to filter out dead frames.
// This might happen for print-preview frames, but maybe for something else as well.
frame.docShell();
frame.domWindow();
frames.push(frame);
} catch (e) {
dump(`WARNING: unable to access docShell and domWindow of the frame[id=${frame.id()}]\n`);
}
}
}
return frames;
}

Просмотреть файл

@ -80,6 +80,7 @@ class nsScreencastService::Session : public rtc::VideoSinkInterface<webrtc::Vide
public webrtc::RawFrameCallback {
Session(
nsIScreencastServiceClient* client,
nsIWidget* widget,
rtc::scoped_refptr<webrtc::VideoCaptureModuleEx>&& capturer,
std::unique_ptr<ScreencastEncoder> encoder,
int width, int height,
@ -87,6 +88,7 @@ class nsScreencastService::Session : public rtc::VideoSinkInterface<webrtc::Vide
gfx::IntMargin margin,
uint32_t jpegQuality)
: mClient(client)
, mWidget(widget)
, mCaptureModule(std::move(capturer))
, mEncoder(std::move(encoder))
, mJpegQuality(jpegQuality)
@ -102,13 +104,20 @@ class nsScreencastService::Session : public rtc::VideoSinkInterface<webrtc::Vide
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(Session)
static RefPtr<Session> Create(
nsIScreencastServiceClient* client,
nsIWidget* widget,
rtc::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, std::move(capturer), std::move(encoder), width, height, viewportWidth, viewportHeight, margin, jpegQuality));
return do_AddRef(new Session(client, widget, std::move(capturer), std::move(encoder), width, height, viewportWidth, viewportHeight, margin, jpegQuality));
}
rtc::scoped_refptr<webrtc::VideoCaptureModuleEx> ReuseCapturer(nsIWidget* widget) {
if (mWidget == widget)
return mCaptureModule;
return nullptr;
}
bool Start() {
@ -141,10 +150,6 @@ class nsScreencastService::Session : public rtc::VideoSinkInterface<webrtc::Vide
mCaptureModule->DeRegisterCaptureDataCallback(this);
else
mCaptureModule->DeRegisterRawFrameCallback(this);
int error = mCaptureModule->StopCapture();
if (error) {
fprintf(stderr, "StopCapture error %d\n", error);
}
if (mEncoder) {
mEncoder->finish([this, protect = RefPtr{this}] {
NS_DispatchToMainThread(NS_NewRunnableFunction(
@ -279,6 +284,7 @@ class nsScreencastService::Session : public rtc::VideoSinkInterface<webrtc::Vide
private:
RefPtr<nsIScreencastServiceClient> mClient;
nsIWidget* mWidget;
rtc::scoped_refptr<webrtc::VideoCaptureModuleEx> mCaptureModule;
std::unique_ptr<ScreencastEncoder> mEncoder;
uint32_t mJpegQuality;
@ -322,7 +328,14 @@ nsresult nsScreencastService::StartVideoRecording(nsIScreencastServiceClient* aC
return NS_ERROR_UNEXPECTED;
nsIWidget* widget = view->GetWidget();
rtc::scoped_refptr<webrtc::VideoCaptureModuleEx> capturer = CreateWindowCapturer(widget);
rtc::scoped_refptr<webrtc::VideoCaptureModuleEx> capturer = nullptr;
for (auto& it : mIdToSession) {
capturer = it.second->ReuseCapturer(widget);
if (capturer)
break;
}
if (!capturer)
capturer = CreateWindowCapturer(widget);
if (!capturer)
return NS_ERROR_FAILURE;
@ -349,7 +362,7 @@ nsresult nsScreencastService::StartVideoRecording(nsIScreencastServiceClient* aC
NS_ENSURE_SUCCESS(rv, rv);
sessionId = uid;
auto session = Session::Create(aClient, std::move(capturer), std::move(encoder), width, height, viewportWidth, viewportHeight, margin, isVideo ? 0 : quality);
auto session = Session::Create(aClient, widget, std::move(capturer), std::move(encoder), width, height, viewportWidth, viewportHeight, margin, isVideo ? 0 : quality);
if (!session->Start())
return NS_ERROR_FAILURE;
mIdToSession.emplace(sessionId, std::move(session));

Просмотреть файл

@ -895,7 +895,7 @@ index b81fb1088ab0025555c24e7353cda836f896b26b..21403d0a219cc478b8de20fda410eb26
static bool AutomaticStorageAccessPermissionCanBeGranted(
diff --git a/dom/base/Navigator.cpp b/dom/base/Navigator.cpp
index e432d25c7397be64b009e4cb671cb6e322175830..074b1c7241c64412ee58a6239d36c9f74476ae46 100644
index e432d25c7397be64b009e4cb671cb6e322175830..2d9fd36ed9bf96065b4d7cf37944523626522345 100644
--- a/dom/base/Navigator.cpp
+++ b/dom/base/Navigator.cpp
@@ -326,14 +326,18 @@ void Navigator::GetAppName(nsAString& aAppName, CallerType aCallerType) const {
@ -949,16 +949,6 @@ index e432d25c7397be64b009e4cb671cb6e322175830..074b1c7241c64412ee58a6239d36c9f7
void Navigator::GetBuildID(nsAString& aBuildID, CallerType aCallerType,
ErrorResult& aRv) const {
@@ -2257,7 +2273,8 @@ bool Navigator::Webdriver() {
}
#endif
- return false;
+ // Playwright is automating the browser, so we should pretend to be a webdriver
+ return true;
}
} // namespace mozilla::dom
diff --git a/dom/base/Navigator.h b/dom/base/Navigator.h
index 19b9c31fa2464fc3e865e7a7d69ff91140153510..14b617eefc5c23fcca20c407cb71b5618321f6da 100644
--- a/dom/base/Navigator.h
@ -2720,7 +2710,7 @@ diff --git a/widget/cocoa/NativeKeyBindings.mm b/widget/cocoa/NativeKeyBindings.
index d3e5983259053175584254e7ac01ca9ce024f33a..97f5b851c402fea5477c0ee57af451c62b016eec 100644
--- a/widget/cocoa/NativeKeyBindings.mm
+++ b/widget/cocoa/NativeKeyBindings.mm
@@ -492,6 +492,13 @@
@@ -492,6 +492,13 @@ void NativeKeyBindings::GetEditCommandsForTests(NativeKeyBindingsType aType,
break;
case KEY_NAME_INDEX_ArrowLeft:
if (aEvent.IsAlt()) {
@ -2734,7 +2724,7 @@ index d3e5983259053175584254e7ac01ca9ce024f33a..97f5b851c402fea5477c0ee57af451c6
break;
}
if (aEvent.IsMeta() || (aEvent.IsControl() && aEvent.IsShift())) {
@@ -512,6 +519,13 @@
@@ -512,6 +519,13 @@ void NativeKeyBindings::GetEditCommandsForTests(NativeKeyBindingsType aType,
break;
case KEY_NAME_INDEX_ArrowRight:
if (aEvent.IsAlt()) {
@ -2748,7 +2738,7 @@ index d3e5983259053175584254e7ac01ca9ce024f33a..97f5b851c402fea5477c0ee57af451c6
break;
}
if (aEvent.IsMeta() || (aEvent.IsControl() && aEvent.IsShift())) {
@@ -532,6 +546,10 @@
@@ -532,6 +546,10 @@ void NativeKeyBindings::GetEditCommandsForTests(NativeKeyBindingsType aType,
break;
case KEY_NAME_INDEX_ArrowUp:
if (aEvent.IsControl()) {
@ -2759,7 +2749,7 @@ index d3e5983259053175584254e7ac01ca9ce024f33a..97f5b851c402fea5477c0ee57af451c6
break;
}
if (aEvent.IsMeta()) {
@@ -541,7 +559,7 @@
@@ -541,7 +559,7 @@ void NativeKeyBindings::GetEditCommandsForTests(NativeKeyBindingsType aType,
instance->AppendEditCommandsForSelector(
!aEvent.IsShift()
? ToObjcSelectorPtr(@selector(moveToBeginningOfDocument:))
@ -2768,7 +2758,7 @@ index d3e5983259053175584254e7ac01ca9ce024f33a..97f5b851c402fea5477c0ee57af451c6
aCommands);
break;
}
@@ -564,6 +582,10 @@
@@ -564,6 +582,10 @@ void NativeKeyBindings::GetEditCommandsForTests(NativeKeyBindingsType aType,
break;
case KEY_NAME_INDEX_ArrowDown:
if (aEvent.IsControl()) {

Просмотреть файл

@ -1,3 +1,3 @@
REMOTE_URL="https://github.com/WebKit/WebKit.git"
BASE_BRANCH="main"
BASE_REVISION="675d141bdcf7fa6df9bdf505d46e46fdac638452"
BASE_REVISION="654646fe6187abcf9ced6a3ace80eaf04754fd39"

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1,7 +1,7 @@
# Tool for printing .exe and .dll dependencies on Windows
This is similar to `ldd` on linux in that loads specified files and tries to
resolve all DLLs referenced by it, printing in the format `<lib name> => <full path> | "no found"`
resolve all DLLs referenced by it, printing in the formar `<lib name> => <full path> | "no found"`
To minimize dependencies we link all C runtime libraries statically, there is
still one dynamic dependency on `dbghelp.dll` which is supposed to be preinstalled
on all Windows machines.
@ -9,4 +9,4 @@ on all Windows machines.
## Build instructions
Open `PrintDeps.sln` solution in Visual Studio 2019 and build `x64/Release` configuration. We
currently commit output binary into `bin/PrintDeps.exe` and bundle it in every npm.
currently commit output binary into `bin/PrintDeps.exe` and bundle it in every npm.