Fix for http://bugs.webkit.org/show_bug.cgi?id=15098
<rdar://problem/
5440319> REGRESSION (9A530-9A534): Double scroll bar on pdfs
* WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::makeDocumentView):
Don't suppress scrollbars before the view creation if we're making the view for a non-html view
* WebView/WebFrameViewInternal.h: Make _scrollView return a WebDynamicScrollBarsView since so many clients were relying on it being that type anyway.
* WebView/WebFrameView.mm:
(-[WebFrameView _setDocumentView:]):
(-[WebFrameView _scrollView]):
(-[WebFrameView setAllowsScrolling:]):
(-[WebFrameView allowsScrolling]):
* WebView/WebView.mm:
(-[WebView setAlwaysShowVerticalScroller:]):
(-[WebView alwaysShowVerticalScroller]):
(-[WebView setAlwaysShowHorizontalScroller:]):
(-[WebView alwaysShowHorizontalScroller]):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@25307
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2007-08-29 Adele Peterson <adele@apple.com>
+
+ Reviewed by Darin.
+
+ Fix for http://bugs.webkit.org/show_bug.cgi?id=15098
+ <rdar://problem/5440319> REGRESSION (9A530-9A534): Double scroll bar on pdfs
+
+ * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::makeDocumentView):
+ Don't suppress scrollbars before the view creation if we're making the view for a non-html view
+
+ * WebView/WebFrameViewInternal.h: Make _scrollView return a WebDynamicScrollBarsView since so many clients were relying on it being that type anyway.
+ * WebView/WebFrameView.mm:
+ (-[WebFrameView _setDocumentView:]):
+ (-[WebFrameView _scrollView]):
+ (-[WebFrameView setAllowsScrolling:]):
+ (-[WebFrameView allowsScrolling]):
+ * WebView/WebView.mm:
+ (-[WebView setAlwaysShowVerticalScroller:]):
+ (-[WebView alwaysShowVerticalScroller]):
+ (-[WebView setAlwaysShowHorizontalScroller:]):
+ (-[WebView alwaysShowHorizontalScroller]):
+
2007-08-29 David Hyatt <hyatt@apple.com>
The method that was swizzled to fix 5441281 does not exist on Tiger.
#import "WebDocumentInternal.h"
#import "WebDocumentLoaderMac.h"
#import "WebDownloadInternal.h"
+#import "WebDynamicScrollBarsView.h"
#import "WebElementDictionary.h"
#import "WebFormDelegate.h"
#import "WebFrameBridge.h"
WebFrameView *v = m_webFrame->_private->webFrameView;
WebDataSource *ds = [m_webFrame.get() _dataSource];
- bool canSkipCreation = [m_webFrame.get() _frameLoader]->committingFirstRealLoad() && [[WebFrameView class] _viewClassForMIMEType:[[ds response] MIMEType]] == [WebHTMLView class];
+ bool willProduceHTMLView = [[WebFrameView class] _viewClassForMIMEType:[[ds response] MIMEType]] == [WebHTMLView class];
+ bool canSkipCreation = [m_webFrame.get() _frameLoader]->committingFirstRealLoad() && willProduceHTMLView;
if (canSkipCreation) {
[[v documentView] setDataSource:ds];
return;
}
+ // Don't suppress scrollbars before the view creation if we're making the view for a non-HTML view.
+ if (!willProduceHTMLView)
+ [[v _scrollView] setScrollBarsSuppressed:NO repaintOnUnsuppress:NO];
+
NSView <WebDocumentView> *documentView = [v _makeDocumentViewForDataSource:ds];
if (!documentView)
return;
- (void)_setDocumentView:(NSView <WebDocumentView> *)view
{
- WebDynamicScrollBarsView *sv = (WebDynamicScrollBarsView *)[self _scrollView];
+ WebDynamicScrollBarsView *sv = [self _scrollView];
core([self _webView])->dragController()->setDidInitiateDrag(false);
[sv setSuppressLayout:YES];
_private->webFrame = webFrame;
}
-- (NSScrollView *)_scrollView
+- (WebDynamicScrollBarsView *)_scrollView
{
// this can be called by [super dealloc] when cleaning up the keyview loop,
// after _private has been nilled out.
- (void)setAllowsScrolling:(BOOL)flag
{
- WebDynamicScrollBarsView *scrollView = (WebDynamicScrollBarsView *)[self _scrollView];
+ WebDynamicScrollBarsView *scrollView = [self _scrollView];
[scrollView setAllowsScrolling:flag];
WebCore::Frame *frame = core([self webFrame]);
if (WebCore::FrameView *view = frame? frame->view() : 0) {
- (BOOL)allowsScrolling
{
- return [(WebDynamicScrollBarsView *)[self _scrollView] allowsScrolling];
+ return [[self _scrollView] allowsScrolling];
}
- (NSView <WebDocumentView> *)documentView
#import <WebKit/WebFrameView.h>
+@class WebDynamicScrollBarsView;
@class WebView;
@interface WebFrameView (WebInternal)
+ (NSMutableDictionary *)_viewTypesAllowImageTypeOmission:(BOOL)allowImageTypeOmission;
+ (Class)_viewClassForMIMEType:(NSString *)MIMEType;
+ (BOOL)_canShowMIMETypeAsHTML:(NSString *)MIMEType;
-- (NSScrollView *)_scrollView;
+- (WebDynamicScrollBarsView *)_scrollView;
@end
- (void)setAlwaysShowVerticalScroller:(BOOL)flag
{
- WebDynamicScrollBarsView *scrollview = (WebDynamicScrollBarsView *)[[[self mainFrame] frameView] _scrollView];
+ WebDynamicScrollBarsView *scrollview = [[[self mainFrame] frameView] _scrollView];
if (flag) {
[scrollview setVerticalScrollingMode:WebCoreScrollbarAlwaysOn andLock:YES];
} else {
- (BOOL)alwaysShowVerticalScroller
{
- WebDynamicScrollBarsView *scrollview = (WebDynamicScrollBarsView *)[[[self mainFrame] frameView] _scrollView];
+ WebDynamicScrollBarsView *scrollview = [[[self mainFrame] frameView] _scrollView];
return [scrollview verticalScrollingModeLocked] && [scrollview verticalScrollingMode] == WebCoreScrollbarAlwaysOn;
}
- (void)setAlwaysShowHorizontalScroller:(BOOL)flag
{
- WebDynamicScrollBarsView *scrollview = (WebDynamicScrollBarsView *)[[[self mainFrame] frameView] _scrollView];
+ WebDynamicScrollBarsView *scrollview = [[[self mainFrame] frameView] _scrollView];
if (flag) {
[scrollview setHorizontalScrollingMode:WebCoreScrollbarAlwaysOn andLock:YES];
} else {
- (BOOL)alwaysShowHorizontalScroller
{
- WebDynamicScrollBarsView *scrollview = (WebDynamicScrollBarsView *)[[[self mainFrame] frameView] _scrollView];
+ WebDynamicScrollBarsView *scrollview = [[[self mainFrame] frameView] _scrollView];
return [scrollview horizontalScrollingModeLocked] && [scrollview horizontalScrollingMode] == WebCoreScrollbarAlwaysOn;
}