| 1 |
wakaba |
1.1 |
<!DOCTYPE HTML> |
| 2 |
|
|
<html> |
| 3 |
|
|
<head> |
| 4 |
|
|
<title>White Space Characters in CSS Style Sheet</title> |
| 5 |
|
|
<style> |
| 6 |
|
|
</style> |
| 7 |
|
|
</head> |
| 8 |
|
|
<body> |
| 9 |
|
|
|
| 10 |
|
|
<p>This test is for non-IE browsers. For IE, use |
| 11 |
|
|
<a href=space-char-1>space-char-1</a>.</p> |
| 12 |
|
|
|
| 13 |
|
|
<p id=test>Script is not executed yet.</p> |
| 14 |
|
|
|
| 15 |
|
|
<ul id=result-list></ul> |
| 16 |
|
|
|
| 17 |
|
|
<script> |
| 18 |
|
|
window.onload = function () { |
| 19 |
|
|
var test = document.getElementById ('test'); |
| 20 |
|
|
var style = document.getElementsByTagName ('style')[0]; |
| 21 |
|
|
var results = document.getElementById ('result-list'); |
| 22 |
|
|
|
| 23 |
|
|
var c = function (j) { |
| 24 |
|
|
test.textContent = 'Testing U+' + j.toString (16) + 'XX...'; |
| 25 |
|
|
|
| 26 |
|
|
for (var i = 0; i < 0x100; i++) { |
| 27 |
|
|
var code = i + 0x100 * j; |
| 28 |
|
|
var ss = 'p { color: ' + String.fromCharCode (code) + ' red}'; |
| 29 |
|
|
style.textContent = ss; |
| 30 |
|
|
var cc = getComputedStyle (test, null).color; |
| 31 |
wakaba |
1.2 |
if (cc == 'rgb(255, 0, 0)' || cc == '#ff0000' || cc == 'red') { |
| 32 |
wakaba |
1.1 |
results.appendChild (document.createElement ('li')) |
| 33 |
|
|
.textContent = code.toString (16).toUpperCase (); |
| 34 |
|
|
} |
| 35 |
|
|
} |
| 36 |
|
|
|
| 37 |
|
|
j++; |
| 38 |
|
|
if (j < 0x100) { |
| 39 |
|
|
setTimeout (function () { c (j) }, 50); |
| 40 |
|
|
} else { |
| 41 |
|
|
setTimeout (function () { xc (0xD800, 0xDC) }, 50); |
| 42 |
|
|
} |
| 43 |
|
|
}; |
| 44 |
|
|
setTimeout (function () { c (0) }, 50); |
| 45 |
|
|
|
| 46 |
|
|
var xc = function (i, jh) { |
| 47 |
|
|
test.textContent = 'Testing surrogate 0x' + i.toString (16) + ' 0x' + |
| 48 |
|
|
jh.toString (16) + 'XX...'; |
| 49 |
|
|
|
| 50 |
|
|
for (var jl = 0x00; jl < 0x100; jl++) { |
| 51 |
|
|
var j = jh * 0x100 + jl; |
| 52 |
|
|
var ss = 'p { color: ' + String.fromCharCode (i) + |
| 53 |
|
|
String.fromCharCode (j) + ' red}'; |
| 54 |
|
|
style.textContent = ss; |
| 55 |
|
|
if (getComputedStyle (test, null).color == 'red') { |
| 56 |
|
|
results.appendChild (document.createElement ('li')) |
| 57 |
|
|
.textContent = i.toString (16).toUpperCase () + ', ' + |
| 58 |
|
|
j.toString (16).toUpperCase (); |
| 59 |
|
|
} |
| 60 |
|
|
} |
| 61 |
|
|
|
| 62 |
|
|
jh++; |
| 63 |
|
|
if (jh > 0xDF) { |
| 64 |
|
|
i++; |
| 65 |
|
|
jh = 0xDC; |
| 66 |
|
|
} |
| 67 |
|
|
|
| 68 |
|
|
if (i < 0xDC00) { |
| 69 |
|
|
setTimeout (function () { xc (i, jh) }, 50); |
| 70 |
|
|
} else { |
| 71 |
|
|
test.textContent = 'Done.'; |
| 72 |
|
|
} |
| 73 |
|
|
}; |
| 74 |
|
|
}; |
| 75 |
|
|
</script> |
| 76 |
|
|
|
| 77 |
|
|
</body> |
| 78 |
|
|
</html> |