| <!doctype html> |
| <!-- Adapted from http://samples.msdn.microsoft.com/ietestcenter/css3/selectors/notSelectorSequence.htm --> |
| <html> |
| <head> |
| <title>:not selector with simple selector sequence</title> |
| <style type="text/css"> |
| div { |
| color: green; |
| } |
| |
| /* div#foo is not a simple selector, but a simple selector sequence. |
| Hence :not(div#foo) is invalid and the entire rule must be dropped. |
| The same applies for others below. */ |
| div, div:not(div#foo) { |
| color: red; |
| } |
| div, div:not(div.bar) { |
| color: red; |
| } |
| div, div:not(#foo.bar) { |
| color: red; |
| } |
| div, div:not([name="x"]#foo) { |
| color: red; |
| } |
| div, div:not(:nth-child(odd).bar) { |
| color: red; |
| } |
| </style> |
| </head> |
| <body> |
| <p>The test passes if the Filler Text below is green.</p> |
| <div id="test">Filler Text</div> |
| <div id="testresult" style="color: blue">Running</div> |
| <script type="text/javascript"> |
| function ArrayContains(array, value, ci) |
| { |
| for (var i = 0; i < array.length; i++) { |
| if (ci && array[i].toLowerCase() == value.toLowerCase()) |
| return true; |
| else if (array[i] == value) |
| return true; |
| } |
| return false; |
| } |
| function TestCase() |
| { |
| try { |
| var target = document.getElementById("test"); |
| var val = getComputedStyle(target, null).getPropertyValue("color"); |
| var aExpectedValues = new Array("green", "#008000", "rgb(0, 128, 0)"); |
| |
| if (ArrayContains(aExpectedValues, val, true)) { |
| document.getElementById("testresult").innerHTML = "Pass"; |
| return; |
| } |
| } catch(e) {} |
| |
| document.getElementById("testresult").innerHTML = "Fail"; |
| } |
| TestCase(); |
| if (window.testRunner) |
| testRunner.dumpAsText(); |
| </script> |
| </body> |
| </html> |