Bug 1543394 - Don't update visited state of all <html:link> elements in chrome docs. r=smaug

I don't think there's a point in making <link> elements match :visited, and it's
an issue for Chrome docs because some chrome code can run before we have a
profile.

Make the already-existent workaround for localization links work more generally.

There's no interop across browsers here anyhow:

  https://github.com/w3c/csswg-drafts/issues/3817

tracks that.

Differential Revision: https://phabricator.services.mozilla.com/D26910

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Emilio Cobos Álvarez 2019-04-10 18:44:42 +00:00
Родитель bfada6ed16
Коммит 4eed4619c8
1 изменённых файлов: 3 добавлений и 6 удалений

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

@ -118,12 +118,8 @@ nsresult HTMLLinkElement::BindToTree(Document* aDocument, nsIContent* aParent,
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()) {
if (!isLocalizationLink || !doc->NodePrincipal()->IsSystemPrincipal()) {
if (!doc->NodePrincipal()->IsSystemPrincipal()) {
doc->RegisterPendingLinkUpdate(this);
}
TryDNSPrefetchOrPreconnectOrPrefetchOrPreloadOrPrerender();
@ -134,7 +130,8 @@ nsresult HTMLLinkElement::BindToTree(Document* aDocument, nsIContent* aParent,
nsContentUtils::AddScriptRunner(
NewRunnableMethod("dom::HTMLLinkElement::BindToTree", this, update));
if (isLocalizationLink) {
if (aDocument && AttrValueIs(kNameSpaceID_None, nsGkAtoms::rel,
nsGkAtoms::localization, eIgnoreCase)) {
aDocument->LocalizationLinkAdded(this);
}