Diff
Modified: branches/safari-610-branch/Source/WebKit/ChangeLog (266428 => 266429)
--- branches/safari-610-branch/Source/WebKit/ChangeLog 2020-09-02 01:19:06 UTC (rev 266428)
+++ branches/safari-610-branch/Source/WebKit/ChangeLog 2020-09-02 01:19:09 UTC (rev 266429)
@@ -1,5 +1,56 @@
2020-09-01 Alan Coon <[email protected]>
+ Cherry-pick r266134. rdar://problem/68164543
+
+ [Mac] REGRESSION(r262322): Focusable elements are focused when exiting from video fullscreen mode.
+ https://bugs.webkit.org/show_bug.cgi?id=215660
+ <rdar://problem/65263150>
+
+ Reviewed by Darin Adler.
+
+ Source/WebKit:
+
+ API Test: Fullscreen.Focus.
+
+ The default behavior of NSWindow is to change its -keyViewSelectionDirection to NSSelectingNext when activating
+ and changing the firstResponder. This causes WKWebView to change it's focus in response to becoming first responder.
+ The cheap fix is to ensure WKWebView is already the firstResponder when the window is activated. Then NSWindow won't
+ try to change the firstResponder in response to activation.
+
+ * UIProcess/mac/WKFullScreenWindowController.mm:
+ (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
+
+ Tools:
+
+ * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+ * TestWebKitAPI/Tests/mac/FullscreenFocus.mm: Added.
+ (-[FullscreenFocusUIDelegate _webViewDidEnterFullscreen:]):
+ (-[FullscreenFocusUIDelegate _webViewDidExitFullscreen:]):
+ (TestWebKitAPI::TEST):
+
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266134 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2020-08-25 Jer Noble <[email protected]>
+
+ [Mac] REGRESSION(r262322): Focusable elements are focused when exiting from video fullscreen mode.
+ https://bugs.webkit.org/show_bug.cgi?id=215660
+ <rdar://problem/65263150>
+
+ Reviewed by Darin Adler.
+
+ API Test: Fullscreen.Focus.
+
+ The default behavior of NSWindow is to change its -keyViewSelectionDirection to NSSelectingNext when activating
+ and changing the firstResponder. This causes WKWebView to change it's focus in response to becoming first responder.
+ The cheap fix is to ensure WKWebView is already the firstResponder when the window is activated. Then NSWindow won't
+ try to change the firstResponder in response to activation.
+
+ * UIProcess/mac/WKFullScreenWindowController.mm:
+ (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
+
+2020-09-01 Alan Coon <[email protected]>
+
Cherry-pick r266268. rdar://problem/68107183
Remove the feature flag for capped cookies set in 3rd-party CNAME cloaked HTTP responses and add ITP debug logging
Modified: branches/safari-610-branch/Source/WebKit/UIProcess/mac/WKFullScreenWindowController.mm (266428 => 266429)
--- branches/safari-610-branch/Source/WebKit/UIProcess/mac/WKFullScreenWindowController.mm 2020-09-02 01:19:06 UTC (rev 266428)
+++ branches/safari-610-branch/Source/WebKit/UIProcess/mac/WKFullScreenWindowController.mm 2020-09-02 01:19:09 UTC (rev 266429)
@@ -344,9 +344,9 @@
NSWindow* window = self.window;
NSWindowCollectionBehavior behavior = [window collectionBehavior];
[window setCollectionBehavior:(behavior | NSWindowCollectionBehaviorCanJoinAllSpaces)];
+ [window makeFirstResponder:_webView];
[window makeKeyAndOrderFront:self];
[window setCollectionBehavior:behavior];
- [window makeFirstResponder:_webView];
_page->setSuppressVisibilityUpdates(false);
ALLOW_DEPRECATED_DECLARATIONS_BEGIN
Modified: branches/safari-610-branch/Tools/ChangeLog (266428 => 266429)
--- branches/safari-610-branch/Tools/ChangeLog 2020-09-02 01:19:06 UTC (rev 266428)
+++ branches/safari-610-branch/Tools/ChangeLog 2020-09-02 01:19:09 UTC (rev 266429)
@@ -1,5 +1,52 @@
2020-09-01 Alan Coon <[email protected]>
+ Cherry-pick r266134. rdar://problem/68164543
+
+ [Mac] REGRESSION(r262322): Focusable elements are focused when exiting from video fullscreen mode.
+ https://bugs.webkit.org/show_bug.cgi?id=215660
+ <rdar://problem/65263150>
+
+ Reviewed by Darin Adler.
+
+ Source/WebKit:
+
+ API Test: Fullscreen.Focus.
+
+ The default behavior of NSWindow is to change its -keyViewSelectionDirection to NSSelectingNext when activating
+ and changing the firstResponder. This causes WKWebView to change it's focus in response to becoming first responder.
+ The cheap fix is to ensure WKWebView is already the firstResponder when the window is activated. Then NSWindow won't
+ try to change the firstResponder in response to activation.
+
+ * UIProcess/mac/WKFullScreenWindowController.mm:
+ (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
+
+ Tools:
+
+ * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+ * TestWebKitAPI/Tests/mac/FullscreenFocus.mm: Added.
+ (-[FullscreenFocusUIDelegate _webViewDidEnterFullscreen:]):
+ (-[FullscreenFocusUIDelegate _webViewDidExitFullscreen:]):
+ (TestWebKitAPI::TEST):
+
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266134 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2020-08-25 Jer Noble <[email protected]>
+
+ [Mac] REGRESSION(r262322): Focusable elements are focused when exiting from video fullscreen mode.
+ https://bugs.webkit.org/show_bug.cgi?id=215660
+ <rdar://problem/65263150>
+
+ Reviewed by Darin Adler.
+
+ * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+ * TestWebKitAPI/Tests/mac/FullscreenFocus.mm: Added.
+ (-[FullscreenFocusUIDelegate _webViewDidEnterFullscreen:]):
+ (-[FullscreenFocusUIDelegate _webViewDidExitFullscreen:]):
+ (TestWebKitAPI::TEST):
+
+2020-09-01 Alan Coon <[email protected]>
+
Cherry-pick r266102. rdar://problem/68160088
Fix TLSVersion.DefaultBehavior on Mojave
Modified: branches/safari-610-branch/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (266428 => 266429)
--- branches/safari-610-branch/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj 2020-09-02 01:19:06 UTC (rev 266428)
+++ branches/safari-610-branch/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj 2020-09-02 01:19:09 UTC (rev 266429)
@@ -1007,6 +1007,7 @@
CDA3159D1ED5643F009F60D3 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CDA3159C1ED5643F009F60D3 /* IOKit.framework */; };
CDA4438E21F7A47700379489 /* ProcessSuspendMediaBuffering.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDA4438D21F7A47700379489 /* ProcessSuspendMediaBuffering.mm */; };
CDA93DAD22F4F11E00490A69 /* FullscreenTouchSecheuristicTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDA93DAC22F4EC2200490A69 /* FullscreenTouchSecheuristicTests.cpp */; };
+ CDB213BD24EF522800FDE301 /* FullscreenFocus.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDB213BC24EF522800FDE301 /* FullscreenFocus.mm */; };
CDB4115A1E0B00DB00EAD352 /* video-with-muted-audio.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = CDB411591E09DA8E00EAD352 /* video-with-muted-audio.html */; };
CDB5DFFF213610FA00D3E189 /* now-playing.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = CDB5DFFE21360ED800D3E189 /* now-playing.html */; };
CDBFCC451A9FF45300A7B691 /* FullscreenZoomInitialFrame.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDBFCC431A9FF44800A7B691 /* FullscreenZoomInitialFrame.mm */; };
@@ -2695,6 +2696,7 @@
CDA3159C1ED5643F009F60D3 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; };
CDA4438D21F7A47700379489 /* ProcessSuspendMediaBuffering.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = ProcessSuspendMediaBuffering.mm; sourceTree = "<group>"; };
CDA93DAC22F4EC2200490A69 /* FullscreenTouchSecheuristicTests.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = FullscreenTouchSecheuristicTests.cpp; sourceTree = "<group>"; };
+ CDB213BC24EF522800FDE301 /* FullscreenFocus.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = FullscreenFocus.mm; sourceTree = "<group>"; };
CDB411591E09DA8E00EAD352 /* video-with-muted-audio.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "video-with-muted-audio.html"; sourceTree = "<group>"; };
CDB5DFFE21360ED800D3E189 /* now-playing.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = "now-playing.html"; sourceTree = "<group>"; };
CDBFCC421A9FF44800A7B691 /* FullscreenZoomInitialFrame.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = FullscreenZoomInitialFrame.html; sourceTree = "<group>"; };
@@ -4400,6 +4402,7 @@
F456AB1B213EDBA300CB2CEF /* FontManagerTests.mm */,
1A7E8B33181208DE00AEB74A /* FragmentNavigation.mm */,
CDBFCC431A9FF44800A7B691 /* FullscreenZoomInitialFrame.mm */,
+ CDB213BC24EF522800FDE301 /* FullscreenFocus.mm */,
51EB125824C68589000CB030 /* HIDGamepads.mm */,
9B4F8FA3159D52B1002D9F94 /* HTMLCollectionNamedItem.mm */,
9B26FC6B159D061000CC3765 /* HTMLFormCollectionNamedItem.mm */,
@@ -5050,6 +5053,7 @@
46A911592108E6780078D40D /* CustomUserAgent.mm in Sources */,
751B05D61F8EAC410028A09E /* DatabaseTrackerTest.mm in Sources */,
2DC4CF771D2D9DD800ECCC94 /* DataDetection.mm in Sources */,
+ CDB213BD24EF522800FDE301 /* FullscreenFocus.mm in Sources */,
44077BB123144B5000179E2D /* DataDetectorsTestIOS.mm in Sources */,
9BAD7F3E22690F2000F8DA66 /* DeallocWebViewInEventListener.mm in Sources */,
518EE51D20A78D3600E024F3 /* DecidePolicyForNavigationAction.mm in Sources */,
Added: branches/safari-610-branch/Tools/TestWebKitAPI/Tests/mac/FullscreenFocus.mm (0 => 266429)
--- branches/safari-610-branch/Tools/TestWebKitAPI/Tests/mac/FullscreenFocus.mm (rev 0)
+++ branches/safari-610-branch/Tools/TestWebKitAPI/Tests/mac/FullscreenFocus.mm 2020-09-02 01:19:09 UTC (rev 266429)
@@ -0,0 +1,90 @@
+/*
+ * Copyright (C) 2020 Apple Inc. All rights reserved.
+ *
+ * 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+#import "config.h"
+
+#if PLATFORM(MAC)
+
+#import "TestCocoa.h"
+#import "TestWKWebView.h"
+#import <WebKit/WKPreferencesPrivate.h>
+#import <WebKit/WKWebViewPrivate.h>
+#import <WebKit/_WKFullscreenDelegate.h>
+#import <wtf/RetainPtr.h>
+
+static bool didEnterFullscreen;
+static bool didExitFullscreen;
+
+@interface FullscreenFocusUIDelegate : NSObject <_WKFullscreenDelegate>
+@end
+
+@implementation FullscreenFocusUIDelegate
+
+- (void)_webViewDidEnterFullscreen:(WKWebView *)webView
+{
+ didEnterFullscreen = true;
+}
+
+- (void)_webViewDidExitFullscreen:(WKWebView *)webView
+{
+ didExitFullscreen = true;
+}
+@end
+
+namespace TestWebKitAPI {
+
+TEST(Fullscreen, Focus)
+{
+ auto configuration = adoptNS([[WKWebViewConfiguration alloc] init]);
+ [configuration preferences]._fullScreenEnabled = YES;
+ auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:NSMakeRect(0, 0, 300, 300) configuration:configuration.get() addToWindow:YES]);
+ auto handler = adoptNS([[FullscreenFocusUIDelegate alloc] init]);
+ [webView _setFullscreenDelegate:handler.get()];
+
+ bool canplaythrough = false;
+ [webView performAfterReceivingMessage:@"canplaythrough" action:[&] { canplaythrough = true; }];
+ [webView synchronouslyLoadHTMLString:
+ @"<video id=\"one\" controls></video><video id=\"two\" controls></video>"
+ @"<script>"
+ @"one.addEventListener('canplaythrough', event => { window.webkit.messageHandlers.testHandler.postMessage('canplaythrough'); }, {once:true});"
+ @"one.src = "" = '';"
+ @"</script>"];
+
+ Util::run(&canplaythrough);
+
+ didEnterFullscreen = false;
+ [webView objectByEvaluatingJavaScriptWithUserGesture:@"one.webkitEnterFullscreen()"];
+ Util::run(&didEnterFullscreen);
+
+ didExitFullscreen = false;
+ [webView objectByEvaluatingJavaScript:@"one.webkitExitFullscreen()"];
+ Util::run(&didExitFullscreen);
+
+ EXPECT_WK_STREQ("[object HTMLBodyElement]", [webView stringByEvaluatingJavaScript:@"String(document.activeElement)"]);
+}
+
+}
+
+#endif