Bug 1456435: Make UpdateStyleSheet less bool-happy. r=heycam

MozReview-Commit-ID: FlTD390lMhg
This commit is contained in:
Emilio Cobos Álvarez
2018-04-24 12:50:35 +02:00
parent 5a15cde7a0
commit 78f32b94e5
13 changed files with 185 additions and 140 deletions

View File

@@ -79,11 +79,12 @@ nsHtml5DocumentBuilder::UpdateStyleSheet(nsIContent* aElement)
ssle->SetEnableUpdates(true);
bool willNotify;
bool isAlternate;
nsresult rv = ssle->UpdateStyleSheet(
mRunsToCompletion ? nullptr : this, &willNotify, &isAlternate);
if (NS_SUCCEEDED(rv) && willNotify && !isAlternate && !mRunsToCompletion) {
auto updateOrError =
ssle->UpdateStyleSheet(mRunsToCompletion ? nullptr : this);
if (updateOrError.isOk() &&
updateOrError.unwrap().ShouldBlock() &&
!mRunsToCompletion) {
++mPendingSheetCount;
mScriptLoader->AddParserBlockingScriptExecutionBlocker();
}