layout/style/test/test_parse_ident.html

Wed, 31 Dec 2014 07:16:47 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:16:47 +0100
branch
TOR_BUG_9701
changeset 3
141e0f1194b1
permissions
-rw-r--r--

Revert simplistic fix pending revisit of Mozilla integration attempt.

michael@0 1 <!DOCTYPE HTML>
michael@0 2 <html>
michael@0 3 <head>
michael@0 4 <title>Test for CSS identifier parsing</title>
michael@0 5 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
michael@0 6 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
michael@0 7 </head>
michael@0 8 <body>
michael@0 9 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=">Mozilla Bug </a>
michael@0 10 <div id="content" style="display: none">
michael@0 11 </div>
michael@0 12 <pre id="test">
michael@0 13 <script type="application/javascript">
michael@0 14
michael@0 15 var div = document.getElementById("content");
michael@0 16
michael@0 17 function counter_increment_parses(i)
michael@0 18 {
michael@0 19 div.style.counterIncrement = "";
michael@0 20 div.style.counterIncrement = i;
michael@0 21 return div.style.counterIncrement != "";
michael@0 22 }
michael@0 23
michael@0 24 function is_valid_identifier(i)
michael@0 25 {
michael@0 26 ok(counter_increment_parses(i),
michael@0 27 "'" + i + "' is a valid CSS identifier");
michael@0 28 }
michael@0 29
michael@0 30 function is_invalid_identifier(i)
michael@0 31 {
michael@0 32 ok(!counter_increment_parses(i),
michael@0 33 "'" + i + "' is not a valid CSS identifier");
michael@0 34 }
michael@0 35
michael@0 36 for (var i = 0x7B; i < 0x80; ++i) {
michael@0 37 is_invalid_identifier(String.fromCharCode(i));
michael@0 38 is_invalid_identifier("a" + String.fromCharCode(i));
michael@0 39 is_invalid_identifier(String.fromCharCode(i) + "a");
michael@0 40 }
michael@0 41
michael@0 42 for (var i = 0x80; i < 0xFF; ++i) {
michael@0 43 is_valid_identifier(String.fromCharCode(i));
michael@0 44 }
michael@0 45
michael@0 46 is_valid_identifier(String.fromCharCode(0x100));
michael@0 47 is_valid_identifier(String.fromCharCode(0x375));
michael@0 48 is_valid_identifier(String.fromCharCode(0xFEFF));
michael@0 49 is_valid_identifier(String.fromCharCode(0xFFFD));
michael@0 50 is_valid_identifier(String.fromCharCode(0xFFFE));
michael@0 51 is_valid_identifier(String.fromCharCode(0xFFFF));
michael@0 52
michael@0 53 </script>
michael@0 54 </pre>
michael@0 55 </body>
michael@0 56 </html>

mercurial