Bug 1533562 - Remove code that deals with non-rounded bottom corners on regular windows. r=spohl
authorMarkus Stange <mstange@themasta.com>
Mon, 29 Apr 2019 16:59:25 +0000
changeset 471828 19d8e4a62f4d677541e7e3c71aa3d3ed607f97db
parent 471827 ffbfe4a683f6fc5a2a89fa86e9d992f4c4e00f22
child 471829 c252f4c4a3b42b25c98432da15cfd5702d0eb840
push id35935
push usershindli@mozilla.com
push dateTue, 30 Apr 2019 03:46:04 +0000
treeherdermozilla-central@f3c2a7206699 [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 code that deals with non-rounded bottom corners on regular windows. r=spohl Rounded bottom corners have been the default since 10.7. We still have square corners on windows without titlebars, such as the address bar autocomplete dropdown, or the reftest window. Differential Revision: https://phabricator.services.mozilla.com/D22643
widget/cocoa/nsChildView.mm
widget/cocoa/nsCocoaWindow.h
widget/cocoa/nsCocoaWindow.mm
--- a/widget/cocoa/nsChildView.mm
+++ b/widget/cocoa/nsChildView.mm
@@ -3392,17 +3392,17 @@ NSEvent* gLastDragMouseDownEvent = nil;
   if ([self hasRoundedBottomCorners]) {
     NSRectFill(NSMakeRect(0, h - radius, radius, radius));
     NSRectFill(NSMakeRect(w - radius, h - radius, radius, radius));
   }
 }
 
 // This is the analog of nsChildView::MaybeDrawRoundedCorners for CGContexts.
 // We only need to mask the top corners here because Cocoa does the masking
-// for the window's bottom corners automatically (starting with 10.7).
+// for the window's bottom corners automatically.
 - (void)maskTopCornersInContext:(CGContextRef)aContext {
   CGFloat radius = [self cornerRadius];
   int32_t devPixelCornerRadius = mGeckoChild->CocoaPointsToDevPixels(radius);
 
   // First make sure that mTopLeftCornerMask is set up.
   if (!mTopLeftCornerMask || int32_t(CGImageGetWidth(mTopLeftCornerMask)) != devPixelCornerRadius) {
     CGImageRelease(mTopLeftCornerMask);
     CGColorSpaceRef rgb = CGColorSpaceCreateDeviceRGB();
--- a/widget/cocoa/nsCocoaWindow.h
+++ b/widget/cocoa/nsCocoaWindow.h
@@ -94,21 +94,16 @@ typedef struct _nsCocoaWindowList {
 
 // If a window has been explicitly removed from the "window cache" (to
 // deactivate it), it's sometimes necessary to "reset" it to reactivate it
 // (and put it back in the "window cache").  One way to do this, which Apple
 // often uses, is to set the "window number" to '-1' and then back to its
 // original value.
 - (void)_setWindowNumber:(NSInteger)aNumber;
 
-// If we set the window's stylemask to be textured, the corners on the bottom of
-// the window are rounded by default. We use this private method to make
-// the corners square again, a la Safari. Starting with 10.7, all windows have
-// rounded bottom corners, so this call doesn't have any effect there.
-- (void)setBottomCornerRounded:(BOOL)rounded;
 - (BOOL)bottomCornerRounded;
 
 // Present in the same form on OS X since at least OS X 10.5.
 - (NSRect)contentRectForFrameRect:(NSRect)windowFrame styleMask:(NSUInteger)windowStyle;
 - (NSRect)frameRectForContentRect:(NSRect)windowContentRect styleMask:(NSUInteger)windowStyle;
 
 // Present since at least OS X 10.5.  The OS calls this method on NSWindow
 // (and its subclasses) to find out which NSFrameView subclass to instantiate
--- a/widget/cocoa/nsCocoaWindow.mm
+++ b/widget/cocoa/nsCocoaWindow.mm
@@ -3165,21 +3165,16 @@ static const NSString* kStateCollectionB
   if ((self = [super initWithContentRect:aContentRect
                                styleMask:aStyle
                                  backing:aBufferingType
                                    defer:aFlag])) {
     mUnifiedToolbarHeight = 22.0f;
     mSheetAttachmentPosition = aContentRect.size.height;
     mWindowButtonsRect = NSZeroRect;
     mFullScreenButtonRect = NSZeroRect;
-
-    // setBottomCornerRounded: is a private API call, so we check to make sure
-    // we respond to it just in case.
-    if ([self respondsToSelector:@selector(setBottomCornerRounded:)])
-      [self setBottomCornerRounded:YES];
   }
   return self;
 
   NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
 }
 
 - (void)setTitlebarNeedsDisplay {
   NSRect rect = [self titlebarRect];