From 2d4bc1d4acee012bebbcb1d8360c3e38588c9792 Mon Sep 17 00:00:00 2001 From: Blake Kaplan Date: Mon, 8 Feb 2016 14:51:00 +0100 Subject: [PATCH] Bug 1176449 - Enter an update here to avoid assertions on startup. r=dbaron --HG-- extra : rebase_source : 333672b991d5ad0c38b9516375366dd69f528d03 --- dom/xul/XULDocument.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/dom/xul/XULDocument.cpp b/dom/xul/XULDocument.cpp index dc6414fd26e3..d391a90b0da2 100644 --- a/dom/xul/XULDocument.cpp +++ b/dom/xul/XULDocument.cpp @@ -92,6 +92,7 @@ #include "nsJSUtils.h" #include "mozilla/dom/URL.h" #include "nsIContentPolicy.h" +#include "mozAutoDocUpdate.h" using namespace mozilla; using namespace mozilla::dom; @@ -2967,10 +2968,14 @@ XULDocument::DoneWalking() // XXXldb This is where we should really be setting the chromehidden // attribute. - uint32_t count = mOverlaySheets.Length(); - for (uint32_t i = 0; i < count; ++i) { - AddStyleSheet(mOverlaySheets[i]); + { + mozAutoDocUpdate updateBatch(this, UPDATE_STYLE, true); + uint32_t count = mOverlaySheets.Length(); + for (uint32_t i = 0; i < count; ++i) { + AddStyleSheet(mOverlaySheets[i]); + } } + mOverlaySheets.Clear(); if (!mDocumentLoaded) {