Skip to content
Permalink
Browse files

Align Fetch's destination concept with changes in Fetch

"subresource" got split into a larger variety of values.
  • Loading branch information...
sideshowbarker authored and annevk committed Jul 4, 2016
1 parent 25379fb commit 5e8f96a85d182d36c177db0d6fdde58b4ded86d4
Showing with 31 additions and 31 deletions.
  1. +31 −31 source
62 source
data-x="concept-internal-response">internal response</span> if it has one, and the <span
data-x="concept-response">response</span> itself otherwise.

<p>To <dfn>create a potential-CORS request</dfn>, given a <var>url</var>,
<p>To <dfn>create a potential-CORS request</dfn>, given a <var>url</var>, <var>destination</var>,
<var>corsAttributeState</var>, and an optional <i>same-origin fallback flag</i>, run these steps:

<ol>

<li><p>Let <var>request</var> be a new <span data-x="concept-request">request</span> whose
<span data-x="concept-request-url">url</span> is <var>url</var>, <span
data-x="concept-request-destination">destination</span> is "<code data-x="">subresource</code>",
data-x="concept-request-destination">destination</span> is <var>destination</var>,
<span data-x="concept-request-mode">mode</span> is <var>mode</var>, <span
data-x="concept-request-credentials-mode">credentials mode</span> is
<var>credentialsMode</var>, and whose <span>use-URL-credentials flag</span> is set.</p></li>
<li><p>Let <var>request</var> be a new <span data-x="concept-request">request</span> whose
<span data-x="concept-request-url">url</span> is <var>urlRecord</var>, <span
data-x="concept-request-client">client</span> is <span>entry settings object</span>, <span
data-x="concept-request-destination">destination</span> is "<code data-x="">subresource</code>",
data-x="concept-request-destination">destination</span> is the empty string,
<span>synchronous flag</span> is set, <span data-x="concept-request-mode">mode</span> is "<code
data-x="">same-origin</code>", <span data-x="concept-request-credentials-mode">credentials
mode</span> is "<code data-x="">same-origin</code>", and whose <span>use-URL-credentials

<li><p>Let <var>request</var> be the result of <span
data-x="create a potential-CORS request">creating a potential-CORS request</span> given
<var>url</var> and <var>corsAttributeState</var>.
<var>url</var>, the empty string, and <var>corsAttributeState</var>.

<li><p>Set <var>request</var>'s <span data-x="concept-request-client">client</span> to the
<code>link</code> element's <span>node document</span>'s <code>Window</code> object's
data-x="concept-request-body">body</span> is `<code data-x="">PING</code>`, <span
data-x="concept-request-client">client</span> is the <span>environment settings object</span> of
the <code>Document</code> containing the <span>hyperlink</span>, <span
data-x="concept-request-destination">destination</span> is "<code data-x="">subresource</code>",
data-x="concept-request-destination">destination</span> is the empty string,
<span data-x="concept-request-credentials-mode">credentials mode</span> is "<code
data-x="">include</code>", <span data-x="concept-request-referrer">referrer</span> is "<code
data-x="">no-referrer</code>", and whose <span>use-URL-credentials flag</span> is set.</p></li>
data-x="concept-request-client">client</span> is the <code>Document</code> object's
<span>relevant settings object</span>, <span data-x="concept-request-type">type</span> is "<code
data-x="">image</code>", <span data-x="concept-request-destination">destination</span> is "<code
data-x="">subresource</code>", <span>synchronous flag</span> is set, <span
data-x="">image</code>", <span>synchronous flag</span> is set, <span
data-x="concept-request-credentials-mode">credentials mode</span> is "<code
data-x="">include</code>", and whose <span>use-URL-credentials flag</span> is set.</p></li>


<p>&#x231B; Let <var>request</var> be the result of <span
data-x="create a potential-CORS request">creating a potential-CORS request</span> given
<var>urlString</var> and the current state of the element's <code
data-x="attr-img-crossorigin">crossorigin</code> content attribute.</p>
<var>urlString</var>, "<code data-x="">image</code>", and the current state of the element's
<code data-x="attr-img-crossorigin">crossorigin</code> content attribute.</p>

