Changeset 179752 in webkit


Ignore:
Timestamp:
Feb 6, 2015 12:46:19 PM (9 years ago)
Author:
timothy@apple.com
Message:

Support overriding the deviceScaleFactor per WKWebView/WKView
https://bugs.webkit.org/show_bug.cgi?id=141311

Reviewed by Tim Horton.

  • UIProcess/API/Cocoa/WKViewPrivate.h:
  • UIProcess/API/Cocoa/WKWebView.mm:

(-[WKWebView _setOverrideDeviceScaleFactor:]):
(-[WKWebView _overrideDeviceScaleFactor]):

  • UIProcess/API/Cocoa/WKWebViewPrivate.h:
  • UIProcess/API/mac/WKView.mm:

(-[WKView _intrinsicDeviceScaleFactor]):
(-[WKView _setOverrideDeviceScaleFactor:]):
(-[WKView _overrideDeviceScaleFactor]):

Location:
trunk/Source/WebKit2
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r179745 r179752  
     12015-02-05  Timothy Hatcher  <timothy@apple.com>
     2
     3        Support overriding the deviceScaleFactor per WKWebView/WKView
     4        https://bugs.webkit.org/show_bug.cgi?id=141311
     5
     6        Reviewed by Tim Horton.
     7
     8        * UIProcess/API/Cocoa/WKViewPrivate.h:
     9        * UIProcess/API/Cocoa/WKWebView.mm:
     10        (-[WKWebView _setOverrideDeviceScaleFactor:]):
     11        (-[WKWebView _overrideDeviceScaleFactor]):
     12        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
     13        * UIProcess/API/mac/WKView.mm:
     14        (-[WKView _intrinsicDeviceScaleFactor]):
     15        (-[WKView _setOverrideDeviceScaleFactor:]):
     16        (-[WKView _overrideDeviceScaleFactor]):
     17
    1182015-02-06  Carlos Garcia Campos  <cgarcia@igalia.com>
    219
  • trunk/Source/WebKit2/UIProcess/API/Cocoa/WKViewPrivate.h

    r178870 r179752  
    9191@property (nonatomic, setter=_setTotalHeightOfBanners:) CGFloat _totalHeightOfBanners;
    9292
     93@property (nonatomic, setter=_setOverrideDeviceScaleFactor:) CGFloat _overrideDeviceScaleFactor WK_AVAILABLE(WK_MAC_TBA, NA);
     94
    9395#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
    9496@property (nonatomic, setter=_setAutomaticallyAdjustsContentInsets:) BOOL _automaticallyAdjustsContentInsets;
  • trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm

    r179668 r179752  
    25312531}
    25322532
     2533- (void)_setOverrideDeviceScaleFactor:(CGFloat)deviceScaleFactor
     2534{
     2535    [_wkView _setOverrideDeviceScaleFactor:deviceScaleFactor];
     2536}
     2537
     2538- (CGFloat)_overrideDeviceScaleFactor
     2539{
     2540    return [_wkView _overrideDeviceScaleFactor];
     2541}
     2542
    25332543- (void)_setTopContentInset:(CGFloat)contentInset
    25342544{
  • trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h

    r178723 r179752  
    156156@property (nonatomic, setter=_setDrawsTransparentBackground:) BOOL _drawsTransparentBackground;
    157157@property (nonatomic, setter=_setTopContentInset:) CGFloat _topContentInset;
     158
    158159#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
    159160@property (nonatomic, setter=_setAutomaticallyAdjustsContentInsets:) BOOL _automaticallyAdjustsContentInsets;
    160161#endif
     162
     163// Default value is 0. A value of 0 means the window's backing scale factor will be used and automatically update when the window moves screens.
     164@property (nonatomic, setter=_setOverrideDeviceScaleFactor:) CGFloat _overrideDeviceScaleFactor WK_AVAILABLE(WK_MAC_TBA, NA);
    161165#endif
    162166
  • trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm

    r179373 r179752  
    262262    CGFloat _topContentInset;
    263263    CGFloat _totalHeightOfBanners;
     264
     265    CGFloat _overrideDeviceScaleFactor;
    264266
    265267#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
     
    28292831- (float)_intrinsicDeviceScaleFactor
    28302832{
     2833    if (_data->_overrideDeviceScaleFactor)
     2834        return _data->_overrideDeviceScaleFactor;
    28312835    if (_data->_targetWindowForMovePreparation)
    28322836        return [_data->_targetWindowForMovePreparation backingScaleFactor];
     
    41284132}
    41294133
     4134- (void)_setOverrideDeviceScaleFactor:(CGFloat)deviceScaleFactor
     4135{
     4136    _data->_overrideDeviceScaleFactor = deviceScaleFactor;
     4137    _data->_page->setIntrinsicDeviceScaleFactor([self _intrinsicDeviceScaleFactor]);
     4138}
     4139
     4140- (CGFloat)_overrideDeviceScaleFactor
     4141{
     4142    return _data->_overrideDeviceScaleFactor;
     4143}
     4144
    41304145- (void)_dispatchSetTopContentInset
    41314146{
Note: See TracChangeset for help on using the changeset viewer.