Title: [87206] branches/safari-534-branch/Source

Diff

Modified: branches/safari-534-branch/Source/WebCore/ChangeLog (87205 => 87206)


--- branches/safari-534-branch/Source/WebCore/ChangeLog	2011-05-24 21:29:30 UTC (rev 87205)
+++ branches/safari-534-branch/Source/WebCore/ChangeLog	2011-05-24 21:32:52 UTC (rev 87206)
@@ -1,5 +1,20 @@
 2011-05-24  Lucas Forschler  <[email protected]>
 
+    Merged r86995.
+
+    2011-05-20  Andy Estes  <[email protected]>
+
+        Reviewed by Darin Adler.
+
+        WebView loses firstResponder status when entering full-screen mode.
+        https://bugs.webkit.org/show_bug.cgi?id=61153
+
+        No test possible via DRT. Add a manual test instead.
+
+        * manual-tests/full-screen-keypress.html: Added.
+
+2011-05-24  Lucas Forschler  <[email protected]>
+
     Merged r86992.
 
     2011-05-20  Jeremy Noble  <[email protected]>

Copied: branches/safari-534-branch/Source/WebCore/manual-tests/full-screen-keypress.html (from rev 86995, trunk/Source/WebCore/manual-tests/full-screen-keypress.html) (0 => 87206)


--- branches/safari-534-branch/Source/WebCore/manual-tests/full-screen-keypress.html	                        (rev 0)
+++ branches/safari-534-branch/Source/WebCore/manual-tests/full-screen-keypress.html	2011-05-24 21:32:52 UTC (rev 87206)
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<script>
+    function enterFullScreen() {
+        var element = document.getElementById("fullscreen");
+        element.innerText = "Press the space bar.";
+        
+        var consoleDiv = document.getElementById("console");
+        consoleDiv.innerHTML = "<span style='color:red'>FAIL</span>";
+        
+        document.addEventListener("keydown", function(event) {
+            consoleDiv.innerHTML = "<span style='color:green'>PASS</span>";
+            document.webkitCancelFullScreen();
+        }, true);
+        
+        element.addEventListener("webkitfullscreenchange", function(event) {
+            if (!document.webkitIsFullScreen)
+                element.innerText = "";
+        }, false);
+        
+        element.webkitRequestFullScreen();
+    }
+</script>
+<p>This test checks that keyboard events are received by an element in full screen mode. To run the test, press the 'Enter Full Screen' button then press the space bar. The test passes if the element exists full screen and you see the word 'PASS' below.</p>
+<button _onclick_="enterFullScreen()">Enter Full Screen</button>
+<div id="fullscreen"></div>
+<div id="console"></div>
\ No newline at end of file

Modified: branches/safari-534-branch/Source/WebKit/ChangeLog (87205 => 87206)


--- branches/safari-534-branch/Source/WebKit/ChangeLog	2011-05-24 21:29:30 UTC (rev 87205)
+++ branches/safari-534-branch/Source/WebKit/ChangeLog	2011-05-24 21:32:52 UTC (rev 87206)
@@ -1,3 +1,13 @@
+2011-05-20  Andy Estes  <[email protected]>
+
+        Reviewed by Darin Adler.
+
+        WebView loses firstResponder status when entering full-screen mode.
+        https://bugs.webkit.org/show_bug.cgi?id=61153
+
+        * WebKit.xcodeproj/project.pbxproj: Export WebNSWindowExtras.h as a
+        private header so that WebKit2 can include it.
+
 2011-05-16  Dan Bernstein  <[email protected]>
 
         No need to compile .js files, that is what the JIT is for.

Modified: branches/safari-534-branch/Source/WebKit/WebKit.xcodeproj/project.pbxproj (87205 => 87206)


