Bug 1533562 - Remove override of -[NSThemeFrame _unifiedToolbarFrame]. r=spohl
☠☠ backed out by d2f707cb83c9 ☠ ☠
authorMarkus Stange <mstange@themasta.com>
Fri, 26 Apr 2019 17:26:31 +0000
changeset 530365 710d3c0129de293e625a284b450af7024062449d
parent 530364 64720021f45c1fc1b2eaaf78084aa14d99e7b069
child 530366 00ffda400dc5824428e78eea2a994e02bfb39d75
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersspohl
bugs1533562
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1533562 - Remove override of -[NSThemeFrame _unifiedToolbarFrame]. r=spohl This override has no effect in CoreAnimation-backed windows. The upcoming patches will implement an alternative approach. Differential Revision: https://phabricator.services.mozilla.com/D22644
widget/cocoa/nsCocoaWindow.mm
--- a/widget/cocoa/nsCocoaWindow.mm
+++ b/widget/cocoa/nsCocoaWindow.mm
@@ -2580,17 +2580,16 @@ already_AddRefed<nsIWidget> nsIWidget::C
 }
 
 @end
 
 @interface NSView (FrameViewMethodSwizzling)
 - (NSPoint)FrameView__closeButtonOrigin;
 - (NSPoint)FrameView__fullScreenButtonOrigin;
 - (BOOL)FrameView__wantsFloatingTitlebar;
-- (NSRect)FrameView__unifiedToolbarFrame;
 @end
 
 @implementation NSView (FrameViewMethodSwizzling)
 
 - (NSPoint)FrameView__closeButtonOrigin {
   NSPoint defaultPosition = [self FrameView__closeButtonOrigin];
   if ([[self window] isKindOfClass:[ToolbarWindow class]]) {
     return [(ToolbarWindow*)[self window] windowButtonsPositionWithDefaultPosition:defaultPosition];
@@ -2606,28 +2605,16 @@ already_AddRefed<nsIWidget> nsIWidget::C
   }
   return defaultPosition;
 }
 
 - (BOOL)FrameView__wantsFloatingTitlebar {
   return NO;
 }
 
-- (NSRect)FrameView__unifiedToolbarFrame {
-  NSRect defaultFrame = [self FrameView__unifiedToolbarFrame];
-  if ([[self window] isKindOfClass:[ToolbarWindow class]]) {
-    CGFloat unifiedToolbarHeight = [(ToolbarWindow*)[self window] unifiedToolbarHeight];
-    CGFloat topEdge = NSMaxY(defaultFrame);
-    CGFloat bottomEdge = topEdge - unifiedToolbarHeight;
-    return NSMakeRect(defaultFrame.origin.x, bottomEdge, defaultFrame.size.width,
-                      unifiedToolbarHeight);
-  }
-  return defaultFrame;
-}
-
 @end
 
 static NSMutableSet* gSwizzledFrameViewClasses = nil;
 
 @interface NSWindow (PrivateSetNeedsDisplayInRectMethod)
 - (void)_setNeedsDisplayInRect:(NSRect)aRect;
 @end
 
@@ -2697,18 +2684,16 @@ static NSMutableSet* gSwizzledFrameViewC
   }
 
   static IMP our_closeButtonOrigin =
       class_getMethodImplementation([NSView class], @selector(FrameView__closeButtonOrigin));
   static IMP our_fullScreenButtonOrigin =
       class_getMethodImplementation([NSView class], @selector(FrameView__fullScreenButtonOrigin));
   static IMP our_wantsFloatingTitlebar =
       class_getMethodImplementation([NSView class], @selector(FrameView__wantsFloatingTitlebar));
-  static IMP our_unifiedToolbarFrame =
-      class_getMethodImplementation([NSView class], @selector(FrameView__unifiedToolbarFrame));
 
   if (![gSwizzledFrameViewClasses containsObject:frameViewClass]) {
     // Either of these methods might be implemented in both a subclass of
     // NSFrameView and one of its own subclasses.  Which means that if we
     // aren't careful we might end up swizzling the same method twice.
     // Since method swizzling involves swapping pointers, this would break
     // things.
     IMP _closeButtonOrigin =
@@ -2724,22 +2709,16 @@ static NSMutableSet* gSwizzledFrameViewC
                                 @selector(FrameView__fullScreenButtonOrigin));
     }
     IMP _wantsFloatingTitlebar =
         class_getMethodImplementation(frameViewClass, @selector(_wantsFloatingTitlebar));
     if (_wantsFloatingTitlebar && _wantsFloatingTitlebar != our_wantsFloatingTitlebar) {
       nsToolkit::SwizzleMethods(frameViewClass, @selector(_wantsFloatingTitlebar),
                                 @selector(FrameView__wantsFloatingTitlebar));
     }
-    IMP _unifiedToolbarFrame =
-        class_getMethodImplementation(frameViewClass, @selector(_unifiedToolbarFrame));
-    if (_unifiedToolbarFrame && _unifiedToolbarFrame != our_unifiedToolbarFrame) {
-      nsToolkit::SwizzleMethods(frameViewClass, @selector(_unifiedToolbarFrame),
-                                @selector(FrameView__unifiedToolbarFrame));
-    }
     [gSwizzledFrameViewClasses addObject:frameViewClass];
   }
 
   return frameViewClass;
 }
 
 - (id)initWithContentRect:(NSRect)aContentRect
                 styleMask:(NSUInteger)aStyle