Skip to content

Commit ab46bff

Browse files
Merge pull request #441 from metromoxie/sri-fix-broken-links
SRI: Fix broken links to section headers.
2 parents eb40c4e + 1fdea8e commit ab46bff

File tree

2 files changed

+20
-19
lines changed

2 files changed

+20
-19
lines changed

specs/subresourceintegrity/index.html

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ <h4 id="agility">Agility</h4>
380380

381381
<p>In this case, the user agent will choose the strongest hash function in the
382382
list, and use that metadata to validate the response (as described below in
383-
the “<a href="#parse-metadata.x">parse metadata</a>” and “<a href="#get-the-strongest-metadata-from-set.x">get the strongest metadata from
383+
the “<a href="#parse-metadata">parse metadata</a>” and “<a href="#get-the-strongest-metadata-from-set">get the strongest metadata from
384384
set</a>” algorithms).</p>
385385

386386
<p>When a hash function is determined to be insecure, user agents SHOULD deprecate
@@ -424,7 +424,7 @@ <h4 id="priority">Priority</h4>
424424
<h3 id="response-verification-algorithms">Response verification algorithms</h3>
425425

426426
<section>
427-
<h4 id="apply-varalgorithmvar-to-varresponsevar">Apply <var>algorithm</var> to <var>response</var></h4>
427+
<h4 id="apply-algorithm-to-response">Apply <var>algorithm</var> to <var>response</var></h4>
428428

429429
<ol>
430430
<li>Let <var>result</var> be the result of <a href="#apply-algorithm-to-response">applying <var>algorithm</var></a>
@@ -436,11 +436,10 @@ <h4 id="apply-varalgorithmvar-to-varresponsevar">Apply <var>algorithm</var> to <
436436
<var>result</var>.</li>
437437
<li>Return <var>encodedResult</var>.</li>
438438
</ol>
439-
440439
</section>
441440
<!-- Algorithms::apply -->
442441
<section>
443-
<h4 id="is-varresponsevar-eligible-for-integrity-validation">Is <var>response</var> eligible for integrity validation</h4>
442+
<h4 id="is-response-eligible-for-integrity-validation">Is <var>response</var> eligible for integrity validation</h4>
444443

445444
<p>In order to mitigate an attacker’s ability to read data cross-origin by
446445
brute-forcing values via integrity checks, responses are only eligible for such
@@ -481,7 +480,7 @@ <h4 id="is-varresponsevar-eligible-for-integrity-validation">Is <var>response</v
481480
</section>
482481
<!-- Algorithms::eligible -->
483482
<section>
484-
<h4 id="parse-varmetadatavar">Parse <var>metadata</var>.</h4>
483+
<h4 id="parse-metadata">Parse <var>metadata</var>.</h4>
485484

486485
<p>This algorithm accepts a string, and returns either <code>no metadata</code>, or a set of
487486
valid hash expressions whose hash functions are understood by
@@ -508,7 +507,7 @@ <h4 id="parse-varmetadatavar">Parse <var>metadata</var>.</h4>
508507
</section>
509508
<!-- Algorithms::parse -->
510509
<section>
511-
<h4 id="get-the-strongest-metadata-from-varsetvar">Get the strongest metadata from <var>set</var>.</h4>
510+
<h4 id="get-the-strongest-metadata-from-set">Get the strongest metadata from <var>set</var>.</h4>
512511

513512
<ol>
514513
<li>Let <var>result</var> be the empty set and <var>strongest</var> be the empty
@@ -535,15 +534,15 @@ <h4 id="get-the-strongest-metadata-from-varsetvar">Get the strongest metadata fr
535534
</section>
536535
<!-- /Algorithms::get the strongest metadata -->
537536
<section>
538-
<h4 id="does-varresponsevar-match-varmetadatalistvar">Does <var>response</var> match <var>metadataList</var>?</h4>
537+
<h4 id="does-response-match-metadatalist">Does <var>response</var> match <var>metadataList</var>?</h4>
539538

540539
<ol>
541540
<li>Let <var>parsedMetadata</var> be the result of
542-
<a href="#parse-metadata.x">parsing <var>metadataList</var></a>.</li>
541+
<a href="#parse-metadata">parsing <var>metadataList</var></a>.</li>
543542
<li>If <var>parsedMetadata</var> is <code>no metadata</code>, return <code>true</code>.</li>
544543
<li>If <a href="#is-response-eligible-for-integrity-validation"><var>response</var> is not eligible for integrity
545544
validation</a>, return <code>true</code>.</li>
546-
<li>Let <var>metadata</var> be the result of <a href="#get-the-strongest-metadata-from-set.x">getting the strongest
545+
<li>Let <var>metadata</var> be the result of <a href="#get-the-strongest-metadata-from-set">getting the strongest
547546
metadata from <var>parsedMetadata</var></a>.</li>
548547
<li>For each <var>item</var> in <var>metadata</var>:
549548
<ol>
@@ -586,7 +585,6 @@ <h4 id="does-varresponsevar-match-varmetadatalistvar">Does <var>response</var> m
586585
same-origin or CORS) should fail open since they are not the result of an attack
587586
in the threat model of this specification. However, user agents SHOULD report
588587
a warning message about this failure in the developer console.</p>
589-
590588
</section>
591589
<!-- Algorithms::Match -->
592590
</section>
@@ -865,9 +863,6 @@ <h3 id="cross-origin-data-leakage">Cross-origin data leakage</h3>
865863
common usernames, and specify those hashes while repeatedly attempting
866864
to load the document.</p>
867865

