Skip to content

Commit

Permalink
Backed out changeset ef564358a7e8 (bug 1778983) for causing wpt failu…
Browse files Browse the repository at this point in the history
…res in CSSTransition-canceling.tentative.html CLOSED TREE
  • Loading branch information
Cristian Tuns committed Jul 12, 2022
1 parent a5ef0bc commit b39b0d3
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions layout/base/PresShell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4333,6 +4333,29 @@ 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;
}

Expand Down

0 comments on commit b39b0d3

Please sign in to comment.