Intent to ship: Make <link> elements always unvisited.

261 views
Skip to first unread message

Emilio Cobos Álvarez

unread,
Aug 8, 2019, 2:40:09 PM8/8/19
to dev-pl...@lists.mozilla.org
Summary: Make HTML <link> elements not query the browser history. This
is unnecessary work, and matches other browsers (kinda, see below in the
"Other browsers" section).

The TLDR is that even though this is technically required per spec as of
today, it's a fairly obscure feature where there's no interop, and it
causes issues unnecessarily, and extra history queries for no good reason.

Long term we should probably aim for <link> to not be traversable (even
if you force-show it).

Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1572246

Standard: https://drafts.csswg.org/selectors-4/#location (though note
https://github.com/w3c/csswg-drafts/issues/3817).

Platform coverage: All

Preference: none

Devtools bug: N/A

Other browsers:

Behavior here is all over the place. We used to match the current spec
text and WebKit, until
http://trac.webkit.org/projects/webkit/changeset/244642 landed not long ago.

With this change, we'd match Edge and WebKit. Chrome is the only browser
which doesn't consider <link> a :link to begin with, and you can't click
on force-showed links.

We may want to aim for this behavior in the long run to simplify the
code, since force-showing a <link> element doesn't seem useful over-all.
That may or may not require changes in the HTML spec
(https://html.spec.whatwg.org/#links).

-- Emilio

Anne van Kesteren

unread,
Aug 9, 2019, 7:30:00 AM8/9/19
to Emilio Cobos Álvarez, dev-platform
On Thu, Aug 8, 2019 at 8:39 PM Emilio Cobos Álvarez <emi...@crisal.io> wrote:
> Standard: https://drafts.csswg.org/selectors-4/#location (though note
> https://github.com/w3c/csswg-drafts/issues/3817).

So the real standard for this is
https://html.spec.whatwg.org/#pseudo-classes as CSS tries to be
host-agnostic (somewhat). It seems okay to me to get rid of this as
the <link> feature set always mismatched that of <a> and <area> a bit
and practically nobody would display a <link> anyway. Would you file
an issue against HTML to make it so?

Emilio Cobos Álvarez

unread,
Aug 9, 2019, 7:51:12 AM8/9/19
to dev-pl...@lists.mozilla.org
So the spec says that it should always match either :link or :visited,
and that's still true with my patch (which just never makes it match
:visited). I filed an issue about having interop / never make them
navigate away from the page, probably:

https://github.com/whatwg/html/issues/4831

And this to consider whether almost all MathML elements should really be
links:

https://github.com/mathml-refresh/mathml/issues/125

(Because they are now).

-- Emilio

> _______________________________________________
> dev-platform mailing list
> dev-pl...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-platform
>
Reply all
Reply to author
Forward
0 new messages