☠☠ backed out by 2e6a1dcc4205 ☠ ☠ | |
author | Gijs Kruitbosch <gijskruitbosch@gmail.com> |
Wed, 27 Mar 2019 17:30:54 +0000 | |
changeset 466500 | 56e336b27bcb388ab4b0d04cd502224af26aa1d7 |
parent 466499 | 09efa187c2cdd1d49a1726f7188858a412851cc5 |
child 466501 | afc9e5ce9971595f7fe6f46ed81f0a89ee65aeea |
push id | 81645 |
push user | gijskruitbosch@gmail.com |
push date | Thu, 28 Mar 2019 02:32:26 +0000 |
treeherder | autoland@afc9e5ce9971 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | smaug |
bugs | 1538968 |
milestone | 68.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/dom/html/HTMLLinkElement.cpp +++ b/dom/html/HTMLLinkElement.cpp @@ -112,28 +112,33 @@ bool HTMLLinkElement::HasDeferredDNSPref nsresult HTMLLinkElement::BindToTree(Document* aDocument, nsIContent* aParent, nsIContent* aBindingParent) { Link::ResetLinkState(false, Link::ElementHasHref()); nsresult rv = nsGenericHTMLElement::BindToTree(aDocument, aParent, aBindingParent); NS_ENSURE_SUCCESS(rv, rv); + bool isLocalizationLink = + aDocument && this->AttrValueIs(kNameSpaceID_None, nsGkAtoms::rel, + nsGkAtoms::localization, eIgnoreCase); + if (Document* doc = GetComposedDoc()) { - doc->RegisterPendingLinkUpdate(this); + if (!isLocalizationLink || !doc->NodePrincipal()->IsSystemPrincipal()) { + doc->RegisterPendingLinkUpdate(this); + } TryDNSPrefetchOrPreconnectOrPrefetchOrPreloadOrPrerender(); } void (HTMLLinkElement::*update)() = &HTMLLinkElement::UpdateStyleSheetInternal; nsContentUtils::AddScriptRunner( NewRunnableMethod("dom::HTMLLinkElement::BindToTree", this, update)); - if (aDocument && this->AttrValueIs(kNameSpaceID_None, nsGkAtoms::rel, - nsGkAtoms::localization, eIgnoreCase)) { + if (isLocalizationLink) { aDocument->LocalizationLinkAdded(this); } CreateAndDispatchEvent(aDocument, NS_LITERAL_STRING("DOMLinkAdded")); return rv; }