diff --git a/content/html/content/src/nsGenericHTMLElement.cpp b/content/html/content/src/nsGenericHTMLElement.cpp
index 568d7113505f..33f002326fec 100644
--- a/content/html/content/src/nsGenericHTMLElement.cpp
+++ b/content/html/content/src/nsGenericHTMLElement.cpp
@@ -2226,10 +2226,6 @@ nsGenericHTMLElement::GetPrimaryFrameFor(nsIContent* aContent,
// Cause a flush of content, so we get up-to-date frame
// information
aDocument->FlushPendingNotifications(Flush_Frames);
- } else {
- // Still need to flush out style reresolves so we don't hand back
- // a frame that could get destroyed on layout flush
- aDocument->FlushPendingNotifications(Flush_StyleReresolves);
}
// Get presentation shell 0
diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp
index acc111340648..7dd1900983a3 100644
--- a/layout/base/nsPresShell.cpp
+++ b/layout/base/nsPresShell.cpp
@@ -5016,7 +5016,7 @@ PresShell::EndReflowBatching(PRBool aFlushPendingReflows)
nsresult rv = NS_OK;
mBatchReflows = PR_FALSE;
if (aFlushPendingReflows) {
- rv = FlushPendingNotifications(Flush_Layout);
+ rv = FlushPendingNotifications(Flush_OnlyReflow);
}
else {
PostReflowEvent();
diff --git a/layout/html/base/src/nsPresShell.cpp b/layout/html/base/src/nsPresShell.cpp
index acc111340648..7dd1900983a3 100644
--- a/layout/html/base/src/nsPresShell.cpp
+++ b/layout/html/base/src/nsPresShell.cpp
@@ -5016,7 +5016,7 @@ PresShell::EndReflowBatching(PRBool aFlushPendingReflows)
nsresult rv = NS_OK;
mBatchReflows = PR_FALSE;
if (aFlushPendingReflows) {
- rv = FlushPendingNotifications(Flush_Layout);
+ rv = FlushPendingNotifications(Flush_OnlyReflow);
}
else {
PostReflowEvent();