Backed out changeset dce49f743139 (bug 1597893) for build bustages on nsCocoaWindow.mm. CLOSED TREE
authorRazvan Maries <rmaries@mozilla.com>
Fri, 22 Nov 2019 14:50:12 +0200
changeset 503348 dcd2e52739ab9b70b637d0b43ff85d17ada8c899
parent 503347 bfe4bccb67304f3b6b2db3fdb3a3bd762e53cac0
child 503349 317361f21066c40e887df888be57e9ee0c171f15
push id36833
push userbtara@mozilla.com
push dateFri, 22 Nov 2019 21:40:53 +0000
treeherdermozilla-central@2c912e46295e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1597893
milestone72.0a1
backs outdce49f743139ded08bb54a0088a289cde0e2ccf8
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
Backed out changeset dce49f743139 (bug 1597893) for build bustages on nsCocoaWindow.mm. CLOSED TREE
layout/generic/nsContainerFrame.cpp
layout/style/ServoBindings.toml
layout/style/nsStyleConsts.h
layout/style/nsStyleStruct.cpp
layout/style/nsStyleStruct.h
layout/xul/nsMenuPopupFrame.cpp
layout/xul/nsMenuPopupFrame.h
servo/components/style/properties/longhands/ui.mako.rs
widget/cocoa/nsCocoaWindow.h
widget/cocoa/nsCocoaWindow.mm
widget/nsBaseWidget.h
widget/nsIWidget.h
--- a/layout/generic/nsContainerFrame.cpp
+++ b/layout/generic/nsContainerFrame.cpp
@@ -593,17 +593,17 @@ void nsContainerFrame::SyncWindowPropert
     // We can change this to allow translucent toplevel HTML documents
     // (e.g. to do something like Dashboard widgets), once we
     // have broad support for translucent scrolled documents, but be
     // careful because apparently some Firefox extensions expect
     // openDialog("something.html") to produce an opaque window
     // even if the HTML doesn't have a background-color set.
     nsTransparencyMode mode =
         nsLayoutUtils::GetFrameTransparency(aFrame, rootFrame);
