style_quirks_test.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548
  1. <!-- BackCompat -->
  2. <!--
  3. This is a copy of style_test.html but without a doctype. Make sure these two
  4. are in sync.
  5. -->
  6. <html>
  7. <!--
  8. Copyright 2006 The Closure Library Authors. All Rights Reserved.
  9. Use of this source code is governed by the Apache License, Version 2.0.
  10. See the COPYING file for details.
  11. -->
  12. <head>
  13. <meta name="viewport" content="width=device-width, initial-scale=1.0,
  14. maximum-scale=1.0, minimum-scale=1.0, user-scalable=0">
  15. <meta charset="UTF-8" />
  16. <title>Closure Unit Tests - goog.dom.style</title>
  17. <script src="../base.js"></script>
  18. <script>goog.require('goog.userAgent');</script>
  19. <style>
  20. * {
  21. box-sizing: border-box;
  22. -moz-box-sizing: border-box;
  23. -webkit-box-sizing: border-box;
  24. }
  25. </style>
  26. <style>
  27. i {
  28. font-family: Times, sans-serif;
  29. font-size: 5em;
  30. }
  31. #testEl5 {
  32. display: none;
  33. }
  34. #styleTest1 {
  35. width: 120px;
  36. text-decoration: underline;
  37. }
  38. #bgcolorTest0 {
  39. background-color: #f00;
  40. }
  41. #bgcolorTest1 {
  42. background-color: #ff0000;
  43. }
  44. #bgcolorTest2 {
  45. background-color: rgb(255, 0, 0);
  46. }
  47. #bgcolorTest3 {
  48. background-color: rgb(100%, 0%, 0%);
  49. }
  50. #bgcolorTest5 {
  51. background-color: lightblue;
  52. }
  53. #bgcolorTest6 {
  54. background-color: inherit;
  55. }
  56. #bgcolorTest7 {
  57. background-color: transparent;
  58. }
  59. .rtl {
  60. direction: rtl;
  61. }
  62. .ltr {
  63. direction: ltr;
  64. }
  65. #pos-scroll-abs {
  66. position: absolute;
  67. top: 200px;
  68. left: 100px;
  69. }
  70. #pos-scroll-abs-1 {
  71. overflow: scroll;
  72. width: 100px;
  73. height: 100px;
  74. }
  75. #pos-scroll-abs-2 {
  76. position: absolute;
  77. top: 100px;
  78. left: 100px;
  79. width: 500px;
  80. background-color: pink;
  81. }
  82. #abs-upper-left {
  83. position: absolute;
  84. top: 0px;
  85. left: 0px;
  86. }
  87. #no-text-font-styles {
  88. font-family: "Helvetica", Times, serif;
  89. font-size: 30px;
  90. }
  91. .century {
  92. font-family: "Comic Sans MS", "Century Schoolbook L", serif;
  93. }
  94. #size-a,
  95. #size-e {
  96. width: 100px;
  97. height: 100px;
  98. background: red;
  99. padding: 0;
  100. border-style: solid;
  101. border-color: black;
  102. border-width: 0;
  103. }
  104. #size-b {
  105. width: 100px;
  106. height: 100px;
  107. background: red;
  108. border: 10px solid black;
  109. }
  110. #size-c {
  111. width: 100px;
  112. height: 100px;
  113. background: red;
  114. border: 10px solid black;
  115. padding: 10px;
  116. overflow: auto;
  117. }
  118. #size-d {
  119. width: 10em;
  120. height: 2cm;
  121. background: red;
  122. border: thick solid black;
  123. padding: 2mm;
  124. }
  125. #size-f {
  126. border-width: 0;
  127. margin: 0;
  128. padding: 0;
  129. }
  130. #css-position-absolute {
  131. position: absolute;
  132. }
  133. #css-overflow-hidden {
  134. overflow: hidden;
  135. }
  136. #css-z-index-200 {
  137. position:relative;
  138. z-index: 200;
  139. }
  140. #css-text-align-center {
  141. text-align: center;
  142. }
  143. #css-cursor-pointer {
  144. cursor: pointer;
  145. }
  146. #test-opacity {
  147. opacity: 0.5;
  148. -moz-opacity: 0.5;
  149. filter: alpha(opacity=50);
  150. }
  151. #test-frame-offset {
  152. display: block;
  153. position: absolute;
  154. top: 50px;
  155. left: 50px;
  156. width: 50px;
  157. height: 50px;
  158. }
  159. #test-visible {
  160. background: yellow;
  161. position: absolute;
  162. overflow: hidden;
  163. }
  164. #test-visible2 {
  165. background: #ebebeb;
  166. position: absolute;
  167. overflow: hidden;
  168. }
  169. .scrollable-container {
  170. border: 8px solid blue;
  171. padding: 16px;
  172. margin: 32px;
  173. width: 100px;
  174. height: 100px;
  175. overflow: auto;
  176. position: absolute;
  177. left: 400px;
  178. top: 0;
  179. }
  180. .scrollable-container-item {
  181. margin: 1px;
  182. border: 2px solid gray;
  183. padding: 4px;
  184. width: auto;
  185. /* The overflow is different from style_test so that we have consistent
  186. scroll positions in all browsers. */
  187. overflow: hidden;
  188. height: 20px;
  189. }
  190. #translation {
  191. position: absolute;
  192. z-index: 10;
  193. left: 10px;
  194. top: 10px;
  195. width: 10px;
  196. height: 10px;
  197. background-color: blue;
  198. -webkit-transform: translate(20px, 30px);
  199. -ms-transform: translate(20px, 30px);
  200. -o-transform: translate(20px, 30px);
  201. -moz-transform: translate(20px, 30px);
  202. transform: translate(20px, 30px);
  203. }
  204. </style>
  205. </head>
  206. <body>
  207. <div id="testEl">
  208. <span>Test Element</span>
  209. </div>
  210. <div id="testEl5">
  211. <span>Test Element 5</span>
  212. </div>
  213. <table id="table1">
  214. <tr>
  215. <td id="td1">td1</td>
  216. </tr>
  217. </table>
  218. <span id="span0">span0</span>
  219. <ul>
  220. <li id="li1">li1</li>
  221. </ul>
  222. <span id="span1" class="test1"></span>
  223. <span id="span2" class="test1"></span>
  224. <span id="span3" class="test2"></span>
  225. <span id="span4" class="test3"></span>
  226. <span id="span5" class="test1"></span>
  227. <span id="span6" class="test1"></span>
  228. <p id="p1"></p>
  229. <div id="styleTest1"></div>
  230. <div id="styleTest2" style="width:100px;text-decoration:underline"></div>
  231. <div id="styleTest3"></div>
  232. <!-- Paragraph to test element child and sibling -->
  233. <p id="p2">
  234. <!-- Comment -->
  235. a
  236. <b id="b1">c</b>
  237. d
  238. <!-- Comment -->
  239. e
  240. <b id="b2">f</b>
  241. g
  242. <!-- Comment -->
  243. </p>
  244. <p style="background-color: #eee">
  245. <span id="bgcolorTest0">1</span>
  246. <span id="bgcolorTest1">1</span>
  247. <span id="bgcolorTest2">2</span>
  248. <span id="bgcolorTest3">3</span>
  249. <span id="bgcolorTest4" style="background-color:#ff0000">4</span>
  250. <span id="bgcolorTest5">5</span>
  251. <span id="bgcolorTest6">6</span>
  252. <span id="bgcolorTest7">7</span>
  253. <span id="bgcolorDest">Dest</span>
  254. <span id="installTest0">Styled 0</span>
  255. <span id="installTest1">Styled 1</span>
  256. </p>
  257. <div class='rtl-test' dir='ltr' id='rtl1'>
  258. <div dir='rtl' id='rtl2'>right to left</div>
  259. <div dir='ltr' id='rtl3'>left to right</div>
  260. <div id='rtl4'>left to right (inherited)</div>
  261. <div id='rtl5' style="direction: rtl">right to left (style)</div>
  262. <div id='rtl6' style="direction: ltr">left to right (style)</div>
  263. <div id='rtl7' class=rtl>right to left (css)</div>
  264. <div id='rtl8' class=ltr>left to right (css)</div>
  265. <div class=rtl>
  266. <div id='rtl9'>right to left (css)</div>
  267. </div>
  268. <div class=ltr>
  269. <div id='rtl10'>left to right (css)</div>
  270. </div>
  271. </div>
  272. <div id="unselectable-gecko" style="-moz-user-select:none">no-select</div>
  273. <div id="unselectable-webkit" style="-webkit-user-select:none">no-select</div>
  274. <div id="unselectable-ie" unselectable="on">no-select</div>
  275. <div id="make-unselectable">
  276. <p>Can't touch this <aside>(Oh-oh oh oh-oh)</aside></p>
  277. <div><em>Stop.</em> Hammer <math><mo>×</mo></math></div>
  278. </div>
  279. <div id="pos-scroll-abs">
  280. <p>Some text some text some text some text some text some text some text
  281. some text some text some text. Some text some text some text some text some
  282. text some text some text some text some text some text. Some text some text
  283. some text some text some text some text some text some text some text some
  284. text. Some text some text some text some text some text some text some text
  285. some text some text some text.
  286. <p>Some text some text some text some text some text some text some text
  287. some text some text some text. Some text some text some text some text some
  288. text some text some text some text some text some text. Some text some text
  289. some text some text some text some text some text some text some text some
  290. text. Some text some text some text some text some text some text some text
  291. some text some text some text.
  292. <div id="pos-scroll-abs-1">
  293. <p>Some text some text some text some text some text some text some text
  294. some text some text some text. Some text some text some text some text
  295. some text some text some text some text some text some text. Some text
  296. some text some text some text some text some text some text some text some
  297. text some text. Some text some text some text some text some text some
  298. text some text some text some text some text.
  299. <p>Some text some text some text some text some text some text some text
  300. some text some text some text. Some text some text some text some text
  301. some text some text some text some text some text some text. Some text
  302. some text some text some text some text some text some text some text some
  303. text some text. Some text some text some text some text some text some
  304. text some text some text some text some text.
  305. <div id="pos-scroll-abs-2">
  306. <p>Some text some text some text some text some text some text some text
  307. some text some text some text. Some text some text some text some text
  308. some text some text some text some text some text some text. Some text
  309. some text some text some text some text some text some text some text
  310. some text some text. Some text some text some text some text some text
  311. some text some text some text some text some text.
  312. </div>
  313. </div>
  314. </div>
  315. <div id="abs-upper-left">
  316. foo
  317. </div>
  318. <div id="no-text-font-styles">
  319. <font size="+1" face="Times,serif" id="font-tag">Times</font>
  320. <pre id="pre-font">pre text</pre>
  321. <span style="font:inherit" id="inherit-font">inherited</span>
  322. <span style="font-family:Times,sans-serif; font-size:3in"
  323. id="times-font-family">Times</span>
  324. <b id="bold-font">Bolded</b>
  325. <i id="css-html-tag-redefinition">Times</i>
  326. <span id="small-text" class="century" style="font-size:small">eensy</span>
  327. <span id="x-small-text" style="font-size:x-small">weensy</span>
  328. <span style="font:50% badFont" id="font-style-badfont">
  329. badFont
  330. <span style="font:inherit" id="inherit-50pct-font">
  331. same size as badFont
  332. </span>
  333. </span>
  334. <span id="icon-font" style="font:icon">Icon Font</span>
  335. </div>
  336. <span id="no-font-style">plain</span>
  337. <span style="font-family:Arial" id="nested-font">Arial<span style="font-family:Times">Times nested inside Arial</span></span>
  338. <img id="img-font-test" src=""/>
  339. <span style="font-size:25px">
  340. <span style="font-size:12.5px" id="font-size-12-point-5-px">12.5PX</span>
  341. <span style="font-size:0.5em" id="font-size-50-pct-of-25-px">12.5PX</span>
  342. </span>
  343. <div id="size-a"></div>
  344. <div id="size-b"></div>
  345. <div id="size-c">xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxxxxxxxxxx
  346. xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx
  347. xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx
  348. xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx
  349. xxxxxxxxxxxxxxxx</div>
  350. <div id="size-d">xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxxxxxxxxxx
  351. xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx
  352. xxxxxxxx x</div>
  353. <div id="size-e"></div>
  354. <div id="size-f">hello</div>
  355. <div style="font-size: 1px">
  356. <div style="font-size: 2em"><span id="em-font-size"></span></div>
  357. </div>
  358. <div id="no-float"></div>
  359. <div id="float-none" style="float:none"></div>
  360. <div id="float-left" style="float:left"></div>
  361. <div id="float-test"></div>
  362. <div id="position-unset"></div>
  363. <div id="style-position-relative" style="position:relative"></div>
  364. <div id="style-position-fixed" style="position:fixed"></div>
  365. <div id="css-position-absolute"></div>
  366. <div id="box-sizing-unset"></div>
  367. <div id="box-sizing-border-box" style="box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box;"></div>
  368. <div id="style-overflow-scroll" style="overflow:scroll"></div>
  369. <div id="css-overflow-hidden"></div>
  370. <!-- Getting the computed z-index of an unpositioned element is unspecified. -->
  371. <div id="style-z-index-200" style="position:relative;z-index:200"></div>
  372. <div id="css-z-index-200"></div>
  373. <div id="style-text-align-right" style="text-align:right">
  374. <div id="style-text-align-right-inner">foo</div>
  375. </div>
  376. <div id="css-text-align-center"></div>
  377. <div id="style-cursor-move" style="cursor:move">
  378. <span id="style-cursor-move-inner">foo</span>
  379. </div>
  380. <div id="css-cursor-pointer"></div>
  381. <div id="height-test" style="display:inline-block;position:relative">
  382. <div id="height-test-inner" style="display:inline-block">
  383. foo
  384. </div>
  385. </div>
  386. <div id="test-opacity"></div>
  387. <iframe id="test-frame-offset"></iframe>
  388. <iframe id="test-translate-frame-standard" src="style_test_standard.html"
  389. style="overflow:auto;position:absolute;left:100px;top:150px;width:200px;height:200px;border:0px;">
  390. </iframe>
  391. <iframe id="test-translate-frame-quirk" src="style_test_quirk.html"
  392. style="overflow:auto;position:absolute;left:100px;top:350px;width:200px;height:200px;border:0px;margin:0px;">
  393. </iframe>
  394. <iframe
  395. id="test-visible-frame"
  396. src="style_test_iframe_standard.html"
  397. style="width: 200px; height: 200px; border: 0px;">
  398. </iframe>
  399. <div id="test-scrollbarwidth" style="background-color: orange; width: 100px; height: 100px; overflow: auto;">
  400. <div style='width: 200px; height: 200px; background-color: red'>Test Scroll bar width with scroll</div>
  401. </div>
  402. <div id="scrollable-container" class="scrollable-container">
  403. <!--
  404. Workaround for overlapping top padding of the container and top margin of
  405. the first item in Internet Explorer 6 and 7.
  406. See http://www.quirksmode.org/bugreports/archives/2005/01/IE_nested_boxes_padding_topmargin_top.html#c11285
  407. -->
  408. <div style="height: 0"><!-- --></div>
  409. <div id="item1" class="scrollable-container-item">1</div>
  410. <div id="item2" class="scrollable-container-item">2</div>
  411. <div id="item3" class="scrollable-container-item">3</div>
  412. <div id="item4" class="scrollable-container-item">4</div>
  413. <div id="item5" class="scrollable-container-item">5</div>
  414. <div id="item6" class="scrollable-container-item">6</div>
  415. <div id="item7" class="scrollable-container-item">7</div>
  416. <div id="item8" class="scrollable-container-item">8</div>
  417. </div>
  418. <div id="test-visible">
  419. Test-visible
  420. <div id="test-visible-el" style="height:200px;">Test-visible</div>
  421. Test-visible
  422. </div>
  423. <div id="test-visible2"></div>
  424. <div id="msFilter" style="-ms-filter:'alpha(opacity=0)'">
  425. A div</div>
  426. <div id="filter" style="filter:alpha(opacity=0)">
  427. Another div</div>
  428. <div id="offset-parent" style="position:relative">
  429. <div id="offset-child">child</div>
  430. </div>
  431. <div id="offset-parent-overflow"
  432. style="overflow: scroll; width: 50px; height: 50px;">
  433. <a id="offset-child-overflow">
  434. scrollscrollscrollscrollscrollscrollscrollscroll
  435. </a>
  436. </div>
  437. <div id="test-viewport"></div>
  438. <div id="translation"></div>
  439. <div id="rotated"></div>
  440. <div id="scaled"></div>
  441. <script>
  442. if (!goog.userAgent.IE || goog.userAgent.isDocumentModeOrHigher(9)) {
  443. document.write(
  444. '<iframe id="svg-frame" src="style_test_rect.svg"></' + 'iframe>');
  445. }
  446. goog.require('goog.style_test');
  447. </script>
  448. </body>
  449. </html>