4 <title>Test for Bug 24742 - CSS tokenizer allows color in 6 hex digit notation to be followed by the next token without separation</title>
11 if (window.layoutTestController)
12 layoutTestController.dumpAsText();
17 /* description, expected style, test style */
18 ["Invalid: 0 hexadecimal digits", "", "border-bottom: solid #"],
19 ["Invalid: 1 hexadecimal digits", "", "border-bottom: solid #1"],
20 ["Invalid: 2 hexadecimal digits", "", "border-bottom: solid #11"],
21 ["Valid: 3 hexadecimal digits", "border-bottom: solid rgb(17,17,17)", "border-bottom: solid #111"],
22 ["Invalid: 4 hexadecimal digits", "", "border-bottom: solid #1111"],
23 ["Invalid: 5 hexadecimal digits", "", "border-bottom: solid #11111"],
24 ["Valid: 6 hexadecimal digits", "border-bottom: solid rgb(17,17,17)", "border-bottom: solid #111111"],
25 ["Invalid: 7 hexadecimal digits", "", "border-bottom: solid #1111111"],
26 ["Invalid: 0 hexadecimal digits concatenated with 'px'", "", "border-bottom: solid #px"],
27 ["Invalid: 1 hexadecimal digits concatenated with 'px'", "", "border-bottom: solid #1px"],
28 ["Invalid: 2 hexadecimal digits concatenated with 'px'", "", "border-bottom: solid #11px"],
29 ["Invalid: 3 hexadecimal digits concatenated with 'px'", "", "border-bottom: solid #111px"],
30 ["Invalid: 4 hexadecimal digits concatenated with 'px'", "", "border-bottom: solid #1111px"],
31 ["Invalid: 5 hexadecimal digits concatenated with 'px'", "", "border-bottom: solid #11111px"],
32 ["Invalid: 6 hexadecimal digits concatenated with 'px'", "", "border-bottom: solid #111111px"],
33 ["Invalid: 7 hexadecimal digits concatenated with 'px'", "", "border-bottom: solid #1111111px"],
37 for (var i = 0; i < test_defs.length; i++) {
38 var test_def = test_defs[i];
39 testHtml += "<div>Test " + i + " (" + test_def[0] + ")" +
40 "<span id='expected_" + i + "' style='" + test_def[1] + "'> [EXPECTED] </span>" +
41 "<span id='actual_" + i + "' style='" + test_def[2] + "'> [ACTUAL] </span>" +
42 "<span id='result_" + i + "'></span></div>";
44 document.getElementById('tests').innerHTML = testHtml;
46 for (var i = 0; i < test_defs.length; i++) {
47 var expected = document.getElementById("expected_" + i).style.borderBottomColor;
48 var actual = document.getElementById("actual_" + i).style.borderBottomColor;
51 if (actual == expected) {
55 message = "FAIL: expected:'" + expected + "' actual:'" + actual + "'";
58 var result = document.getElementById("result_" + i);
59 result.innerHTML = message;
60 result.style.color = color;
65 <body onload="test()">
66 <div id='tests'>Test didn't run</div>