OLD | NEW |
(Empty) | |
| 1 <html> |
| 2 <head> |
| 3 <script src="../../resources/js-test.js"></script> |
| 4 <style> |
| 5 :dir(RTL) { |
| 6 color: red; |
| 7 } |
| 8 :dir(ltr) { |
| 9 color: green; |
| 10 } |
| 11 :dir( abc) { |
| 12 color: yellow; |
| 13 } |
| 14 :dir(a,b) { |
| 15 color: blue; |
| 16 } |
| 17 </style> |
| 18 </head> |
| 19 <body> |
| 20 <div dir="auto"> |
| 21 <label id="label1">one</label> |
| 22 </div> |
| 23 <div> |
| 24 <label id="label2">two</label> |
| 25 </div> |
| 26 <div dir="rtl"> |
| 27 <label id="label3">three</label> |
| 28 </div> |
| 29 <script> |
| 30 debug('Checks total number of valid rules'); |
| 31 shouldBe('document.styleSheets[0].cssRules.length', '3'); |
| 32 |
| 33 debug('Checks direction styles are applied correctly based on the computed direc
tion value for each element'); |
| 34 shouldBeEqualToString('getComputedStyle(document.getElementById("label1")).color
', 'rgb(0, 128, 0)'); |
| 35 shouldBeEqualToString('getComputedStyle(document.getElementById("label2")).color
', 'rgb(0, 128, 0)'); |
| 36 shouldBeEqualToString('getComputedStyle(document.getElementById("label3")).color
', 'rgb(255, 0, 0)'); |
| 37 </script> |
| 38 </body> |
| 39 </html> |
OLD | NEW |