Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Side by Side Diff: third_party/WebKit/LayoutTests/fast/css/invalid-hex-color.html

Issue 1936913002: [CSS] Accept 8 (#RRGGBBAA) and 4 (#RGBA) value hex colors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add quirks mode fastParseColorInternal() test cases. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <!doctype html> 1 <!doctype html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <title>Test for Bug 24742 - CSS tokenizer allows color in 6 hex digit notation t o be followed by the next token without separation</title> 4 <title>Test for Bug 24742 - CSS tokenizer allows color in 6 hex digit notation t o be followed by the next token without separation</title>
5 <style> 5 <style>
6 div { 6 div {
7 margin-bottom:11px; 7 margin-bottom:11px;
8 } 8 }
9 </style> 9 </style>
10 <script> 10 <script>
11 if (window.testRunner) 11 if (window.testRunner)
12 testRunner.dumpAsText(); 12 testRunner.dumpAsText();
13 13
14 function test() 14 function test()
15 { 15 {
16 var test_defs = [ 16 var test_defs = [
17 /* description, expected style, test style */ 17 /* description, expected style, test style */
18 ["Invalid: 0 hexadecimal digits", "", "border-bottom: solid #"], 18 ["Invalid: 0 hexadecimal digits", "", "border-bottom: solid #"],
19 ["Invalid: 1 hexadecimal digits", "", "border-bottom: solid #1"], 19 ["Invalid: 1 hexadecimal digits", "", "border-bottom: solid #1"],
20 ["Invalid: 2 hexadecimal digits", "", "border-bottom: solid #11"], 20 ["Invalid: 2 hexadecimal digits", "", "border-bottom: solid #11"],
21 ["Valid: 3 hexadecimal digits", "border-bottom: solid rgb(17,17,17)", "b order-bottom: solid #111"], 21 ["Valid: 3 hexadecimal digits", "border-bottom: solid rgb(17,17,17)", "b order-bottom: solid #111"],
22 ["Invalid: 4 hexadecimal digits", "", "border-bottom: solid #1111"], 22 ["Valid: 4 hexadecimal digits", "border-bottom: solid rgba(17,17,17,255) ", "border-bottom: solid #111f"],
23 ["Invalid: 5 hexadecimal digits", "", "border-bottom: solid #11111"], 23 ["Invalid: 5 hexadecimal digits", "", "border-bottom: solid #11111"],
24 ["Valid: 6 hexadecimal digits", "border-bottom: solid rgb(17,17,17)", "b order-bottom: solid #111111"], 24 ["Valid: 6 hexadecimal digits", "border-bottom: solid rgb(17,17,17)", "b order-bottom: solid #111111"],
25 ["Invalid: 7 hexadecimal digits", "", "border-bottom: solid #1111111"], 25 ["Invalid: 7 hexadecimal digits", "", "border-bottom: solid #1111111"],
26 ["Valid: 8 hexadecimal digits", "border-bottom: solid rgba(17,17,17,255) ", "border-bottom: solid #111111ff"],
26 ["Invalid: 0 hexadecimal digits concatenated with 'px'", "", "border-bot tom: solid #px"], 27 ["Invalid: 0 hexadecimal digits concatenated with 'px'", "", "border-bot tom: solid #px"],
27 ["Invalid: 1 hexadecimal digits concatenated with 'px'", "", "border-bot tom: solid #1px"], 28 ["Invalid: 1 hexadecimal digits concatenated with 'px'", "", "border-bot tom: solid #1px"],
28 ["Invalid: 2 hexadecimal digits concatenated with 'px'", "", "border-bot tom: solid #11px"], 29 ["Invalid: 2 hexadecimal digits concatenated with 'px'", "", "border-bot tom: solid #11px"],
29 ["Invalid: 3 hexadecimal digits concatenated with 'px'", "", "border-bot tom: solid #111px"], 30 ["Invalid: 3 hexadecimal digits concatenated with 'px'", "", "border-bot tom: solid #111px"],
30 ["Invalid: 4 hexadecimal digits concatenated with 'px'", "", "border-bot tom: solid #1111px"], 31 ["Invalid: 4 hexadecimal digits concatenated with 'px'", "", "border-bot tom: solid #1111px"],
31 ["Invalid: 5 hexadecimal digits concatenated with 'px'", "", "border-bot tom: solid #11111px"], 32 ["Invalid: 5 hexadecimal digits concatenated with 'px'", "", "border-bot tom: solid #11111px"],
32 ["Invalid: 6 hexadecimal digits concatenated with 'px'", "", "border-bot tom: solid #111111px"], 33 ["Invalid: 6 hexadecimal digits concatenated with 'px'", "", "border-bot tom: solid #111111px"],
33 ["Invalid: 7 hexadecimal digits concatenated with 'px'", "", "border-bot tom: solid #1111111px"], 34 ["Invalid: 7 hexadecimal digits concatenated with 'px'", "", "border-bot tom: solid #1111111px"],
35 ["Invalid: 8 hexadecimal digits concatenated with 'px'", "", "border-bot tom: solid #11111111px"],
34 ]; 36 ];
35 37
36 var testHtml = ""; 38 var testHtml = "";
37 for (var i = 0; i < test_defs.length; i++) { 39 for (var i = 0; i < test_defs.length; i++) {
38 var test_def = test_defs[i]; 40 var test_def = test_defs[i];
39 testHtml += "<div>Test " + i + " (" + test_def[0] + ")" + 41 testHtml += "<div>Test " + i + " (" + test_def[0] + ")" +
40 "<span id='expected_" + i + "' style='" + test_def[1] + "'> [EXPECTED] </span>" + 42 "<span id='expected_" + i + "' style='" + test_def[1] + "'> [EXPECTED] </span>" +
41 "<span id='actual_" + i + "' style='" + test_def[2] + "'> [A CTUAL] </span>" + 43 "<span id='actual_" + i + "' style='" + test_def[2] + "'> [A CTUAL] </span>" +
42 "<span id='result_" + i + "'></span></div>"; 44 "<span id='result_" + i + "'></span></div>";
43 } 45 }
(...skipping 15 matching lines...) Expand all
59 result.innerHTML = message; 61 result.innerHTML = message;
60 result.style.color = color; 62 result.style.color = color;
61 } 63 }
62 } 64 }
63 </script> 65 </script>
64 </head> 66 </head>
65 <body onload="test()"> 67 <body onload="test()">
66 <div id='tests'>Test didn't run</div> 68 <div id='tests'>Test didn't run</div>
67 </html> 69 </html>
68 70
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698