forked from mirrors/gecko-dev
Bug 1861259 part 3: Coalesce redundant array-index checks in nsRefreshDriver. r=tnikkel
This patch doesn't change behavior; it just removes some redundant checks. (Note that the tight-scoping around nsAutoMicroTask/ReduceAnimations is important for the RAII object to be torn down at the intended time; but it doesn't need its own if-check.) Depends on D191909 Differential Revision: https://phabricator.services.mozilla.com/D191911
This commit is contained in:
parent
98398d6c56
commit
071c722cc0
1 changed files with 10 additions and 11 deletions
|
|
@ -2427,19 +2427,18 @@ bool nsRefreshDriver::TickObserverArray(uint32_t aIdx, TimeStamp aNowTime) {
|
|||
//
|
||||
// [1]
|
||||
// https://drafts.csswg.org/web-animations-1/#update-animations-and-send-events
|
||||
if (aIdx == 1) {
|
||||
nsAutoMicroTask mt;
|
||||
ReduceAnimations(*mPresContext->Document());
|
||||
}
|
||||
|
||||
// Check if running the microtask checkpoint caused the pres context to
|
||||
// be destroyed.
|
||||
if (aIdx == 1 && (!mPresContext || !mPresContext->GetPresShell())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (aIdx == 1) {
|
||||
// This is the FlushType::Style case.
|
||||
{
|
||||
nsAutoMicroTask mt;
|
||||
ReduceAnimations(*mPresContext->Document());
|
||||
}
|
||||
|
||||
// Check if running the microtask checkpoint caused the pres context to
|
||||
// be destroyed.
|
||||
if (!mPresContext || !mPresContext->GetPresShell()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
FlushAutoFocusDocuments();
|
||||
DispatchScrollEvents();
|
||||
|
|
|
|||
Loading…
Reference in a new issue