868-
<p>User agents SHOULD mitigate the risk by refusing to fire <code>error</code> events
869-
on elements which loaded non-CORS cross-origin resources, but
870-
some side-channels will likely be difficult to avoid.</p>
871866
</section>
872867
<!-- /Security::cross-origin -->
873868

specs/subresourceintegrity/spec.markdown

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,8 @@ only to simplify the algorithm description.
301301

302302
<section>
303303
#### Apply <var>algorithm</var> to <var>response</var>
304+
{: #apply-algorithm-to-response}
305+
[apply-algorithm]: #apply-algorithm-to-response
304306

305307
1. Let <var>result</var> be the result of [applying <var>algorithm</var>][apply-algorithm]
306308
to the [representation data][representationdata] without any content-codings
@@ -310,11 +312,10 @@ only to simplify the algorithm description.
310312
2. Let <var>encodedResult</var> be result of base64-encoding
311313
<var>result</var>.
312314
3. Return <var>encodedResult</var>.
313-
314-
[apply-algorithm]: #apply-algorithm-to-response
315315
</section><!-- Algorithms::apply -->
316316
<section>
317317
#### Is <var>response</var> eligible for integrity validation
318+
{: #is-response-eligible-for-integrity-validation}
318319
[eligible]: #is-response-eligible-for-integrity-validation
319320

320321
In order to mitigate an attacker's ability to read data cross-origin by
@@ -363,6 +364,8 @@ checking because it won't have loaded successfully.
363364
</section><!-- Algorithms::eligible -->
364365
<section>
365366
#### Parse <var>metadata</var>.
367+
{: #parse-metadata}
368+
[parse]: #parse-metadata
366369

367370
This algorithm accepts a string, and returns either `no metadata`, or a set of
368371
valid hash expressions whose hash functions are understood by
@@ -385,6 +388,8 @@ the user agent.
385388
</section><!-- Algorithms::parse -->
386389
<section>
387390
#### Get the strongest metadata from <var>set</var>.
391+
{: #get-the-strongest-metadata-from-set}
392+
[get-the-strongest]: #get-the-strongest-metadata-from-set
388393

389394
1. Let <var>result</var> be the empty set and <var>strongest</var> be the empty
390395
string.
@@ -407,6 +412,8 @@ the user agent.
407412
</section><!-- /Algorithms::get the strongest metadata -->
408413
<section>
409414
#### Does <var>response</var> match <var>metadataList</var>?
415+
{: #does-response-match-metadatalist}
416+
[match]: #does-response-match-metadatalist
410417

411418
1. Let <var>parsedMetadata</var> be the result of
412419
[parsing <var>metadataList</var>][parse].
@@ -455,10 +462,6 @@ same-origin or CORS) should fail open since they are not the result of an attack
455462
in the threat model of this specification. However, user agents SHOULD report
456463
a warning message about this failure in the developer console.
457464
{:.note}
458-
459-
[parse]: #parse-metadata.x
460-
[get-the-strongest]: #get-the-strongest-metadata-from-set.x
461-
[match]: #does-response-match-metadatalist
462465
</section><!-- Algorithms::Match -->
463466
</section><!-- Algorithms -->
464467

@@ -541,6 +544,7 @@ for all possible subresources, i.e., `a`, `audio`, `embed`, `iframe`, `img`,
541544

542545
<section>
543546
#### The `integrity` attribute
547+
{: #the-integrity-attribute}
544548

545549
The `integrity` attribute represents [integrity metadata][] for an element.
546550
The value of the attribute MUST be either the empty string, or at least one
@@ -612,6 +616,7 @@ failed resource with a different one.
612616

613617
<section>
614618
###### The `link` element for stylesheets
619+
{: #the-link-element-for-stylesheets}
615620

616621
Whenever a user agent attempts to [obtain a resource][] pointed to by a
617622
`link` element that has a `rel` attribute with the keyword of `stylesheet`,
@@ -630,6 +635,7 @@ value of the element's `integrity` attribute.
630635

631636
<section>
632637
###### The `script` element
638+
{: #the-script-element}
633639

634640
Replace step 14.1 of HTML5's ["prepare a script" algorithm][prepare] with:
635641

0 commit comments

Comments
 (0)