Bug 1778983 - Remove useless ProcessPendingRestyles call. r=boris

That was about XBL constructors being able to run script. But XBL is
gone and this should just be wasted work.

I want to land this in preparation for container queries substantially
changing the model here.

Differential Revision: https://phabricator.services.mozilla.com/D151495
This commit is contained in:
Emilio Cobos Álvarez 2022-07-12 09:45:39 +00:00
Родитель 8e30aa6f90
Коммит c4ef579d53
1 изменённых файлов: 0 добавлений и 23 удалений

Просмотреть файл

@ -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<uint64_t> innerWindowID;
if (auto* window = mDocument->GetInnerWindow()) {
innerWindowID = Some(window->WindowID());
}
AutoProfilerStyleMarker tracingStyleFlush(std::move(mStyleCause),
innerWindowID);
PerfStats::AutoMetricRecording<PerfStats::Metric::Styling> 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;
}