| OLD | NEW |
| (Empty) |
| 1 <style> | |
| 2 postive-z-above, | |
| 3 postive-z-below, | |
| 4 zero-z-above, | |
| 5 zero-z-below, | |
| 6 no-z-above, | |
| 7 no-z-below, | |
| 8 postive-z-after { | |
| 9 position: absolute; | |
| 10 display: flex; | |
| 11 left: 0; | |
| 12 right: 0; | |
| 13 top: 0; | |
| 14 bottom: 0; | |
| 15 background-color: blue; | |
| 16 } | |
| 17 | |
| 18 no-z-below { | |
| 19 top: 50px; | |
| 20 background-color: green; | |
| 21 } | |
| 22 zero-z-above { | |
| 23 z-index: 0; | |
| 24 top: 100px; | |
| 25 background-color: red; | |
| 26 } | |
| 27 zero-z-below { | |
| 28 z-index: 0; | |
| 29 top: 150px; | |
| 30 background-color: salmon; | |
| 31 } | |
| 32 postive-z-above { | |
| 33 z-index: 1; | |
| 34 top: 200px; | |
| 35 background-color: yellow; | |
| 36 } | |
| 37 postive-z-below { | |
| 38 z-index: 1; | |
| 39 top: 250px; | |
| 40 background-color: pink; | |
| 41 } | |
| 42 postive-z-after { | |
| 43 z-index: 1; | |
| 44 top: 300px; | |
| 45 background-color: orange; | |
| 46 } | |
| 47 </style> | |
| 48 <postive-z-above layer yellow></postive-z-above> | |
| 49 <postive-z-below layer pink></postive-z-below> | |
| 50 <no-z-above no-layer blue></no-z-above> | |
| 51 <no-z-below no-layer green></no-z-below> | |
| 52 <zero-z-above layer red></zero-z-above> | |
| 53 <zero-z-below layer salmon></zero-z-below> | |
| 54 <postive-z-after layer orange></postive-z-after> | |
| 55 <script> | |
| 56 import "../resources/third_party/unittest/unittest.dart"; | |
| 57 import "../resources/unit.dart"; | |
| 58 | |
| 59 import "dart:sky"; | |
| 60 | |
| 61 void main() { | |
| 62 initUnit(); | |
| 63 | |
| 64 test("should hit test top item", () { | |
| 65 expect(document.elementFromPoint(100, 25).tagName, equals('no-z-above')); | |
| 66 }); | |
| 67 | |
| 68 test("should hit test second", () { | |
| 69 expect(document.elementFromPoint(100, 75).tagName, equals('no-z-below')); | |
| 70 }); | |
| 71 | |
| 72 test("should hit test third", () { | |
| 73 expect(document.elementFromPoint(100, 125).tagName, equals('zero-z-above')); | |
| 74 }); | |
| 75 | |
| 76 test("should hit test fourth", () { | |
| 77 expect(document.elementFromPoint(100, 175).tagName, equals('zero-z-below')); | |
| 78 }); | |
| 79 | |
| 80 test("should hit test fifth", () { | |
| 81 expect(document.elementFromPoint(100, 225).tagName, equals('postive-z-above'
)); | |
| 82 }); | |
| 83 | |
| 84 test("should hit test sixth", () { | |
| 85 expect(document.elementFromPoint(100, 275).tagName, equals('postive-z-below'
)); | |
| 86 }); | |
| 87 | |
| 88 test("should hit test seventh", () { | |
| 89 expect(document.elementFromPoint(100, 325).tagName, equals('postive-z-after'
)); | |
| 90 }); | |
| 91 } | |
| 92 </script> | |
| OLD | NEW |