@@ -2752,6 +2752,7 @@ index ee9edb30dd7b3461c4d491dfaf7929011d498bc9..71b51b0261494112b23800fe02f5e31b
2752
2752
}
2753
2753
2754
2754
-void InspectorNetworkAgent::interceptContinue(ErrorString& errorString, const String& requestId)
2755
+ -{
2755
2756
+bool InspectorNetworkAgent::interceptRequest(ResourceLoader& loader, Function<void(bool handled)>&& handler) {
2756
2757
+ if (!m_interceptionEnabled || !m_interceptRequests)
2757
2758
+ return false;
@@ -2765,10 +2766,7 @@ index ee9edb30dd7b3461c4d491dfaf7929011d498bc9..71b51b0261494112b23800fe02f5e31b
2765
2766
+}
2766
2767
+
2767
2768
+void InspectorNetworkAgent::interceptContinue(ErrorString& errorString, const String& requestId, const String* method, const JSON::Object* headers, const String* postData)
2768
- {
2769
- - auto pendingInterceptResponse = m_pendingInterceptResponses.take(requestId);
2770
- - if (!pendingInterceptResponse) {
2771
- - errorString = "Missing pending intercept response for given requestId"_s;
2769
+ +{
2772
2770
+ auto pendingRequest = m_pendingInterceptRequests.take(requestId);
2773
2771
+ if (pendingRequest) {
2774
2772
+ ResourceLoader* loader = pendingRequest->m_loader.get();
@@ -2799,16 +2797,18 @@ index ee9edb30dd7b3461c4d491dfaf7929011d498bc9..71b51b0261494112b23800fe02f5e31b
2799
2797
+ request->setHTTPBody(WTFMove(data));
2800
2798
+ }
2801
2799
+ pendingRequest->m_callback(false);
2800
+ + return;
2801
+ + }
2802
+ +
2803
+ auto pendingInterceptResponse = m_pendingInterceptResponses.take(requestId);
2804
+ - if (!pendingInterceptResponse) {
2805
+ - errorString = "Missing pending intercept response for given requestId"_s;
2806
+ + if (pendingInterceptResponse) {
2807
+ + pendingInterceptResponse->respondWithOriginalResponse();
2802
2808
return;
2803
2809
}
2804
2810
2805
2811
- pendingInterceptResponse->respondWithOriginalResponse();
2806
- + auto pendingInterceptResponse = m_pendingInterceptResponses.take(requestId);
2807
- + if (pendingInterceptResponse) {
2808
- + pendingInterceptResponse->respondWithOriginalResponse();
2809
- + return;
2810
- + }
2811
- +
2812
2812
+ errorString = "Missing pending intercept response for given requestId"_s;
2813
2813
}
2814
2814
@@ -3132,16 +3132,16 @@ index 09dd591948baa0bf4a31cc57b391792faae97a57..d5d4a44e4d921ed3b60a2ac093346b93
3132
3132
+ Frame* frame = frameId ? assertFrame(errorString, *frameId) : &m_inspectedPage.mainFrame();
3133
3133
+ if (!frame)
3134
3134
+ return;
3135
-
3136
- - ResourceRequest resourceRequest { frame.document()->completeURL(url) };
3137
- - FrameLoadRequest frameLoadRequest { *frame.document(), frame.document()->securityOrigin(), WTFMove(resourceRequest), "_self"_s, LockHistory::No, LockBackForwardList::No, ReferrerPolicy::EmptyString, AllowNavigationToInvalidURL::No, NewFrameOpenerPolicy::Allow, ShouldOpenExternalURLsPolicy::ShouldNotAllow, InitiatedByMainFrame::Unknown };
3138
- - frame.loader().changeLocation(WTFMove(frameLoadRequest));
3135
+ +
3139
3136
+ ResourceRequest resourceRequest { frame->document()->completeURL(url) };
3140
3137
+ if (!resourceRequest.url().isValid()) {
3141
3138
+ errorString = "Cannot navigate to invalid URL"_s;
3142
3139
+ return;
3143
3140
+ }
3144
- +
3141
+
3142
+ - ResourceRequest resourceRequest { frame.document()->completeURL(url) };
3143
+ - FrameLoadRequest frameLoadRequest { *frame.document(), frame.document()->securityOrigin(), WTFMove(resourceRequest), "_self"_s, LockHistory::No, LockBackForwardList::No, ReferrerPolicy::EmptyString, AllowNavigationToInvalidURL::No, NewFrameOpenerPolicy::Allow, ShouldOpenExternalURLsPolicy::ShouldNotAllow, InitiatedByMainFrame::Unknown };
3144
+ - frame.loader().changeLocation(WTFMove(frameLoadRequest));
3145
3145
+ if (referrer)
3146
3146
+ resourceRequest.setInitiatorIdentifier(InspectorNetworkAgent::createInitiatorIdentifierForInspectorNavigation(*referrer));
3147
3147
+ FrameLoadRequest frameLoadRequest { *frame->document(), frame->document()->securityOrigin(), WTFMove(resourceRequest), "_self"_s, LockHistory::No, LockBackForwardList::No, ReferrerPolicy::EmptyString, AllowNavigationToInvalidURL::No, NewFrameOpenerPolicy::Allow, ShouldOpenExternalURLsPolicy::ShouldNotAllow, InitiatedByMainFrame::Unknown };
@@ -4415,19 +4415,23 @@ index 69146c375b32cec512d7750f114a0a4f8e614f1a..403fefc5e2f3ab69f3a51919e9e70666
4415
4415
4416
4416
Ref<Frame> Frame::create(Page* page, HTMLFrameOwnerElement* ownerElement, UniqueRef<FrameLoaderClient>&& client)
4417
4417
diff --git a/Source/WebCore/page/FrameSnapshotting.cpp b/Source/WebCore/page/FrameSnapshotting.cpp
4418
- index 73587787f88a6ad4e4baffb0beb0b87e7782916f..7e7a984207d6005bdb116784f981b487c8c16846 100644
4418
+ index 73587787f88a6ad4e4baffb0beb0b87e7782916f..88492f501e6ec9e38455dbe6fd27537bf0ee6970 100644
4419
4419
--- a/Source/WebCore/page/FrameSnapshotting.cpp
4420
4420
+++ b/Source/WebCore/page/FrameSnapshotting.cpp
4421
- @@ -115,6 +115,8 @@ std::unique_ptr<ImageBuffer> snapshotFrameRectWithClip(Frame& frame, const IntRe
4421
+ @@ -114,7 +114,12 @@ std::unique_ptr<ImageBuffer> snapshotFrameRectWithClip(Frame& frame, const IntRe
4422
+ std::unique_ptr<ImageBuffer> buffer = ImageBuffer::create(imageRect.size(), RenderingMode::Unaccelerated, scaleFactor);
4422
4423
if (!buffer)
4423
4424
return nullptr;
4425
+ +#if !PLATFORM(MAC)
4426
+ + buffer->context().scale(scaleFactor);
4427
+ +#endif
4424
4428
buffer->context().translate(-imageRect.x(), -imageRect.y());
4425
4429
+ if (coordinateSpace != FrameView::ViewCoordinates)
4426
4430
+ buffer->context().scale(1 / frame.page()->pageScaleFactor());
4427
4431
4428
4432
if (!clipRects.isEmpty()) {
4429
4433
Path clipPath;
4430
- @@ -123,7 +125 ,10 @@ std::unique_ptr<ImageBuffer> snapshotFrameRectWithClip(Frame& frame, const IntRe
4434
+ @@ -123,7 +128 ,10 @@ std::unique_ptr<ImageBuffer> snapshotFrameRectWithClip(Frame& frame, const IntRe
4431
4435
buffer->context().clipPath(clipPath);
4432
4436
}
4433
4437
@@ -13575,9 +13579,7 @@ index 1e4fb27884034dcca333f77efd24150d4c9dc2ec..30eaa65b5600fce08e6153bbd47fdbca
13575
13579
13576
13580
-WKPageRef WebKitBrowserWindow::createNewPage(WKPageRef page, WKPageConfigurationRef configuration, WKNavigationActionRef navigationAction, WKWindowFeaturesRef windowFeatures, const void *clientInfo)
13577
13581
+void WebKitBrowserWindow::closeWindow(WKPageRef page, const void* clientInfo)
13578
- {
13579
- - auto& newWindow = MainWindow::create().leakRef();
13580
- - auto factory = [configuration](BrowserWindowClient& client, HWND mainWnd, bool) -> auto {
13582
+ +{
13581
13583
+ auto& thisWindow = toWebKitBrowserWindow(clientInfo);
13582
13584
+ PostMessage(thisWindow.m_hMainWnd, WM_CLOSE, 0, 0);
13583
13585
+}
@@ -13604,7 +13606,9 @@ index 1e4fb27884034dcca333f77efd24150d4c9dc2ec..30eaa65b5600fce08e6153bbd47fdbca
13604
13606
+}
13605
13607
+
13606
13608
+void WebKitBrowserWindow::runBeforeUnloadConfirmPanel(WKPageRef page, WKStringRef message, WKFrameRef frame, WKPageRunBeforeUnloadConfirmPanelResultListenerRef listener, const void *clientInfo)
13607
- +{
13609
+ {
13610
+ - auto& newWindow = MainWindow::create().leakRef();
13611
+ - auto factory = [configuration](BrowserWindowClient& client, HWND mainWnd, bool) -> auto {
13608
13612
+ auto& thisWindow = toWebKitBrowserWindow(clientInfo);
13609
13613
+ WKRetain(listener);
13610
13614
+ thisWindow.m_beforeUnloadDialog = listener;
@@ -13794,9 +13798,9 @@ index 6008ca19e26a938cf962c0c336299fff7d13f9a3..8005d72f8c0d9ef82efda8aec1ff0e7d
13794
13798
- else
13795
13799
- ::SetProcessDPIAware();
13796
13800
+ SetProcessDpiAwarenessContextPtr()(DPI_AWARENESS_CONTEXT_UNAWARE);
13797
-
13798
- + MainWindow::configure(options.headless, options.noStartupWindow);
13799
13801
+
13802
+ + MainWindow::configure(options.headless, options.noStartupWindow);
13803
+
13800
13804
+ if (!options.noStartupWindow) {
13801
13805
#if !ENABLE(WEBKIT_LEGACY)
13802
13806
- auto factory = WebKitBrowserWindow::create;
0 commit comments