Bug 1533562 - Remove override of -[NSThemeFrame _unifiedToolbarFrame]. r=spohl
☠☠ backed out by 73e8dcb8be07 ☠ ☠
authorMarkus Stange <mstange@themasta.com>
Mon, 22 Apr 2019 19:26:29 +0000
changeset 470392 3a3b4d52e10a17f947717e0e468665d2bdcfb57e
parent 470391 5fae2f233aa03481685694cfa013c9b4d50d5608
child 470393 498cd34eea782ce73c1eaffd193427add877117c
push id35905
push userdvarga@mozilla.com
push dateTue, 23 Apr 2019 09:53:27 +0000
treeherdermozilla-central@831918f009f6 [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