Define the HTTP Refresh header by annevk · Pull Request #2892 · whatwg/html · GitHub | Latest TMZ Celebrity News & Gossip | Watch TMZ Live
Skip to content

Define the HTTP Refresh header #2892

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 9, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 67 additions & 21 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -14290,20 +14290,25 @@ people expect to have work and what is necessary.
<div w-nodev>

<ol>
<!-- TESTS: https://www.hixie.ch/tests/adhoc/html/meta/refresh/ -->
<!-- https://software.hixie.ch/utilities/js/live-dom-viewer/?saved=734 -->
<li><p>Let <var>document</var> be the <code>meta</code> element's <span>node
document</span>.</p></li>

<li><p>If <var>document</var>'s <span>will declaratively refresh</span> is true, then
return.</p></li>

<li><p>If the <code>meta</code> element has no <code data-x="attr-meta-content">content</code>
attribute, or if that attribute's value is the empty string, then return.</p></li>

<li><p>Let <var>input</var> be the value of the element's <code
data-x="attr-meta-content">content</code> attribute.</p></li>

<li><p>Run the <span>shared declarative refresh steps</span> with the <code>meta</code>
element's <span>node document</span>, <var>input</var>, and the <code>meta</code>
element.</p></li>
</ol>

<p>The <dfn>shared declarative refresh steps</dfn>, given a <code>Document</code> object
<var>document</var>, string <var>input</var>, and optionally a <code>meta</code> element
<var>meta</var>, are as follows:</p>

<ol>
<li><p>If <var>document</var>'s <span>will declaratively refresh</span> is true, then
return.</p></li>

<li><p>Let <var>position</var> point at the first <span>code point</span> of
<var>input</var>.</p></li>

Expand Down Expand Up @@ -14410,12 +14415,12 @@ people expect to have work and what is necessary.
<ul>
<li>
<p>After the refresh has come due (as defined below), if the user has not canceled the
redirect and <var>document</var>'s <span>active sandboxing flag set</span> does not have the
<span>sandboxed automatic features browsing context flag</span> set, <span
data-x="navigate">navigate</span><!--DONAV meta refresh--> <var>document</var>'s <span
data-x="concept-document-bc">browsing context</span> to <var>urlRecord</var>, with
<span>replacement enabled</span>, and with <var>document</var>'s <span
data-x="concept-document-bc">browsing context</span> as the <span>source browsing
redirect and, if <var>meta</var> is given, <var>document</var>'s <span>active sandboxing
flag set</span> does not have the <span>sandboxed automatic features browsing context
flag</span> set, then <span data-x="navigate">navigate</span><!--DONAV meta refresh-->
<var>document</var>'s <span data-x="concept-document-bc">browsing context</span> to
<var>urlRecord</var>, with <span>replacement enabled</span>, and with <var>document</var>'s
<span data-x="concept-document-bc">browsing context</span> as the <span>source browsing
context</span>.</p>

<p>For the purposes of the previous paragraph, a refresh is said to have come due as soon as
Expand All @@ -14427,20 +14432,22 @@ people expect to have work and what is necessary.
preferences.</li>
<!-- https://software.hixie.ch/utilities/js/live-dom-viewer/?saved=774 -->

<li>At least <var>time</var> seconds have elapsed since the <code>meta</code> element was
<span data-x="node is inserted into a document">inserted into the document</span>
<var>document</var>, adjusted to take into account user or user agent preferences.</li>
<li>If <var>meta</var> is given, at least <var>time</var> seconds have elapsed since
<var>meta</var> was <span data-x="node is inserted into a document">inserted into the
document</span> <var>document</var>, adjusted to take into account user or user agent
preferences.</li>
<!-- https://software.hixie.ch/utilities/js/live-dom-viewer/?saved=772 -->
</ul>

<p class="note">It is important to use <var>document</var> here, and not the
<code>meta</code> element's <span>node document</span>, as that might have changed between
the initial set of steps and the refresh coming due.</p>
<p class="note">It is important to use <var>document</var> here, and not <var>meta</var>'s
<span>node document</span>, as that might have changed between the initial set of steps and
the refresh coming due and <var>meta</var> is not always given (in case of the HTTP
`<code data-x="http-refresh">Refresh</code>` header).</p>
</li>

<li><p>Provide the user with an interface that, when selected, <span
data-x="navigate">navigates</span><!--DONAV meta refresh--> a <span>browsing context</span>
to <var>urlRecord</var>, with the <code>Document</code>'s <span
to <var>urlRecord</var>, with <var>document</var>'s <span
data-x="concept-document-bc">browsing context</span> as the <span>source browsing
context</span>.</p></li>

Expand Down Expand Up @@ -82324,6 +82331,22 @@ State: &lt;OUTPUT NAME=I>1&lt;/OUTPUT> &lt;INPUT VALUE="Increment" TYPE=BUTTON O
<li><p><span>Implement the sandboxing</span> for the <code>Document</code>.</p></li>

<li><p><span>Set the allow* flags</span> for the <code>Document</code>.</p></li>

<li>
<p>If <var>response</var> has a `<code data-x="http-refresh">Refresh</code>` header, then:</p>

<ol>
<li><p class="&#x0058;&#x0058;&#x0058;"><a
href="https://github.com/whatwg/html/issues/2900">Multiple `<code
data-x="http-refresh">Refresh</code>` headers</a>.</p></li>

<li><p>Let <var>value</var> be the value of the header with each byte mapped to a code point
of equal value.</p></li>

<li><p>Run the <span>shared declarative refresh steps</span> with the <code>Document</code>
and <var>value</var>.</p></li>
</ol>
</li>
</ol>
</li>

Expand Down Expand Up @@ -115353,6 +115376,29 @@ interface <dfn>External</dfn> {
</dl>


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really thought we'd alphabetized the headers but I guess not...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want that done as part of this PR/commit? Happy to sort that out.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nah, we can leave it for later; I might be missing something too in how they're ordered.

<h3>`<dfn><code data-x="http-refresh">Refresh</code></dfn>`</h3>

<p>This section describes a header for registration in the Permanent Message Header Field
Registry. <ref spec=RFC3864></p>

<dl>
<dt>Header field name:</dt>
<dd>Refresh</dd>
<dt>Applicable protocol:</dt>
<dd>http</dd>
<dt>Status:</dt>
<dd>standard</dd>
<dt>Author/Change controller:</dt>
<dd>WHATWG</dd>
<dt>Specification document(s):</dt>
<dd>
This document is the relevant specification.
</dd>
<dt>Related information:</dt>
<dd>None.</dd>
</dl>


<h3>`<dfn><code data-x="http-last-event-id">Last-Event-ID</code></dfn>`</h3>

<p>This section describes a header for registration in the Permanent Message Header Field
Expand Down

TMZ Celebrity News – Breaking Stories, Videos & Gossip

Looking for the latest TMZ celebrity news? You've come to the right place. From shocking Hollywood scandals to exclusive videos, TMZ delivers it all in real time.

Whether it’s a red carpet slip-up, a viral paparazzi moment, or a legal drama involving your favorite stars, TMZ news is always first to break the story. Stay in the loop with daily updates, insider tips, and jaw-dropping photos.

🎥 Watch TMZ Live

TMZ Live brings you daily celebrity news and interviews straight from the TMZ newsroom. Don’t miss a beat—watch now and see what’s trending in Hollywood.