Changeset 246905 in webkit


Ignore:
Timestamp:
Jun 27, 2019 2:11:13 PM (5 years ago)
Author:
timothy@apple.com
Message:

Move WebKitLegacy off of a couple AppKit ivars.
https://bugs.webkit.org/show_bug.cgi?id=199279
rdar://problem/34983438

Reviewed by Tim Horton.

Source/WebKitLegacy/mac:

  • WebView/WebHTMLView.mm:

(-[NSView _setSubviewsIvar:]): Added. Implement on older systems.
(-[NSView _subviewsIvar]): Added. Ditto.
(needsCursorRectsSupportAtPoint): Use _borderView property.
(-[WebHTMLView _setAsideSubviews]): Use _subviewsIvar property.
(-[NSWindow _web_borderView]): Deleted.

Source/WTF:

  • wtf/Platform.h: Added HAVE_SUBVIEWS_IVAR_SPI.
Location:
trunk/Source
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r246892 r246905  
     12019-06-27  Timothy Hatcher  <timothy@apple.com>
     2
     3        Move WebKitLegacy off of a couple AppKit ivars.
     4        https://bugs.webkit.org/show_bug.cgi?id=199279
     5        rdar://problem/34983438
     6
     7        Reviewed by Tim Horton.
     8
     9        * wtf/Platform.h: Added HAVE_SUBVIEWS_IVAR_SPI.
     10
    1112019-06-27  Beth Dakin  <bdakin@apple.com>
    212
  • trunk/Source/WTF/wtf/Platform.h

    r246892 r246905  
    16001600#define USE_INTEL_METAL_WORKAROUND 1
    16011601#endif
     1602
     1603#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500
     1604#define HAVE_SUBVIEWS_IVAR_SPI 1
     1605#endif
  • trunk/Source/WebKitLegacy/mac/ChangeLog

    r246892 r246905  
     12019-06-27  Timothy Hatcher  <timothy@apple.com>
     2
     3        Move WebKitLegacy off of a couple AppKit ivars.
     4        https://bugs.webkit.org/show_bug.cgi?id=199279
     5        rdar://problem/34983438
     6
     7        Reviewed by Tim Horton.
     8
     9        * WebView/WebHTMLView.mm:
     10        (-[NSView _setSubviewsIvar:]): Added. Implement on older systems.
     11        (-[NSView _subviewsIvar]): Added. Ditto.
     12        (needsCursorRectsSupportAtPoint): Use _borderView property.
     13        (-[WebHTMLView _setAsideSubviews]): Use _subviewsIvar property.
     14        (-[NSWindow _web_borderView]): Deleted.
     15
    1162019-06-27  Beth Dakin  <bdakin@apple.com>
    217
  • trunk/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm

    r246429 r246905  
    214214
    215215@interface NSWindow ()
     216@property (readonly) __kindof NSView *_borderView;
     217
    216218- (id)_newFirstResponderAfterResigning;
    217219@end
    218220
    219 @interface NSWindow (WebBorderViewAccess)
    220 - (NSView *)_web_borderView;
     221@interface NSView (SubviewsIvar)
     222@property (nullable, assign, setter=_setSubviewsIvar:) NSMutableArray<__kindof NSView *> *_subviewsIvar;
    221223@end
     224
     225#if !HAVE(SUBVIEWS_IVAR_SPI)
     226@implementation NSView (SubviewsIvar)
     227
     228- (void)_setSubviewsIvar:(NSMutableArray<__kindof NSView *> *)subviews {
     229    ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     230    _subviews = subviews;
     231    ALLOW_DEPRECATED_DECLARATIONS_END
     232}
     233
     234- (NSMutableArray<__kindof NSView *> *)_subviewsIvar {
     235    ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     236    return (NSMutableArray *)_subviews;
     237    ALLOW_DEPRECATED_DECLARATIONS_END
     238}
     239
     240@end
     241#endif
    222242
    223243using WebEvent = NSEvent;
     
    627647@end
    628648
    629 @implementation NSWindow (WebBorderViewAccess)
    630 
    631 - (NSView *)_web_borderView
    632 {
    633     ALLOW_DEPRECATED_DECLARATIONS_BEGIN
    634     return _borderView;
    635     ALLOW_DEPRECATED_DECLARATIONS_END
    636 }
    637 
    638 @end
    639 
    640649@interface WebResponderChainSink : NSResponder {
    641650    NSResponder* _lastResponderInChain;
     
    686695{
    687696    forceNSViewHitTest = YES;
    688     NSView* view = [[window _web_borderView] hitTest:point];
     697    NSView* view = [window._borderView hitTest:point];
    689698    forceNSViewHitTest = NO;
    690699
     
    15451554    ASSERT(!_private->subviewsSetAside);
    15461555    ASSERT(_private->savedSubviews == nil);
    1547     ALLOW_DEPRECATED_DECLARATIONS_BEGIN
    1548     _private->savedSubviews = _subviews;
    1549     ALLOW_DEPRECATED_DECLARATIONS_END
     1556    _private->savedSubviews = self._subviewsIvar;
    15501557    // We need to keep the layer-hosting view in the subviews, otherwise the layers flash.
    15511558    if (_private->layerHostingView) {
    1552         NSArray* newSubviews = [[NSArray alloc] initWithObjects:_private->layerHostingView, nil];
    1553         ALLOW_DEPRECATED_DECLARATIONS_BEGIN
    1554         _subviews = newSubviews;
     1559        NSMutableArray* newSubviews = [[NSMutableArray alloc] initWithObjects:_private->layerHostingView, nil];
     1560        self._subviewsIvar = newSubviews;
    15551561    } else
    1556         _subviews = nil;
    1557     ALLOW_DEPRECATED_DECLARATIONS_END
     1562        self._subviewsIvar = nil;
    15581563    _private->subviewsSetAside = YES;
    15591564#endif
     
    15651570    ASSERT(_private->subviewsSetAside);
    15661571    if (_private->layerHostingView) {
    1567         ALLOW_DEPRECATED_DECLARATIONS_BEGIN
    1568         [_subviews release];
    1569         _subviews = _private->savedSubviews;
     1572        [self._subviewsIvar release];
     1573        self._subviewsIvar = _private->savedSubviews;
    15701574    } else {
    1571         ASSERT(_subviews == nil);
    1572         _subviews = _private->savedSubviews;
    1573         ALLOW_DEPRECATED_DECLARATIONS_END
     1575        ASSERT(self._subviewsIvar == nil);
     1576        self._subviewsIvar = _private->savedSubviews;
    15741577    }
    15751578    _private->savedSubviews = nil;
Note: See TracChangeset for help on using the changeset viewer.