diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-charset-01.html | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-charset-01.html')
-rw-r--r-- | testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-charset-01.html | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-charset-01.html b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-charset-01.html new file mode 100644 index 000000000..c5ac0d0a6 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-charset-01.html @@ -0,0 +1,89 @@ +<!DOCTYPE html> +<head> + <meta charset="utf-8"> + <title>Script @type: unknown parameters</title> + <link rel="author" title="askalski" href="github.com/askalski"> + <link rel="help" href="https://html.spec.whatwg.org/multipage/#scriptingLanguages"> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <div id="log"></div> + + <!-- "Step1" tests --> + <!-- charset is set incorrectly via Content Type "text/javascript;charset=utf-8" in response + which has priority before a correct setting in "charset" attribute of script tag. + --> + <script type="text/javascript" + src="serve-with-content-type.py?fn=external-script-windows1250.js&ct=text/javascript%3Bcharset=utf-8" charset="windows-1250"> + </script> + <script> + test(function() { + //these strings should not match, since the file charset is set incorrectly + assert_not_equals(window.getSomeString(), "śćążź"); + }); + </script> + <!-- charset is set correctly via Content Type "text/javascript;charset=utf-8" in response + which has priority before a incorrect setting in "charset" attribute of script tag. + --> + + <script type="text/javascript" + src="serve-with-content-type.py?fn=external-script-windows1250.js&ct=text/javascript%3Bcharset=windows-1250" charset="utf-8"> + </script> + <script> + //the charset is set correctly via Content Type "text/javascript;charset=windows-1250" in respones + test(function() { + assert_equals(window.getSomeString(), "śćążź"); + }); + </script> + + <!-- end of step1 tests, now step2 tests --> + <!-- in this case, the response's Content Type does not bring charset information. + Second step takes block character encoding if available.--> + <script type="text/javascript" + src="serve-with-content-type.py?fn=external-script-windows1250.js&ct=text/javascript" charset="utf-8"> + </script> + <script> + test(function() { + //these strings should not match, since the file charset is set incorrectly in "charset" tag of <script> above + assert_not_equals(window.getSomeString(), "śćążź"); + }); + </script> + <!-- charset is set correctly via Content Type "text/javascript;charset=utf-8" in response + which has priority before a incorrect setting in "charset" attribute of script tag. + --> + + <script type="text/javascript" + src="serve-with-content-type.py?fn=external-script-windows1250.js&ct=text/javascript" charset="windows-1250"> + </script> + <script> + //the charset is set correctly via content attribute in <script> above + test(function() { + assert_equals(window.getSomeString(), "śćążź"); + }); + </script> + + <!-- end of step2 tests, now step3 tests --> + <!-- in this case, neither response's Content Type nor charset attribute bring correct charset information. + Third step takes this document's character encoding (declared correctly as UTF-8).--> + <script type="text/javascript" + src="serve-with-content-type.py?fn=external-script-windows1250.js&ct=text/javascript"> + </script> + <script> + test(function() { + //these strings should not match, since the tested file is in windows-1250, and document is utf-8 + assert_not_equals(window.getSomeString(), "śćążź"); + }); + </script> + + <script type="text/javascript" + src="serve-with-content-type.py?fn=external-script-utf8.js&ct=text/javascript"> + </script> + <script> + //these strings should match, both document and tested file are utf-8 + test(function() { + assert_equals(window.getSomeString(), "śćążź"); + }); + </script> + + <!-- the last portion of tests (step4) are in file script-charset-02.html + +</head> |