Skip to content

Commit

Permalink
Preload: only allow certain values for as=""
Browse files Browse the repository at this point in the history
Closes whatwg#8332.
  • Loading branch information
noamr authored and rubberyuzu committed Apr 8, 2024
1 parent 69694a7 commit 8966af0
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -15802,8 +15802,8 @@ interface <dfn interface>HTMLLinkElement</dfn> : <span>HTMLElement</span> {
<li><p><span>Assert</span>: <var>options</var>'s <span data-x="link options href">href</span> is
not the empty string.</p></li>

<li><p>If <var>options</var>'s <span data-x="link options destination">destination</span> is not
a <span data-x="concept-request-destination">destination</span>, then return null.</p></li>
<li><p>If <var>options</var>'s <span data-x="link options destination">destination</span> is
null, then return null.</p></li>

<li>
<p>Let <var>url</var> be the result of <span>encoding-parsing a URL</span> given
Expand Down Expand Up @@ -15942,8 +15942,9 @@ interface <dfn interface>HTMLLinkElement</dfn> : <span>HTMLElement</span> {

<dl class="props">
<dt><span data-x="link options destination">destination</span></dt>
<dd>the result of <span data-x="concept-potential-destination-translate">translating</span> the
state of <var>el</var>'s <code data-x="attr-link-as">as</code> attribute</dd>
<dd>the result of <span
data-x="translate a preload destination">translating</span> the state of <var>el</var>'s <code
data-x="attr-link-as">as</code> attribute.</dd>

<dt><span data-x="link options crossorigin">crossorigin</span></dt>
<dd>the state of <var>el</var>'s <code data-x="attr-link-crossorigin">crossorigin</code>
Expand Down Expand Up @@ -16118,7 +16119,7 @@ interface <dfn interface>HTMLLinkElement</dfn> : <span>HTMLElement</span> {
<li><p>If <var>attribs</var>["<code data-x="attr-link-as">as</code>"] <span data-x="map
exists">exists</span>, then set <var>options</var>'s <span data-x="link options
destination">destination</span> to the result of <span
data-x="concept-potential-destination-translate">translating</span> <var>attribs</var>["<code
data-x="translate a preload destination">translating</span> <var>attribs</var>["<code
data-x="attr-link-as">as</code>"].</p></li>

<li><p>If <var>attribs</var>["<code data-x="attr-link-crossorigin">crossorigin</code>"] <span
Expand Down Expand Up @@ -27647,6 +27648,18 @@ document.body.appendChild(wbr);</code></pre>
<span data-x="preload credentials mode">credentials mode</span> is <var>request</var>'s <span
data-x="concept-request-credentials-mode">credentials mode</span>.</p>

<p>To <dfn>translate a preload destination</dfn> given a string <var>destination</var>:</p>

<ol>
<li><p>If destination is not "<code data-x="">fetch</code>", "<code data-x="">font</code>",
"<code data-x="">image</code>", "<code data-x="">script</code>", "<code data-x="">style</code>",
or "<code data-x="">track</code>", then return null.</p></li>

<li><p>Return the result of <span
data-x="concept-potential-destination-translate">translating</span>
<var>destination</var>.</p></li>
</ol>

<p>To <dfn>preload</dfn> given a <span
data-x="link processing options">link processing options</span> <var>options</var> and
an optional <var>processResponse</var>, which is an algorithm accepting a <span
Expand Down

0 comments on commit 8966af0

Please sign in to comment.