Changeset 180885 in webkit
- Timestamp:
- Mar 2, 2015 9:37:14 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/mac/ChangeLog
r180871 r180885 1 2015-03-02 Jer Noble <jer.noble@apple.com> 2 3 [WK1][WK2][Mac] Fullscreen animation is incorrect when page is scaled. 4 https://bugs.webkit.org/show_bug.cgi?id=142121 5 6 Reviewed by Simon Fraser. 7 8 Fullscreening a page with a non-1 scale would result in that scale being applied to the 9 fullscreen content, breaking fullscreen mode. Set the page scale to 1 when entering 10 fullscreen and reset it to the original value when exiting fullscreen. 11 12 * WebView/WebFullScreenController.h: 13 * WebView/WebFullScreenController.mm: 14 (-[WebFullScreenController enterFullScreen:]): Set the page scale to 1. 15 (-[WebFullScreenController finishedExitFullScreenAnimation:]): Reset the page 16 scale to the original value. 17 * WebView/WebView.mm: 18 (-[WebView _supportsFullScreenForElement:withKeyboard:]): Drive-by fix. Check the 19 WebView's own preferences to see if fullscreen mode is enabled, rather than 20 the global object's. 21 1 22 2015-03-01 Chris Dumez <cdumez@apple.com> 2 23 -
trunk/Source/WebKit/mac/WebView/WebFullScreenController.h
r161185 r180885 52 52 NSRect _finalFrame; 53 53 WebCore::IntPoint _scrollPosition; 54 float _savedScale; 54 55 55 56 BOOL _isEnteringFullScreen; … … 58 59 BOOL _isPlaying; 59 60 } 61 62 @property (readonly) NSRect initialFrame; 63 @property (readonly) NSRect finalFrame; 60 64 61 65 - (WebView*)webView; -
trunk/Source/WebKit/mac/WebView/WebFullScreenController.mm
r171120 r180885 108 108 } 109 109 110 @synthesize initialFrame=_initialFrame; 111 @synthesize finalFrame=_finalFrame; 112 110 113 - (void)windowDidLoad 111 114 { … … 239 242 240 243 [[self window] makeResponder:webWindowFirstResponder firstResponderIfDescendantOfView:_webView]; 241 244 245 _savedScale = [_webView _viewScaleFactor]; 246 [_webView _scaleWebView:1 atOrigin:NSMakePoint(0, 0)]; 242 247 [self _document]->webkitWillEnterFullScreenForElement(_element.get()); 243 248 [self _document]->setAnimatingFullScreen(true); … … 345 350 // Screen updates to be re-enabled at the end of this function 346 351 NSDisableScreenUpdates(); 347 352 348 353 [self _document]->setAnimatingFullScreen(false); 349 354 [self _document]->webkitDidExitFullScreenForElement(_element.get()); 350 355 [_webView _scaleWebView:_savedScale atOrigin:NSMakePoint(0, 0)]; 356 351 357 NSResponder *firstResponder = [[self window] firstResponder]; 352 358 [self _swapView:_webViewPlaceholder.get() with:_webView]; -
trunk/Source/WebKit/mac/WebView/WebView.mm
r180704 r180885 8435 8435 - (BOOL)_supportsFullScreenForElement:(const WebCore::Element*)element withKeyboard:(BOOL)withKeyboard 8436 8436 { 8437 if (![[ WebPreferences standardPreferences] fullScreenEnabled])8437 if (![[self preferences] fullScreenEnabled]) 8438 8438 return NO; 8439 8439 -
trunk/Source/WebKit2/ChangeLog
r180882 r180885 1 2015-03-02 Jer Noble <jer.noble@apple.com> 2 3 [WK1][WK2][Mac] Fullscreen animation is incorrect when page is scaled. 4 https://bugs.webkit.org/show_bug.cgi?id=142121 5 6 Reviewed by Simon Fraser. 7 8 Change the order of operations when entering or exiting fullscreen. Change the page scale to 9 1 before entering, so the final screen rect takes that scale into account, and vice-versa on 10 exiting. 11 12 * UIProcess/mac/WKFullScreenWindowController.mm: 13 (-[WKFullScreenWindowController enterFullScreen:]): 14 (-[WKFullScreenWindowController exitFullScreen]): 15 1 16 2015-03-01 Simon Fraser <simon.fraser@apple.com> 2 17 -
trunk/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.h
r177835 r180885 62 62 } 63 63 64 @property (readonly) NSRect initialFrame; 65 @property (readonly) NSRect finalFrame; 66 64 67 - (id)initWithWindow:(NSWindow *)window webView:(WKView *)webView; 65 68 -
trunk/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm
r173888 r180885 131 131 #pragma mark Accessors 132 132 133 @synthesize initialFrame=_initialFrame; 134 @synthesize finalFrame=_finalFrame; 135 133 136 - (BOOL)isFullScreen 134 137 { … … 250 253 makeResponderFirstResponderIfDescendantOfView(self.window, webWindowFirstResponder, _webView); 251 254 255 _savedScale = [self _page]->pageScaleFactor(); 256 [self _page]->scalePage(1, IntPoint()); 252 257 [self _manager]->setAnimatingFullScreen(true); 253 258 [self _manager]->willEnterFullScreen(); 254 _savedScale = [self _page]->pageScaleFactor();255 [self _page]->scalePage(1, IntPoint());256 259 } 257 260 … … 321 324 [[_webView window] makeKeyAndOrderFront:self]; 322 325 326 [self _page]->scalePage(_savedScale, IntPoint()); 327 [self _manager]->restoreScrollPosition(); 323 328 [self _manager]->didExitFullScreen(); 324 329 [self _manager]->setAnimatingFullScreen(false); 325 [self _page]->scalePage(_savedScale, IntPoint());326 [self _manager]->restoreScrollPosition();327 330 } 328 331 -
trunk/Tools/ChangeLog
r180866 r180885 1 2015-03-02 Jer Noble <jer.noble@apple.com> 2 3 [WK1][WK2][Mac] Fullscreen animation is incorrect when page is scaled. 4 https://bugs.webkit.org/show_bug.cgi?id=142121 5 6 Reviewed by Simon Fraser. 7 8 Add a test which changes the WebView's page scale, then enters fullscreen mode, and verifies 9 that the initial and final screen rects for the web content are as expected. 10 11 * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: 12 * TestWebKitAPI/Tests/mac/FullscreenZoomInitialFrame.html: Added. 13 * TestWebKitAPI/Tests/mac/FullscreenZoomInitialFrame.mm: Added. 14 (-[FullscreenStateDelegate webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:]): 15 (runJavaScriptAlert): 16 (TestWebKitAPI::FullscreenZoomInitialFrame::initializeView): 17 (TestWebKitAPI::FullscreenZoomInitialFrame::teardownView): 18 (TestWebKitAPI::FullscreenZoomInitialFrame::setPageScale): 19 (TestWebKitAPI::FullscreenZoomInitialFrame::sendMouseDownEvent): 20 (TestWebKitAPI::FullscreenZoomInitialFrame::runTest): 21 (TestWebKitAPI::TEST_F): 22 1 23 2015-03-01 David Kilzer <ddkilzer@apple.com> 2 24 -
trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
r180798 r180885 273 273 CD59F53419E9110D00CF1835 /* file-with-mse.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = CD59F53219E910AA00CF1835 /* file-with-mse.html */; }; 274 274 CD59F53519E9110D00CF1835 /* test-mse.mp4 in Copy Resources */ = {isa = PBXBuildFile; fileRef = CD59F53319E910BC00CF1835 /* test-mse.mp4 */; }; 275 CDBFCC451A9FF45300A7B691 /* FullscreenZoomInitialFrame.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDBFCC431A9FF44800A7B691 /* FullscreenZoomInitialFrame.mm */; }; 276 CDBFCC461A9FF49E00A7B691 /* FullscreenZoomInitialFrame.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = CDBFCC421A9FF44800A7B691 /* FullscreenZoomInitialFrame.html */; }; 275 277 CE14F1A4181873B0001C2705 /* WillPerformClientRedirectToURLCrash.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = CE14F1A2181873B0001C2705 /* WillPerformClientRedirectToURLCrash.html */; }; 276 278 CEA6CF2819CCF69D0064F5A7 /* open-and-close-window.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = CEA6CF2719CCF69D0064F5A7 /* open-and-close-window.html */; }; … … 342 344 C5101C4F176B8D9200EE9B15 /* findRanges.html in Copy Resources */, 343 345 1A7E8B3618120B2F00AEB74A /* FragmentNavigation.html in Copy Resources */, 346 CDBFCC461A9FF49E00A7B691 /* FullscreenZoomInitialFrame.html in Copy Resources */, 344 347 26F52EAD1828827B0023D412 /* geolocationGetCurrentPosition.html in Copy Resources */, 345 348 26F52EAF18288C230023D412 /* geolocationGetCurrentPositionWithHighAccuracy.html in Copy Resources */, … … 666 669 CD59F53219E910AA00CF1835 /* file-with-mse.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "file-with-mse.html"; sourceTree = "<group>"; }; 667 670 CD59F53319E910BC00CF1835 /* test-mse.mp4 */ = {isa = PBXFileReference; lastKnownFileType = file; path = "test-mse.mp4"; sourceTree = "<group>"; }; 671 CDBFCC421A9FF44800A7B691 /* FullscreenZoomInitialFrame.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = FullscreenZoomInitialFrame.html; sourceTree = "<group>"; }; 672 CDBFCC431A9FF44800A7B691 /* FullscreenZoomInitialFrame.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FullscreenZoomInitialFrame.mm; sourceTree = "<group>"; }; 668 673 CDC2C7141797089D00E627FB /* TimeRanges.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = TimeRanges.cpp; sourceTree = "<group>"; }; 669 674 CE14F1A2181873B0001C2705 /* WillPerformClientRedirectToURLCrash.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = WillPerformClientRedirectToURLCrash.html; sourceTree = "<group>"; }; … … 1145 1150 4BB4160316815F9100824238 /* ElementAtPointInWebFrame.mm */, 1146 1151 1A7E8B33181208DE00AEB74A /* FragmentNavigation.mm */, 1152 CDBFCC431A9FF44800A7B691 /* FullscreenZoomInitialFrame.mm */, 1147 1153 9B4F8FA3159D52B1002D9F94 /* HTMLCollectionNamedItem.mm */, 1148 1154 9B26FC6B159D061000CC3765 /* HTMLFormCollectionNamedItem.mm */, … … 1187 1193 37DC678F140D7D3A00ABCCDB /* DOMRangeOfString.html */, 1188 1194 1A7E8B351812093600AEB74A /* FragmentNavigation.html */, 1195 CDBFCC421A9FF44800A7B691 /* FullscreenZoomInitialFrame.html */, 1189 1196 9B4F8FA6159D52CA002D9F94 /* HTMLCollectionNamedItem.html */, 1190 1197 9B26FCB4159D15E700CC3765 /* HTMLFormCollectionNamedItem.html */, … … 1403 1410 7CCE7EF81A411AE600447C4C /* Geolocation.cpp in Sources */, 1404 1411 7CCE7EE11A411A9A00447C4C /* GetBackingScaleFactor.mm in Sources */, 1412 CDBFCC451A9FF45300A7B691 /* FullscreenZoomInitialFrame.mm in Sources */, 1405 1413 7CCE7EF91A411AE600447C4C /* GetInjectedBundleInitializationUserDataCallback.cpp in Sources */, 1406 1414 7CCE7EE21A411A9A00447C4C /* GetPIDAfterAbortedProcessLaunch.cpp in Sources */,
Note: See TracChangeset
for help on using the changeset viewer.