Skip to content

Commit 7162b58

Browse files
committed
Fix style issues
1 parent 844842c commit 7162b58

File tree

1 file changed

+73
-66
lines changed

1 file changed

+73
-66
lines changed

fetch.bs

Lines changed: 73 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -2133,18 +2133,17 @@ Unless stated otherwise, it is false.
21332133

21342134
<p class=note>This flag is for exclusive use by HTML's render-blocking mechanism. [[!HTML]]
21352135

2136-
<p>A <a for=/>request</a> has an associated boolean <dfn export for=request>https-upgrade</dfn>.
2136+
<p>A <a for=/>request</a> has an associated boolean <dfn export for=request>is HTTPS upgrade</dfn>.
21372137
Unless stated otherwise, it is false.
21382138

2139-
<p class=note>This flag is for exclusive use by https-upgrades algorithm.
2139+
<p class=note>This flag is for exclusive use by HTTPS Upgrading algorithm.
21402140

2141-
<p>A <a for=/>request</a> has an associated
2142-
<dfn export for=request id=https-upgrade-fallback-url>https-upgrade-fallback-url</dfn>. It is a copy
2143-
of the <a for=/>request</a>'s original <a for=/>URL</a> before <a for=/>request</a> is
2144-
<a href="#https-upgrades-upgrade">optionally upgraded to HTTPS</a>. Unless stated otherwise, it is
2145-
unset.
2141+
<p>A <a for=/>request</a> has an associated <dfn export for=request>HTTPS upgrade fallback URL</dfn>
2142+
which is a <a for=/>URL</a>. It is a copy of the <a for=/>request</a>'s original
2143+
<a for=request>URL</a> before <a for=/>request</a> is <a href="#https-upgrades-upgrade">optionally
2144+
upgraded to HTTPS</a>. Unless stated otherwise, it is unset.
21462145

2147-
<p class=note>This flag is for exclusive use by https-upgrades algorithm.
2146+
<p class=note>This flag is for exclusive use by HTTPS Upgrading algorithm.
21482147

21492148
<hr>
21502149

@@ -3256,76 +3255,84 @@ through TLS using ALPN. The protocol cannot be spoofed through HTTP requests in
32563255

32573256
<h3 id=https-upgrades>HTTPS upgrading</h3>
32583257

3259-
<div algorithm="https-upgrades">
3258+
<p>User agents may optionally upgrade requests with URLs that are not <a>potentially trustworthy
3259+
URLs</a> to attempt to fetch them over <a>potentially trustworthy URLs</a>. If an upgraded request
3260+
fails with a network error, it is retried over the original URL.
32603261

3261-
<p>User agents may optionally upgrade requests with URLs that are not
3262-
<a>potentially trustworthy URLs</a> to attempt to fetch them over <a>potentially trustworthy URL</a>s.
3263-
If an upgraded request fails with a network error, it is retried over the original URL.
3264-
3265-
<p>The HTTPS upgrading algorithm consists of Upgrade and Fallback algorithms, with the following
3266-
steps:
3262+
<p>The HTTPS upgrading algorithm consists of upgrade and fallback algorithms.
32673263

3264+
<div algorithm>
32683265
<h4 id=https-upgrades-upgrade>HTTPS upgrade algorithm</h4>
32693266

3270-
To <dfn>upgrade an HTTP request</dfn> given a <a for=/>request</a> <var>request</var>, run these
3267+
<p>To <dfn>upgrade an HTTP request</dfn> given a <a for=/>request</a> <var>request</var>, run these
32713268
steps:
32723269

32733270
<ol>
3274-
<li>
3275-
<p>If one or more of the following conditions are met, return:
3276-
<ul>
3277-
<li><p><var>request</var>'s <a for="request">destination</a> is not "<code>document</code>"
3271+
<li>
3272+
<p>If one or more of the following conditions are met, return:
3273+
<ul>
3274+
<li><p><var>request</var>'s <a for="request">destination</a> is not "<code>document</code>"
32783275

3279-
<li><p><var>request</var>'s <a for="request">method</a> is not "<code>GET</code>"
3276+
<li><p><var>request</var>'s <a for="request">method</a> is not "<code>GET</code>"
32803277

