Skip to content

Commit

Permalink
Simplify <link>s
Browse files Browse the repository at this point in the history
In particular, remove their activation behavior, stop them from matching
:link and :visited, and stop suggesting that they be focusable areas.

This also includes a slight expansion and rearrangement of the link
element's section to make it clearer what hyperlinks created by <link>
are meant for, contrasting them to <a> and <area> hyperlinks.

Closes #4831. Closes #2617. Helps with #5490.
  • Loading branch information
domenic committed Jan 19, 2021
1 parent a9d2511 commit 1e0ee7f
Showing 1 changed file with 28 additions and 30 deletions.
58 changes: 28 additions & 30 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -13235,10 +13235,6 @@ interface <dfn>HTMLLinkElement</dfn> : <span>HTMLElement</span> {
data-x="attr-link-imagesrcset">imagesrcset</code> attributes are absent, then the element does not
define a link.</p>

<p>The <dfn element-attr for="link"><code data-x="attr-link-crossorigin">crossorigin</code></dfn>
attribute is a <span>CORS settings attribute</span>. It is intended for use with <span
data-x="external resource link">external resource links</span>.</p>

<p>The types of link indicated (the relationships) are given by the value of the <dfn><code
data-x="attr-link-rel">rel</code></dfn> attribute, which, if present, must have a value that is a
<span>unordered set of unique space-separated tokens</span>. The <a href="#linkTypes">allowed
Expand Down Expand Up @@ -13294,6 +13290,8 @@ interface <dfn>HTMLLinkElement</dfn> : <span>HTMLElement</span> {
<code>head</code> element and in the <code>body</code> of the page, subject to the constraints of
the microdata model.</p>

<hr>

<p>Two categories of links can be created using the <code>link</code> element: <span
data-x="external resource link">links to external resources</span> and <span
data-x="hyperlink">hyperlinks</span>. The <a href="#linkTypes">link types section</a> defines
Expand Down Expand Up @@ -13326,16 +13324,32 @@ interface <dfn>HTMLLinkElement</dfn> : <span>HTMLElement</span> {
information regarding the license under which the current page is provided.</p>
</div>

<p class="note"><span data-x="hyperlink">Hyperlinks</span> created with the <code>link</code>
element and its <code data-x="attr-link-rel">rel</code> attribute apply to the whole document.
This contrasts with the <code data-x="attr-hyperlink-rel">rel</code> attribute of <code>a</code>
and <code>area</code> elements, which indicates the type of a link whose context is given by the
link's location within the document.</p>
<p><span data-x="hyperlink">Hyperlinks</span> created with the <code>link</code> element and its
<code data-x="attr-link-rel">rel</code> attribute apply to the whole document. This contrasts with
the <code data-x="attr-hyperlink-rel">rel</code> attribute of <code>a</code> and <code>area</code>
elements, which indicates the type of a link whose context is given by the link's location within
the document.</p>

<p>Unlike those created by <code>a</code> and <code>area</code> elements, <span
data-x="hyperlink">hyperlinks</span> created by <code>link</code> elements are not displayed as
part of the document by default, in user agents that <a href="#renderingUA">support the suggested
default rendering</a>. And even if they are force-displayed using CSS, they have no
<span>activation behavior</span>. Instead, they primarily provide semantic information which might
be used by the page or by other software that consumes the page's contents. Additionally, the user
agent can <a
href="#providing-users-with-a-means-to-follow-hyperlinks-created-using-the-link-element">provide
its own UI for following such hyperlinks</a>.</p>

<p>The exact behavior for <span data-x="external resource link">links to external resources</span>
depends on the exact relationship, as defined for the relevant <a href="#linkTypes">link
type</a>.</p>

<hr>

<p>The <dfn element-attr for="link"><code data-x="attr-link-crossorigin">crossorigin</code></dfn>
attribute is a <span>CORS settings attribute</span>. It is intended for use with <span
data-x="external resource link">external resource links</span>.</p>

<p>The <dfn element-attr for="link"><code data-x="attr-link-media">media</code></dfn> attribute
says which media the resource applies to. The value must be a <span>valid media query
list</span>.</p>
Expand Down Expand Up @@ -13810,11 +13824,6 @@ interface <dfn>HTMLLinkElement</dfn> : <span>HTMLElement</span> {
<p>User agents could also include other information, such as the type of the resource (as given by
the <code data-x="attr-link-type">type</code> attribute).</p>

<!-- c.f. <a> and <area>'s similar sections -->
<p>The <span>activation behavior</span> of <code>link</code> elements that create <span
data-x="hyperlink">hyperlinks</span> is to <span data-x="following hyperlinks">follow the
hyperlink</span> created by the <code>link</code> element.</p>




Expand Down Expand Up @@ -29024,7 +29033,7 @@ was an English &lt;a href="/wiki/Music_hall">music hall&lt;/a> singer, ...</code

<h6>A link or button containing nothing but the image</h6>

<p>When an <span>a</span> element that creates a <span>hyperlink</span>, or a <code>button</code>
<p>When an <code>a</code> element that creates a <span>hyperlink</span>, or a <code>button</code>
element, has no textual content but contains one or more images, the <code
data-x="attr-img-alt">alt</code> attributes must contain text that together convey the purpose of
the link or button.</p>
Expand Down Expand Up @@ -68194,9 +68203,8 @@ contradict people?
<dt><dfn noexport><code data-x="selector-visited">:visited</code></dfn></dt>
<dd>
<p>All <code>a</code> elements that have an <code data-x="attr-hyperlink-href">href</code>
attribute, all <code>area</code> elements that have an <code
data-x="attr-hyperlink-href">href</code> attribute, and all <code>link</code> elements that have
an <code data-x="attr-link-href">href</code> attribute, must match one of <code
attribute, and all <code>area</code> elements that have an <code
data-x="attr-hyperlink-href">href</code> attribute, must match one of <code
data-x="selector-link">:link</code> and <code data-x="selector-visited">:visited</code>.</p>

<p>Other specifications might apply more specific rules regarding how these elements are to
Expand Down Expand Up @@ -73041,9 +73049,6 @@ END:VCARD</pre>
<li><code>a</code> elements that have an <code data-x="attr-hyperlink-href">href</code>
attribute</li>

<li><code>link</code> elements that have an <code
data-x="attr-link-href">href</code> attribute</li>

<li><code>button</code> elements</li>

<li><code>input</code> elements whose <code data-x="attr-input-type">type</code> attribute are
Expand Down Expand Up @@ -115367,15 +115372,8 @@ marquee {
<code>ins</code>, and <code>del</code> elements.</p>

<p>User agents may surface <span data-x="hyperlink">hyperlinks</span> created by <code>link</code>
elements in their user interface.</p>

<p class="note">While <code>link</code> elements that create <span
data-x="hyperlink">hyperlinks</span> will match the <code data-x="selector-link">:link</code> or
<code data-x="selector-visited">:visited</code> <span data-x="pseudo-class">pseudo-classes</span>,
will react to clicks if visible, and so forth, this does not extend to any browser interface
constructs that expose those same links. Activating a link through the browser's interface, rather
than in the page itself, does not trigger <code data-x="event-click">click</code> events and the
like.</p>
elements in their user interface, as discussed <a
href="#providing-users-with-a-means-to-follow-hyperlinks-created-using-the-link-element">previously</a>.</p>



Expand Down

0 comments on commit 1e0ee7f

Please sign in to comment.