Bug 1409580 - Raise headless sheet widgets when shown. r?jrmuizel draft
authorBrendan Dahl <brendan.dahl@gmail.com>
Thu, 19 Oct 2017 17:09:28 -0700
changeset 699281 ab738ec640a3f0e464310ad4d928af51072a9387
parent 699280 89bbbb7e58e84f62101ae006aca5bbdd0d326474
child 699282 db6c87b101ff4f3e4c37529ccf12c3ef676def8d
push id89521
push userbmo:bdahl@mozilla.com
push dateThu, 16 Nov 2017 23:49:56 +0000
reviewersjrmuizel
bugs1409580
milestone59.0a1
Bug 1409580 - Raise headless sheet widgets when shown. r?jrmuizel Fixes: - test_modal_prompts.html - test_prompt.html MozReview-Commit-ID: IHkrqAaMe7L
widget/headless/HeadlessWidget.cpp
--- a/widget/headless/HeadlessWidget.cpp
+++ b/widget/headless/HeadlessWidget.cpp
@@ -170,17 +170,19 @@ nsIWidget*
 HeadlessWidget::GetTopLevelWidget()
 {
   return mTopLevel;
 }
 
 void
 HeadlessWidget::RaiseWindow()
 {
-  MOZ_ASSERT(mTopLevel == this || mWindowType == eWindowType_dialog, "Raising a non-toplevel window.");
+  MOZ_ASSERT(mTopLevel == this ||
+             mWindowType == eWindowType_dialog ||
+             mWindowType == eWindowType_sheet, "Raising a non-toplevel window.");
 
   // Do nothing if this is the currently active window.
   RefPtr<HeadlessWidget> activeWindow = GetActiveWindow();
   if (activeWindow == this) {
     return;
   }
 
   // Raise the window to the top of the stack.
@@ -209,17 +211,19 @@ HeadlessWidget::RaiseWindow()
 void
 HeadlessWidget::Show(bool aState)
 {
   mVisible = aState;
 
   LOG(("HeadlessWidget::Show [%p] state %d\n", (void *)this, aState));
 
   // Top-level window and dialogs are activated/raised when shown.
-  if (aState && (mTopLevel == this || mWindowType == eWindowType_dialog)) {
+  if (aState && (mTopLevel == this ||
+                 mWindowType == eWindowType_dialog ||
+                 mWindowType == eWindowType_sheet)) {
     RaiseWindow();
   }
 
   ApplySizeModeSideEffects();
 }
 
 bool
 HeadlessWidget::IsVisible() const