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

@@ -192,7 +192,7 @@ HTMLLinkElement::UnbindFromTree(bool aDeep, bool aNullParent)
CreateAndDispatchEvent(oldDoc, NS_LITERAL_STRING("DOMLinkRemoved"));
nsGenericHTMLElement::UnbindFromTree(aDeep, aNullParent);
UpdateStyleSheetInternal(oldDoc, oldShadowRoot);
Unused << UpdateStyleSheetInternal(oldDoc, oldShadowRoot);
}
bool
@@ -328,11 +328,13 @@ HTMLLinkElement::AfterSetAttr(int32_t aNameSpaceID, nsAtom* aName,
UpdatePreload(aName, aValue, aOldValue);
}
UpdateStyleSheetInternal(nullptr, nullptr,
dropSheet ||
(aName == nsGkAtoms::title ||
aName == nsGkAtoms::media ||
aName == nsGkAtoms::type));
const bool forceUpdate = dropSheet ||
aName == nsGkAtoms::title ||
aName == nsGkAtoms::media ||
aName == nsGkAtoms::type;
Unused << UpdateStyleSheetInternal(
nullptr, nullptr, forceUpdate ? ForceUpdate::Yes : ForceUpdate::No);
}
} else {
// Since removing href or rel makes us no longer link to a
@@ -343,7 +345,7 @@ HTMLLinkElement::AfterSetAttr(int32_t aNameSpaceID, nsAtom* aName,
aName == nsGkAtoms::title ||
aName == nsGkAtoms::media ||
aName == nsGkAtoms::type) {
UpdateStyleSheetInternal(nullptr, nullptr, true);
Unused << UpdateStyleSheetInternal(nullptr, nullptr, ForceUpdate::Yes);
}
if ((aName == nsGkAtoms::as || aName == nsGkAtoms::type ||
aName == nsGkAtoms::crossorigin || aName == nsGkAtoms::media) &&