Bug 1291515 - Part 1: Introduce a pref for <style scoped>. r=bholley,dbaron

MozReview-Commit-ID: 1J9IvPrC0xh
This commit is contained in:
Cameron McCormack
2017-06-21 09:25:43 +08:00
parent bf3e381cdf
commit 542bcca28c
14 changed files with 66 additions and 18 deletions

View File

@@ -179,7 +179,8 @@ HTMLStyleElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
aName == nsGkAtoms::media ||
aName == nsGkAtoms::type) {
UpdateStyleSheetInternal(nullptr, nullptr, true);
} else if (aName == nsGkAtoms::scoped) {
} else if (aName == nsGkAtoms::scoped &&
OwnerDoc()->IsScopedStyleEnabled()) {
bool isScoped = aValue;
UpdateStyleSheetScopedness(isScoped);
}
@@ -242,7 +243,8 @@ HTMLStyleElement::GetStyleSheetInfo(nsAString& aTitle,
GetAttr(kNameSpaceID_None, nsGkAtoms::type, aType);
*aIsScoped = HasAttr(kNameSpaceID_None, nsGkAtoms::scoped);
*aIsScoped = HasAttr(kNameSpaceID_None, nsGkAtoms::scoped) &&
OwnerDoc()->IsScopedStyleEnabled();
nsAutoString mimeType;
nsAutoString notUsed;