Changeset 38245 in webkit
- Timestamp:
- Nov 9, 2008 12:19:54 PM (15 years ago)
- Location:
- trunk/WebKit/mac
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit/mac/ChangeLog
r38235 r38245 1 2008-11-09 Darin Adler <darin@apple.com> 2 3 Reviewed by John Sullivan. 4 5 - fix https://bugs.webkit.org/show_bug.cgi?id=15063 6 <rdar://problem/5452227> REGRESSION (r25151): Switching to a tab waiting 7 for first data does not clear the window 8 9 * WebCoreSupport/WebFrameLoaderClient.mm: 10 (WebFrameLoaderClient::frameLoadCompleted): Added comments, and got rid of 11 a local variable to make this code match the code in the function below 12 more closely. 13 (WebFrameLoaderClient::provisionalLoadStarted): Added comments. 14 15 * WebView/WebFrame.mm: 16 (-[WebFrame _updateBackgroundAndUpdatesWhileOffscreen]): Improved comment. 17 18 * WebView/WebFrameView.mm: 19 (-[WebFrameView _scrollView]): Tweaked formatting. 20 (-[WebFrameView initWithFrame:]): Ditto. 21 (-[WebFrameView setFrameSize:]): Added a comment and tweaked formatting. 22 (-[WebFrameView viewDidMoveToWindow]): Added. This is the change that fixes 23 the bug. Calls setDrawsBackground:YES as appropriate since moving the view 24 out of the window to switch to another view disrupts the special technique 25 for showing the old page during the start of loading. This is the identical 26 reason for the setFrameSize: method above, and the code is almost the same. 27 1 28 2008-11-08 David Kilzer <ddkilzer@apple.com> 2 29 -
trunk/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
r38110 r38245 801 801 { 802 802 // Note: Can be called multiple times. 803 804 // See WebFrameLoaderClient::provisionalLoadStarted. 805 if ([getWebView(m_webFrame.get()) drawsBackground]) 806 [[m_webFrame->_private->webFrameView _scrollView] setDrawsBackground:YES]; 807 803 808 // Even if already complete, we might have set a previous item on a frame that 804 809 // didn't do any data loading on the past transaction. Make sure to clear these out. 805 NSScrollView *sv = [m_webFrame->_private->webFrameView _scrollView];806 if ([getWebView(m_webFrame.get()) drawsBackground])807 [sv setDrawsBackground:YES];808 810 core(m_webFrame.get())->loader()->setPreviousHistoryItem(0); 809 811 } … … 847 849 void WebFrameLoaderClient::provisionalLoadStarted() 848 850 { 849 // FIXME: This is OK as long as no one resizes the window, 850 // but in the case where someone does, it means garbage outside 851 // the occupied part of the scroll view. 851 // Tell the scroll view not to draw a background so we can leave the contents of 852 // the old page showing during the beginning of the loading process. 853 854 // This will stay set to NO until: 855 // 1) The load gets far enough along: WebFrameLoader::frameLoadCompleted. 856 // 2) The window is resized: -[WebFrameView setFrameSize:]. 857 // or 3) The view is moved out of the window: -[WebFrameView viewDidMoveToWindow]. 858 // Please keep the comments in these four functions in agreement with each other. 859 852 860 [[m_webFrame->_private->webFrameView _scrollView] setDrawsBackground:NO]; 853 861 } -
trunk/WebKit/mac/WebView/WebFrame.mm
r38235 r38245 374 374 for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame)) { 375 375 WebFrame *webFrame = kit(frame); 376 // Never call setDrawsBackground:YES here on the scroll view or the background color will377 // flash between pages loads. setDrawsBackground:YES will be called in _frameLoadCompleted.376 // Don't call setDrawsBackground:YES here because it may be NO because of a load 377 // in progress; WebFrameLoaderClient keeps it set to NO during the load process. 378 378 if (!drawsBackground) 379 379 [[[webFrame frameView] _scrollView] setDrawsBackground:NO]; -
trunk/WebKit/mac/WebView/WebFrameView.mm
r37371 r38245 190 190 - (WebDynamicScrollBarsView *)_scrollView 191 191 { 192 // this can be called by [super dealloc] when cleaning up the keyview loop,192 // This can be called by [super dealloc] when cleaning up the key view loop, 193 193 // after _private has been nilled out. 194 if (_private == nil) {194 if (_private == nil) 195 195 return nil; 196 }197 196 return _private->frameScrollView; 198 197 } … … 301 300 InitWebCoreSystemInterface(); 302 301 303 // Need to tell WebCore what function to call for the 304 // "History Item has Changed" notification 305 // Note: We also do this in WebHistoryItem's init method 302 // Need to tell WebCore what function to call for the "History Item has Changed" notification. 303 // Note: We also do this in WebHistoryItem's init method. 306 304 WebCore::notifyHistoryItemChanged = WKNotifyHistoryItemChanged; 307 305 … … 311 309 NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; 312 310 313 // CoreGraphics deferred updates are disabled if WebKitEnableCoalescedUpdatesPreferenceKey is set 314 // to NO, or has no value. For compatibility with Mac OS X 10.4.6, deferred updates are OFF by 315 // default. 311 // CoreGraphics deferred updates are disabled if WebKitEnableCoalescedUpdatesPreferenceKey is NO 312 // or has no value. For compatibility with Mac OS X 10.4.6, deferred updates are off by default. 316 313 if (![defaults boolForKey:WebKitEnableDeferredUpdatesPreferenceKey]) 317 314 WKDisableCGDeferredUpdates(); … … 323 320 _private = [[WebFrameViewPrivate alloc] init]; 324 321 325 WebDynamicScrollBarsView *scrollView 322 WebDynamicScrollBarsView *scrollView = [[WebDynamicScrollBarsView alloc] initWithFrame:NSMakeRect(0.0f, 0.0f, frame.size.width, frame.size.height)]; 326 323 _private->frameScrollView = scrollView; 327 324 [scrollView setContentView:[[[WebClipView alloc] initWithFrame:[scrollView bounds]] autorelease]]; … … 332 329 [scrollView setLineScroll:40.0f]; 333 330 [self addSubview:scrollView]; 334 // don't call our overridden version here; we need to make the standard NSView link between us 335 // and our subview so that previousKeyView and previousValidKeyView work as expected. This works 336 // together with our becomeFirstResponder and setNextKeyView overrides. 331 332 // Don't call our overridden version of setNextKeyView here; we need to make the standard NSView 333 // link between us and our subview so that previousKeyView and previousValidKeyView work as expected. 334 // This works together with our becomeFirstResponder and setNextKeyView overrides. 337 335 [super setNextKeyView:scrollView]; 338 336 … … 492 490 - (void)setFrameSize:(NSSize)size 493 491 { 494 if (!NSEqualSizes(size, [self frame].size) && [[[self webFrame] webView] drawsBackground]) { 492 // See WebFrameLoaderClient::provisionalLoadStarted. 493 if (!NSEqualSizes(size, [self frame].size) && [[[self webFrame] webView] drawsBackground]) 495 494 [[self _scrollView] setDrawsBackground:YES]; 496 }497 495 [super setFrameSize:size]; 496 } 497 498 - (void)viewDidMoveToWindow 499 { 500 // See WebFrameLoaderClient::provisionalLoadStarted. 501 if ([[[self webFrame] webView] drawsBackground]) 502 [[self _scrollView] setDrawsBackground:YES]; 503 [super viewDidMoveToWindow]; 498 504 } 499 505
Note: See TracChangeset
for help on using the changeset viewer.