Skip to content

Commit

Permalink
Fix spec example - see #152. (#153)
Browse files Browse the repository at this point in the history
  • Loading branch information
koto authored May 3, 2019
1 parent 10eb9e7 commit 80aee1f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions dist/spec/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1213,7 +1213,7 @@
}
</style>
<link href="https://www.w3.org/StyleSheets/TR/2016/cg-draft" rel="stylesheet">
<meta content="Bikeshed version e0f6b8b749fa390ec1e89d64ac471d2710b038a2" name="generator">
<meta content="Bikeshed version 10ff3eb4050069e20bb9b943c8b76fe5bfe3a48f" name="generator">
<link href="https://wicg.github.io/trusted-types/dist/spec/" rel="canonical">
<style>/* style-md-lists */

Expand Down Expand Up @@ -1461,7 +1461,7 @@
<div class="head">
<p data-fill-with="logo"></p>
<h1 class="p-name no-ref" id="title">Trusted Types Spec WIP</h1>
<h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">Draft Community Group Report, <time class="dt-updated" datetime="2019-04-24">24 April 2019</time></span></h2>
<h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">Draft Community Group Report, <time class="dt-updated" datetime="2019-05-02">2 May 2019</time></span></h2>
<div data-fill-with="spec-metadata">
<dl>
<dt>This version:
Expand Down Expand Up @@ -1815,7 +1815,7 @@ <h3 class="heading settled" data-level="2.3" id="policies"><span class="secno">2
createScriptURL<c- p>(</c->url<c- p>)</c-> <c- p>{</c->
<c- kr>const</c-> parsed <c- o>=</c-> <c- k>new</c-> URL<c- p>(</c->url<c- p>,</c-> document<c- p>.</c->baseURI<c- p>);</c->
<c- k>if</c-> <c- p>(</c->parsed<c- p>.</c->origin <c- o>==</c-> <c- t>'https://mycdn.example'</c-><c- p>)</c-> <c- p>{</c->
<c- k>return</c-> URL<c- p>.</c->toString<c- p>();</c->
<c- k>return</c-> parsed<c- p>.</c->toString<c- p>();</c->
<c- p>}</c->
<c- k>throw</c-> <c- k>new</c-> TypeError<c- p>(</c-><c- t>'invalid URL'</c-><c- p>);</c->
<c- p>},</c->
Expand Down
2 changes: 1 addition & 1 deletion spec/index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ const cdnScriptsPolicy = TrustedTypes.createPolicy('cdn-scripts', {
createScriptURL(url) {
const parsed = new URL(url, document.baseURI);
if (parsed.origin == 'https://mycdn.example') {
return URL.toString();
return parsed.toString();
}
throw new TypeError('invalid URL');
},
Expand Down

0 comments on commit 80aee1f

Please sign in to comment.