<p>&#x231B; Set <var>request</var>'s <span data-x="concept-request-client">client</span> to the
element's <span>node document</span>'s <code>Window</code> object's <span>environment settings
<ol>
<li><p>Let <var>request</var> be the result of <span
data-x="create a potential-CORS request">creating a potential-CORS request</span> given
<var>urlString</var> and <var>corsAttributeState</var>.</p></li>
<var>urlString</var>, "<code data-x="">image</code>", and
<var>corsAttributeState</var>.</p></li>

<li><p>Set <var>request</var>'s <span data-x="concept-request-client">client</span> to
<var>client</var>, <span data-x="concept-request-type">type</span> to "<code
<span data-x="concept-request-client">client</span> is the element's <span>node
document</span>'s <code>Window</code> object's <span>environment settings object</span>,
<span data-x="concept-request-destination">destination</span> is "<code
data-x="">unknown</code>", <span>omit-<code>Origin</code>-header flag</span> is set if the
data-x="">embed</code>", <span>omit-<code>Origin</code>-header flag</span> is set if the
element doesn't have a <span>browsing context scope origin</span>, <span
data-x="concept-request-credentials-mode">credentials mode</span> is "<code
data-x="">include</code>", and whose <span>use-URL-credentials flag</span> is set.</p></li>
<span data-x="concept-request-client">client</span> is the element's <span>node
document</span>'s <code>Window</code> object's <span>environment settings object</span>,
<span data-x="concept-request-destination">destination</span> is "<code
data-x="">unknown</code>", <span>omit-<code>Origin</code>-header flag</span> is set if the
data-x="">object</code>", <span>omit-<code>Origin</code>-header flag</span> is set if the
element doesn't have a <span>browsing context scope origin</span>, <span
data-x="concept-request-credentials-mode">credentials mode</span> is "<code
data-x="">include</code>", and whose <span>use-URL-credentials flag</span> is set.</p></li>
<span data-x="concept-request-client">client</span> is the element's <span>node document</span>'s
<code>Window</code> object's <span>environment settings object</span>, <span
data-x="concept-request-type">type</span> is "<code data-x="">image</code>", <span
data-x="concept-request-destination">destination</span> is "<code data-x="">subresource</code>",
data-x="concept-request-destination">destination</span> is "<code data-x="">image</code>",
<span data-x="concept-request-credentials-mode">credentials mode</span> is "<code
data-x="">include</code>", and whose <span>use-URL-credentials flag</span> is set.


<p>Let <var>request</var> be the result of <span
data-x="create a potential-CORS request">creating a potential-CORS request</span> given
<var>current media resource</var>'s <span>URL record</span> and the <span>media
element</span>'s <code data-x="attr-media-crossorigin">crossorigin</code> content attribute
value.
<var>current media resource</var>'s <span>URL record</span>, "<code data-x="">media</code>",
and the <span>media element</span>'s <code
data-x="attr-media-crossorigin">crossorigin</code> content attribute value.

<p>Set <var>request</var>'s <span data-x="concept-request-client">client</span> to the
<span>media element</span>'s <span>node document</span>'s <code>Window</code> object's
<ol>
<li><p>Let <var>request</var> be the result of <span
data-x="create a potential-CORS request">creating a potential-CORS request</span> given
<var>URL</var>, <var>corsAttributeState</var>, and with the <i>same-origin fallback flag</i>
set.</p></li>
<var>URL</var>, "<code data-x="">media</code>", and <var>corsAttributeState</var>, and with the
<i>same-origin fallback flag</i> set.</p></li>

<li><p>Set <var>request</var>'s <span data-x="concept-request-client">client</span> to the
<code>track</code> element's <span>node document</span>'s <code>Window</code> object's
<span data-x="concept-request-client">client</span> is the element's <span>node document</span>'s
<span>relevant settings object</span>, <span data-x="concept-request-type">type</span> is "<code
data-x="">image</code>", <span data-x="concept-request-destination">destination</span> is "<code
data-x="">subresource</code>", <span>omit-<code>Origin</code>-header flag</span> is set, <span
data-x="">image</code>", <span>omit-<code>Origin</code>-header flag</span> is set, <span
data-x="concept-request-credentials-mode">credentials mode</span> is "<code
data-x="">include</code>", and whose <span>use-URL-credentials flag</span> is set.</p></li>

