mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-10 05:08:36 +02:00
Automatic update from web-platform-tests
Replace some assert_throws("Something", stuff) calls with assert_throws_dom. (#21377)
This diff was generated by running:
find . -type f -print0 | xargs -0 perl -pi -e 'BEGIN { $/ = undef; } s/assert_throws\(([ \n]*"[A-Za-z_]*") *(, *.)/assert_throws_dom(\1\2/gs'
followed by a fix to
xhr/resources/send-after-setting-document-domain-window-helper.js to make
xhr/send-after-setting-document-domain.htm pass.
This does affect indentation poorly in cases when the first arg was on the same
line as the assert_throws, there was a newline after the ',' after the first
arg, and the following args were lined up with the first arg. Fixing that,
especially when there are multiple lines after the first arg, is not trivial
with a regexp.
Co-authored-by: Boris Zbarsky <bzbarsky@mit.edu>
--
wpt-commits: 3696f2233a37437896505b7187968aa605be9255
wpt-pr: 21377
46 lines
1.7 KiB
HTML
46 lines
1.7 KiB
HTML
<!doctype html>
|
|
<title>Escaped EOF</title>
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
|
|
<meta name="author" title="Tab Atkins-Bittner">
|
|
<link rel=help href="https://drafts.csswg.org/css-syntax/#consume-escaped-code-point">
|
|
<link rel=help href="https://drafts.csswg.org/css-syntax/#consume-string-token">
|
|
<link rel=help href="https://drafts.csswg.org/css-syntax/#consume-token">
|
|
|
|
<style>foo { --foo:foo\</style>
|
|
<style>foo { --foo:1foo\</style>
|
|
<style>foo { --foo:url(foo\</style>
|
|
<style>foo { --foo:"foo\</style>
|
|
|
|
<script>
|
|
test(()=>{
|
|
assert_throws_dom("SyntaxError", ()=>{document.querySelector("#123");}, "numeric hash token is invalid in a selector");
|
|
document.querySelector("#foo\\"); // escaped-EOF in a hash token is valid in a selector
|
|
}, "Escaped EOF turns into a U+FFFD in a hash token, makes it 'ID' type.");
|
|
|
|
test(()=>{
|
|
const sh = document.styleSheets[0];
|
|
const val = sh.cssRules[0].style.getPropertyValue("--foo");
|
|
assert_equals("foo\ufffd", val);
|
|
}, "Escaped EOF turns into a U+FFFD in an ident token.");
|
|
|
|
test(()=>{
|
|
const sh = document.styleSheets[1];
|
|
const val = sh.cssRules[0].style.getPropertyValue("--foo");
|
|
assert_equals("1foo\ufffd", val);
|
|
}, "Escaped EOF turns into a U+FFFD in a dimension token.");
|
|
|
|
test(()=>{
|
|
const sh = document.styleSheets[2];
|
|
const val = sh.cssRules[0].style.getPropertyValue("--foo");
|
|
assert_equals("url(foo\ufffd)", val);
|
|
}, "Escaped EOF turns into a U+FFFD in a url token.");
|
|
|
|
test(()=>{
|
|
const sh = document.styleSheets[3];
|
|
const val = sh.cssRules[0].style.getPropertyValue("--foo");
|
|
assert_equals(`"foo"`, val);
|
|
}, "Escaped EOF in a string is ignored.");
|
|
|
|
</script>
|