Bug 1457102: Avoid all the work if the compat mode hasn't actually changed. r=heycam

In this case the stylist is marked dirty because a compat mode change. The
change just doesn't exist (NavQuirks -> NavQuirks).

So avoid the work in the first place.

MozReview-Commit-ID: lchKJECNkO
This commit is contained in:
Emilio Cobos Álvarez
2018-04-26 16:07:30 +02:00
parent 899af63182
commit e4ff97375b

View File

@@ -852,6 +852,9 @@ nsHTMLDocument::SetCompatibilityMode(nsCompatibility aMode)
NS_ASSERTION(IsHTMLDocument() || aMode == eCompatibility_FullStandards,
"Bad compat mode for XHTML document!");
if (mCompatMode == aMode) {
return;
}
mCompatMode = aMode;
CSSLoader()->SetCompatibilityMode(mCompatMode);
RefPtr<nsPresContext> pc = GetPresContext();