positioning_test.html 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. <!DOCTYPE html>
  2. <html>
  3. <!--
  4. Copyright 2008 The Closure Library Authors. All Rights Reserved.
  5. Use of this source code is governed by the Apache License, Version 2.0.
  6. See the COPYING file for details.
  7. Author: eae@google.com (Emil A Eklund)
  8. -->
  9. <head>
  10. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  11. <meta charset="UTF-8" />
  12. <title>Closure Unit Tests - goog.positioning</title>
  13. <script src="../base.js"></script>
  14. <style>
  15. .box1 {
  16. border: 1px solid black;
  17. margin: 10px;
  18. padding: 5px;
  19. height: 150px;
  20. }
  21. .outerbox {
  22. border: 1px solid gray;
  23. padding: 3px;
  24. margin: 5px 5px 5px 100px;
  25. }
  26. .box2 {
  27. position: relative;
  28. padding: 0px; /* If the padding has >0 value, IE6 fails some tests. */
  29. margin: -2px;
  30. }
  31. .box8 {
  32. position: absolute;
  33. padding: 0px; /* If the padding has >0 value, IE6 fails some tests. */
  34. margin: -2px;
  35. width: 500px;
  36. height: 100px;
  37. }
  38. .box9 {
  39. border: 1px solid black;
  40. margin: 10px;
  41. padding: 5px;
  42. height: 150px;
  43. width: 150px;
  44. }
  45. .anchorFrame {
  46. overflow: auto;
  47. width: 100px;
  48. height: 100px;
  49. }
  50. #popup1, #popup2, #popup3, #popup5, #popup6, #popup7 {
  51. position: absolute;
  52. border: 1px solid red;
  53. width: 100px;
  54. height: 100px;
  55. }
  56. #popup9 {
  57. border: 1px solid green;
  58. height: 100px;
  59. left: 0;
  60. position: absolute;
  61. top: 0;
  62. width: 100px;
  63. }
  64. #popup8 {
  65. position: absolute;
  66. border: 1px solid red;
  67. width: 100px;
  68. height: 100px;
  69. }
  70. #anchor1 {
  71. border: 1px solid blue;
  72. }
  73. #anchor4 {
  74. position: absolute;
  75. left: 2px;
  76. }
  77. #test-area {
  78. height: 1000px;
  79. position: relative;
  80. width: 1000px;
  81. }
  82. .overflow-hidden {
  83. overflow: hidden;
  84. }
  85. .overflow-auto {
  86. overflow: auto;
  87. }
  88. </style>
  89. </head>
  90. <body>
  91. <div id='offscreen-anchor'
  92. style='position: absolute; left: -1000px; top: -1000px'></div>
  93. <div id="ltr" dir="ltr">
  94. Left to right element.
  95. </div>
  96. <div id="rtl" dir="rtl">
  97. Right to left element.
  98. </div>
  99. <div class="outerbox">
  100. <div id="box1" class="box1">
  101. <span id="anchor1">Anchor LTR.</span>
  102. </div>
  103. <div class="box2">
  104. <div id="popup1">
  105. <div>Popup ltr.</div>
  106. </div>
  107. </div>
  108. </div>
  109. <div class="outerbox" dir="rtl">
  110. <div class="box1">
  111. <span id="anchor2">Anchor RTL.</span>
  112. </div>
  113. <div class="box2">
  114. <div id="popup2">
  115. <div>Popup rtl.</div>
  116. </div>
  117. </div>
  118. </div>
  119. <div id="anchor4">
  120. Anchor 4.
  121. </div>
  122. <div id="popup3">
  123. Popup.
  124. </div>
  125. <div dir="rtl" style="border: 1px solid red;">
  126. <div dir="rtl" style="position: relative; overflow: auto; width: 150px; height: 100px; border: 1px solid black;">
  127. <div style="height: 200px;">
  128. <span id="anchor5">Anchor 5.</span>
  129. </div>
  130. <div id="popup5">
  131. Popup.
  132. </div>
  133. </div>
  134. </div>
  135. <iframe id="iframe-standard" src="positioning_test_standard.html" class="anchorFrame">
  136. </iframe>
  137. <iframe id="iframe-quirk" src="positioning_test_quirk.html" class="anchorFrame">
  138. </iframe>
  139. <div id="popup6">Popup6</div>
  140. <div style="position:relative;height:100px;width:100px;overflow:auto;">
  141. I hate positioning!
  142. <div>1</div>
  143. <div>2</div>
  144. <div>3</div>
  145. <div>4</div>
  146. <div>5</div>
  147. <div>6</div>
  148. <div>7</div>
  149. <div id="popup7">Popup7</div>
  150. </div>
  151. <iframe id="nested-outer" src="positioning_test_iframe1.html"
  152. style="overflow:auto;width:150px;height:150px;"></iframe>
  153. <div class="outerbox" dir="rtl">
  154. <div class="box1">
  155. <span id="anchor8">Anchor8 RTL.</span>
  156. </div>
  157. <div class="box8 overflow-auto">
  158. <div id="popup8">
  159. <div>Popup8 rtl.</div>
  160. </div>
  161. <div style="width:10000px;">&nbsp;</div>
  162. </div>
  163. </div>
  164. <div id="box9" class="box9">
  165. <div id="popup9">
  166. <div>Popup9</div>
  167. </div>
  168. <span id="anchor9">Anchor9</span>
  169. </div>
  170. <div id="test-area"></div>
  171. <script>
  172. goog.require('goog.positioningTest');
  173. </script>
  174. </body>
  175. </html>