3281-
<li><p><var>request</var>'s <a for="request">URL</a>'s <a for="url">scheme</a> is not
3282-
"<code>http</code>"
3278+
<li><p><var>request</var>'s <a for="request">URL</a>'s <a for="url">scheme</a> is not
3279+
"<code>http</code>"
32833280

3284-
<li><p><var>request</var>'s <a for="request">URL</a>'s <a for="url">host</a> is exempted from
3285-
upgrades in an <a>implementation-defined</a> way.
3281+
<li>
3282+
<p><var>request</var>'s <a for="request">URL</a>'s <a for="url">host</a> is exempted from
3283+
upgrades in an <a>implementation-defined</a> way.
32863284

3287-
<p class="example" id="example-https-upgrades-exempted-hosts">If <a for=url>host</a> is a
3288-
non-registrable or non-assignable domain name such as .local or an IP address that falls in a
3289-
range reserved for non-publicly routable networks, the implementation might return without
3290-
modifying <var>request</var>.
3291-
</ul>
3292-
</li>
3285+
<p class=example id="example-https-upgrades-exempted-hosts">If <a for=url>host</a> is a
3286+
non-registrable or non-assignable domain name such as .local or an IP address that falls in a
3287+
range reserved for non-publicly routable networks, the implementation might return without
3288+
modifying <var>request</var>.
3289+
</ul>
3290+
</li>
32933291

3294-
<li><p>If <var>request</var>'s <code>https-upgrade-fallback-url</code> is non-null, clear the
3295-
<code>https-upgrade</code> and <code>https-upgrade-fallback-url</code> flags and return.
3292+
<li>
3293+
<p>If <var>request</var>'s <a for=request>HTTPS upgrade fallback URL</a> is non-null, clear
3294+
<a for=request>is HTTPS upgrade</a> and <a for=request>HTTPS upgrade fallback URL</a> and return.
32963295

3297-
<p class="note">This is a fallback request that shouldn't be upgraded again.
3296+
<p class=note>This is a fallback request that shouldn't be upgraded again.
32983297

3299-
<li><p>Otherwise, set the following fields:
3300-
<ul>
3301-
<li>Set <code>https-upgrade-fallback-url</code> to <var>request</var>'s <a for="request">URL</a>.
3302-
<li>Set <var>request</var>'s <a for="request">URL</a>'s <a for="url">scheme</a> to "<code>https</code>".
3303-
<li>Set <code>https-upgrade</code> flag to true.
3304-
</ul>
3305-
</li>
3298+
<li><p>Otherwise, set the following fields:
3299+
<ul>
3300+
<li><p>Set <a for=request>HTTPS upgrade fallback URL</a> to <var>request</var>'s
3301+
<a for="request">URL</a>.
3302+
3303+
<li><p>Set <var>request</var>'s <a for="request">URL</a>'s <a for="url">scheme</a> to
3304+
"<code>https</code>".
3305+
3306+
<li><p>Set <a for=request>is HTTPS upgrade</a> to true.
3307+
</ul>
3308+
</li>
33063309
</ol>
3310+
</div>
33073311

3312+
<div algorithm>
33083313
<h4 id=https-upgrades-fallback>Fallback algorithm</h4>
33093314

3310-
To run <dfn>HTTPS upgrade fallback</dfn> given a <a for=/>request</a>
3311-
<var>request</var> and <a for=/>response</a> <var>response</var>, run these steps:
3315+
<p>To run <dfn>HTTPS upgrade fallback</dfn> given a <a for=/>request</a> <var>request</var> and
3316+
<a for=/>response</a> <var>response</var>, run these steps:
33123317

33133318
<ol>
3314-
<li><p>If <var>request</var>'s <code>https-upgrade</code> flag is not set, return
3315-
<var>response</var>.
3319+
<li><p>If <var>request</var>'s <a for=request>is HTTPS upgrade</a> is not set, return
3320+
<var>response</var>.
33163321

