Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1850635 [wpt PR 41704] - Implement parseHTMLUnsafe and setHTMLUns…
…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
Showing
19 changed files
with
4,402 additions
and
98 deletions.
There are no files selected for viewing
346 changes: 346 additions & 0 deletions
346
...mic-markup-insertion/html-unsafe-methods/Document-parseHTMLUnsafe-encoding.tentative.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
> |
Oops, something went wrong.