--- branches/safari-534-branch/Source/WebKit/WebKit.xcodeproj/project.pbxproj	2011-05-24 21:29:30 UTC (rev 87205)
+++ branches/safari-534-branch/Source/WebKit/WebKit.xcodeproj/project.pbxproj	2011-05-24 21:32:52 UTC (rev 87206)
@@ -170,7 +170,7 @@
 		939810220824BF01008DF038 /* WebNSImageExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = 8398847A03426FB000BC5F5E /* WebNSImageExtras.h */; };
 		939810230824BF01008DF038 /* WebNSPasteboardExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = ED2B2474033A2DA800C1A526 /* WebNSPasteboardExtras.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		939810240824BF01008DF038 /* WebNSViewExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = F508946902B71D59018A9CD4 /* WebNSViewExtras.h */; settings = {ATTRIBUTES = (Private, ); }; };
-		939810250824BF01008DF038 /* WebNSWindowExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = 9345DDAE0365FB27008635CE /* WebNSWindowExtras.h */; };
+		939810250824BF01008DF038 /* WebNSWindowExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = 9345DDAE0365FB27008635CE /* WebNSWindowExtras.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		939810270824BF01008DF038 /* WebStringTruncator.h in Headers */ = {isa = PBXBuildFile; fileRef = F59668C802AD2923018635CA /* WebStringTruncator.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		939810290824BF01008DF038 /* WebAuthenticationPanel.h in Headers */ = {isa = PBXBuildFile; fileRef = F8CA15B5029A39D901000122 /* WebAuthenticationPanel.h */; };
 		9398102A0824BF01008DF038 /* WebPanelAuthenticationHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 93154EF103A41270008635CE /* WebPanelAuthenticationHandler.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -1468,6 +1468,7 @@
 				51CBFCAD0D10E6C5002DBF51 /* WebCachedFramePlatformData.h in Headers */,
 				14D8252F0AF955090004F057 /* WebChromeClient.h in Headers */,
 				939810490824BF01008DF038 /* WebClipView.h in Headers */,
+				939810250824BF01008DF038 /* WebNSWindowExtras.h in Headers */,
 				065AD5A30B0C32C7005A2B1D /* WebContextMenuClient.h in Headers */,
 				939810160824BF01008DF038 /* WebCoreStatistics.h in Headers */,
 				51AEDEF10CECF45700854328 /* WebDatabaseManagerInternal.h in Headers */,
@@ -1581,7 +1582,6 @@
 				65E0F88408500917007E5CB9 /* WebNSURLRequestExtras.h in Headers */,
 				65E0F9E608500F23007E5CB9 /* WebNSUserDefaultsExtras.h in Headers */,
 				939810240824BF01008DF038 /* WebNSViewExtras.h in Headers */,
-				939810250824BF01008DF038 /* WebNSWindowExtras.h in Headers */,
 				9398102A0824BF01008DF038 /* WebPanelAuthenticationHandler.h in Headers */,
 				37B6FB4E1063530C000FDB3B /* WebPDFDocumentExtras.h in Headers */,
 				939810A50824BF01008DF038 /* WebPDFRepresentation.h in Headers */,

Modified: branches/safari-534-branch/Source/WebKit/mac/ChangeLog (87205 => 87206)


--- branches/safari-534-branch/Source/WebKit/mac/ChangeLog	2011-05-24 21:29:30 UTC (rev 87205)
+++ branches/safari-534-branch/Source/WebKit/mac/ChangeLog	2011-05-24 21:32:52 UTC (rev 87206)
@@ -1,3 +1,27 @@
+2011-05-24  Lucas Forschler  <[email protected]>
+
+    Merged r86995.
+
+    2011-05-20  Andy Estes  <[email protected]>
+
+        Reviewed by Darin Adler.
+
+        WebView loses firstResponder status when entering full-screen mode.
+        https://bugs.webkit.org/show_bug.cgi?id=61153
+
+        * Misc/WebNSWindowExtras.h:
+        * Misc/WebNSWindowExtras.m:
+        (-[NSWindow makeResponder:firstResponderIfDescendantOfView:]): Add a
+        convenience method to NSWindow that makes the given NSResponder first
+        responder only if it is a descendant of the given view.
+        * WebView/WebFullScreenController.mm:
+        (-[WebFullScreenController windowDidEnterFullscreen:]): If the WebView
+        was a descendant of the browser window's first responder when entering
+        full-screen mode, set the full-screen window's first responder to that
+        same NSResponder.
+        (-[WebFullScreenController exitFullscreen]): Do the reverse of what is
+        done in windowDidEnterFullscreen:.
+
 2011-05-17  Timothy Hatcher  <[email protected]>
 
         Update the the context menu to reflect the system search provider on Mac.

Modified: branches/safari-534-branch/Source/WebKit/mac/Misc/WebNSWindowExtras.h (87205 => 87206)


--- branches/safari-534-branch/Source/WebKit/mac/Misc/WebNSWindowExtras.h	2011-05-24 21:29:30 UTC (rev 87205)
+++ branches/safari-534-branch/Source/WebKit/mac/Misc/WebNSWindowExtras.h	2011-05-24 21:32:52 UTC (rev 87206)
@@ -30,5 +30,6 @@
 
 @interface NSWindow (WebExtras)
 // centers "visually", putting 1/3 of the remaining space above, and 2/3 below
-- (void)centerOverMainWindow; 
+- (void)centerOverMainWindow;
+- (void)makeResponder:(NSResponder *)responder firstResponderIfDescendantOfView:(NSView *)view;
 @end

Modified: branches/safari-534-branch/Source/WebKit/mac/Misc/WebNSWindowExtras.m (87205 => 87206)


--- branches/safari-534-branch/Source/WebKit/mac/Misc/WebNSWindowExtras.m	2011-05-24 21:29:30 UTC (rev 87205)
+++ branches/safari-534-branch/Source/WebKit/mac/Misc/WebNSWindowExtras.m	2011-05-24 21:32:52 UTC (rev 87206)
@@ -49,4 +49,10 @@
     [self setFrameOrigin:origin];
 }
 
