Skip to content

Commit

Permalink
Bug 1850635 [wpt PR 41704] - Implement parseHTMLUnsafe and setHTMLUns…
Browse files Browse the repository at this point in the history
…afe, a=testonly

Automatic update from web-platform-tests
Implement parseHTMLUnsafe and setHTMLUnsafe

I am speccing this here: whatwg/html#9538

Bug: 1478969
Change-Id: Ie55827cebdf349aadae13fbf1086baf6177bbff2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4824679
Reviewed-by: Mason Freed <masonfchromium.org>
Commit-Queue: Joey Arhar <jarharchromium.org>
Cr-Commit-Position: refs/heads/main{#1210412}

--

wpt-commits: 17743f761d9f8bd3954bc68c60b88d251f9a2239
wpt-pr: 41704

UltraBlame original commit: 27a50ba5472ea3cd6771918695f14558391747fd
  • Loading branch information
marco-c committed Oct 30, 2023
1 parent 62a02d2 commit ffce3d7
Show file tree
Hide file tree
Showing 19 changed files with 4,402 additions and 98 deletions.
@@ -0,0 +1,346 @@
<
!
DOCTYPE
html
>
<
meta
charset
=
"
windows
-
1252
"
>
<
!
-
-
intentional
to
make
sure
the
results
are
UTF
-
8
anyway
-
-
>
<
link
rel
=
author
href
=
"
mailto
:
jarhar
chromium
.
org
"
>
<
link
rel
=
help
href
=
"
https
:
/
/
github
.
com
/
whatwg
/
html
/
pull
/
9538
"
>
<
script
src
=
"
/
resources
/
testharness
.
js
"
>
<
/
script
>
<
script
src
=
"
/
resources
/
testharnessreport
.
js
"
>
<
/
script
>
<
!
-
-
This
was
adapted
from
DOMParser
-
parseFromString
-
encoding
.
html
-
-
>
<
script
>
function
assertEncoding
(
doc
)
{
assert_equals
(
doc
.
charset
"
UTF
-
8
"
"
document
.
charset
"
)
;
assert_equals
(
doc
.
characterSet
"
UTF
-
8
"
"
document
.
characterSet
"
)
;
assert_equals
(
doc
.
inputEncoding
"
UTF
-
8
"
"
document
.
characterSet
"
)
;
}
setup
(
(
)
=
>
{
assert_equals
(
document
.
characterSet
"
windows
-
1252
"
"
the
meta
charset
must
be
in
effect
making
the
main
document
windows
-
1252
"
)
;
}
)
;
test
(
(
)
=
>
{
const
doc
=
Document
.
parseHTMLUnsafe
(
'
'
)
;
assertEncoding
(
doc
)
;
}
'
Parse
empty
string
'
)
;
test
(
(
)
=
>
{
const
doc
=
Document
.
parseHTMLUnsafe
(
<
meta
charset
=
"
latin2
"
>
)
;
assertEncoding
(
doc
)
;
}
"
meta
charset
latin2
"
)
;
test
(
(
)
=
>
{
const
doc
=
Document
.
parseHTMLUnsafe
(
<
?
xml
version
=
"
1
.
0
"
encoding
=
"
latin2
"
?
>
<
x
/
>
)
;
assertEncoding
(
doc
)
;
}
"
XML
declaration
"
)
;
<
/
script
>

0 comments on commit ffce3d7

Please sign in to comment.