Skip to content

Commit

Permalink
Preload: only allow certain values for the as attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
noamr committed Mar 19, 2024
1 parent f9313a2 commit a8eac2d
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 @@ -15684,8 +15684,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 @@ -15824,8 +15824,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 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 @@ -16000,7 +16001,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 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 @@ -27530,6 +27531,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 preload destination</dfn> given a string <var>destination</var>:</p>

<ol>
<li><p>If destination is neither "<code data-x="">image</code>", "<code data-x="">font</code>",
"<code data-x="">script</code>", "<code data-x="">style</code>", "<code data-x="">fetch</code>",
"<code data-x="">track</code>", or "<code data-x="">json</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 a8eac2d

Please sign in to comment.