diff --git a/layout/base/PresShell.cpp b/layout/base/PresShell.cpp index 1cea00ad4ef0..7169f96815a0 100644 --- a/layout/base/PresShell.cpp +++ b/layout/base/PresShell.cpp @@ -4333,29 +4333,6 @@ void PresShell::DoFlushPendingNotifications(mozilla::ChangesToFlush aFlush) { LAYOUT_TELEMETRY_RECORD_BASE(Restyle); mPresContext->RestyleManager()->ProcessPendingRestyles(); - } - - // Now those constructors or events might have posted restyle - // events. At the same time, we still need up-to-date style data. - // In particular, reflow depends on style being completely up to - // date. If it's not, then style reparenting, which can - // happen during reflow, might suddenly pick up the new rules and - // we'll end up with frames whose style doesn't match the frame - // type. - if (MOZ_LIKELY(!mIsDestroying)) { - nsAutoScriptBlocker scriptBlocker; - Maybe innerWindowID; - if (auto* window = mDocument->GetInnerWindow()) { - innerWindowID = Some(window->WindowID()); - } - AutoProfilerStyleMarker tracingStyleFlush(std::move(mStyleCause), - innerWindowID); - PerfStats::AutoMetricRecording autoRecording; - LAYOUT_TELEMETRY_RECORD_BASE(Restyle); - - mPresContext->RestyleManager()->ProcessPendingRestyles(); - // Clear mNeedStyleFlush here agagin to make this flag work properly for - // optimization since the flag might have set in ProcessPendingRestyles(). mNeedStyleFlush = false; }