Wed, 31 Dec 2014 13:27:57 +0100
Ignore runtime configuration files generated during quality assurance.
michael@0 | 1 | <!DOCTYPE HTML> |
michael@0 | 2 | <html> |
michael@0 | 3 | <!-- |
michael@0 | 4 | https://bugzilla.mozilla.org/show_bug.cgi?id=160403 |
michael@0 | 5 | --> |
michael@0 | 6 | <head> |
michael@0 | 7 | <title>Test for Bug 160403</title> |
michael@0 | 8 | <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
michael@0 | 9 | <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> |
michael@0 | 10 | </head> |
michael@0 | 11 | <body> |
michael@0 | 12 | <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=160403">Mozilla Bug 160403</a> |
michael@0 | 13 | <div id="content" style="display: none"> |
michael@0 | 14 | |
michael@0 | 15 | </div> |
michael@0 | 16 | <pre id="test"> |
michael@0 | 17 | <script type="application/javascript"> |
michael@0 | 18 | |
michael@0 | 19 | /** Test for Bug 160403 **/ |
michael@0 | 20 | |
michael@0 | 21 | var element = document.getElementById("content"); |
michael@0 | 22 | var style = element.style; |
michael@0 | 23 | |
michael@0 | 24 | element.setAttribute("style", "border-top-style: dotted"); |
michael@0 | 25 | is(style.getPropertyValue("border-top-style"), "dotted"); |
michael@0 | 26 | is(style.getPropertyPriority("border-top-style"), ""); |
michael@0 | 27 | is(style.getPropertyValue("border-style"), ""); |
michael@0 | 28 | is(style.getPropertyPriority("border-style"), ""); |
michael@0 | 29 | |
michael@0 | 30 | element.setAttribute("style", "border-top-style: dotted ! important"); |
michael@0 | 31 | is(style.getPropertyValue("border-top-style"), "dotted"); |
michael@0 | 32 | is(style.getPropertyPriority("border-top-style"), "important"); |
michael@0 | 33 | is(style.getPropertyValue("border-style"), ""); |
michael@0 | 34 | is(style.getPropertyPriority("border-style"), ""); |
michael@0 | 35 | |
michael@0 | 36 | element.setAttribute("style", "border-top-style: dotted ! important; border-bottom-style: dotted ! important; border-left-style: dotted ! important"); |
michael@0 | 37 | is(style.getPropertyValue("border-top-style"), "dotted"); |
michael@0 | 38 | is(style.getPropertyPriority("border-top-style"), "important"); |
michael@0 | 39 | is(style.getPropertyValue("border-style"), ""); |
michael@0 | 40 | is(style.getPropertyPriority("border-style"), ""); |
michael@0 | 41 | |
michael@0 | 42 | element.setAttribute("style", "border-top-style: dotted ! important; border-right-style: dotted; border-bottom-style: dotted ! important; border-left-style: dotted ! important"); |
michael@0 | 43 | is(style.getPropertyValue("border-top-style"), "dotted"); |
michael@0 | 44 | is(style.getPropertyPriority("border-top-style"), "important"); |
michael@0 | 45 | is(style.getPropertyValue("border-right-style"), "dotted"); |
michael@0 | 46 | is(style.getPropertyPriority("border-right-style"), ""); |
michael@0 | 47 | is(style.getPropertyValue("border-style"), ""); |
michael@0 | 48 | is(style.getPropertyPriority("border-style"), ""); |
michael@0 | 49 | |
michael@0 | 50 | element.setAttribute("style", "border-top-style: dotted ! important; border-right-style: dotted ! important; border-bottom-style: dotted ! important; border-left-style: dotted ! important"); |
michael@0 | 51 | is(style.getPropertyValue("border-top-style"), "dotted"); |
michael@0 | 52 | is(style.getPropertyPriority("border-top-style"), "important"); |
michael@0 | 53 | is(style.getPropertyValue("border-right-style"), "dotted"); |
michael@0 | 54 | is(style.getPropertyPriority("border-right-style"), "important"); |
michael@0 | 55 | isnot(style.getPropertyValue("border-style"), ""); |
michael@0 | 56 | is(style.getPropertyPriority("border-style"), "important"); |
michael@0 | 57 | |
michael@0 | 58 | // Also test that we check consistency of inherit and initial. |
michael@0 | 59 | element.setAttribute("style", "border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted"); |
michael@0 | 60 | isnot(style.getPropertyValue("border-style"), "", "serialize shorthand when all values not inherit/initial"); |
michael@0 | 61 | element.setAttribute("style", "border-top-style: inherit; border-right-style: inherit; border-bottom-style: inherit; border-left-style: inherit"); |
michael@0 | 62 | is(style.getPropertyValue("border-style"), "inherit", "serialize shorthand as inherit"); |
michael@0 | 63 | element.setAttribute("style", "border-top-style: initial; border-right-style: initial; border-bottom-style: initial; border-left-style: initial"); |
michael@0 | 64 | is(style.getPropertyValue("border-style"), "initial", "serialize shorthand as initial"); |
michael@0 | 65 | element.setAttribute("style", "border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: inherit"); |
michael@0 | 66 | is(style.getPropertyValue("border-style"), "", "don't serialize shorthand when partly inherit"); |
michael@0 | 67 | element.setAttribute("style", "border-top-style: initial; border-right-style: dotted; border-bottom-style: initial; border-left-style: initial"); |
michael@0 | 68 | is(style.getPropertyValue("border-style"), "", "don't serialize shorthand when partly initial"); |
michael@0 | 69 | |
michael@0 | 70 | </script> |
michael@0 | 71 | </pre> |
michael@0 | 72 | </body> |
michael@0 | 73 | </html> |