Bug 1408019 - Code clean up for sSupportedRelValues. r=bz

This commit is contained in:
Dragana Damjanovic 2017-10-17 18:38:10 +02:00
Родитель 031b782d8e
Коммит a1b076412f
1 изменённых файлов: 3 добавлений и 16 удалений

Просмотреть файл

@ -378,7 +378,8 @@ HTMLLinkElement::GetLinkTarget(nsAString& aTarget)
static const DOMTokenListSupportedToken sSupportedRelValues[] = {
// Keep this in sync with ToLinkMask in nsStyleLinkElement.cpp.
// "import" must come first because it's conditional.
// "preload" must come first because it can be disabled.
"preload",
"prefetch",
"dns-prefetch",
"stylesheet",
@ -387,23 +388,9 @@ static const DOMTokenListSupportedToken sSupportedRelValues[] = {
"preconnect",
"icon",
"search",
"preload",
nullptr
};
static const DOMTokenListSupportedToken sSupportedRelValuesNoPreload[] = {
// Keep this in sync with ToLinkMask in nsStyleLinkElement.cpp.
// "import" must come first because it's conditional.
"prefetch",
"dns-prefetch",
"stylesheet",
"next",
"alternate",
"preconnect",
"icon",
"search",
nullptr
};
nsDOMTokenList*
HTMLLinkElement::RelList()
{
@ -411,7 +398,7 @@ HTMLLinkElement::RelList()
if (Preferences::GetBool("network.preload")) {
mRelList = new nsDOMTokenList(this, nsGkAtoms::rel, sSupportedRelValues);
} else {
mRelList = new nsDOMTokenList(this, nsGkAtoms::rel, sSupportedRelValuesNoPreload);
mRelList = new nsDOMTokenList(this, nsGkAtoms::rel, &sSupportedRelValues[1]);
}
}
return mRelList;