Bug 1322939 - Render pending dialog stack into top layer. r=xidorn draft
authorTim Nguyen <ntim.bugs@gmail.com>
Sat, 14 Jan 2017 01:12:13 +0000
changeset 460907 584a34f80d9d3ff741dd6b98b5a3bb5584e76dd0
parent 460906 addd62f8bb7cc11e3569d474ed20d6eadb069610
child 460908 d18b8407053651ca334b47559431c794adc91a70
child 460912 93a1a5f4a9c19531d45d0cc20f76746cb8cd2b77
push id41522
push userbmo:ntim.bugs@gmail.com
push dateSat, 14 Jan 2017 01:50:59 +0000
reviewersxidorn
bugs1322939
milestone53.0a1
Bug 1322939 - Render pending dialog stack into top layer. r=xidorn MozReview-Commit-ID: 63jvhQi9jpN
layout/generic/ViewportFrame.cpp
--- a/layout/generic/ViewportFrame.cpp
+++ b/layout/generic/ViewportFrame.cpp
@@ -154,16 +154,31 @@ ViewportFrame::BuildDisplayListForTopLay
           static_cast<nsPlaceholderFrame*>(backdropPh)->GetOutOfFlowFrame();
         MOZ_ASSERT(backdropFrame);
         BuildDisplayListForTopLayerFrame(aBuilder, backdropFrame, aList);
       }
       BuildDisplayListForTopLayerFrame(aBuilder, frame, aList);
     }
   }
 
+  nsTArray<Element*> pendingDialogStack = doc->GetPendingDialogStack();
+  for (Element* dialog : pendingDialogStack) {
+    if (nsIFrame* frame = dialog->GetPrimaryFrame()) {
+      if (nsIFrame* backdropPh =
+          frame->GetChildList(kBackdropList).FirstChild()) {
+        MOZ_ASSERT(backdropPh->GetType() == nsGkAtoms::placeholderFrame);
+        nsIFrame* backdropFrame =
+          static_cast<nsPlaceholderFrame*>(backdropPh)->GetOutOfFlowFrame();
+        MOZ_ASSERT(backdropFrame);
+        BuildDisplayListForTopLayerFrame(aBuilder, backdropFrame, aList);
+      }
+      BuildDisplayListForTopLayerFrame(aBuilder, frame, aList);
+    }
+  }
+
   nsIPresShell* shell = PresContext()->PresShell();
   if (nsCanvasFrame* canvasFrame = shell->GetCanvasFrame()) {
     if (Element* container = canvasFrame->GetCustomContentContainer()) {
       if (nsIFrame* frame = container->GetPrimaryFrame()) {
         BuildDisplayListForTopLayerFrame(aBuilder, frame, aList);
       }
     }
   }