+2007-10-17 Darin Adler <darin@apple.com>
+
+ Reviewed by Mark Rowe.
+
+ - fix <rdar://problem/5183775> Uninitialized memory in -[WebDynamicScrollBarsView updateScrollers]
+
+ * WebView/WebDynamicScrollBarsView.m: (-[WebDynamicScrollBarsView updateScrollers]):
+ Change code path so it doesn't dispatch a method that returns an NSSize passing a nil object.
+ It's safe to do that for functions that return integers or pointers, but not structures.
+
2007-10-16 David Kilzer <ddkilzer@apple.com>
Reviewed by Timothy.
- <rdar://problem/5544354> Wrong delegate method called in WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad()
+ <rdar://problem/5544354> Wrong delegate method called in
+ WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad()
* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad): Fixed selector name.
// Do a layout if pending, before checking if scrollbars are needed.
// This fixes 2969367, although may introduce a slowdown in live resize performance.
NSView *documentView = [self documentView];
- if ((hasVerticalScroller != oldHasVertical ||
- hasHorizontalScroller != oldHasHorizontal || [documentView inLiveResize]) && [documentView conformsToProtocol:@protocol(WebDocumentView)]) {
- [(id <WebDocumentView>)documentView setNeedsLayout: YES];
- [(id <WebDocumentView>)documentView layout];
- }
-
- NSSize documentSize = [documentView frame].size;
- NSSize frameSize = [self frame].size;
-
- scrollsVertically = (vScroll == WebCoreScrollbarAlwaysOn) ||
- (vScroll == WebCoreScrollbarAuto && documentSize.height > frameSize.height);
- if (scrollsVertically)
- scrollsHorizontally = (hScroll == WebCoreScrollbarAlwaysOn) ||
- (hScroll == WebCoreScrollbarAuto && documentSize.width + [NSScroller scrollerWidth] > frameSize.width);
- else {
- scrollsHorizontally = (hScroll == WebCoreScrollbarAlwaysOn) ||
- (hScroll == WebCoreScrollbarAuto && documentSize.width > frameSize.width);
- if (scrollsHorizontally)
- scrollsVertically = (vScroll == WebCoreScrollbarAlwaysOn) ||
- (vScroll == WebCoreScrollbarAuto && documentSize.height + [NSScroller scrollerWidth] > frameSize.height);
+ if (!documentView) {
+ scrollsHorizontally = NO;
+ scrollsVertically = NO;
+ } else {
+ if ((hasVerticalScroller != oldHasVertical ||
+ hasHorizontalScroller != oldHasHorizontal || [documentView inLiveResize]) && [documentView conformsToProtocol:@protocol(WebDocumentView)]) {
+ [(id <WebDocumentView>)documentView setNeedsLayout: YES];
+ [(id <WebDocumentView>)documentView layout];
+ }
+
+ NSSize documentSize = [documentView frame].size;
+ NSSize frameSize = [self frame].size;
+
+ scrollsVertically = (vScroll == WebCoreScrollbarAlwaysOn) ||
+ (vScroll == WebCoreScrollbarAuto && documentSize.height > frameSize.height);
+ if (scrollsVertically)
+ scrollsHorizontally = (hScroll == WebCoreScrollbarAlwaysOn) ||
+ (hScroll == WebCoreScrollbarAuto && documentSize.width + [NSScroller scrollerWidth] > frameSize.width);
+ else {
+ scrollsHorizontally = (hScroll == WebCoreScrollbarAlwaysOn) ||
+ (hScroll == WebCoreScrollbarAuto && documentSize.width > frameSize.width);
+ if (scrollsHorizontally)
+ scrollsVertically = (vScroll == WebCoreScrollbarAlwaysOn) ||
+ (vScroll == WebCoreScrollbarAuto && documentSize.height + [NSScroller scrollerWidth] > frameSize.height);
+ }
}
} else {
scrollsHorizontally = (hScroll == WebCoreScrollbarAuto) ? hasHorizontalScroller : (hScroll == WebCoreScrollbarAlwaysOn);