Bug 1409580 - Raise headless sheet widgets when shown. r?jrmuizel
Fixes:
- test_modal_prompts.html
- test_prompt.html
MozReview-Commit-ID: IHkrqAaMe7L
--- 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