Changeset 191315 in webkit
- Timestamp:
- Oct 19, 2015 1:39:47 PM (9 years ago)
- Location:
- trunk/Source
- Files:
-
- 3 deleted
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r191314 r191315 1 2015-10-19 Commit Queue <commit-queue@webkit.org> 2 3 Unreviewed, rolling out r191307. 4 https://bugs.webkit.org/show_bug.cgi?id=150338 5 6 broke lots of API tests, need time to figure out whats up 7 (Requested by thorton on #webkit). 8 9 Reverted changeset: 10 11 "WKView being inside WKWebView leads to weird API issues" 12 https://bugs.webkit.org/show_bug.cgi?id=150174 13 http://trac.webkit.org/changeset/191307 14 1 15 2015-10-19 Commit Queue <commit-queue@webkit.org> 2 16 -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r191312 r191315 1122 1122 2D0B4AAB18DA1CCD00434DE1 /* IOSurface.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D0B4AA918DA1CCD00434DE1 /* IOSurface.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1123 1123 2D0B4AAC18DA1CCD00434DE1 /* IOSurface.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D0B4AAA18DA1CCD00434DE1 /* IOSurface.mm */; }; 1124 2D0CF8171BCF5DE1007A4937 /* NSWindowSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D0CF8161BCF5DE1007A4937 /* NSWindowSPI.h */; settings = {ATTRIBUTES = (Private, ); }; };1125 1124 2D232C001A326F02006BF2DB /* TUCallSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D232BFF1A326EF9006BF2DB /* TUCallSPI.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1126 1125 2D25396218CE7F6200270222 /* ImageControlsButtonElementMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D25396018CE7F6200270222 /* ImageControlsButtonElementMac.cpp */; }; … … 8441 8440 2D0B4AA918DA1CCD00434DE1 /* IOSurface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOSurface.h; sourceTree = "<group>"; }; 8442 8441 2D0B4AAA18DA1CCD00434DE1 /* IOSurface.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = IOSurface.mm; sourceTree = "<group>"; }; 8443 2D0CF8161BCF5DE1007A4937 /* NSWindowSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSWindowSPI.h; sourceTree = "<group>"; };8444 8442 2D232BFF1A326EF9006BF2DB /* TUCallSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TUCallSPI.h; sourceTree = "<group>"; }; 8445 8443 2D25396018CE7F6200270222 /* ImageControlsButtonElementMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ImageControlsButtonElementMac.cpp; sourceTree = "<group>"; }; … … 18543 18541 2DCB837719F99BBA00A7FBE4 /* NSSharingServicePickerSPI.h */, 18544 18542 2DCB837819F99BBA00A7FBE4 /* NSSharingServiceSPI.h */, 18545 2D0CF8161BCF5DE1007A4937 /* NSWindowSPI.h */,18546 18543 937F4CCB1A2D48C100BB39F5 /* QuickLookMacSPI.h */, 18547 18544 2D232BFF1A326EF9006BF2DB /* TUCallSPI.h */, … … 27844 27841 93F199F008245E59001E9ABC /* WebCoreView.h in Headers */, 27845 27842 A5E616741894581F009ADF50 /* WebDebuggerAgent.h in Headers */, 27846 2D0CF8171BCF5DE1007A4937 /* NSWindowSPI.h in Headers */,27847 27843 FE0D84E910484348001A179E /* WebEvent.h in Headers */, 27848 27844 225A16B50D5C11E900090295 /* WebEventRegion.h in Headers */, -
trunk/Source/WebKit2/ChangeLog
r191311 r191315 1 2015-10-19 Commit Queue <commit-queue@webkit.org> 2 3 Unreviewed, rolling out r191307. 4 https://bugs.webkit.org/show_bug.cgi?id=150338 5 6 broke lots of API tests, need time to figure out whats up 7 (Requested by thorton on #webkit). 8 9 Reverted changeset: 10 11 "WKView being inside WKWebView leads to weird API issues" 12 https://bugs.webkit.org/show_bug.cgi?id=150174 13 http://trac.webkit.org/changeset/191307 14 1 15 2015-10-19 Tim Horton <timothy_horton@apple.com> 2 16 -
trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm
r191307 r191315 67 67 #import "WKTextInputWindowController.h" 68 68 #import "WKViewInternal.h" 69 #import "WKViewLayoutStrategy.h" 69 70 #import "WKViewPrivate.h" 70 71 #import "WKWebView.h" … … 81 82 #import "WebProcessProxy.h" 82 83 #import "WebSystemInterface.h" 83 #import "WebViewImpl.h"84 84 #import "_WKRemoteObjectRegistryInternal.h" 85 85 #import "_WKThumbnailViewInternal.h" … … 131 131 @end 132 132 133 @interface NSWindow (WKNSWindowDetails) 134 - (id)_newFirstResponderAfterResigning; 135 @end 136 133 137 #if USE(ASYNC_NSTEXTINPUTCLIENT) 134 138 @interface NSTextInputContext (WKNSTextInputContextDetails) … … 178 182 std::unique_ptr<PageClientImpl> _pageClient; 179 183 RefPtr<WebPageProxy> _page; 180 std::unique_ptr<WebViewImpl> _impl;181 184 182 185 #if WK_API_ENABLED … … 213 216 #endif 214 217 218 NSSize _resizeScrollOffset; 219 215 220 // The identifier of the plug-in we want to send complex text input to, or 0 if there is none. 216 221 uint64_t _pluginComplexTextInputIdentifier; … … 219 224 PluginComplexTextInputState _pluginComplexTextInputState; 220 225 226 bool _inBecomeFirstResponder; 227 bool _inResignFirstResponder; 221 228 BOOL _willBecomeFirstResponderAgain; 222 229 NSEvent *_mouseDownEvent; … … 226 233 id _flagsChangedEventMonitor; 227 234 235 #if ENABLE(FULLSCREEN_API) 236 RetainPtr<WKFullScreenWindowController> _fullScreenWindowController; 237 #endif 238 228 239 BOOL _hasSpellCheckerDocumentTag; 229 240 NSInteger _spellCheckerDocumentTag; 241 242 BOOL _inSecureInputState; 230 243 231 244 BOOL _shouldDeferViewInWindowChanges; … … 242 255 String _promisedFilename; 243 256 String _promisedURL; 244 257 258 NSSize _intrinsicContentSize; 259 BOOL _clipsToVisibleRect; 260 NSRect _contentPreparationRect; 261 BOOL _useContentPreparationRectForVisibleRect; 245 262 BOOL _windowOcclusionDetectionEnabled; 246 263 … … 254 271 BOOL _allowsLinkPreview; 255 272 273 RetainPtr<WKViewLayoutStrategy> _layoutStrategy; 274 WKLayoutMode _lastRequestedLayoutMode; 275 float _lastRequestedViewScale; 276 256 277 RetainPtr<CALayer> _rootLayer; 257 278 … … 349 370 @end 350 371 351 @interface WKView () <WebViewImplDelegate>352 @end353 354 372 @implementation WKView 355 373 … … 373 391 [_data->_immediateActionController willDestroyView:self]; 374 392 #endif 375 376 _data->_impl = nullptr; 393 [_data->_layoutStrategy willDestroyView:self]; 377 394 378 395 #if WK_API_ENABLED … … 388 405 ASSERT(!_data->_thumbnailView); 389 406 #endif 407 ASSERT(!_data->_inSecureInputState); 390 408 391 409 [_data release]; … … 417 435 - (void)setDrawsBackground:(BOOL)drawsBackground 418 436 { 419 _data->_ impl->setDrawsBackground(drawsBackground);437 _data->_page->setDrawsBackground(drawsBackground); 420 438 } 421 439 422 440 - (BOOL)drawsBackground 423 441 { 424 return _data->_ impl->drawsBackground();442 return _data->_page->drawsBackground(); 425 443 } 426 444 427 445 - (void)setDrawsTransparentBackground:(BOOL)drawsTransparentBackground 428 446 { 429 _data->_ impl->setDrawsTransparentBackground(drawsTransparentBackground);447 _data->_page->setDrawsTransparentBackground(drawsTransparentBackground); 430 448 } 431 449 432 450 - (BOOL)drawsTransparentBackground 433 451 { 434 return _data->_ impl->drawsTransparentBackground();452 return _data->_page->drawsTransparentBackground(); 435 453 } 436 454 437 455 - (BOOL)acceptsFirstResponder 438 456 { 439 return _data->_impl->acceptsFirstResponder();457 return YES; 440 458 } 441 459 442 460 - (BOOL)becomeFirstResponder 443 461 { 444 return _data->_impl->becomeFirstResponder(); 462 // If we just became first responder again, there is no need to do anything, 463 // since resignFirstResponder has correctly detected this situation. 464 if (_data->_willBecomeFirstResponderAgain) { 465 _data->_willBecomeFirstResponderAgain = NO; 466 return YES; 467 } 468 469 NSSelectionDirection direction = [[self window] keyViewSelectionDirection]; 470 471 _data->_inBecomeFirstResponder = true; 472 473 [self _updateSecureInputState]; 474 _data->_page->viewStateDidChange(ViewState::IsFocused); 475 // Restore the selection in the editable region if resigning first responder cleared selection. 476 _data->_page->restoreSelectionInFocusedEditableElement(); 477 478 _data->_inBecomeFirstResponder = false; 479 480 if (direction != NSDirectSelection) { 481 NSEvent *event = [NSApp currentEvent]; 482 NSEvent *keyboardEvent = nil; 483 if ([event type] == NSKeyDown || [event type] == NSKeyUp) 484 keyboardEvent = event; 485 _data->_page->setInitialFocus(direction == NSSelectingNext, keyboardEvent != nil, NativeWebKeyboardEvent(keyboardEvent, false, Vector<KeypressCommand>()), [](WebKit::CallbackBase::Error) { }); 486 } 487 return YES; 445 488 } 446 489 447 490 - (BOOL)resignFirstResponder 448 491 { 449 return _data->_impl->resignFirstResponder(); 492 #if WK_API_ENABLED 493 // Predict the case where we are losing first responder status only to 494 // gain it back again. We want resignFirstResponder to do nothing in that case. 495 id nextResponder = [[self window] _newFirstResponderAfterResigning]; 496 if ([nextResponder isKindOfClass:[WKWebView class]] && self.superview == nextResponder) { 497 _data->_willBecomeFirstResponderAgain = YES; 498 return YES; 499 } 500 #endif 501 502 _data->_willBecomeFirstResponderAgain = NO; 503 _data->_inResignFirstResponder = true; 504 505 #if USE(ASYNC_NSTEXTINPUTCLIENT) 506 _data->_page->confirmCompositionAsync(); 507 #else 508 if (_data->_page->editorState().hasComposition && !_data->_page->editorState().shouldIgnoreCompositionSelectionChange) 509 _data->_page->cancelComposition(); 510 #endif 511 512 [self _notifyInputContextAboutDiscardedComposition]; 513 514 [self _resetSecureInputState]; 515 516 if (!_data->_page->maintainsInactiveSelection()) 517 _data->_page->clearSelection(); 518 519 _data->_page->viewStateDidChange(ViewState::IsFocused); 520 521 _data->_inResignFirstResponder = false; 522 523 return YES; 450 524 } 451 525 452 526 - (void)viewWillStartLiveResize 453 527 { 454 _data->_impl->viewWillStartLiveResize(); 528 _data->_page->viewWillStartLiveResize(); 529 530 [_data->_layoutStrategy willStartLiveResize]; 455 531 } 456 532 457 533 - (void)viewDidEndLiveResize 458 534 { 459 _data->_impl->viewDidEndLiveResize(); 535 _data->_page->viewWillEndLiveResize(); 536 537 [_data->_layoutStrategy didEndLiveResize]; 460 538 } 461 539 … … 467 545 - (NSSize)intrinsicContentSize 468 546 { 469 return NSSizeFromCGSize(_data->_impl->intrinsicContentSize());547 return _data->_intrinsicContentSize; 470 548 } 471 549 472 550 - (void)prepareContentInRect:(NSRect)rect 473 551 { 474 _data->_impl->setContentPreparationRect(NSRectToCGRect(rect)); 475 _data->_impl->updateViewExposedRect(); 552 _data->_contentPreparationRect = rect; 553 _data->_useContentPreparationRectForVisibleRect = YES; 554 555 [self _updateViewExposedRect]; 556 } 557 558 - (void)_updateViewExposedRect 559 { 560 NSRect exposedRect = [self visibleRect]; 561 562 if (_data->_useContentPreparationRectForVisibleRect) 563 exposedRect = NSUnionRect(_data->_contentPreparationRect, exposedRect); 564 565 if (auto drawingArea = _data->_page->drawingArea()) 566 drawingArea->setExposedRect(_data->_clipsToVisibleRect ? FloatRect(exposedRect) : FloatRect::infiniteRect()); 476 567 } 477 568 … … 479 570 { 480 571 [super setFrameSize:size]; 481 _data->_impl->setFrameSize(NSSizeToCGSize(size)); 572 573 [_data->_layoutStrategy didChangeFrameSize]; 482 574 } 483 575 484 576 - (void)_updateWindowAndViewFrames 485 577 { 486 if (_data->_ impl->clipsToVisibleRect())487 _data->_impl->updateViewExposedRect();578 if (_data->_clipsToVisibleRect) 579 [self _updateViewExposedRect]; 488 580 489 581 if (_data->_didScheduleWindowAndViewFrameUpdate) … … 1738 1830 text = string; 1739 1831 1740 if (_data->_i mpl->inSecureInputState()) {1832 if (_data->_inSecureInputState) { 1741 1833 // In password fields, we only allow ASCII dead keys, and don't allow inline input, matching NSSecureTextInputField. 1742 1834 // Allowing ASCII dead keys is necessary to enable full Roman input when using a Vietnamese keyboard. 1743 1835 ASSERT(!_data->_page->editorState().hasComposition); 1744 _data->_impl->notifyInputContextAboutDiscardedComposition();1836 [self _notifyInputContextAboutDiscardedComposition]; 1745 1837 // FIXME: We should store the command to handle it after DOM event processing, as it's regular keyboard input now, not a composition. 1746 1838 if ([text length] == 1 && isASCII([text characterAtIndex:0])) … … 2134 2226 // Allowing ASCII dead keys is necessary to enable full Roman input when using a Vietnamese keyboard. 2135 2227 ASSERT(!_data->_page->editorState().hasComposition); 2136 _data->_impl->notifyInputContextAboutDiscardedComposition();2228 [self _notifyInputContextAboutDiscardedComposition]; 2137 2229 if ([text length] == 1 && [[text decomposedStringWithCanonicalMapping] characterAtIndex:0] < 0x80) { 2138 2230 _data->_page->insertText(text, replacementRange); … … 2345 2437 2346 2438 #endif // USE(ASYNC_NSTEXTINPUTCLIENT) 2347 2348 - (NSTextInputContext *)_superInputContext2349 {2350 return [super inputContext];2351 }2352 2439 2353 2440 - (NSArray *)validAttributesForMarkedText … … 2671 2758 NSWindow *keyWindow = [notification object]; 2672 2759 if (keyWindow == [self window] || keyWindow == [[self window] attachedSheet]) { 2673 _data->_impl->updateSecureInputState();2760 [self _updateSecureInputState]; 2674 2761 _data->_page->viewStateDidChange(ViewState::WindowIsActive); 2675 2762 } … … 2690 2777 NSWindow *formerKeyWindow = [notification object]; 2691 2778 if (formerKeyWindow == [self window] || formerKeyWindow == [[self window] attachedSheet]) { 2692 _data->_impl->updateSecureInputState();2779 [self _updateSecureInputState]; 2693 2780 _data->_page->viewStateDidChange(ViewState::WindowIsActive); 2694 2781 } … … 2914 3001 } 2915 3002 3003 - (void)_setDrawingAreaSize:(NSSize)size 3004 { 3005 if (!_data->_page->drawingArea()) 3006 return; 3007 3008 _data->_page->drawingArea()->setSize(IntSize(size), IntSize(0, 0), IntSize(_data->_resizeScrollOffset)); 3009 _data->_resizeScrollOffset = NSZeroSize; 3010 } 3011 2916 3012 - (void)quickLookWithEvent:(NSEvent *)event 2917 3013 { … … 2936 3032 2937 3033 return std::make_unique<TiledCoreAnimationDrawingAreaProxy>(*_data->_page); 3034 } 3035 3036 - (BOOL)_isFocused 3037 { 3038 if (_data->_inBecomeFirstResponder) 3039 return YES; 3040 if (_data->_inResignFirstResponder) 3041 return NO; 3042 return [[self window] firstResponder] == self; 2938 3043 } 2939 3044 … … 2957 3062 - (void)_processDidExit 2958 3063 { 2959 _data->_impl->notifyInputContextAboutDiscardedComposition();3064 [self _notifyInputContextAboutDiscardedComposition]; 2960 3065 2961 3066 if (_data->_layerHostingView) … … 3190 3295 if (_data->_textIndicatorWindow) 3191 3296 _data->_textIndicatorWindow->setAnimationProgress(progress); 3297 } 3298 3299 - (CALayer *)_rootLayer 3300 { 3301 return [_data->_layerHostingView layer]; 3192 3302 } 3193 3303 … … 3523 3633 } 3524 3634 3635 - (void)_updateSecureInputState 3636 { 3637 if (![[self window] isKeyWindow] || ![self _isFocused]) { 3638 if (_data->_inSecureInputState) { 3639 DisableSecureEventInput(); 3640 _data->_inSecureInputState = NO; 3641 } 3642 return; 3643 } 3644 // WKView has a single input context for all editable areas (except for plug-ins). 3645 NSTextInputContext *context = [super inputContext]; 3646 bool isInPasswordField = _data->_page->editorState().isInPasswordField; 3647 3648 if (isInPasswordField) { 3649 if (!_data->_inSecureInputState) 3650 EnableSecureEventInput(); 3651 static NSArray *romanInputSources = [[NSArray alloc] initWithObjects:&NSAllRomanInputSourcesLocaleIdentifier count:1]; 3652 LOG(TextInput, "-> setAllowedInputSourceLocales:romanInputSources"); 3653 [context setAllowedInputSourceLocales:romanInputSources]; 3654 } else { 3655 if (_data->_inSecureInputState) 3656 DisableSecureEventInput(); 3657 LOG(TextInput, "-> setAllowedInputSourceLocales:nil"); 3658 [context setAllowedInputSourceLocales:nil]; 3659 } 3660 _data->_inSecureInputState = isInPasswordField; 3661 } 3662 3663 - (void)_resetSecureInputState 3664 { 3665 if (_data->_inSecureInputState) { 3666 DisableSecureEventInput(); 3667 _data->_inSecureInputState = NO; 3668 } 3669 } 3670 3671 - (void)_notifyInputContextAboutDiscardedComposition 3672 { 3673 // <rdar://problem/9359055>: -discardMarkedText can only be called for active contexts. 3674 // FIXME: We fail to ever notify the input context if something (e.g. a navigation) happens while the window is not key. 3675 // This is not a problem when the window is key, because we discard marked text on resigning first responder. 3676 if (![[self window] isKeyWindow] || self != [[self window] firstResponder]) 3677 return; 3678 3679 LOG(TextInput, "-> discardMarkedText"); 3680 [[super inputContext] discardMarkedText]; // Inform the input method that we won't have an inline input area despite having been asked to. 3681 } 3525 3682 3526 3683 - (NSWindow *)_targetWindowForMovePreparation … … 3532 3689 - (BOOL)_hasFullScreenWindowController 3533 3690 { 3534 return _data->_impl->hasFullScreenWindowController();3691 return (bool)_data->_fullScreenWindowController; 3535 3692 } 3536 3693 3537 3694 - (WKFullScreenWindowController *)_fullScreenWindowController 3538 3695 { 3539 return _data->_impl->fullScreenWindowController(); 3696 if (!_data->_fullScreenWindowController) 3697 _data->_fullScreenWindowController = adoptNS([[WKFullScreenWindowController alloc] initWithWindow:[self createFullScreenWindow] webView:self]); 3698 3699 return _data->_fullScreenWindowController.get(); 3540 3700 } 3541 3701 3542 3702 - (void)_closeFullScreenWindowController 3543 3703 { 3544 _data->_impl->closeFullScreenWindowController(); 3704 if (!_data->_fullScreenWindowController) 3705 return; 3706 3707 [_data->_fullScreenWindowController close]; 3708 _data->_fullScreenWindowController = nullptr; 3545 3709 } 3546 3710 #endif … … 3559 3723 - (void)_setIntrinsicContentSize:(NSSize)intrinsicContentSize 3560 3724 { 3561 _data->_impl->setIntrinsicContentSize(NSSizeToCGSize(intrinsicContentSize)); 3725 // If the intrinsic content size is less than the minimum layout width, the content flowed to fit, 3726 // so we can report that that dimension is flexible. If not, we need to report our intrinsic width 3727 // so that autolayout will know to provide space for us. 3728 3729 NSSize intrinsicContentSizeAcknowledgingFlexibleWidth = intrinsicContentSize; 3730 if (intrinsicContentSize.width < _data->_page->minimumLayoutSize().width()) 3731 intrinsicContentSizeAcknowledgingFlexibleWidth.width = NSViewNoInstrinsicMetric; 3732 3733 _data->_intrinsicContentSize = intrinsicContentSizeAcknowledgingFlexibleWidth; 3734 [self invalidateIntrinsicContentSize]; 3562 3735 } 3563 3736 … … 3621 3794 _data->_pageClient = std::make_unique<PageClientImpl>(self, webView); 3622 3795 _data->_page = processPool.createWebPage(*_data->_pageClient, WTF::move(configuration)); 3623 3624 _data->_impl = std::make_unique<WebViewImpl>(self, *_data->_page);3625 static_cast<PageClientImpl*>(_data->_pageClient.get())->setImpl(*_data->_impl);3626 3627 3796 _data->_page->setAddsVisitedLinks(processPool.historyClient().addsVisitedLinks()); 3628 3797 … … 3633 3802 _data->_pressureEvent = nil; 3634 3803 _data->_ignoringMouseDraggedEvents = NO; 3804 _data->_clipsToVisibleRect = NO; 3805 _data->_useContentPreparationRectForVisibleRect = NO; 3635 3806 _data->_windowOcclusionDetectionEnabled = YES; 3807 _data->_lastRequestedLayoutMode = kWKLayoutModeViewSize; 3808 _data->_lastRequestedViewScale = 1; 3636 3809 3637 3810 _data->_windowVisibilityObserver = adoptNS([[WKWindowVisibilityObserver alloc] initWithView:self]); 3638 3811 3812 _data->_intrinsicContentSize = NSMakeSize(NSViewNoInstrinsicMetric, NSViewNoInstrinsicMetric); 3813 3639 3814 _data->_needsViewFrameInWindowCoordinates = _data->_page->preferences().pluginsEnabled(); 3815 3816 _data->_layoutStrategy = [WKViewLayoutStrategy layoutStrategyWithPage:*_data->_page view:self mode:kWKLayoutModeViewSize]; 3640 3817 3641 3818 [self _registerDraggedTypes]; … … 3748 3925 } 3749 3926 3927 - (BOOL)_supportsArbitraryLayoutModes 3928 { 3929 if ([_data->_fullScreenWindowController isFullScreen]) 3930 return NO; 3931 3932 WebPageProxy* page = _data->_page.get(); 3933 if (!page) 3934 return YES; 3935 WebFrameProxy* frame = page->mainFrame(); 3936 if (!frame) 3937 return YES; 3938 3939 // If we have a plugin document in the main frame, avoid using custom WKLayoutModes 3940 // and fall back to the defaults, because there's a good chance that it won't work (e.g. with PDFPlugin). 3941 if (frame->containsPluginDocument()) 3942 return NO; 3943 3944 return YES; 3945 } 3946 3947 - (void)_updateSupportsArbitraryLayoutModes 3948 { 3949 if (![self _supportsArbitraryLayoutModes]) { 3950 WKLayoutMode oldRequestedLayoutMode = _data->_lastRequestedLayoutMode; 3951 float oldRequestedViewScale = _data->_lastRequestedViewScale; 3952 [self _setViewScale:1]; 3953 [self _setLayoutMode:kWKLayoutModeViewSize]; 3954 3955 // The 'last requested' parameters will have been overwritten by setting them above, but we don't 3956 // want this to count as a request (only changes from the client count), so reset them. 3957 _data->_lastRequestedLayoutMode = oldRequestedLayoutMode; 3958 _data->_lastRequestedViewScale = oldRequestedViewScale; 3959 } else if (_data->_lastRequestedLayoutMode != [_data->_layoutStrategy layoutMode]) { 3960 [self _setViewScale:_data->_lastRequestedViewScale]; 3961 [self _setLayoutMode:_data->_lastRequestedLayoutMode]; 3962 } 3963 } 3964 3750 3965 #if WK_API_ENABLED 3751 3966 - (_WKRemoteObjectRegistry *)_remoteObjectRegistry … … 3758 3973 return _data->_remoteObjectRegistry.get(); 3759 3974 } 3760 #endif 3975 3976 #endif 3977 3978 3979 - (void)_didCommitLoadForMainFrame 3980 { 3981 [self _updateSupportsArbitraryLayoutModes]; 3982 } 3761 3983 3762 3984 - (void)_didFinishLoadForMainFrame … … 3799 4021 } 3800 4022 #endif 3801 3802 // FIXME: Get rid of this when we have better plumbing to WKViewLayoutStrategy.3803 - (void)_updateViewExposedRect3804 {3805 _data->_impl->updateViewExposedRect();3806 }3807 4023 3808 4024 @end … … 3893 4109 - (void)setFrame:(NSRect)rect andScrollBy:(NSSize)offset 3894 4110 { 3895 _data->_impl->setFrameAndScrollBy(NSRectToCGRect(rect), NSSizeToCGSize(offset)); 4111 ASSERT(NSEqualSizes(_data->_resizeScrollOffset, NSZeroSize)); 4112 4113 _data->_resizeScrollOffset = offset; 4114 [self setFrame:rect]; 3896 4115 } 3897 4116 3898 4117 - (void)disableFrameSizeUpdates 3899 4118 { 3900 _data->_impl->disableFrameSizeUpdates();4119 [_data->_layoutStrategy disableFrameSizeUpdates]; 3901 4120 } 3902 4121 3903 4122 - (void)enableFrameSizeUpdates 3904 4123 { 3905 _data->_impl->enableFrameSizeUpdates();4124 [_data->_layoutStrategy enableFrameSizeUpdates]; 3906 4125 } 3907 4126 3908 4127 - (BOOL)frameSizeUpdatesDisabled 3909 4128 { 3910 return _data->_impl->frameSizeUpdatesDisabled();4129 return [_data->_layoutStrategy frameSizeUpdatesDisabled]; 3911 4130 } 3912 4131 … … 3943 4162 - (BOOL)shouldClipToVisibleRect 3944 4163 { 3945 return _data->_ impl->clipsToVisibleRect();4164 return _data->_clipsToVisibleRect; 3946 4165 } 3947 4166 3948 4167 - (void)setShouldClipToVisibleRect:(BOOL)clipsToVisibleRect 3949 4168 { 3950 _data->_impl->setClipsToVisibleRect(clipsToVisibleRect); 4169 _data->_clipsToVisibleRect = clipsToVisibleRect; 4170 [self _updateViewExposedRect]; 3951 4171 } 3952 4172 … … 3985 4205 - (NSView *)fullScreenPlaceholderView 3986 4206 { 3987 return _data->_impl->fullScreenPlaceholderView(); 3988 } 3989 3990 // FIXME: This returns an autoreleased object. Should it really be prefixed 'create'? 4207 #if ENABLE(FULLSCREEN_API) 4208 if (_data->_fullScreenWindowController && [_data->_fullScreenWindowController isFullScreen]) 4209 return [_data->_fullScreenWindowController webViewPlaceholder]; 4210 #endif 4211 return nil; 4212 } 4213 3991 4214 - (NSWindow *)createFullScreenWindow 3992 4215 { 3993 return _data->_impl->createFullScreenWindow(); 4216 #if ENABLE(FULLSCREEN_API) 4217 return [[[WebCoreFullScreenWindow alloc] initWithContentRect:[[NSScreen mainScreen] frame] styleMask:(NSBorderlessWindowMask | NSResizableWindowMask) backing:NSBackingStoreBuffered defer:NO] autorelease]; 4218 #else 4219 return nil; 4220 #endif 3994 4221 } 3995 4222 … … 4157 4384 - (WKLayoutMode)_layoutMode 4158 4385 { 4159 return _data->_impl->layoutMode();4386 return [_data->_layoutStrategy layoutMode]; 4160 4387 } 4161 4388 4162 4389 - (void)_setLayoutMode:(WKLayoutMode)layoutMode 4163 4390 { 4164 _data->_impl->setLayoutMode(layoutMode); 4391 _data->_lastRequestedLayoutMode = layoutMode; 4392 4393 if (![self _supportsArbitraryLayoutModes] && layoutMode != kWKLayoutModeViewSize) 4394 return; 4395 4396 if (layoutMode == [_data->_layoutStrategy layoutMode]) 4397 return; 4398 4399 [_data->_layoutStrategy willChangeLayoutStrategy]; 4400 _data->_layoutStrategy = [WKViewLayoutStrategy layoutStrategyWithPage:*_data->_page view:self mode:layoutMode]; 4165 4401 } 4166 4402 4167 4403 - (CGSize)_fixedLayoutSize 4168 4404 { 4169 return _data->_ impl->fixedLayoutSize();4405 return _data->_page->fixedLayoutSize(); 4170 4406 } 4171 4407 4172 4408 - (void)_setFixedLayoutSize:(CGSize)fixedLayoutSize 4173 4409 { 4174 _data->_ impl->setFixedLayoutSize(fixedLayoutSize);4410 _data->_page->setFixedLayoutSize(expandedIntSize(FloatSize(fixedLayoutSize))); 4175 4411 } 4176 4412 4177 4413 - (CGFloat)_viewScale 4178 4414 { 4179 return _data->_ impl->viewScale();4415 return _data->_page->viewScaleFactor(); 4180 4416 } 4181 4417 4182 4418 - (void)_setViewScale:(CGFloat)viewScale 4183 4419 { 4184 _data->_impl->setViewScale(viewScale); 4420 _data->_lastRequestedViewScale = viewScale; 4421 4422 if (![self _supportsArbitraryLayoutModes] && viewScale != 1) 4423 return; 4424 4425 if (viewScale <= 0 || isnan(viewScale) || isinf(viewScale)) 4426 [NSException raise:NSInvalidArgumentException format:@"View scale should be a positive number"]; 4427 4428 _data->_page->scaleView(viewScale); 4429 [_data->_layoutStrategy didChangeViewScale]; 4185 4430 } 4186 4431 … … 4283 4528 // This SPI is only used on 10.9 and below, and is incompatible with the fence-based drawing area size synchronization in 10.10+. 4284 4529 #if __MAC_OS_X_VERSION_MIN_REQUIRED <= 1090 4285 if (_data->_ impl->clipsToVisibleRect())4286 _data->_impl->updateViewExposedRect();4287 _data->_impl->setDrawingAreaSize(NSSizeToCGSize(size));4530 if (_data->_clipsToVisibleRect) 4531 [self _updateViewExposedRect]; 4532 [self _setDrawingAreaSize:size]; 4288 4533 4289 4534 // If a geometry update is pending the new update won't be sent. Poll without waiting for any -
trunk/Source/WebKit2/UIProcess/API/mac/WKViewInternal.h
r191307 r191315 78 78 79 79 - (std::unique_ptr<WebKit::DrawingAreaProxy>)_createDrawingAreaProxy; 80 - (BOOL)_isFocused; 80 81 - (void)_processDidExit; 81 82 - (void)_pageClosed; … … 110 111 - (void)_setPromisedDataForAttachment:(NSString *)filename withExtension:(NSString *)extension withTitle:(NSString *)title withURL:(NSString *)url withVisibleURL:(NSString *)visibleUrl forPasteboard:(NSString *)pasteboardName; 111 112 #endif 113 - (void)_updateSecureInputState; 114 - (void)_resetSecureInputState; 115 - (void)_notifyInputContextAboutDiscardedComposition; 112 116 113 117 - (WebKit::ColorSpaceData)_colorSpace; … … 120 124 121 125 - (void)_didFirstVisuallyNonEmptyLayoutForMainFrame; 126 - (void)_didCommitLoadForMainFrame; 122 127 - (void)_didFinishLoadForMainFrame; 123 128 - (void)_didFailLoadForMainFrame; … … 154 159 @property (readonly) NSWindow *_targetWindowForMovePreparation; 155 160 161 // For WKViewLayoutStrategy and subclasses: 162 - (void)_setDrawingAreaSize:(NSSize)size; 163 - (void)_updateViewExposedRect; 164 - (CALayer *)_rootLayer; 165 166 - (void)_updateSupportsArbitraryLayoutModes; 167 156 168 #if WK_API_ENABLED 157 169 @property (nonatomic, readonly) _WKRemoteObjectRegistry *_remoteObjectRegistry; -
trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.h
r191307 r191315 44 44 namespace WebKit { 45 45 46 class WebViewImpl;47 48 46 class PageClientImpl final : public PageClient 49 47 #if ENABLE(FULLSCREEN_API) … … 54 52 PageClientImpl(WKView *, WKWebView *); 55 53 virtual ~PageClientImpl(); 56 57 // FIXME: Eventually WebViewImpl should become the PageClient. 58 void setImpl(WebViewImpl& impl) { m_impl = &impl; } 59 54 60 55 void viewWillMoveToAnotherWindow(); 61 56 … … 219 214 WKView *m_wkView; 220 215 WKWebView *m_webView; 221 WebViewImpl* m_impl { nullptr };222 216 RetainPtr<WKEditorUndoTargetObjC> m_undoTarget; 223 217 #if USE(AUTOCORRECTION_PANEL) -
trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm
r191307 r191315 48 48 #import "WebEditCommandProxy.h" 49 49 #import "WebPopupMenuProxyMac.h" 50 #import "WebViewImpl.h"51 50 #import "WindowServerConnection.h" 52 51 #import "_WKDownloadInternal.h" … … 221 220 bool PageClientImpl::isViewFocused() 222 221 { 223 // FIXME: This is called from the WebPageProxy constructor before we have a WebViewImpl. 224 // Once WebViewImpl and PageClient merge, this won't be a problem. 225 if (!m_impl) 226 return NO; 227 228 return m_impl->isFocused(); 222 return [m_wkView _isFocused]; 229 223 } 230 224 … … 318 312 void PageClientImpl::didCommitLoadForMainFrame(const String& mimeType, bool useCustomContentProvider) 319 313 { 320 m_impl->updateSupportsArbitraryLayoutModes();314 [m_wkView _didCommitLoadForMainFrame]; 321 315 } 322 316 … … 440 434 void PageClientImpl::updateSecureInputState() 441 435 { 442 m_impl->updateSecureInputState();436 [m_wkView _updateSecureInputState]; 443 437 } 444 438 445 439 void PageClientImpl::resetSecureInputState() 446 440 { 447 m_impl->resetSecureInputState();441 [m_wkView _resetSecureInputState]; 448 442 } 449 443 450 444 void PageClientImpl::notifyInputContextAboutDiscardedComposition() 451 445 { 452 m_impl->notifyInputContextAboutDiscardedComposition();446 [m_wkView _notifyInputContextAboutDiscardedComposition]; 453 447 } 454 448 … … 730 724 { 731 725 [m_wkView._fullScreenWindowController beganEnterFullScreenWithInitialFrame:initialFrame finalFrame:finalFrame]; 732 m_impl->updateSupportsArbitraryLayoutModes();726 [m_wkView _updateSupportsArbitraryLayoutModes]; 733 727 } 734 728 … … 736 730 { 737 731 [m_wkView._fullScreenWindowController beganExitFullScreenWithInitialFrame:initialFrame finalFrame:finalFrame]; 738 m_impl->updateSupportsArbitraryLayoutModes();732 [m_wkView _updateSupportsArbitraryLayoutModes]; 739 733 } 740 734 -
trunk/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.h
r191307 r191315 31 31 namespace WebKit { 32 32 class LayerTreeContext; 33 class WebPageProxy;34 33 } 35 34 … … 46 45 @interface WKFullScreenWindowController : NSWindowController<NSWindowDelegate> { 47 46 @private 48 NSView *_webView; // Cannot be retained, see <rdar://problem/14884666>. 49 WebKit::WebPageProxy* _page; 47 WKView *_webView; // Cannot be retained, see <rdar://problem/14884666>. 50 48 RetainPtr<WebCoreFullScreenPlaceholderView> _webViewPlaceholder; 51 49 RetainPtr<NSView> _clipView; … … 63 61 @property (readonly) NSRect finalFrame; 64 62 65 - (id)initWithWindow:(NSWindow *)window webView:( NSView *)webView page:(WebKit::WebPageProxy&)page;63 - (id)initWithWindow:(NSWindow *)window webView:(WKView *)webView; 66 64 67 65 - (WebCoreFullScreenPlaceholderView*)webViewPlaceholder; -
trunk/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm
r191307 r191315 64 64 @end 65 65 66 @interface WKFullScreenWindowController (Private)<NSAnimationDelegate>66 @interface WKFullScreenWindowController(Private)<NSAnimationDelegate> 67 67 - (void)_replaceView:(NSView*)view with:(NSView*)otherView; 68 - (WebPageProxy*)_page; 68 69 - (WebFullScreenManagerProxy*)_manager; 69 70 - (void)_startEnterFullScreenAnimationWithDuration:(NSTimeInterval)duration; … … 86 87 #pragma mark - 87 88 #pragma mark Initialization 88 - (id)initWithWindow:(NSWindow *)window webView:( NSView *)webView page:(WebPageProxy&)page89 - (id)initWithWindow:(NSWindow *)window webView:(WKView *)webView 89 90 { 90 91 self = [super initWithWindow:window]; … … 106 107 [self windowDidLoad]; 107 108 _webView = webView; 108 _page = &page;109 109 110 110 return self; … … 242 242 // https://bugs.webkit.org/show_bug.cgi?id=88940 and https://bugs.webkit.org/show_bug.cgi?id=88374 243 243 // We will resume the normal behavior in _startEnterFullScreenAnimationWithDuration: 244 _page->setSuppressVisibilityUpdates(true);244 [_webView _setSuppressVisibilityUpdates:YES]; 245 245 246 246 // Swap the webView placeholder into place. … … 254 254 255 255 // Then insert the WebView into the full screen window 256 NSView *contentView = [[self window] contentView];256 NSView* contentView = [[self window] contentView]; 257 257 [_clipView addSubview:_webView positioned:NSWindowBelow relativeTo:nil]; 258 258 [_webView setFrame:[contentView bounds]]; … … 260 260 makeResponderFirstResponderIfDescendantOfView(self.window, webWindowFirstResponder, _webView); 261 261 262 _savedScale = _page->pageScaleFactor();263 _page->scalePage(1, IntPoint());262 _savedScale = [self _page]->pageScaleFactor(); 263 [self _page]->scalePage(1, IntPoint()); 264 264 [self _manager]->setAnimatingFullScreen(true); 265 265 [self _manager]->willEnterFullScreen(); … … 310 310 311 311 [[self window] setAutodisplay:YES]; 312 _page->setSuppressVisibilityUpdates(false);312 [_webView _setSuppressVisibilityUpdates:NO]; 313 313 314 314 NSResponder *firstResponder = [[self window] firstResponder]; … … 317 317 [[_webView window] makeKeyAndOrderFront:self]; 318 318 319 _page->scalePage(_savedScale, IntPoint());319 [self _page]->scalePage(_savedScale, IntPoint()); 320 320 [self _manager]->restoreScrollPosition(); 321 321 [self _manager]->didExitFullScreen(); … … 345 345 // See the related comment in enterFullScreen: 346 346 // We will resume the normal behavior in _startExitFullScreenAnimationWithDuration: 347 _page->setSuppressVisibilityUpdates(true);347 [_webView _setSuppressVisibilityUpdates:YES]; 348 348 [_webViewPlaceholder setTarget:nil]; 349 349 … … 380 380 // Screen updates to be re-enabled in completeFinishExitFullScreenAnimationAfterRepaint. 381 381 NSDisableScreenUpdates(); 382 _page->setSuppressVisibilityUpdates(true);382 [_webView _setSuppressVisibilityUpdates:YES]; 383 383 [[self window] orderOut:self]; 384 384 NSView *contentView = [[self window] contentView]; … … 395 395 [self _manager]->didExitFullScreen(); 396 396 [self _manager]->setAnimatingFullScreen(false); 397 _page->scalePage(_savedScale, IntPoint());397 [self _page]->scalePage(_savedScale, IntPoint()); 398 398 [self _manager]->restoreScrollPosition(); 399 399 … … 407 407 [self completeFinishExitFullScreenAnimationAfterRepaint]; 408 408 }); 409 _page->forceRepaint(_repaintCallback);409 [self _page]->forceRepaint(_repaintCallback); 410 410 } 411 411 … … 415 415 [[_webView window] setAutodisplay:YES]; 416 416 [[_webView window] displayIfNeeded]; 417 _page->setSuppressVisibilityUpdates(false);417 [_webView _setSuppressVisibilityUpdates:NO]; 418 418 NSEnableScreenUpdates(); 419 419 } … … 488 488 #pragma mark Internal Interface 489 489 490 - (WebPageProxy*)_page 491 { 492 return toImpl([_webView pageRef]); 493 } 494 490 495 - (WebFullScreenManagerProxy*)_manager 491 496 { 492 if (!_page) 493 return nullptr; 494 return _page->fullScreenManager(); 497 WebPageProxy* webPage = [self _page]; 498 if (!webPage) 499 return 0; 500 return webPage->fullScreenManager(); 495 501 } 496 502 … … 599 605 [window setCollectionBehavior:behavior]; 600 606 601 _page->setSuppressVisibilityUpdates(false);607 [_webView _setSuppressVisibilityUpdates:NO]; 602 608 [[self window] setAutodisplay:YES]; 603 609 [[self window] displayIfNeeded]; … … 622 628 [contentView.layer addAnimation:fadeAnimation(duration, AnimateOut) forKey:@"fullscreen"]; 623 629 624 _page->setSuppressVisibilityUpdates(false);630 [_webView _setSuppressVisibilityUpdates:NO]; 625 631 [[self window] setAutodisplay:YES]; 626 632 [[self window] displayIfNeeded]; -
trunk/Source/WebKit2/UIProcess/mac/WKViewLayoutStrategy.h
r191307 r191315 33 33 namespace WebKit { 34 34 class WebPageProxy; 35 class WebViewImpl;36 35 } 37 36 38 @class NSView;37 @class WKView; 39 38 40 39 @interface WKViewLayoutStrategy : NSObject { 41 40 @package 42 WebKit::WebPageProxy* _page; 43 WebKit::WebViewImpl* _webViewImpl; 44 NSView *_view; 41 WebKit::WebPageProxy *_page; 42 WKView *_wkView; 45 43 46 44 WKLayoutMode _layoutMode; … … 48 46 } 49 47 50 + (instancetype)layoutStrategyWithPage:(WebKit::WebPageProxy&)page view:( NSView *)view viewImpl:(WebKit::WebViewImpl&)webViewImplmode:(WKLayoutMode)mode;48 + (instancetype)layoutStrategyWithPage:(WebKit::WebPageProxy&)page view:(WKView *)wkView mode:(WKLayoutMode)mode; 51 49 52 - (void) invalidate;50 - (void)willDestroyView:(WKView *)view; 53 51 54 52 - (void)enableFrameSizeUpdates; -
trunk/Source/WebKit2/UIProcess/mac/WKViewLayoutStrategy.mm
r191307 r191315 29 29 #if PLATFORM(MAC) 30 30 31 #import "WKViewInternal.h" 31 32 #import "WebPageProxy.h" 32 #import "WebViewImpl.h"33 33 #import <WebCore/MachSendRight.h> 34 34 #import <WebCore/QuartzCoreSPI.h> … … 51 51 @implementation WKViewLayoutStrategy 52 52 53 + (instancetype)layoutStrategyWithPage:(WebPageProxy&)page view:( NSView *)view viewImpl:(WebViewImpl&)webViewImplmode:(WKLayoutMode)mode53 + (instancetype)layoutStrategyWithPage:(WebPageProxy&)page view:(WKView *)wkView mode:(WKLayoutMode)mode 54 54 { 55 55 WKViewLayoutStrategy *strategy; … … 57 57 switch (mode) { 58 58 case kWKLayoutModeFixedSize: 59 strategy = [[WKViewFixedSizeLayoutStrategy alloc] initWithPage:page view: view viewImpl:webViewImplmode:mode];59 strategy = [[WKViewFixedSizeLayoutStrategy alloc] initWithPage:page view:wkView mode:mode]; 60 60 break; 61 61 case kWKLayoutModeDynamicSizeComputedFromViewScale: 62 strategy = [[WKViewDynamicSizeComputedFromViewScaleLayoutStrategy alloc] initWithPage:page view: view viewImpl:webViewImplmode:mode];62 strategy = [[WKViewDynamicSizeComputedFromViewScaleLayoutStrategy alloc] initWithPage:page view:wkView mode:mode]; 63 63 break; 64 64 case kWKLayoutModeDynamicSizeComputedFromMinimumDocumentSize: 65 strategy = [[WKViewDynamicSizeComputedFromMinimumDocumentSizeLayoutStrategy alloc] initWithPage:page view: view viewImpl:webViewImplmode:mode];65 strategy = [[WKViewDynamicSizeComputedFromMinimumDocumentSizeLayoutStrategy alloc] initWithPage:page view:wkView mode:mode]; 66 66 break; 67 67 case kWKLayoutModeViewSize: 68 68 default: 69 strategy = [[WKViewViewSizeLayoutStrategy alloc] initWithPage:page view: view viewImpl:webViewImplmode:mode];69 strategy = [[WKViewViewSizeLayoutStrategy alloc] initWithPage:page view:wkView mode:mode]; 70 70 break; 71 71 } … … 76 76 } 77 77 78 - (instancetype)initWithPage:(WebPageProxy&)page view:( NSView *)view viewImpl:(WebViewImpl&)webViewImplmode:(WKLayoutMode)mode78 - (instancetype)initWithPage:(WebPageProxy&)page view:(WKView *)wkView mode:(WKLayoutMode)mode 79 79 { 80 80 self = [super init]; … … 84 84 85 85 _page = &page; 86 _webViewImpl = &webViewImpl; 87 _view = view; 86 _wkView = wkView; 88 87 _layoutMode = mode; 89 88 … … 91 90 } 92 91 93 - (void) invalidate92 - (void)willDestroyView:(WKView *)view 94 93 { 95 94 _page = nullptr; 96 _webViewImpl = nullptr; 97 _view = nil; 95 _wkView = nil; 98 96 } 99 97 … … 143 141 return; 144 142 145 if (_w ebViewImpl->clipsToVisibleRect())146 _webViewImpl->updateViewExposedRect();147 _webViewImpl->setDrawingAreaSize(NSSizeToCGSize(_view.frame.size));143 if (_wkView.shouldClipToVisibleRect) 144 [_wkView _updateViewExposedRect]; 145 [_wkView _setDrawingAreaSize:_wkView.frame.size]; 148 146 } 149 147 … … 156 154 @implementation WKViewViewSizeLayoutStrategy 157 155 158 - (instancetype)initWithPage:(WebPageProxy&)page view:( NSView *)view viewImpl:(WebViewImpl&)webViewImplmode:(WKLayoutMode)mode159 { 160 self = [super initWithPage:page view: view viewImpl:webViewImplmode:mode];156 - (instancetype)initWithPage:(WebPageProxy&)page view:(WKView *)wkView mode:(WKLayoutMode)mode 157 { 158 self = [super initWithPage:page view:wkView mode:mode]; 161 159 162 160 if (!self) … … 176 174 @implementation WKViewFixedSizeLayoutStrategy 177 175 178 - (instancetype)initWithPage:(WebPageProxy&)page view:( NSView *)view viewImpl:(WebViewImpl&)webViewImplmode:(WKLayoutMode)mode179 { 180 self = [super initWithPage:page view: view viewImpl:webViewImplmode:mode];176 - (instancetype)initWithPage:(WebPageProxy&)page view:(WKView *)wkView mode:(WKLayoutMode)mode 177 { 178 self = [super initWithPage:page view:wkView mode:mode]; 181 179 182 180 if (!self) … … 196 194 @implementation WKViewDynamicSizeComputedFromViewScaleLayoutStrategy 197 195 198 - (instancetype)initWithPage:(WebPageProxy&)page view:( NSView *)view viewImpl:(WebViewImpl&)webViewImplmode:(WKLayoutMode)mode199 { 200 self = [super initWithPage:page view: view viewImpl:webViewImplmode:mode];196 - (instancetype)initWithPage:(WebPageProxy&)page view:(WKView *)wkView mode:(WKLayoutMode)mode 197 { 198 self = [super initWithPage:page view:wkView mode:mode]; 201 199 202 200 if (!self) … … 211 209 { 212 210 CGFloat inverseScale = 1 / _page->viewScaleFactor(); 213 _webViewImpl->setFixedLayoutSize(CGSizeMake(_view.frame.size.width * inverseScale, _view.frame.size.height * inverseScale));211 [_wkView _setFixedLayoutSize:CGSizeMake(_wkView.frame.size.width * inverseScale, _wkView.frame.size.height * inverseScale)]; 214 212 } 215 213 … … 225 223 [super didChangeFrameSize]; 226 224 227 if ( self.frameSizeUpdatesDisabled)225 if ([_wkView frameSizeUpdatesDisabled]) 228 226 return; 229 227 … … 235 233 @implementation WKViewDynamicSizeComputedFromMinimumDocumentSizeLayoutStrategy 236 234 237 - (instancetype)initWithPage:(WebPageProxy&)page view:( NSView *)view viewImpl:(WebViewImpl&)webViewImplmode:(WKLayoutMode)mode238 { 239 self = [super initWithPage:page view: view viewImpl:webViewImplmode:mode];235 - (instancetype)initWithPage:(WebPageProxy&)page view:(WKView *)wkView mode:(WKLayoutMode)mode 236 { 237 self = [super initWithPage:page view:wkView mode:mode]; 240 238 241 239 if (!self) -
trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
r191307 r191315 697 697 2E0B8A7A1BC59A590044B32D /* _WKFormDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E0B8A791BC59A590044B32D /* _WKFormDelegate.h */; settings = {ATTRIBUTES = (Private, ); }; }; 698 698 2E7A944A1BBD97C300945547 /* _WKFocusedElementInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E7A94491BBD95C600945547 /* _WKFocusedElementInfo.h */; settings = {ATTRIBUTES = (Private, ); }; }; 699 2DFC7DBB1BCCC19500C1548C /* WebViewImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DFC7DB91BCCC19500C1548C /* WebViewImpl.h */; settings = {ASSET_TAGS = (); }; };700 2DFC7DBC1BCCC19500C1548C /* WebViewImpl.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2DFC7DBA1BCCC19500C1548C /* WebViewImpl.mm */; settings = {ASSET_TAGS = (); }; };701 699 31099973146C75A20029DEB9 /* WebNotificationClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31099971146C759B0029DEB9 /* WebNotificationClient.cpp */; }; 702 700 310999C7146C9E3D0029DEB9 /* WebNotificationClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 31099968146C71F50029DEB9 /* WebNotificationClient.h */; }; … … 2863 2861 2E0B8A791BC59A590044B32D /* _WKFormDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKFormDelegate.h; sourceTree = "<group>"; }; 2864 2862 2E7A94491BBD95C600945547 /* _WKFocusedElementInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _WKFocusedElementInfo.h; sourceTree = "<group>"; }; 2865 2DFC7DB91BCCC19500C1548C /* WebViewImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebViewImpl.h; sourceTree = "<group>"; };2866 2DFC7DBA1BCCC19500C1548C /* WebViewImpl.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebViewImpl.mm; sourceTree = "<group>"; };2867 2863 31099968146C71F50029DEB9 /* WebNotificationClient.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebNotificationClient.h; sourceTree = "<group>"; }; 2868 2864 31099971146C759B0029DEB9 /* WebNotificationClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebNotificationClient.cpp; sourceTree = "<group>"; }; … … 4946 4942 7CE4D2151A49148400C7F152 /* WebProcessPoolCocoa.mm */, 4947 4943 1A04F6171A4A3A7A00A21B6E /* WebProcessProxyCocoa.mm */, 4948 2DFC7DB91BCCC19500C1548C /* WebViewImpl.h */,4949 2DFC7DBA1BCCC19500C1548C /* WebViewImpl.mm */,4950 4944 1AD01BCB1905D54900C9C45F /* WKReloadFrameErrorRecoveryAttempter.h */, 4951 4945 1AD01BCA1905D54900C9C45F /* WKReloadFrameErrorRecoveryAttempter.mm */, … … 7672 7666 BC82837A16B36A4F00A278FE /* ChildProcessEntryPoint.h in Headers */, 7673 7667 51FAEC3A1B0657630009C4E7 /* ChildProcessMessages.h in Headers */, 7674 2DFC7DBB1BCCC19500C1548C /* WebViewImpl.h in Headers */,7675 7668 E1513C67166EABB200149FCB /* ChildProcessProxy.h in Headers */, 7676 7669 290F4272172A0C7400939FF0 /* ChildProcessSupplement.h in Headers */, … … 9813 9806 BC111A5B112F4FBB00337BAB /* WebContextMenuClient.cpp in Sources */, 9814 9807 51021E9C12B16788005C033C /* WebContextMenuClientMac.mm in Sources */, 9815 2DFC7DBC1BCCC19500C1548C /* WebViewImpl.mm in Sources */,9816 9808 512935D71288D19400A4B695 /* WebContextMenuItem.cpp in Sources */, 9817 9809 510FBB9A1288C95E00AFFDF4 /* WebContextMenuItemData.cpp in Sources */,
Note: See TracChangeset
for help on using the changeset viewer.