Skip to content

Commit

Permalink
Bug 1601575 [wpt PR 20630] - [Trusted Types] Support 'allow-duplicate…
Browse files Browse the repository at this point in the history
…s' in trusted-types directive., a=testonly

Automatic update from web-platform-tests
[Trusted Types] Support 'allow-duplicates' in trusted-types directive.

Implements 'allow-duplicates' according to
w3c/trusted-types#245

Also updates policy name checking to follow the spec.

Bug: 1030259
Change-Id: I74a1a12d5e36b642cfbcf2517a6ee8f0d7f000e7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1950529
Commit-Queue: Daniel Vogelheim <vogelheimchromium.org>
Reviewed-by: Mike West <mkwstchromium.org>
Cr-Commit-Position: refs/heads/master{#723780}

--

wpt-commits: af8e392b3d0dbe69d8e77c77395f248a9dfc7afb
wpt-pr: 20630

UltraBlame original commit: d6e5a8b7e148b10271550b631f8e1458f4552547
  • Loading branch information
marco-c committed Dec 17, 2019
1 parent 87d9d0e commit f71e48a
Show file tree
Hide file tree
Showing 3 changed files with 159 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,18 @@
(
window
c
[
0
]
+
"
-
"
+
c
[
1
]
t
c
[
Expand Down Expand Up @@ -297,6 +309,18 @@
(
window
c
[
0
]
+
"
-
"
+
c
[
1
]
t
c
[
Expand Down Expand Up @@ -421,6 +445,18 @@
(
window
c
[
0
]
+
"
-
"
+
c
[
1
]
t
c
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@
-
types
*
'
allow
-
duplicates
'
"
>
<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,13 @@
trusted
-
types
*
'
allow
-
duplicates
'
duplicatename
default
"
>
<
Expand Down Expand Up @@ -88,6 +94,9 @@
to
throw
.
let
a
=
trustedTypes
.
createPolicy
Expand All @@ -96,9 +105,20 @@
duplicatename
"
{
createHTML
:
_
=
>
"
a
"
}
)
;
let
b
=
trustedTypes
.
createPolicy
Expand All @@ -107,9 +127,106 @@
duplicatename
"
{
createHTML
:
_
=
>
"
b
"
}
)
;
/
/
Both
should
have
worked
.
They
should
still
be
separate
functions
.
assert_not_equals
(
a
b
)
;
assert_equals
(
"
"
+
a
.
createHTML
(
"
"
)
"
a
"
)
;
assert_equals
(
"
"
+
b
.
createHTML
(
"
"
)
"
b
"
)
;
let
def
=
trustedTypes
.
createPolicy
(
"
default
"
{
}
)
;
assert_throws
(
new
TypeError
(
)
_
=
>
trustedTypes
.
createPolicy
(
"
default
"
{
}
)
)
;
}
"
policy
Expand Down

0 comments on commit f71e48a

Please sign in to comment.