-    StyleWindowShadow shadow = rootFrame->StyleUIReset()->mWindowShadow;
+    int32_t shadow = rootFrame->StyleUIReset()->mWindowShadow;
     nsCOMPtr<nsIWidget> viewWidget = aView->GetWidget();
     viewWidget->SetTransparencyMode(mode);
     windowWidget->SetWindowShadowStyle(shadow);
   }
 
   if (!aRC) return;
 
   if (!weak.IsAlive()) {
--- a/layout/style/ServoBindings.toml
+++ b/layout/style/ServoBindings.toml
@@ -103,17 +103,16 @@ rusty-enums = [
     "mozilla::StyleTextJustify",
     "mozilla::StyleHyphens",
     "mozilla::StyleShapeSourceType",
     "mozilla::StyleBasicShapeType",
     "nsStyleImageLayers_Size_DimensionType",
     "mozilla::StyleBorderCollapse",
     "mozilla::StyleBorderImageRepeat",
     "mozilla::StyleBoxPack",
-    "mozilla::StyleWindowShadow",
     "mozilla::StyleBoxOrient",
     "mozilla::StyleBoxAlign",
     "mozilla::StyleUserFocus",
     "mozilla::StyleUserSelect",
     "mozilla::StyleImageLayerRepeat",
     "mozilla::StyleImageLayerAttachment",
     "mozilla::StyleBoxDecorationBreak",
     "mozilla::StyleBorderStyle",
--- a/layout/style/nsStyleConsts.h
+++ b/layout/style/nsStyleConsts.h
@@ -729,23 +729,22 @@ enum class StyleWhiteSpace : uint8_t {
 #define NS_STYLE_IME_MODE_INACTIVE 4
 
 // See nsStyleSVG
 
 /*
  * -moz-window-shadow
  * Also used in widget code
  */
-enum class StyleWindowShadow : uint8_t {
-  None,
-  Default,
-  Menu,
-  Tooltip,
-  Sheet,
-};
+
+#define NS_STYLE_WINDOW_SHADOW_NONE 0
+#define NS_STYLE_WINDOW_SHADOW_DEFAULT 1
+#define NS_STYLE_WINDOW_SHADOW_MENU 2
+#define NS_STYLE_WINDOW_SHADOW_TOOLTIP 3
+#define NS_STYLE_WINDOW_SHADOW_SHEET 4
 
 // dominant-baseline
 #define NS_STYLE_DOMINANT_BASELINE_AUTO 0
 #define NS_STYLE_DOMINANT_BASELINE_IDEOGRAPHIC 1
 #define NS_STYLE_DOMINANT_BASELINE_ALPHABETIC 2
 #define NS_STYLE_DOMINANT_BASELINE_HANGING 3
 #define NS_STYLE_DOMINANT_BASELINE_MATHEMATICAL 4
 #define NS_STYLE_DOMINANT_BASELINE_CENTRAL 5
--- a/layout/style/nsStyleStruct.cpp
+++ b/layout/style/nsStyleStruct.cpp
@@ -3700,17 +3700,17 @@ nsChangeHint nsStyleUI::CalcDifference(c
 //
 
 nsStyleUIReset::nsStyleUIReset(const Document& aDocument)
     : mUserSelect(StyleUserSelect::Auto),
       mScrollbarWidth(StyleScrollbarWidth::Auto),
       mForceBrokenImageIcon(0),
       mIMEMode(NS_STYLE_IME_MODE_AUTO),
       mWindowDragging(StyleWindowDragging::Default),
-      mWindowShadow(StyleWindowShadow::Default),
+      mWindowShadow(NS_STYLE_WINDOW_SHADOW_DEFAULT),
       mWindowOpacity(1.0),
       mWindowTransformOrigin{LengthPercentage::FromPercentage(0.5),
                              LengthPercentage::FromPercentage(0.5),
                              {0.}} {
   MOZ_COUNT_CTOR(nsStyleUIReset);
 }
 
 nsStyleUIReset::nsStyleUIReset(const nsStyleUIReset& aSource)
--- a/layout/style/nsStyleStruct.h
+++ b/layout/style/nsStyleStruct.h
@@ -2071,17 +2071,17 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
 
   nsChangeHint CalcDifference(const nsStyleUIReset& aNewData) const;
 
   mozilla::StyleUserSelect mUserSelect;  // [reset](selection-style)
   mozilla::StyleScrollbarWidth mScrollbarWidth;
   uint8_t mForceBrokenImageIcon;  // (0 if not forcing, otherwise forcing)
   uint8_t mIMEMode;
   mozilla::StyleWindowDragging mWindowDragging;
-  mozilla::StyleWindowShadow mWindowShadow;
+  uint8_t mWindowShadow;
   float mWindowOpacity;
   mozilla::StyleTransform mMozWindowTransform;
   mozilla::StyleTransformOrigin mWindowTransformOrigin;
 };
 
 struct nsCursorImage {
   bool mHaveHotspot;
   float mHotspotX, mHotspotY;
--- a/layout/xul/nsMenuPopupFrame.cpp
+++ b/layout/xul/nsMenuPopupFrame.cpp
@@ -349,27 +349,27 @@ nsresult nsMenuPopupFrame::CreateWidgetF
   // one
   if (!title.IsEmpty()) {
     widget->SetTitle(title);
   }
 
   return NS_OK;
 }
 
-StyleWindowShadow nsMenuPopupFrame::GetShadowStyle() {
-  StyleWindowShadow shadow = StyleUIReset()->mWindowShadow;
-  if (shadow != StyleWindowShadow::Default) return shadow;
+uint8_t nsMenuPopupFrame::GetShadowStyle() {
+  uint8_t shadow = StyleUIReset()->mWindowShadow;
+  if (shadow != NS_STYLE_WINDOW_SHADOW_DEFAULT) return shadow;
 
   switch (StyleDisplay()->mAppearance) {
     case StyleAppearance::Tooltip:
-      return StyleWindowShadow::Tooltip;
+      return NS_STYLE_WINDOW_SHADOW_TOOLTIP;
     case StyleAppearance::Menupopup:
-      return StyleWindowShadow::Menu;
+      return NS_STYLE_WINDOW_SHADOW_MENU;
     default:
-      return StyleWindowShadow::Default;
+      return NS_STYLE_WINDOW_SHADOW_DEFAULT;
   }
 }
 
 NS_IMETHODIMP nsXULPopupShownEvent::Run() {
   nsMenuPopupFrame* popup = do_QueryFrame(mPopup->GetPrimaryFrame());
   // Set the state to visible if the popup is still open.
   if (popup && popup->IsOpen()) {
     popup->SetPopupState(ePopupShown);
--- a/layout/xul/nsMenuPopupFrame.h
+++ b/layout/xul/nsMenuPopupFrame.h
@@ -243,17 +243,17 @@ class nsMenuPopupFrame final : public ns
   nsPopupLevel PopupLevel() const { return PopupLevel(IsNoAutoHide()); }
 
   // Ensure that a widget has already been created for this view, and create
   // one if it hasn't. If aRecreate is true, destroys any existing widget and
   // creates a new one, regardless of whether one has already been created.
   void EnsureWidget(bool aRecreate = false);
 
   nsresult CreateWidgetForView(nsView* aView);
-  mozilla::StyleWindowShadow GetShadowStyle();
+  uint8_t GetShadowStyle();
 
   bool IsLeafDynamic() const override;
 
   void DidSetComputedStyle(ComputedStyle* aOldStyle) override;
 
   // layout, position and display the popup as needed
   MOZ_CAN_RUN_SCRIPT_BOUNDARY
   void LayoutPopup(nsBoxLayoutState& aState, nsIFrame* aParentMenu,
--- a/servo/components/style/properties/longhands/ui.mako.rs
+++ b/servo/components/style/properties/longhands/ui.mako.rs
@@ -53,17 +53,17 @@
     spec="None (Nonstandard Firefox-only property)",
 )}
 
 ${helpers.single_keyword(
     "-moz-window-shadow",
     "none default menu tooltip sheet",
     engines="gecko",
     gecko_ffi_name="mWindowShadow",
-    gecko_enum_prefix="StyleWindowShadow",
+    gecko_constant_prefix="NS_STYLE_WINDOW_SHADOW",
     animation_value_type="discrete",
     enabled_in="chrome",
     spec="None (Nonstandard internal property)",
 )}
 
 ${helpers.predefined_type(
     "-moz-window-opacity",
     "Opacity",
--- a/widget/cocoa/nsCocoaWindow.h
+++ b/widget/cocoa/nsCocoaWindow.h
@@ -289,17 +289,17 @@ class nsCocoaWindow final : public nsBas
       LayersBackend aBackendHint = mozilla::layers::LayersBackend::LAYERS_NONE,
       LayerManagerPersistence aPersistence = LAYER_MANAGER_CURRENT) override;
   virtual nsresult DispatchEvent(mozilla::WidgetGUIEvent* aEvent, nsEventStatus& aStatus) override;
   virtual void CaptureRollupEvents(nsIRollupListener* aListener, bool aDoCapture) override;
   virtual MOZ_MUST_USE nsresult GetAttention(int32_t aCycleCount) override;
   virtual bool HasPendingInputEvent() override;
   virtual nsTransparencyMode GetTransparencyMode() override;
   virtual void SetTransparencyMode(nsTransparencyMode aMode) override;
-  virtual void SetWindowShadowStyle(mozilla::StyleWindowShadow aStyle) override;
+  virtual void SetWindowShadowStyle(int32_t aStyle) override;
   virtual void SetWindowOpacity(float aOpacity) override;
   virtual void SetWindowTransform(const mozilla::gfx::Matrix& aTransform) override;
   virtual void SetShowsToolbarButton(bool aShow) override;
   virtual void SetShowsFullScreenButton(bool aShow) override;
   virtual void SetWindowAnimationType(WindowAnimationType aType) override;
   virtual void SetDrawsTitle(bool aDrawTitle) override;
   virtual void SetUseBrightTitlebarForeground(bool aBrightForeground) override;
   virtual nsresult SetNonClientMargins(LayoutDeviceIntMargin& aMargins) override;
@@ -361,17 +361,17 @@ class nsCocoaWindow final : public nsBas
   BaseWindow* mWindow;        // our cocoa window [STRONG]
   WindowDelegate* mDelegate;  // our delegate for processing window msgs [STRONG]
   RefPtr<nsMenuBarX> mMenuBar;
   NSWindow* mSheetWindowParent;    // if this is a sheet, this is the NSWindow it's attached to
   nsChildView* mPopupContentView;  // if this is a popup, this is its content widget
   // if this is a toplevel window, and there is any ongoing fullscreen
   // transition, it is the animation object.
   NSAnimation* mFullscreenTransitionAnimation;
-  mozilla::StyleWindowShadow mShadowStyle;
+  int32_t mShadowStyle;
 
   CGFloat mBackingScaleFactor;
   CGFloat mAspectRatio;
 
   WindowAnimationType mAnimationType;
 
   bool mWindowMadeHere;  // true if we created the window, false for embedding
   bool mSheetNeedsShow;  // if this is a sheet, are we waiting to be shown?
--- a/widget/cocoa/nsCocoaWindow.mm
+++ b/widget/cocoa/nsCocoaWindow.mm
@@ -134,17 +134,17 @@ static void RollUpPopups() {
 nsCocoaWindow::nsCocoaWindow()
     : mParent(nullptr),
       mAncestorLink(nullptr),
       mWindow(nil),
       mDelegate(nil),
       mSheetWindowParent(nil),
       mPopupContentView(nil),
       mFullscreenTransitionAnimation(nil),
-      mShadowStyle(StyleWindowShadow::Default),
+      mShadowStyle(NS_STYLE_WINDOW_SHADOW_DEFAULT),
       mBackingScaleFactor(0.0),
       mAnimationType(nsIWidget::eGenericWindowAnimation),
       mWindowMadeHere(false),
       mSheetNeedsShow(false),
       mInFullScreenMode(false),
       mInFullScreenTransition(false),
       mModal(false),
       mFakeModal(false),
@@ -994,17 +994,18 @@ void nsCocoaWindow::AdjustWindowShadow()
 static const NSUInteger kWindowBackgroundBlurRadius = 4;
 
 void nsCocoaWindow::SetWindowBackgroundBlur() {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
 
   if (!mWindow || ![mWindow isVisible] || [mWindow windowNumber] == -1) return;
 
   // Only blur the background of menus and fake sheets.
-  if (mShadowStyle != StyleWindowShadow::Menu && mShadowStyle != StyleWindowShadow::Sheet) return;
+  if (mShadowStyle != NS_STYLE_WINDOW_SHADOW_MENU && mShadowStyle != NS_STYLE_WINDOW_SHADOW_SHEET)
+    return;
 
   CGSConnection cid = _CGSDefaultConnection();
   CGSSetWindowBackgroundBlurRadius(cid, [mWindow windowNumber], kWindowBackgroundBlurRadius);
 
   NS_OBJC_END_TRY_ABORT_BLOCK;
 }
 
 nsresult nsCocoaWindow::ConfigureChildren(const nsTArray<Configuration>& aConfigurations) {
@@ -1986,29 +1987,29 @@ nsresult nsCocoaWindow::GetAttention(int
   [NSApp requestUserAttention:NSInformationalRequest];
   return NS_OK;
 
   NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
 }
 
 bool nsCocoaWindow::HasPendingInputEvent() { return nsChildView::DoHasPendingInputEvent(); }
 
-void nsCocoaWindow::SetWindowShadowStyle(StyleWindowShadow aStyle) {
+void nsCocoaWindow::SetWindowShadowStyle(int32_t aStyle) {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
 
   if (!mWindow) return;
 
   mShadowStyle = aStyle;
 
   // Shadowless windows are only supported on popups.
   if (mWindowType == eWindowType_popup) {
-    [mWindow setHasShadow:aStyle != StyleWindowShadow::None];
+    [mWindow setHasShadow:aStyle != NS_STYLE_WINDOW_SHADOW_NONE];
   }
 
-  [mWindow setUseMenuStyle:(aStyle == StyleWindowShadow::Menu)];
+  [mWindow setUseMenuStyle:(aStyle == NS_STYLE_WINDOW_SHADOW_MENU)];
   AdjustWindowShadow();
   SetWindowBackgroundBlur();
 
   NS_OBJC_END_TRY_ABORT_BLOCK;
 }
 
 void nsCocoaWindow::SetWindowOpacity(float aOpacity) {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
--- a/widget/nsBaseWidget.h
+++ b/widget/nsBaseWidget.h
@@ -174,18 +174,17 @@ class nsBaseWidget : public nsIWidget, p
 
   virtual void SetCursor(nsCursor aDefaultCursor, imgIContainer* aCursor,
                          uint32_t aHotspotX, uint32_t aHotspotY) override;
   virtual void ClearCachedCursor() override { mUpdateCursor = true; }
   virtual void SetTransparencyMode(nsTransparencyMode aMode) override;
   virtual nsTransparencyMode GetTransparencyMode() override;
   virtual void GetWindowClipRegion(
       nsTArray<LayoutDeviceIntRect>* aRects) override;
-  virtual void SetWindowShadowStyle(
-      mozilla::StyleWindowShadow aStyle) override {}
+  virtual void SetWindowShadowStyle(int32_t aStyle) override {}
   virtual void SetShowsToolbarButton(bool aShow) override {}
   virtual void SetShowsFullScreenButton(bool aShow) override {}
   virtual void SetWindowAnimationType(WindowAnimationType aType) override {}
   virtual void HideWindowChrome(bool aShouldHide) override {}
   virtual bool PrepareForFullscreenTransition(nsISupports** aData) override {
     return false;
   }
   virtual void PerformFullscreenTransition(FullscreenTransitionStage aStage,
--- a/widget/nsIWidget.h
+++ b/widget/nsIWidget.h
@@ -1112,17 +1112,17 @@ class nsIWidget : public nsISupports {
   virtual uint64_t CreateScrollCaptureContainer() = 0;
 #endif
 
   /**
    * Set the shadow style of the window.
    *
    * Ignored on child widgets and on non-Mac platforms.
    */
-  virtual void SetWindowShadowStyle(mozilla::StyleWindowShadow aStyle) = 0;
+  virtual void SetWindowShadowStyle(int32_t aStyle) = 0;
 
   /**
    * Set the opacity of the window.
    * Values need to be between 0.0f (invisible) and 1.0f (fully opaque).
    *
    * Ignored on child widgets and on non-Mac platforms.
    */
   virtual void SetWindowOpacity(float aOpacity) {}