3317-
<li>
3318-
<p>If <var>response</var> is a network error, run the following steps:
3319-
<p class="note">This means that the upgrade failed and initiates a fallback load.
3320-
<ol>
3321-
<li><p>Let <var>fallbackResponse</var> be a new <a for=/>Response</a> with its <code>Location</code> header set to
3322-
<code>https-upgrade-fallback-url</code>, and its <a for="response">status</a> set to 307.
3323-
<li>Return <var>fallbackResponse</var>.
3324-
</ol>
3322+
<li>
3323+
<p>If <var>response</var> is a network error, run the following steps:
3324+
<p class=note>This means that the upgrade failed and initiates a fallback load.
3325+
<ol>
3326+
<li><p>Let <var>fallbackResponse</var> be a new <a for=/>Response</a> with its
3327+
<code>Location</code> header set to <a for=request>HTTPS upgrade fallback URL</a>, and its
3328+
<a for="response">status</a> set to 307.
3329+
3330+
<li>Return <var>fallbackResponse</var>.
3331+
</ol>
33253332

3326-
<li>
3327-
<p class="note">The upgrade was successful.
3328-
<p>Return <var>response</var>.
3333+
<li>
3334+
<p class=note>The upgrade was successful.
3335+
<p>Return <var>response</var>.
33293336
</ol>
33303337

33313338
<p class=note>
@@ -3337,9 +3344,8 @@ requests, in order to quickly initiate a fallback http load.
33373344
<h4 id=http-upgrades-examples>Examples</h4>
33383345

33393346
<div id=example-https-upgrade-good-https class=example>
3340-
<p>
3341-
<code>a.com</code> serves both <code>http://a.com</code> and <code>https://a.com</code>.
3342-
An eligible request to <code>http://a.com</code> will be upgraded to <code>https://a.com</code>.
3347+
<p><code>a.com</code> serves both <code>http://a.com</code> and <code>https://a.com</code>. An
3348+
eligible request to <code>http://a.com</code> will be upgraded to <code>https://a.com</code>.
33433349
</div>
33443350

33453351
<div id=example-https-upgrade-bad-https class=example>
@@ -4530,11 +4536,12 @@ steps:
45304536

45314537
<li><p><a>Upgrade <var>request</var> to a potentially trustworthy URL, if appropriate</a>.
45324538

4533-
<li><p>Optionally, run <a>upgrade an HTTP request</a> algorithm on <var>request</var>, if appropriate</a>.
4539+
<li>
4540+
<p>Optionally, run <a>upgrade an HTTP request</a> algorithm on <var>request</var>, if appropriate</a>.
45344541

4535-
<p class="note">HTTPS upgrading only applies to requests with <a>HTTP(S) scheme</a>s, but it's done
4536-
in <a>main fetch</a> instead of <a>HTTP fetch</a> to ensure that <a>upgrade a mixed content</a>
4537-
step runs next and applies to the upgraded request.</p>
4542+
<p class=note>HTTPS upgrading only applies to requests with <a>HTTP(S) scheme</a>s, but it's done
4543+
in <a>main fetch</a> instead of <a>HTTP fetch</a> to ensure that <a>upgrade a mixed content</a>
4544+
step runs next and applies to the upgraded request.
45384545

45394546
<li><p><a>Upgrade a mixed content <var>request</var> to a potentially trustworthy URL, if appropriate</a>.
45404547

@@ -5258,8 +5265,8 @@ these steps:
52585265
<a for="filtered response">internal response</a>.
52595266

52605267
<li><p>If <var>response</var>'s <a for=response>type</a> is "<code>error</code>" then
5261-
return the result of running <a>HTTPS upgrade fallback</a> given <var>request</var>
5262-
and a <a>network error</a>.
5268+
return the result of running <a>HTTPS upgrade fallback</a> given <var>request</var>
5269+
and a <a>network error</a>.
52635270

52645271
<li>
52655272
<p>If one of the following is true
@@ -5352,7 +5359,7 @@ these steps:
53525359
<a>CORS check</a>, as <var>request</var>'s <a for=request>client</a> and the service worker can
53535360
have different embedder policies.
53545361

5355-
<li>If <var>request</var>'s <code>https-upgrade</code> flag is set, set <var>response</var> and
5362+
<li>If <var>request</var>'s <a for=request>is HTTPS upgrade</a> is set, set <var>response</var> and
53565363
<var>internalResponse</var> to the result of running
53575364
<a>HTTPS upgrade fallback</a> given <var>request</var> and <var>response</var>.
53585365

0 commit comments

Comments
 (0)