Changeset 95459 in webkit
- Timestamp:
- Sep 19, 2011 1:07:46 PM (13 years ago)
- Location:
- trunk/Source/WebKit/mac
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/mac/ChangeLog
r95458 r95459 1 2011-09-19 Anders Carlsson <andersca@apple.com> 2 3 Remove calls to -[WebView _usesDocumentViews] from WebFrameLoaderClient.mm 4 https://bugs.webkit.org/show_bug.cgi?id=68379 5 6 Reviewed by Adam Roben. 7 8 Remove checks and begin assuming that -[WebView _usesDocumentViews] always 9 returns true, since viewless WebKit1 has been abandoned. 10 11 * WebCoreSupport/WebFrameLoaderClient.mm: 12 (WebFrameLoaderClient::hasHTMLView): 13 (WebFrameLoaderClient::dispatchDidCommitLoad): 14 (WebFrameLoaderClient::transitionToCommittedForNewPage): 15 (WebFrameLoaderClient::createFrame): 16 * WebView/WebFrame.mm: 17 (-[WebFrame _updateBackgroundAndUpdatesWhileOffscreen]): 18 (-[WebFrame _hasSelection]): 19 (-[WebFrame _clearSelection]): 20 (-[WebFrame _shouldFlattenCompositingLayers:]): 21 (-[WebFrame _dragSourceEndedAt:operation:]): 22 (-[WebFrame frameView]): 23 1 24 2011-09-19 Anders Carlsson <andersca@apple.com> 2 25 -
trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
r95387 r95459 234 234 bool WebFrameLoaderClient::hasHTMLView() const 235 235 { 236 if (![getWebView(m_webFrame.get()) _usesDocumentViews]) {237 // FIXME (Viewless): For now we just assume that all frames have an HTML view238 return true;239 }240 241 236 NSView <WebDocumentView> *view = [m_webFrame->_private->webFrameView documentView]; 242 237 return [view isKindOfClass:[WebHTMLView class]]; … … 659 654 { 660 655 // Tell the client we've committed this URL. 661 ASSERT([m_webFrame->_private->webFrameView documentView] != nil || ![getWebView(m_webFrame.get()) _usesDocumentViews]);656 ASSERT([m_webFrame->_private->webFrameView documentView] != nil); 662 657 663 658 WebView *webView = getWebView(m_webFrame.get()); … … 1234 1229 WebView *webView = getWebView(m_webFrame.get()); 1235 1230 WebDataSource *dataSource = [m_webFrame.get() _dataSource]; 1236 bool usesDocumentViews = [webView _usesDocumentViews]; 1237 1238 if (usesDocumentViews) { 1239 // FIXME (Viewless): I assume we want the equivalent of this optimization for viewless mode too. 1240 bool willProduceHTMLView = [m_webFrame->_private->webFrameView _viewClassForMIMEType:[dataSource _responseMIMEType]] == [WebHTMLView class]; 1241 bool canSkipCreation = core(m_webFrame.get())->loader()->stateMachine()->committingFirstRealLoad() && willProduceHTMLView; 1242 if (canSkipCreation) { 1243 [[m_webFrame->_private->webFrameView documentView] setDataSource:dataSource]; 1244 return; 1245 } 1246 1247 // Don't suppress scrollbars before the view creation if we're making the view for a non-HTML view. 1248 if (!willProduceHTMLView) 1249 [[m_webFrame->_private->webFrameView _scrollView] setScrollBarsSuppressed:NO repaintOnUnsuppress:NO]; 1250 } 1231 1232 bool willProduceHTMLView = [m_webFrame->_private->webFrameView _viewClassForMIMEType:[dataSource _responseMIMEType]] == [WebHTMLView class]; 1233 bool canSkipCreation = core(m_webFrame.get())->loader()->stateMachine()->committingFirstRealLoad() && willProduceHTMLView; 1234 if (canSkipCreation) { 1235 [[m_webFrame->_private->webFrameView documentView] setDataSource:dataSource]; 1236 return; 1237 } 1238 1239 // Don't suppress scrollbars before the view creation if we're making the view for a non-HTML view. 1240 if (!willProduceHTMLView) 1241 [[m_webFrame->_private->webFrameView _scrollView] setScrollBarsSuppressed:NO repaintOnUnsuppress:NO]; 1251 1242 1252 1243 // clean up webkit plugin instances before WebHTMLView gets freed. 1253 1244 [webView removePluginInstanceViewsFor:(m_webFrame.get())]; 1254 1245 1255 NSView <WebDocumentView> *documentView = nil; 1256 if (usesDocumentViews) { 1257 documentView = [m_webFrame->_private->webFrameView _makeDocumentViewForDataSource:dataSource]; 1258 if (!documentView) 1259 return; 1260 } 1246 NSView <WebDocumentView> *documentView = [m_webFrame->_private->webFrameView _makeDocumentViewForDataSource:dataSource]; 1247 if (!documentView) 1248 return; 1261 1249 1262 1250 // FIXME: Could we skip some of this work for a top-level view that is not a WebHTMLView? … … 1269 1257 coreFrame->view()->setParentVisible(false); 1270 1258 coreFrame->setView(0); 1271 RefPtr<FrameView> coreView; 1272 if (usesDocumentViews) 1273 coreView = FrameView::create(coreFrame); 1274 else 1275 coreView = FrameView::create(coreFrame, IntSize([webView bounds].size)); 1259 RefPtr<FrameView> coreView = FrameView::create(coreFrame); 1276 1260 coreFrame->setView(coreView); 1277 1261 1278 1262 [m_webFrame.get() _updateBackgroundAndUpdatesWhileOffscreen]; 1279 1280 if (usesDocumentViews) 1281 [m_webFrame->_private->webFrameView _install]; 1263 [m_webFrame->_private->webFrameView _install]; 1282 1264 1283 1265 if (isMainFrame) 1284 1266 coreView->setParentVisible(true); 1285 1267 1286 if (usesDocumentViews) { 1287 // Call setDataSource on the document view after it has been placed in the view hierarchy. 1288 // This what we for the top-level view, so should do this for views in subframes as well. 1289 [documentView setDataSource:dataSource]; 1290 1291 // The following is a no-op for WebHTMLRepresentation, but for custom document types 1292 // like the ones that Safari uses for bookmarks it is the only way the DocumentLoader 1293 // will get the proper title. 1294 if (DocumentLoader* documentLoader = [dataSource _documentLoader]) 1295 documentLoader->setTitle(StringWithDirection([dataSource pageTitle], LTR)); 1296 } 1268 // Call setDataSource on the document view after it has been placed in the view hierarchy. 1269 // This what we for the top-level view, so should do this for views in subframes as well. 1270 [documentView setDataSource:dataSource]; 1271 1272 // The following is a no-op for WebHTMLRepresentation, but for custom document types 1273 // like the ones that Safari uses for bookmarks it is the only way the DocumentLoader 1274 // will get the proper title. 1275 if (DocumentLoader* documentLoader = [dataSource _documentLoader]) 1276 documentLoader->setTitle(StringWithDirection([dataSource pageTitle], LTR)); 1297 1277 1298 1278 if (HTMLFrameOwnerElement* owner = coreFrame->ownerElement()) … … 1300 1280 1301 1281 // If the document view implicitly became first responder, make sure to set the focused frame properly. 1302 if ( usesDocumentViews &&[[documentView window] firstResponder] == documentView) {1282 if ([[documentView window] firstResponder] == documentView) { 1303 1283 page->focusController()->setFocusedFrame(coreFrame); 1304 1284 page->focusController()->setFocused(true); … … 1421 1401 ASSERT(m_webFrame); 1422 1402 1423 WebFrameView *childView = [ getWebView(m_webFrame.get()) _usesDocumentViews] ? [[WebFrameView alloc] init] : nil;1403 WebFrameView *childView = [[WebFrameView alloc] init]; 1424 1404 1425 1405 RefPtr<Frame> result = [WebFrame _createSubframeWithOwnerElement:ownerElement frameName:name frameView:childView]; -
trunk/Source/WebKit/mac/WebView/WebFrame.mm
r95271 r95459 364 364 Frame* coreFrame = _private->coreFrame; 365 365 for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame)) { 366 if ([webView _usesDocumentViews]) { 367 // Don't call setDrawsBackground:YES here because it may be NO because of a load 368 // in progress; WebFrameLoaderClient keeps it set to NO during the load process. 369 WebFrame *webFrame = kit(frame); 370 if (!drawsBackground) 371 [[[webFrame frameView] _scrollView] setDrawsBackground:NO]; 372 [[[webFrame frameView] _scrollView] setBackgroundColor:backgroundColor]; 373 id documentView = [[webFrame frameView] documentView]; 374 if ([documentView respondsToSelector:@selector(setDrawsBackground:)]) 375 [documentView setDrawsBackground:drawsBackground]; 376 if ([documentView respondsToSelector:@selector(setBackgroundColor:)]) 377 [documentView setBackgroundColor:backgroundColor]; 378 } 366 // Don't call setDrawsBackground:YES here because it may be NO because of a load 367 // in progress; WebFrameLoaderClient keeps it set to NO during the load process. 368 WebFrame *webFrame = kit(frame); 369 if (!drawsBackground) 370 [[[webFrame frameView] _scrollView] setDrawsBackground:NO]; 371 [[[webFrame frameView] _scrollView] setBackgroundColor:backgroundColor]; 372 id documentView = [[webFrame frameView] documentView]; 373 if ([documentView respondsToSelector:@selector(setDrawsBackground:)]) 374 [documentView setDrawsBackground:drawsBackground]; 375 if ([documentView respondsToSelector:@selector(setBackgroundColor:)]) 376 [documentView setBackgroundColor:backgroundColor]; 379 377 380 378 if (FrameView* view = frame->view()) { … … 416 414 - (BOOL)_hasSelection 417 415 { 418 if ([getWebView(self) _usesDocumentViews]) { 419 id documentView = [_private->webFrameView documentView]; 420 421 // optimization for common case to avoid creating potentially large selection string 422 if ([documentView isKindOfClass:[WebHTMLView class]]) 423 if (Frame* coreFrame = _private->coreFrame) 424 return coreFrame->selection()->isRange(); 425 426 if ([documentView conformsToProtocol:@protocol(WebDocumentText)]) 427 return [[documentView selectedString] length] > 0; 428 429 return NO; 430 } 431 432 Frame* coreFrame = _private->coreFrame; 433 return coreFrame && coreFrame->selection()->isRange(); 416 id documentView = [_private->webFrameView documentView]; 417 418 // optimization for common case to avoid creating potentially large selection string 419 if ([documentView isKindOfClass:[WebHTMLView class]]) 420 if (Frame* coreFrame = _private->coreFrame) 421 return coreFrame->selection()->isRange(); 422 423 if ([documentView conformsToProtocol:@protocol(WebDocumentText)]) 424 return [[documentView selectedString] length] > 0; 425 426 return NO; 434 427 } 435 428 436 429 - (void)_clearSelection 437 430 { 438 ASSERT([getWebView(self) _usesDocumentViews]);439 431 id documentView = [_private->webFrameView documentView]; 440 432 if ([documentView conformsToProtocol:@protocol(WebDocumentText)]) … … 546 538 547 539 // If we're drawing into a bitmap, we might be snapshotting, or drawing into a layer-backed view. 548 if ([getWebView(self) _usesDocumentViews]) { 549 id documentView = [_private->webFrameView documentView]; 550 if ([documentView isKindOfClass:[WebHTMLView class]] && [(WebHTMLView *)documentView _web_isDrawingIntoLayer]) 551 return NO; 552 } 540 id documentView = [_private->webFrameView documentView]; 541 if ([documentView isKindOfClass:[WebHTMLView class]] && [(WebHTMLView *)documentView _web_isDrawingIntoLayer]) 542 return NO; 553 543 554 544 return [getWebView(self) _includesFlattenedCompositingLayersWhenDrawingToBitmap]; … … 834 824 if (!view) 835 825 return; 836 ASSERT([getWebView(self) _usesDocumentViews]);837 826 // FIXME: These are fake modifier keys here, but they should be real ones instead. 838 827 PlatformMouseEvent event(IntPoint(windowLoc), globalPoint(windowLoc, [view->platformWidget() window]), … … 1412 1401 - (WebFrameView *)frameView 1413 1402 { 1414 ASSERT(!getWebView(self) || [getWebView(self) _usesDocumentViews]);1415 1403 return _private->webFrameView; 1416 1404 }
Note: See TracChangeset
for help on using the changeset viewer.