From 8ccc8229b8fd08e55272da22001e13c017121b0d Mon Sep 17 00:00:00 2001 From: Makoto Kato Date: Fri, 27 May 2016 00:05:10 +0900 Subject: [PATCH] Backed out changeset d89f93a40f78 (bug 1212527) due to static analysis bustage MozReview-Commit-ID: 79SduJl9zcs --- widget/cocoa/nsChildView.mm | 32 -------------------------------- widget/cocoa/nsCocoaWindow.h | 2 -- widget/cocoa/nsCocoaWindow.mm | 10 ---------- 3 files changed, 44 deletions(-) diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm index 02c472e67c8c..6a92c36dc9cc 100644 --- a/widget/cocoa/nsChildView.mm +++ b/widget/cocoa/nsChildView.mm @@ -2880,36 +2880,6 @@ nsChildView::DispatchAPZWheelInputEvent(InputData& aEvent, bool aCanTriggerSwipe } } -// When using 10.11, calling showDefinitionForAttributedString causes the -// following exception on LookupViewService. (rdar://26476091) -// -// Exception: decodeObjectForKey: class "TitlebarAndBackgroundColor" not -// loaded or does not exist -// -// So we set temporary color that is NSColor before calling it. - -class MOZ_RAII AutoBackgroundSetter final { -public: - AutoBackgroundSetter(NSView* aView) { - if (nsCocoaFeatures::OnElCapitanOrLater() && - [[aView window] isKindOfClass:[ToolbarWindow class]]) { - mWindow = (ToolbarWindow*)[aView window]; - [mWindow setTemporaryBackgroundColor]; - } else { - mWindow = nullptr; - } - } - - ~AutoBackgroundSetter() { - if (mWindow) { - [mWindow restoreBackgroundColor]; - } - } - -private: - ToolbarWindow* mWindow; -}; - void nsChildView::LookUpDictionary( const nsAString& aText, @@ -2934,8 +2904,6 @@ nsChildView::LookUpDictionary( pt.y += [font ascender]; } } - - AutoBackgroundSetter setter(mView); [mView showDefinitionForAttributedString:attrStr atPoint:pt]; NS_OBJC_END_TRY_ABORT_BLOCK; diff --git a/widget/cocoa/nsCocoaWindow.h b/widget/cocoa/nsCocoaWindow.h index 00fb9e2db459..a86c3d0eb3a7 100644 --- a/widget/cocoa/nsCocoaWindow.h +++ b/widget/cocoa/nsCocoaWindow.h @@ -241,8 +241,6 @@ typedef struct _nsCocoaWindowList { - (void)placeFullScreenButton:(NSRect)aRect; - (NSPoint)windowButtonsPositionWithDefaultPosition:(NSPoint)aDefaultPosition; - (NSPoint)fullScreenButtonPositionWithDefaultPosition:(NSPoint)aDefaultPosition; -- (void)setTemporaryBackgroundColor; -- (void)restoreBackgroundColor; @end class nsCocoaWindow : public nsBaseWidget, public nsPIWidgetCocoa diff --git a/widget/cocoa/nsCocoaWindow.mm b/widget/cocoa/nsCocoaWindow.mm index f1dbe3ef8575..9b378f0ba6da 100644 --- a/widget/cocoa/nsCocoaWindow.mm +++ b/widget/cocoa/nsCocoaWindow.mm @@ -3401,16 +3401,6 @@ static const NSString* kStateCollectionBehavior = @"collectionBehavior"; return mBackgroundColor; } -- (void)setTemporaryBackgroundColor -{ - [super setBackgroundColor:[NSColor whiteColor]]; -} - -- (void)restoreBackgroundColor -{ - [super setBackgroundColor:mBackgroundColor]; -} - - (void)setTitlebarNeedsDisplayInRect:(NSRect)aRect { [self setTitlebarNeedsDisplayInRect:aRect sync:NO];