Wed, 31 Dec 2014 06:55:50 +0100
Added tag UPSTREAM_283F7C6 for changeset ca08bd8f51b2
michael@0 | 1 | <!doctype html> |
michael@0 | 2 | <html> |
michael@0 | 3 | <!-- |
michael@0 | 4 | https://bugzilla.mozilla.org/show_bug.cgi?id=413958 |
michael@0 | 5 | --> |
michael@0 | 6 | <head> |
michael@0 | 7 | <title>Test for Bug 413958</title> |
michael@0 | 8 | <meta charset="UTF-8"> |
michael@0 | 9 | <script src="/tests/SimpleTest/SimpleTest.js"></script> |
michael@0 | 10 | <link rel="stylesheet" href="/tests/SimpleTest/test.css"> |
michael@0 | 11 | </head> |
michael@0 | 12 | <body> |
michael@0 | 13 | <style>span { color: red }</style><!-- backstop --> |
michael@0 | 14 | <p><a target="_blank" |
michael@0 | 15 | href="https://bugzilla.mozilla.org/show_bug.cgi?id=413958" |
michael@0 | 16 | >Mozilla Bug 413958</a>. All text below should be black on white.</p> |
michael@0 | 17 | <p>Sheet: <span id="s1">1</span> |
michael@0 | 18 | <span id="s2">2</span> |
michael@0 | 19 | <span id="s3">3</span>. |
michael@0 | 20 | Style attr: <span id="setStyle">4</span>. |
michael@0 | 21 | Properties: <span id="setStyleProp" style="">5</span>.</p> |
michael@0 | 22 | <script> |
michael@0 | 23 | var tests = [ |
michael@0 | 24 | function() { |
michael@0 | 25 | var s = document.createTextNode( |
michael@0 | 26 | "#s1{nosuchprop:auto; color:black}\n"+ |
michael@0 | 27 | "#s2{nosuchprop:auto; color:black}invalid?sel{}#s3{color:black}"), |
michael@0 | 28 | e = document.createElement("style"); |
michael@0 | 29 | e.appendChild(s); |
michael@0 | 30 | document.body.appendChild(e); |
michael@0 | 31 | }, |
michael@0 | 32 | function() { |
michael@0 | 33 | document.getElementById("setStyle") |
michael@0 | 34 | .setAttribute("style", "width:200;color:black"); |
michael@0 | 35 | }, |
michael@0 | 36 | function() { |
michael@0 | 37 | var s = document.getElementById("setStyleProp").style; |
michael@0 | 38 | s.width = "200"; |
michael@0 | 39 | s.color = "black"; |
michael@0 | 40 | }, |
michael@0 | 41 | ]; |
michael@0 | 42 | var results = [ |
michael@0 | 43 | [ { errorMessage: /Unknown property 'nosuchprop'/, |
michael@0 | 44 | lineNumber: 1, columnNumber: 14, |
michael@0 | 45 | sourceLine: "#s1{nosuchprop:auto; color:black}" }, |
michael@0 | 46 | { errorMessage: /Unknown property 'nosuchprop'/, |
michael@0 | 47 | lineNumber: 2, columnNumber: 14, sourceLine: |
michael@0 | 48 | "#s2{nosuchprop:auto; color:black}invalid?sel{}#s3{color:black}" }, |
michael@0 | 49 | { errorMessage: /Ruleset ignored due to bad selector/, |
michael@0 | 50 | lineNumber: 2, columnNumber: 40, sourceLine: |
michael@0 | 51 | "#s2{nosuchprop:auto; color:black}invalid?sel{}#s3{color:black}" } ], |
michael@0 | 52 | [ { errorMessage: /parsing value for 'width'/, |
michael@0 | 53 | lineNumber: 0, columnNumber: 6, |
michael@0 | 54 | sourceLine: "width:200;color:black" } ], |
michael@0 | 55 | [ { errorMessage: /parsing value for 'width'/, |
michael@0 | 56 | lineNumber: 0, columnNumber: 0, |
michael@0 | 57 | sourceLine: "200" } ], |
michael@0 | 58 | ]; |
michael@0 | 59 | var curTest = -1; |
michael@0 | 60 | |
michael@0 | 61 | function doTest() { |
michael@0 | 62 | if (++curTest == tests.length) { |
michael@0 | 63 | var ss = document.getElementsByTagName("span"); |
michael@0 | 64 | for (var i = 0; i < ss.length; i++) { |
michael@0 | 65 | is(window.getComputedStyle(ss[i], "").color, "rgb(0, 0, 0)", |
michael@0 | 66 | "recovery | " + ss[i].id); |
michael@0 | 67 | } |
michael@0 | 68 | SimpleTest.finish(); |
michael@0 | 69 | } else { |
michael@0 | 70 | SimpleTest.expectConsoleMessages(tests[curTest], results[curTest], doTest); |
michael@0 | 71 | } |
michael@0 | 72 | } |
michael@0 | 73 | |
michael@0 | 74 | SimpleTest.waitForExplicitFinish(); |
michael@0 | 75 | doTest(); |
michael@0 | 76 | </script> |
michael@0 | 77 | </body> |
michael@0 | 78 | </html> |