3 <script type=
"text/javascript" src=
"../MochiKit/Base.js"></script>
4 <script type=
"text/javascript" src=
"../MochiKit/Iter.js"></script>
5 <script type=
"text/javascript" src=
"../MochiKit/DOM.js"></script>
6 <script type=
"text/javascript" src=
"../MochiKit/Style.js"></script>
7 <script type=
"text/javascript" src=
"../MochiKit/Logging.js"></script>
8 <script type=
"text/javascript" src=
"../MochiKit/Color.js"></script>
9 <script type=
"text/javascript" src=
"SimpleTest/SimpleTest.js"></script>
10 <link rel=
"stylesheet" type=
"text/css" href=
"SimpleTest/test.css">
11 <style type=
"text/css">.redtext {color: red}
</style>
14 <div style=
"position:absolute; top: 0px; left:0px; width:0px; height:0px">
15 <span style=
"color: red" id=
"c_direct"></span>
16 <span class=
"redtext" id=
"c_indirect"></span>
19 <script type=
"text/javascript" src=
"test_Color.js"></script>
20 <script type=
"text/javascript">
23 var t = {ok:ok, is:is};
24 tests.test_Color({ok:ok, is:is});
26 Color.fromText(SPAN()).toHexString(),
32 Color.fromText(
"c_direct").toHexString(),
33 Color.fromName(
"red").toHexString(),
34 "fromText direct style"
38 Color.fromText(
"c_indirect").toHexString(),
39 Color.fromName(
"red").toHexString(),
40 "fromText indirect style"
44 Color.fromComputedStyle(
"c_direct",
"color").toHexString(),
45 Color.fromName(
"red").toHexString(),
46 "fromComputedStyle direct style"
50 Color.fromComputedStyle(
"c_indirect",
"color").toHexString(),
51 Color.fromName(
"red").toHexString(),
52 "fromComputedStyle indirect style"
56 Color.fromBackground((SPAN(null, 'test'))).toHexString(),
57 Color.fromName(
"white").toHexString(),
58 "fromBackground with DOM"
64 ok( true,
"test suite finished!");
68 var s =
"test suite failure!\n";
72 // ensure unique keys?!
74 s += k +
": " + err[k] +
"\n";