Bug 686513 - RenderFrameParent::BuildDisplayList crash when shadow root layer is null; r=roc
authorOleg Romashin <romaxa@gmail.com>
Wed, 14 Sep 2011 08:51:24 +0100
changeset 76935 d9a39885a9d2ef1bf1be1db908286d9fb77368ca
parent 76934 1e7cfb65f1953e29a83080fffb5d4d912f270434
child 76936 c576f8acafd63f71893b56f72634a0975d00ebe5
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewersroc
bugs686513
milestone9.0a1
Bug 686513 - RenderFrameParent::BuildDisplayList crash when shadow root layer is null; r=roc
layout/ipc/RenderFrameParent.cpp
--- a/layout/ipc/RenderFrameParent.cpp
+++ b/layout/ipc/RenderFrameParent.cpp
@@ -806,21 +806,22 @@ NS_IMETHODIMP
 RenderFrameParent::BuildDisplayList(nsDisplayListBuilder* aBuilder,
                                     nsSubDocumentFrame* aFrame,
                                     const nsRect& aDirtyRect,
                                     const nsDisplayListSet& aLists)
 {
   // We're the subdoc for <browser remote="true"> and it has
   // painted content.  Display its shadow layer tree.
   nsDisplayList shadowTree;
-  if (aBuilder->IsForEventDelivery()) {
+  ContainerLayer* container = GetRootLayer();
+  if (aBuilder->IsForEventDelivery() && container) {
     nsRect bounds = aFrame->EnsureInnerView()->GetBounds();
     ViewTransform offset =
       ViewTransform(GetRootFrameOffset(aFrame, aBuilder), 1, 1);
-    BuildListForLayer(GetRootLayer(), mFrameLoader, offset,
+    BuildListForLayer(container, mFrameLoader, offset,
                       aBuilder, shadowTree, aFrame);
   } else {
     shadowTree.AppendToTop(
       new (aBuilder) nsDisplayRemote(aBuilder, aFrame, this));
   }
 
   // Clip the shadow layers to subdoc bounds
   nsPoint offset = aFrame->GetOffsetToCrossDoc(aBuilder->ReferenceFrame());