<li><p>Let <var>request</var> be a new <span data-x="concept-request">request</span> whose
<span data-x="concept-request-url">url</span> is <var>manifest URL</var>, <span
data-x="concept-request-client">client</span> is null, <span
data-x="concept-request-destination">destination</span> is "<code data-x="">subresource</code>",
data-x="concept-request-destination">destination</span> is the empty string,
<span>omit-<code>Origin</code>-header flag</span> is set, <span
data-x="concept-request-referrer">referrer</span> is "<code data-x="">no-referrer</code>",
<span>synchronous flag</span> is set, <span data-x="concept-request-credentials-mode">credentials
<li><p>Let <var>request</var> be a new <span data-x="concept-request">request</span> whose
<span data-x="concept-request-url">url</span> is URL, <span
data-x="concept-request-client">client</span> is null, <span
data-x="concept-request-destination">destination</span> is "<code
data-x="">subresource</code>", <span data-x="concept-request-origin">origin</span> is
data-x="concept-request-destination">destination</span> is the empty string,
<span data-x="concept-request-origin">origin</span> is
<var>manifest URL</var>'s <span>origin</span>, <span
data-x="concept-request-referrer">referrer</span> is "<code data-x="">no-referrer</code>",
<span>synchronous flag</span> is set, <span
<li><p>Let <var>request</var> be a new <span data-x="concept-request">request</span> whose
<span data-x="concept-request-url">url</span> is <var>manifest URL</var>, <span
data-x="concept-request-client">client</span> is null, <span
data-x="concept-request-destination">destination</span> is "<code data-x="">subresource</code>",
data-x="concept-request-destination">destination</span> is the empty string,
<span data-x="concept-request-referrer">referrer</span> is "<code data-x="">no-referrer</code>",
<span>synchronous flag</span> is set, <span data-x="concept-request-credentials-mode">credentials
mode</span> is "<code data-x="">include</code>", and whose <span>use-URL-credentials

<ol>
<li><p>Let <var>request</var> be the result of <span data-x="create a potential-CORS
request">creating a potential-CORS request</span> given <var>url</var> and <var>CORS
setting</var>.</p></li>
request">creating a potential-CORS request</span> given <var>url</var>, "<code
data-x="">script</code>", and <var>CORS setting</var>.</p></li>

<li><p>Set <var>request</var>'s <span data-x="concept-request-client">client</span> to
<var>settings object</var>, its <span data-x="concept-request-type">type</span> to "<code
data-x="">script</code>", its <span data-x="concept-request-destination">destination</span>
to "<code data-x="">script</code>", its <span
data-x="concept-request-nonce-metadata">cryptographic nonce metadata</span> to
<var>cryptographic nonce</var>, and its <span data-x="concept-request-parser-metadata">parser
metadata</span> to <var>parser state</var>.</p></li>
data-x="">script</code>", its <span data-x="concept-request-nonce-metadata">cryptographic nonce
metadata</span> to <var>cryptographic nonce</var>, and its <span
data-x="concept-request-parser-metadata">parser metadata</span> to <var>parser
state</var>.</p></li>

<li><p>If the caller specified custom steps to <span data-x="fetching-scripts-set-up-request">set
up the request</span>, perform them on <var>request</var>.</p></li>

<li><p>Let <var>request</var> be the result of <span
data-x="create a potential-CORS request">creating a potential-CORS request</span> given
<var>urlRecord</var>, <var>corsAttributeState</var>, and with the <i>same-origin fallback
flag</i> set.</p></li>
<var>urlRecord</var>, the empty string, and <var>corsAttributeState</var>, and with the
<i>same-origin fallback flag</i> set.</p></li>

<li><p>Set <var>request</var>'s <span data-x="concept-request-client">client</span> to
<var>settings</var>.</p></li>

0 comments on commit 5e8f96a

Please sign in to comment.
You can’t perform that action at this time.