Changeset 21618 in webkit
- Timestamp:
- May 21, 2007, 4:04:51 AM (17 years ago)
- Location:
- trunk/WebKit
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit/ChangeLog
r21596 r21618 1 2007-05-19 Maciej Stachowiak <mjs@apple.com> 2 3 Reviewed by Geoff. 4 5 <rdar://problem/5205358> REGRESSION (r21367): All messages appear entirely blank when running Mail off of tip of tree WebKit 6 7 The fix is to return nil from [WebFrame dataSource] when it has not loaded anything but the fake 8 empty initial document. However, WebKit still needs the real data source internally, so I also 9 added a [WebFrame _dataSource] method that skips this check, and made WebKit use it throughout. 10 11 * Misc/WebNSAttributedStringExtras.mm: 12 (fileWrapperForElement): 13 * Plugins/WebBaseNetscapePluginView.mm: 14 (-[WebBaseNetscapePluginView dataSource]): 15 * Plugins/WebNullPluginView.mm: 16 (-[WebNullPluginView viewDidMoveToWindow]): 17 * Plugins/WebPluginController.mm: 18 (-[WebPluginController URLPolicyCheckReferrer]): 19 * WebCoreSupport/WebFrameBridge.mm: 20 (-[WebFrameBridge dataSource]): 21 (-[WebFrameBridge redirectDataToPlugin:]): 22 * WebCoreSupport/WebFrameLoaderClient.mm: 23 (WebFrameLoaderClient::makeDocumentView): 24 (WebFrameLoaderClient::forceLayoutForNonHTML): 25 (WebFrameLoaderClient::prepareForDataSourceReplacement): 26 (WebFrameLoaderClient::canCachePage): 27 * WebCoreSupport/WebViewFactory.mm: 28 (-[WebViewFactory bridgeForView:]): 29 * WebKit.xcodeproj/project.pbxproj: 30 * WebView/WebArchiver.mm: 31 (+[WebArchiver archiveFrame:]): 32 (+[WebArchiver archiveMainResourceForFrame:]): 33 (+[WebArchiver _archiveWithMarkupString:fromFrame:nodes:]): 34 (+[WebArchiver archiveSelectionInFrame:]): 35 * WebView/WebFrame.mm: 36 (-[WebFrame _loadURL:referrer:intoChild:]): 37 (-[WebFrame _addChild:]): 38 (-[WebFrame _dataSource]): 39 (-[WebFrame DOMDocument]): 40 (-[WebFrame dataSource]): 41 * WebView/WebFrameInternal.h: 42 * WebView/WebHTMLView.mm: 43 (-[WebHTMLView _setPrinting:minimumPageWidth:maximumPageWidth:adjustViewSize:]): 44 * WebView/WebRenderNode.mm: 45 (-[WebRenderNode initWithWebFrameView:]): 46 * WebView/WebView.mm: 47 (-[WebView _mainFrameOverrideEncoding]): 48 (-[WebView mainFrameURL]): 49 (-[WebView mainFrameTitle]): 50 (-[WebView mainFrameIcon]): 51 (-[WebView validateUserInterfaceItemWithoutDelegate:]): 52 (-[WebView replaceSelectionWithArchive:]): 53 (-[WebView _isLoading]): 54 (-[WebView _performTextSizingSelector:withObject:onTrackingDocs:selForNonTrackingDocs:newScaleFactor:]): 55 (-[WebView _notifyTextSizeMultiplierChanged]): 56 1 57 2007-05-18 Oliver Hunt <oliver@apple.com> 2 58 -
trunk/WebKit/Misc/WebNSAttributedStringExtras.mm
r20930 r21618 95 95 if (!attr.isEmpty()) { 96 96 NSURL *URL = KURL(e->document()->completeURL(attr.deprecatedString())).getNSURL(); 97 wrapper = [[kit(e->document()->frame()) dataSource] _fileWrapperForURL:URL];97 wrapper = [[kit(e->document()->frame()) _dataSource] _fileWrapperForURL:URL]; 98 98 } 99 99 if (!wrapper) { -
trunk/WebKit/Plugins/WebBaseNetscapePluginView.mm
r21500 r21618 1448 1448 { 1449 1449 WebFrame *webFrame = kit(core(element)->document()->frame()); 1450 return [webFrame dataSource];1450 return [webFrame _dataSource]; 1451 1451 } 1452 1452 -
trunk/WebKit/Plugins/WebNullPluginView.mm
r21159 r21618 76 76 WebFrame *webFrame = kit(core(element)->document()->frame()); 77 77 WebView *webView = [webFrame webView]; 78 WebDataSource *dataSource = [webFrame dataSource];78 WebDataSource *dataSource = [webFrame _dataSource]; 79 79 80 80 id resourceLoadDelegate = [webView resourceLoadDelegate]; -
trunk/WebKit/Plugins/WebPluginController.mm
r20104 r21618 380 380 - (NSString *)URLPolicyCheckReferrer 381 381 { 382 NSURL *responseURL = [[[[self webFrame] dataSource] response] URL];382 NSURL *responseURL = [[[[self webFrame] _dataSource] response] URL]; 383 383 ASSERT(responseURL); 384 384 return [responseURL _web_originalDataAsString]; -
trunk/WebKit/WebCoreSupport/WebFrameBridge.mm
r21503 r21618 322 322 { 323 323 ASSERT(_frame != nil); 324 WebDataSource *dataSource = [_frame dataSource];324 WebDataSource *dataSource = [_frame _dataSource]; 325 325 326 326 ASSERT(dataSource != nil); … … 531 531 - (void)redirectDataToPlugin:(NSView *)pluginView 532 532 { 533 WebHTMLRepresentation *representation = (WebHTMLRepresentation *)[[_frame dataSource] representation];533 WebHTMLRepresentation *representation = (WebHTMLRepresentation *)[[_frame _dataSource] representation]; 534 534 535 535 if ([pluginView isKindOfClass:[WebNetscapePluginEmbeddedView class]]) -
trunk/WebKit/WebCoreSupport/WebFrameLoaderClient.mm
r21582 r21618 160 160 { 161 161 WebFrameView *v = m_webFrame->_private->webFrameView; 162 WebDataSource *ds = [m_webFrame.get() dataSource];162 WebDataSource *ds = [m_webFrame.get() _dataSource]; 163 163 164 164 NSView <WebDocumentView> *documentView = [v _makeDocumentViewForDataSource:ds]; … … 211 211 // Tell the just loaded document to layout. This may be necessary 212 212 // for non-html content that needs a layout message. 213 if (!([[m_webFrame.get() dataSource] _isDocumentHTML])) {213 if (!([[m_webFrame.get() _dataSource] _isDocumentHTML])) { 214 214 [thisDocumentView setNeedsLayout:YES]; 215 215 [thisDocumentView layout]; … … 955 955 void WebFrameLoaderClient::prepareForDataSourceReplacement() 956 956 { 957 if (![m_webFrame.get() dataSource]) {957 if (![m_webFrame.get() _dataSource]) { 958 958 ASSERT(!core(m_webFrame.get())->tree()->childCount()); 959 959 return; … … 1148 1148 { 1149 1149 // We can only cache HTML pages right now 1150 return [[[m_webFrame.get() dataSource] representation] isKindOfClass:[WebHTMLRepresentation class]];1150 return [[[m_webFrame.get() _dataSource] representation] isKindOfClass:[WebHTMLRepresentation class]]; 1151 1151 } 1152 1152 -
trunk/WebKit/WebCoreSupport/WebViewFactory.mm
r19919 r21618 91 91 while (aView) { 92 92 if ([aView isKindOfClass:[WebHTMLView class]]) { 93 return [[[(WebHTMLView *)aView _frame] dataSource] _bridge];93 return [[[(WebHTMLView *)aView _frame] _dataSource] _bridge]; 94 94 } 95 95 aView = [aView superview]; -
trunk/WebKit/WebKit.xcodeproj/project.pbxproj
r21596 r21618 1318 1318 isa = PBXProject; 1319 1319 buildConfigurationList = 149C283208902B0F008A9EFC /* Build configuration list for PBXProject "WebKit" */; 1320 compatibilityVersion = "Xcode 2.4"; 1320 1321 hasScannedForEncodings = 1; 1321 1322 knownRegions = ( … … 1332 1333 projectDirPath = ""; 1333 1334 projectRoot = ""; 1335 shouldCheckCompatibility = 1; 1334 1336 targets = ( 1335 1337 9398100A0824BF01008DF038 /* WebKit */, -
trunk/WebKit/WebView/WebArchiver.mm
r20018 r21618 62 62 + (WebArchive *)archiveFrame:(WebFrame *)frame; 63 63 { 64 return [[[WebArchive alloc] initWithMainResource:[[frame dataSource] mainResource]65 subresources:[[frame dataSource] subresources]64 return [[[WebArchive alloc] initWithMainResource:[[frame _dataSource] mainResource] 65 subresources:[[frame _dataSource] subresources] 66 66 subframeArchives:[self _subframeArchivesForFrame:frame]] autorelease]; 67 67 } … … 69 69 + (WebArchive *)archiveMainResourceForFrame:(WebFrame *)frame; 70 70 { 71 return [[[WebArchive alloc] initWithMainResource:[[frame dataSource] mainResource]71 return [[[WebArchive alloc] initWithMainResource:[[frame _dataSource] mainResource] 72 72 subresources:nil 73 73 subframeArchives:nil] autorelease]; … … 84 84 + (WebArchive *)_archiveWithMarkupString:(NSString *)markupString fromFrame:(WebFrame *)frame nodes:(NSArray *)nodes 85 85 { 86 NSURLResponse *response = [[frame dataSource] response];86 NSURLResponse *response = [[frame _dataSource] response]; 87 87 WebResource *mainResource = [[WebResource alloc] initWithData:[markupString dataUsingEncoding:NSUTF8StringEncoding] 88 88 URL:[response URL] … … 110 110 continue; 111 111 [uniqueSubresources addObject:URL]; 112 WebResource *subresource = [[frame dataSource] subresourceForURL:URL];112 WebResource *subresource = [[frame _dataSource] subresourceForURL:URL]; 113 113 if (subresource) 114 114 [subresources addObject:subresource]; … … 162 162 // another document (which will have a body or frameset of its own). 163 163 164 NSString *iframeMarkup = [[NSString alloc] initWithFormat:@"<iframe frameborder=\"no\" marginwidth=\"0\" marginheight=\"0\" width=\"98%%\" height=\"98%%\" src=\"%@\"></iframe>", [[[frame dataSource] response] URL]];164 NSString *iframeMarkup = [[NSString alloc] initWithFormat:@"<iframe frameborder=\"no\" marginwidth=\"0\" marginheight=\"0\" width=\"98%%\" height=\"98%%\" src=\"%@\"></iframe>", [[[frame _dataSource] response] URL]]; 165 165 WebResource *iframeResource = [[WebResource alloc] initWithData:[iframeMarkup dataUsingEncoding:NSUTF8StringEncoding] 166 166 URL:[NSURL URLWithString:@"about:blank"] -
trunk/WebKit/WebView/WebFrame.mm
r21529 r21618 321 321 } 322 322 323 WebArchive *archive = [[self dataSource] _popSubframeArchiveWithName:[childFrame name]];323 WebArchive *archive = [[self _dataSource] _popSubframeArchiveWithName:[childFrame name]]; 324 324 if (archive) 325 325 [childFrame loadArchive:archive]; … … 347 347 { 348 348 core(self)->tree()->appendChild(adoptRef(core(child))); 349 if ([child dataSource])350 [[child dataSource] _documentLoader]->setOverrideEncoding([[selfdataSource] _documentLoader]->overrideEncoding());349 if ([child _dataSource]) 350 [[child _dataSource] _documentLoader]->setOverrideEncoding([[self _dataSource] _documentLoader]->overrideEncoding()); 351 351 } 352 352 … … 575 575 } 576 576 577 - (WebDataSource *)_dataSource 578 { 579 FrameLoader* frameLoader = [self _frameLoader]; 580 581 if (!frameLoader) 582 return nil; 583 584 return dataSource(frameLoader->documentLoader()); 585 } 586 577 587 @end 578 588 … … 736 746 // into a web frame, the old document can still be around. This makes sure that 737 747 // we'll return nil in those cases. 738 if (![[self dataSource] _isDocumentHTML])748 if (![[self _dataSource] _isDocumentHTML]) 739 749 return nil; 740 750 … … 766 776 - (WebDataSource *)dataSource 767 777 { 768 FrameLoader* frameLoader = [self _frameLoader]; 769 return frameLoader ? dataSource(frameLoader->documentLoader()) : nil; 778 if (![self _frameLoader]->frameHasLoaded()) 779 return nil; 780 781 return [self _dataSource]; 770 782 } 771 783 -
trunk/WebKit/WebView/WebFrameInternal.h
r20179 r21618 165 165 - (void)_detachScriptDebugger; 166 166 167 // dataSource reports null for the initial empty document's data source; this is needed 168 // to preserve compatibility with Mail and Safari among others. But internal to WebKit, 169 // we need to be able to get the initial data source as well, so the _dataSource method 170 // should be used instead. 171 - (WebDataSource *)_dataSource; 172 167 173 @end 168 174 -
trunk/WebKit/WebView/WebHTMLView.mm
r21596 r21618 3088 3088 WebFrame *subframe = [subframes objectAtIndex:i]; 3089 3089 WebFrameView *frameView = [subframe frameView]; 3090 if ([[subframe dataSource] _isDocumentHTML]) {3090 if ([[subframe _dataSource] _isDocumentHTML]) { 3091 3091 [(WebHTMLView *)[frameView documentView] _setPrinting:printing minimumPageWidth:0.0f maximumPageWidth:0.0f adjustViewSize:adjustViewSize]; 3092 3092 } -
trunk/WebKit/WebView/WebRenderNode.mm
r18725 r21618 34 34 #import <WebKit/WebDataSourceInternal.h> 35 35 #import <WebKit/WebNSViewExtras.h> 36 #import "WebFrameInternal.h" 36 37 37 38 @interface WebKitRenderTreeCopier : NSObject <WebCoreRenderTreeCopier> … … 82 83 83 84 copier = [[WebKitRenderTreeCopier alloc] init]; 84 self = [[[[[view webFrame] dataSource] _bridge] copyRenderTree:copier] retain];85 self = [[[[[view webFrame] _dataSource] _bridge] copyRenderTree:copier] retain]; 85 86 [copier release]; 86 87 -
trunk/WebKit/WebView/WebView.mm
r21533 r21618 2164 2164 WebDataSource *dataSource = [[self mainFrame] provisionalDataSource]; 2165 2165 if (dataSource == nil) 2166 dataSource = [[self mainFrame] dataSource];2166 dataSource = [[self mainFrame] _dataSource]; 2167 2167 if (dataSource == nil) 2168 2168 return nil; … … 2488 2488 ds = [[self mainFrame] provisionalDataSource]; 2489 2489 if (!ds) 2490 ds = [[self mainFrame] dataSource];2490 ds = [[self mainFrame] _dataSource]; 2491 2491 return [[[ds request] URL] _web_originalDataAsString]; 2492 2492 } … … 2500 2500 - (NSString *)mainFrameTitle 2501 2501 { 2502 NSString *mainFrameTitle = [[[self mainFrame] dataSource] pageTitle];2502 NSString *mainFrameTitle = [[[self mainFrame] _dataSource] pageTitle]; 2503 2503 return (mainFrameTitle != nil) ? mainFrameTitle : (NSString *)@""; 2504 2504 } … … 2506 2506 - (NSImage *)mainFrameIcon 2507 2507 { 2508 return [[WebIconDatabase sharedIconDatabase] iconForURL:[[[[self mainFrame] dataSource] _URL] _web_originalDataAsString] withSize:WebIconSmallSize];2508 return [[WebIconDatabase sharedIconDatabase] iconForURL:[[[[self mainFrame] _dataSource] _URL] _web_originalDataAsString] withSize:WebIconSmallSize]; 2509 2509 } 2510 2510 … … 2684 2684 return [self canMakeTextStandardSize]; 2685 2685 } else if (action == @selector(reload:)) { 2686 return [[self mainFrame] dataSource] != nil;2686 return [[self mainFrame] _dataSource] != nil; 2687 2687 } else if (action == @selector(stopLoading:)) { 2688 2688 return [self _isLoading]; … … 3371 3371 - (void)replaceSelectionWithArchive:(WebArchive *)archive 3372 3372 { 3373 [[[[self _bridgeForSelectedOrMainFrame] webFrame] dataSource] _replaceSelectionWithArchive:archive selectReplacement:YES];3373 [[[[self _bridgeForSelectedOrMainFrame] webFrame] _dataSource] _replaceSelectionWithArchive:archive selectReplacement:YES]; 3374 3374 } 3375 3375 … … 3495 3495 { 3496 3496 WebFrame *mainFrame = [self mainFrame]; 3497 return [[mainFrame dataSource] isLoading]3497 return [[mainFrame _dataSource] isLoading] 3498 3498 || [[mainFrame provisionalDataSource] isLoading]; 3499 3499 } … … 3609 3609 - (BOOL)_performTextSizingSelector:(SEL)sel withObject:(id)arg onTrackingDocs:(BOOL)doTrackingViews selForNonTrackingDocs:(SEL)testSel newScaleFactor:(float)newScaleFactor 3610 3610 { 3611 if ([[self mainFrame] dataSource] == nil)3611 if ([[self mainFrame] _dataSource] == nil) 3612 3612 return NO; 3613 3613 … … 3645 3645 - (void)_notifyTextSizeMultiplierChanged 3646 3646 { 3647 if ([[self mainFrame] dataSource] == nil)3647 if ([[self mainFrame] _dataSource] == nil) 3648 3648 return; 3649 3649
Note:
See TracChangeset
for help on using the changeset viewer.