dom_test.html 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <!DOCTYPE html>
  2. <html>
  3. <!--
  4. Copyright 2006 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. -->
  8. <!--
  9. When changing this, make sure that dom_quirks_test.html is kept in sync.
  10. -->
  11. <head>
  12. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  13. <meta charset="UTF-8" />
  14. <title>Closure Unit Tests - goog.dom</title>
  15. <script src="../base.js"></script>
  16. <script>
  17. goog.require('goog.array');
  18. goog.require('goog.dom');
  19. goog.require('goog.testing.jsunit');
  20. goog.require('goog.userAgent');
  21. </script>
  22. <style type="text/css">
  23. #styleTest1 {
  24. width:120px;font-weight:bold;
  25. }
  26. </style>
  27. </head>
  28. <body>
  29. <div>
  30. abc <i>def</i> <s id="offsetParent1">g <b>h <i id="offsetTest1">ij</i> kl</b> mn</s> opq
  31. </div>
  32. <div id="testEl">
  33. <span>Test Element</span>
  34. </div>
  35. <div><div><div id="testEl2"></div></div></div>
  36. <!-- classbefore and classafter are for making sure that getElementsByClass
  37. works when multiple classes are specified. -->
  38. <div id="span-container">
  39. <span id="span1" class="classbefore test1"></span>
  40. <span id="span2" class="test1"></span>
  41. <span id="span3" class="test2"></span>
  42. <span id="span4" class="test3"></span>
  43. <span id="span5" class="test1 classafter"></span>
  44. </div>
  45. <div class="mixedCaseClass"></div>
  46. <p id="p1"></p>
  47. <div id="styleTest1"></div>
  48. <div id="styleTest2" style="width:100px;font-weight:bold"></div>
  49. <div id="styleTest3"></div>
  50. <!-- Paragraph to test element child and sibling -->
  51. <p id="p2">
  52. <!-- Comment -->
  53. a
  54. <b id="b1">c</b>
  55. d
  56. <!-- Comment -->
  57. e
  58. <b id="b2">f</b>
  59. g
  60. <!-- Comment -->
  61. </p>
  62. <table id="testTable1">
  63. <tr>
  64. <td>&nbsp;
  65. </tr>
  66. </table>
  67. <iframe name="frame" src="tagname_test.html"></iframe>
  68. <p id="order-test"></p>
  69. <div id="testAncestorDiv" class="ancestorClassA testAncestor">
  70. <p id="testAncestorP" class="ancestorClassB testAncestor">
  71. <b id="nestedElement">ancestorTest</b>
  72. </p>
  73. </div>
  74. <div id="noTabIndex">Test</div>
  75. <div id="tabIndexNegative2" tabindex="-2">Test</div>
  76. <div id="tabIndexNegative1" tabindex="-1">Test</div>
  77. <div id="tabIndex0" tabindex="0">Test</div>
  78. <div id="tabIndex1" tabindex="1">Test</div>
  79. <div id="tabIndex2" tabindex="2">Test</div>
  80. <form>
  81. <a href="testUrl" id="noTabIndexAnchor">Test</a>
  82. <input id="noTabIndexInput">
  83. <textarea id="noTabIndexTextArea">Test</textarea>
  84. <select id="noTabIndexSelect"><option>Test</option></select>
  85. <button id="noTabIndexButton">Test</button>
  86. <button id="negTabIndexButton" tabindex="-1">Test</button>
  87. <button id="zeroTabIndexButton" tabindex="0">Test</button>
  88. <button id="posTabIndexButton" tabindex="1">Test</button>
  89. <button id="disabledNoTabIndexButton" disabled>Test</button>
  90. <button id="disabledNegTabIndexButton" disabled tabindex="-1">Test</button>
  91. <button id="disabledZeroTabIndexButton" disabled tabindex="0">Test</button>
  92. <button id="disabledPosTabIndexButton" disabled tabindex="1">Test</button>
  93. </form>
  94. <div id="toReplace">Replace Test</div>
  95. <iframe id="iframe"></iframe>
  96. <div id="myIframeDiv1" style="height:42px;font-size:1px;line-height:0;">hello world</div>
  97. <div id="myIframeDiv2" style="height:23px;font-size:1px;line-height:0;">hello world</div>
  98. <iframe id="myIframe" style="width:400px;height:200px;"></iframe>
  99. <a id='link' href='foo.html'>Foo</a>
  100. <svg id="testSvg" width="100" height="100" viewPort="0 0 100 100" version="1.0">
  101. <g id="testG">
  102. <rect id="testRect" x="10" y="10" width="50" height="50"/>
  103. </g>
  104. </svg>
  105. <script src="dom_test.js"></script></body>
  106. </html>