diff --git a/dom/base/Document.cpp b/dom/base/Document.cpp index af80d21d4c41..d7b660531f91 100644 --- a/dom/base/Document.cpp +++ b/dom/base/Document.cpp @@ -9793,7 +9793,7 @@ void Document::FlushPendingNotifications(mozilla::ChangesToFlush aFlush) { // layout flush on our parent, since we need our container to be the // correct size to determine the correct style. if (StyleOrLayoutObservablyDependsOnParentDocumentLayout() && - IsSafeToFlush()) { + mParentDocument->MayStartLayout() && IsSafeToFlush()) { mozilla::ChangesToFlush parentFlush = aFlush; if (flushType >= FlushType::Style) { parentFlush.mFlushType = std::max(FlushType::Layout, flushType);