pointer-events.html 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
  2. "http://www.w3.org/TR/html4/strict.dtd">
  3. <html>
  4. <head>
  5. <meta http-equiv="Content-type" content="text/html; charset=utf-8">
  6. <title>Test for 'pointer-events' property in HTML</title>
  7. <style type="text/css" media="screen">
  8. #a {
  9. pointer-events: auto;
  10. background: #88f;
  11. }
  12. #a:hover {
  13. background: green;
  14. }
  15. #b {
  16. pointer-events: none;
  17. background: #88f;
  18. }
  19. #b:hover {
  20. background: red;
  21. }
  22. #c {
  23. pointer-events: auto;
  24. background: #88f;
  25. }
  26. #c span {
  27. pointer-events: none;
  28. background: #8ff;
  29. }
  30. #c:hover {
  31. background: green;
  32. }
  33. #d {
  34. pointer-events: none;
  35. background: #88f;
  36. }
  37. #d span {
  38. pointer-events: auto;
  39. padding: 0 10px;
  40. background: #8ff;
  41. }
  42. #d:hover {
  43. background: gray;
  44. }
  45. #e {
  46. padding: 10px;
  47. pointer-events: none;
  48. background: #88f;
  49. }
  50. #e div {
  51. pointer-events: auto;
  52. background: #8ff;
  53. }
  54. #e:hover {
  55. background: gray;
  56. }
  57. #e div:hover {
  58. background: green;
  59. }
  60. #f, #g, #h, #i, #k, #m {
  61. padding: 10px;
  62. background: #88f;
  63. }
  64. #f {
  65. pointer-events: auto;
  66. }
  67. #f:hover {
  68. background: green;
  69. }
  70. #g {
  71. pointer-events: none;
  72. }
  73. #g:hover {
  74. background: red;
  75. }
  76. #h {
  77. pointer-events: auto;
  78. }
  79. #h:hover {
  80. background: green;
  81. }
  82. #i {
  83. pointer-events: none;
  84. }
  85. #i:hover {
  86. background: red;
  87. }
  88. #j {
  89. background: #88f;
  90. pointer-events: none;
  91. }
  92. #j:hover {
  93. background: gray;
  94. }
  95. #k {
  96. pointer-events: auto;
  97. }
  98. #k:hover {
  99. background: green;
  100. }
  101. #l {
  102. background: #88f;
  103. pointer-events: auto;
  104. }
  105. #l:hover {
  106. background: green;
  107. }
  108. #m {
  109. pointer-events: none;
  110. }
  111. #m:hover {
  112. background: red;
  113. }
  114. </style>
  115. </head>
  116. <body>
  117. <h1>Testing 'pointer-events' property in HTML</h1>
  118. <p id="a">This whole paragraph SHOULD change background when hovered</p>
  119. <p id="b">This whole paragraph SHOULD NOT change background when hovered</p>
  120. <p id="c">This paragraph SHOULD change background when hovered anywhere including
  121. <span>this inline text</span> even though the inline text ignores pointer events.</p>
  122. <p id="d">This paragraph SHOULD NOT change when the pointer is over only it but
  123. <span>this inline text</span> SHOULD change and cause the parent to change also.</p>
  124. <div id="e">This paragraph SHOULD NOT change when the pointer is over only it (not the child)
  125. <div>This child element SHOULD change and cause the parent to change also</div>
  126. </div>
  127. <p>
  128. The following image SHOULD change when the pointer is over it.
  129. </p>
  130. <img id="f" src="../../../LayoutTests/media/content/abe.png">
  131. <p>
  132. The following image SHOULD NOT change when the pointer is over it.
  133. </p>
  134. <img id="g" src="../../../LayoutTests/media/content/abe.png">
  135. <p>
  136. The following image SHOULD change when the pointer is over it. It is inline
  137. with this paragraph.
  138. <img id="h" src="../../../LayoutTests/media/content/abe.png">
  139. </p>
  140. <p>
  141. The following image SHOULD NOT change when the pointer is over it. It is inline
  142. with this paragraph.
  143. <img id="i" src="../../../LayoutTests/media/content/abe.png">
  144. </p>
  145. <p id="j">
  146. This paragraph SHOULD NOT change when the pointer is over only it, but the child
  147. image SHOULD react and cause the parent to change.
  148. <img id="k" src="../../../LayoutTests/media/content/abe.png">
  149. </p>
  150. <p id="l">
  151. This paragraph SHOULD change when the pointer is over it, but the child
  152. image SHOULD NOT react.
  153. <img id="m" src="../../../LayoutTests/media/content/abe.png">
  154. </p>
  155. </body>
  156. </html>