+- (void)makeResponder:(NSResponder *)responder firstResponderIfDescendantOfView:(NSView *)view
+{
+    if ([responder isKindOfClass:[NSView class]] && [(id)responder isDescendantOf:view])
+        [self makeFirstResponder:responder];
+}
+
 @end

Modified: branches/safari-534-branch/Source/WebKit/mac/WebView/WebFullScreenController.mm (87205 => 87206)


--- branches/safari-534-branch/Source/WebKit/mac/WebView/WebFullScreenController.mm	2011-05-24 21:29:30 UTC (rev 87205)
+++ branches/safari-534-branch/Source/WebKit/mac/WebView/WebFullScreenController.mm	2011-05-24 21:32:52 UTC (rev 87206)
@@ -27,6 +27,7 @@
 
 #import "WebFullScreenController.h"
 
+#import "WebNSWindowExtras.h"
 #import "WebPreferencesPrivate.h"
 #import "WebWindowAnimation.h"
 #import "WebViewInternal.h"
@@ -273,6 +274,7 @@
 
         WebView *webView = [self webView];
         NSWindow *webWindow = [webView window];
+        NSResponder *webWindowFirstResponder = [webWindow firstResponder];
 
         // Do not swap the placeholder into place if already is in a window,
         // assuming the placeholder's window will always be the webView's 
@@ -284,6 +286,7 @@
             [[webView superview] replaceSubview:webView with:_placeholderView];
             
             [[[self window] contentView] addSubview:webView];
+            [[self window] makeResponder:webWindowFirstResponder firstResponderIfDescendantOfView:webView];
             [webView setAutoresizingMask:NSViewWidthSizable|NSViewHeightSizable];
             [webView setFrame:[(NSView *)[[self window] contentView] bounds]];
         }
