| <!DOCTYPE html> |
| <script src="../../resources/js-test.js"></script> |
| <style> |
| .green + div.sibling + div { |
| color: green; |
| } |
| </style> |
| <div> |
| <div id="first"></div> |
| <div class="sibling"></div> |
| <div id="target">This text should be green.</div> |
| </div> |
| <script> |
| description("Test if direct adjacent selectors are counted correctly where combined with subselector."); |
| |
| shouldBeEqualToString("getComputedStyle(target, null).color", "rgb(0, 0, 0)"); |
| first.className = "green"; |
| shouldBeEqualToString("getComputedStyle(target, null).color", "rgb(0, 128, 0)"); |
| </script> |