| <!DOCTYPE html> |
| <script src="../../resources/js-test.js"></script> |
| <style> |
| #t1 > :-webkit-any(:not([myattr])) { color: green } |
| </style> |
| <div id="t1"> |
| <div myattr>This text should be black</div> |
| <div>This text should be green</div> |
| </div> |
| <script> |
| description("Style sharing based on attribute selectors"); |
| |
| var black = "rgb(0, 0, 0)"; |
| var green = "rgb(0, 128, 0)"; |
| |
| |
| debug("Attribute selector in nested functional syntax"); |
| |
| var firstDiv = t1.querySelector("div"); |
| var secondDiv = t1.querySelector("div+div"); |
| |
| shouldBe("getComputedStyle(firstDiv).color", "black"); |
| shouldBe("getComputedStyle(secondDiv).color", "green"); |
| if (window.internals) |
| shouldBeFalse("internals.isSharingStyle(firstDiv, secondDiv)"); |
| </script> |