@@ -523,10 +526,12 @@
     if (_placeholderView && [_placeholderView window]) {
         // Move the webView back to its own native window:
         WebView* webView = [self webView];
+        NSResponder *fullScreenWindowFirstResponder = [[self window] firstResponder];
         [webView setFrame:[_placeholderView frame]];
         [webView setAutoresizingMask:[_placeholderView autoresizingMask]];
         [webView removeFromSuperview];
         [[_placeholderView superview] replaceSubview:_placeholderView with:webView];
+        [[webView window] makeResponder:fullScreenWindowFirstResponder firstResponderIfDescendantOfView:webView];
         
         NSWindow *webWindow = [[self webView] window];
 #if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)

Modified: branches/safari-534-branch/Source/WebKit2/ChangeLog (87205 => 87206)


--- branches/safari-534-branch/Source/WebKit2/ChangeLog	2011-05-24 21:29:30 UTC (rev 87205)
+++ branches/safari-534-branch/Source/WebKit2/ChangeLog	2011-05-24 21:32:52 UTC (rev 87206)
@@ -1,5 +1,24 @@
 2011-05-24  Lucas Forschler  <[email protected]>
 
+    Merged r86995.
+
+    2011-05-20  Andy Estes  <[email protected]>
+
+        Reviewed by Darin Adler.
+
+        WebView loses firstResponder status when entering full-screen mode.
+        https://bugs.webkit.org/show_bug.cgi?id=61153
+
+        * UIProcess/mac/WKFullScreenWindowController.mm:
+        (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]): If
+        the WebView was a descendant of the browser window's first responder
+        when entering full-screen mode, set the full-screen window's first
+        responder to that same NSResponder.
+        (-[WKFullScreenWindowController beganExitFullScreenAnimation]): Do the
+        reverse of what is done in finishedEnterFullScreenAnimation:.
+
+2011-05-24  Lucas Forschler  <[email protected]>
+
     Merged r86992.
 
     2011-05-20  Jeremy Noble  <[email protected]>

Modified: branches/safari-534-branch/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm (87205 => 87206)


--- branches/safari-534-branch/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm	2011-05-24 21:29:30 UTC (rev 87205)
+++ branches/safari-534-branch/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm	2011-05-24 21:32:52 UTC (rev 87206)
@@ -39,6 +39,7 @@
 #import <QuartzCore/QuartzCore.h>
 #import <WebCore/FloatRect.h>
 #import <WebCore/IntRect.h>
+#import <WebKit/WebNSWindowExtras.h>
 #import <WebKitSystemInterface.h>
 
 static const NSTimeInterval tickleTimerInterval = 1.0;
@@ -249,12 +250,14 @@
         // Swap the webView placeholder into place.
         if (!_webViewPlaceholder)
             _webViewPlaceholder.adoptNS([[NSView alloc] init]);
+        NSResponder *webWindowFirstResponder = [[_webView window] firstResponder];
         [self _swapView:_webView with:_webViewPlaceholder.get()];
         
         // Then insert the WebView into the full screen window
         NSView* contentView = [[self _fullScreenWindow] contentView];
         [contentView addSubview:_webView positioned:NSWindowBelow relativeTo:nil];
         [_webView setFrame:[contentView bounds]];
+        [[self window] makeResponder:webWindowFirstResponder firstResponderIfDescendantOfView:_webView];
         
         NSWindow *webWindow = [_webViewPlaceholder.get() window];
 #if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
@@ -298,6 +301,7 @@
     
     // Swap the webView back into its original position:
     if ([_webView window] == [self window]) {
+        NSResponder *fullScreenWindowFirstResponder = [[self _fullScreenWindow] firstResponder];
 #if defined(BUILDING_ON_LEOPARD) || defined(BUILDING_ON_SNOW_LEOPARD)
         // Work around a bug in AppKit <rdar://problem/9443385> where moving a 
         // layer-hosted view from a layer-backed view to a non-layer-backed view
@@ -309,6 +313,7 @@
         }
 #endif
         [self _swapView:_webViewPlaceholder.get() with:_webView];
+        [[_webView window] makeResponder:fullScreenWindowFirstResponder firstResponderIfDescendantOfView:_webView];
         NSWindow* webWindow = [_webView window];
 #if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
         // In Lion, NSWindow will animate into and out of orderOut operations. Suppress that
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to