Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
check the type/language of script elements
- Loading branch information
1 parent
80c001b
commit bc129fe
Showing
3 changed files
with
169 additions
and
1 deletion.
There are no files selected for viewing
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
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
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,101 @@ | ||
<html> | ||
<head> | ||
<title></title> | ||
<script src="harness.js"></script> | ||
</head> | ||
<body> | ||
<script> | ||
expect(22); | ||
function ok(msg) { _pass(msg, ""); } | ||
function fail(msg) { _fail(msg, ""); } | ||
</script> | ||
<script type=""> | ||
ok('type is empty string'); | ||
</script> | ||
<script language=""> | ||
ok('language is empty string'); | ||
</script> | ||
<script type="text/javascript" language="vbscript"> | ||
ok('type is text/javascript, language ignored'); | ||
</script> | ||
<script type="" language="fooscript"> | ||
ok('type is empty string, language ingored'); | ||
</script> | ||
<script language="javascript"> | ||
ok('language is javascript'); | ||
</script> | ||
<script language="ecmascript"> | ||
ok('language is ecmascript'); | ||
</script> | ||
|
||
<!-- list found at http://www.whatwg.org/specs/web-apps/current-work/multipage/scripting.html#support-the-scripting-language --> | ||
<script type="application/ecmascript"> | ||
ok('type is application/ecmascript'); | ||
</script> | ||
<script type="application/javascript"> | ||
ok('type is application/javascript'); | ||
</script> | ||
<script type="application/x-ecmascript"> | ||
ok('type is application/x-ecmascript'); | ||
</script> | ||
<script type="application/x-javascript"> | ||
ok('type is application/x-javascript'); | ||
</script> | ||
<script type="text/ecmascript"> | ||
ok('type is text/ecmascript'); | ||
</script> | ||
<script type="text/javascript"> | ||
ok('type is text/javascript'); | ||
</script> | ||
<script type="text/javascript1.0"> | ||
ok('type is text/javascript1.0'); | ||
</script> | ||
<script type="text/javascript1.1"> | ||
ok('type is text/javascript1.1'); | ||
</script> | ||
<script type="text/javascript1.2"> | ||
ok('type is text/javascript1.2'); | ||
</script> | ||
<script type="text/javascript1.3"> | ||
ok('type is text/javascript1.3'); | ||
</script> | ||
<script type="text/javascript1.4"> | ||
ok('type is text/javascript1.4'); | ||
</script> | ||
<script type="text/javascript1.5"> | ||
ok('type is text/javascript1.5'); | ||
</script> | ||
<script type="text/jscript"> | ||
ok('type is text/jsscript'); | ||
</script> | ||
<script type="text/livescript"> | ||
ok('type is text/livescript'); | ||
</script> | ||
<script type="text/x-ecmascript"> | ||
ok('type is text/x-ecmascript'); | ||
</script> | ||
<script type="text/x-javascript"> | ||
ok('type is text/x-javascript'); | ||
</script> | ||
|
||
|
||
<!-- should not execute --> | ||
<script type=" "> | ||
fail('type is space'); | ||
</script> | ||
<script type="foo"> | ||
fail('type is unknown'); | ||
</script> | ||
<script type="text/javascript1.6"> | ||
fail('type is unknown'); | ||
</script> | ||
<script language="text/javascript"> | ||
fail('language is text/javascript'); | ||
</script> | ||
|
||
<script> | ||
finish(); | ||
</script> | ||
</body> | ||
</html> | ||
|