browser(webkit): support larger-than-screen window in headed WebKit (#14578)
This commit is contained in:
Родитель
b4c8db68d2
Коммит
2b33f76825
|
@ -1,2 +1,2 @@
|
|||
1659
|
||||
Changed: max@schmitt.mx Wed Jun 8 15:20:52 UTC 2022
|
||||
1660
|
||||
Changed: lushnikov@chromium.org Thu Jun 9 16:49:27 +03 2022
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
</customObject>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||
<window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" frameAutosaveName="Main Window" animationBehavior="default" id="1">
|
||||
<window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" frameAutosaveName="Main Window" animationBehavior="default" id="1" customClass="CustomWindow">
|
||||
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES" fullSizeContentView="YES"/>
|
||||
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
|
||||
<rect key="contentRect" x="517" y="330" width="776" height="608"/>
|
||||
|
|
|
@ -25,6 +25,12 @@
|
|||
|
||||
@class WKWebView;
|
||||
|
||||
@interface CustomWindow : NSWindow
|
||||
|
||||
- (NSRect)constrainFrameRect:(NSRect)frameRect toScreen:(NSScreen *)screen;
|
||||
|
||||
@end
|
||||
|
||||
@interface BrowserWindowController : NSWindowController
|
||||
|
||||
- (IBAction)goBack:(id)sender;
|
||||
|
|
|
@ -63,6 +63,18 @@ static void* keyValueObservingContext = &keyValueObservingContext;
|
|||
|
||||
@end
|
||||
|
||||
@implementation CustomWindow
|
||||
|
||||
- (NSRect)constrainFrameRect:(NSRect)frameRect toScreen:(NSScreen *)screen
|
||||
{
|
||||
// Retain the frame size, but make sure that
|
||||
// the top of the window is always visible.
|
||||
CGFloat yPos = NSHeight(self.screen.frame) - 100 - NSHeight(self.frame);
|
||||
return NSMakeRect(frameRect.origin.x, yPos, frameRect.size.width, frameRect.size.height);
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@interface BrowserWindowController () <NSTextFinderBarContainer, WKNavigationDelegate, WKUIDelegate, _WKIconLoadingDelegate, NSSharingServicePickerDelegate, NSSharingServiceDelegate>
|
||||
@end
|
||||
|
||||
|
|
|
@ -2238,7 +2238,7 @@ diff --git a/Source/WebCore/Modules/speech/cocoa/WebSpeechRecognizerTask.mm b/So
|
|||
index a941d76a4f748718df1e3cff2a6c5e0827f48891..f62db5a27ac0e4c12430e7d19e60c83d768ace22 100644
|
||||
--- a/Source/WebCore/Modules/speech/cocoa/WebSpeechRecognizerTask.mm
|
||||
+++ b/Source/WebCore/Modules/speech/cocoa/WebSpeechRecognizerTask.mm
|
||||
@@ -198,6 +198,7 @@ - (void)sendEndIfNeeded
|
||||
@@ -198,6 +198,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
- (void)speechRecognizer:(SFSpeechRecognizer *)speechRecognizer availabilityDidChange:(BOOL)available
|
||||
{
|
||||
|
@ -2246,7 +2246,7 @@ index a941d76a4f748718df1e3cff2a6c5e0827f48891..f62db5a27ac0e4c12430e7d19e60c83d
|
|||
ASSERT(isMainThread());
|
||||
|
||||
if (available || !_task)
|
||||
@@ -211,6 +212,7 @@ - (void)speechRecognizer:(SFSpeechRecognizer *)speechRecognizer availabilityDidC
|
||||
@@ -211,6 +212,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
- (void)speechRecognitionTask:(SFSpeechRecognitionTask *)task didHypothesizeTranscription:(SFTranscription *)transcription
|
||||
{
|
||||
|
@ -2254,7 +2254,7 @@ index a941d76a4f748718df1e3cff2a6c5e0827f48891..f62db5a27ac0e4c12430e7d19e60c83d
|
|||
ASSERT(isMainThread());
|
||||
|
||||
[self sendSpeechStartIfNeeded];
|
||||
@@ -219,6 +221,7 @@ - (void)speechRecognitionTask:(SFSpeechRecognitionTask *)task didHypothesizeTran
|
||||
@@ -219,6 +221,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
- (void)speechRecognitionTask:(SFSpeechRecognitionTask *)task didFinishRecognition:(SFSpeechRecognitionResult *)recognitionResult
|
||||
{
|
||||
|
@ -2262,7 +2262,7 @@ index a941d76a4f748718df1e3cff2a6c5e0827f48891..f62db5a27ac0e4c12430e7d19e60c83d
|
|||
ASSERT(isMainThread());
|
||||
[self callbackWithTranscriptions:recognitionResult.transcriptions isFinal:YES];
|
||||
|
||||
@@ -230,6 +233,7 @@ - (void)speechRecognitionTask:(SFSpeechRecognitionTask *)task didFinishRecogniti
|
||||
@@ -230,6 +233,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
- (void)speechRecognitionTaskWasCancelled:(SFSpeechRecognitionTask *)task
|
||||
{
|
||||
|
@ -8868,7 +8868,7 @@ diff --git a/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm b/Source/
|
|||
index 1d9c725383fa4ad497de378783e519b98451fb20..44fd5f3b958f8a7bd85b8657fff5bac058a86a69 100644
|
||||
--- a/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm
|
||||
+++ b/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm
|
||||
@@ -723,7 +723,7 @@ - (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didRece
|
||||
@@ -723,7 +723,7 @@ void NetworkSessionCocoa::setClientAuditToken(const WebCore::AuthenticationChall
|
||||
|
||||
if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) {
|
||||
sessionCocoa->setClientAuditToken(challenge);
|
||||
|
@ -10291,7 +10291,7 @@ index b8bf936e2eb8ca4dc0f445099dfb899395950bdb..30a2af76de0daac450c7afbb8a2dfe81
|
|||
#import <WebCore/Credential.h>
|
||||
#import <WebCore/RegistrationDatabase.h>
|
||||
#import <WebCore/ServiceWorkerClientData.h>
|
||||
@@ -234,6 +235,11 @@ - (void)removeDataOfTypes:(NSSet *)dataTypes modifiedSince:(NSDate *)date comple
|
||||
@@ -234,6 +235,11 @@ static WallTime toSystemClockTime(NSDate *date)
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -10470,7 +10470,7 @@ diff --git a/Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm b/
|
|||
index 2e235bb880c638a0e74256b6d66cb0244ea0a3f1..3471eebb47e860f7c2071d0e7f2691c9f0a6355d 100644
|
||||
--- a/Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm
|
||||
+++ b/Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm
|
||||
@@ -257,6 +257,16 @@ - (BOOL)processSwapsOnNavigation
|
||||
@@ -257,6 +257,16 @@
|
||||
return _processPoolConfiguration->processSwapsOnNavigation();
|
||||
}
|
||||
|
||||
|
@ -20721,7 +20721,7 @@ diff --git a/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm b/Source/WebKitLegac
|
|||
index 725c6714b8f75365ba4cdb969df1bd1bbe4c69c1..562571835a5740c5df06e1bad8b6ce9077bf7d66 100644
|
||||
--- a/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm
|
||||
+++ b/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm
|
||||
@@ -4189,7 +4189,7 @@ - (void)mouseDown:(WebEvent *)event
|
||||
@@ -4189,7 +4189,7 @@ static BOOL currentScrollIsBlit(NSView *clipView)
|
||||
_private->handlingMouseDownEvent = NO;
|
||||
}
|
||||
|
||||
|
@ -20734,7 +20734,7 @@ diff --git a/Source/WebKitLegacy/mac/WebView/WebView.mm b/Source/WebKitLegacy/ma
|
|||
index 59cecf9242ab834dadc904ef295365e1476f47f9..ca4cc96e62df62e92c22c3535f5972cc1fdc4cba 100644
|
||||
--- a/Source/WebKitLegacy/mac/WebView/WebView.mm
|
||||
+++ b/Source/WebKitLegacy/mac/WebView/WebView.mm
|
||||
@@ -4039,7 +4039,7 @@ + (void)_doNotStartObservingNetworkReachability
|
||||
@@ -4039,7 +4039,7 @@ IGNORE_WARNINGS_END
|
||||
}
|
||||
#endif // PLATFORM(IOS_FAMILY)
|
||||
|
||||
|
@ -20743,7 +20743,7 @@ index 59cecf9242ab834dadc904ef295365e1476f47f9..ca4cc96e62df62e92c22c3535f5972cc
|
|||
|
||||
- (NSArray *)_touchEventRegions
|
||||
{
|
||||
@@ -4081,7 +4081,7 @@ - (NSArray *)_touchEventRegions
|
||||
@@ -4081,7 +4081,7 @@ IGNORE_WARNINGS_END
|
||||
}).autorelease();
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче