replaced_display.rml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <rml>
  2. <head>
  3. <title>Display of replaced elements</title>
  4. <link type="text/rcss" href="../style.rcss"/>
  5. <link rel="help" href="https://www.w3.org/TR/2011/REC-CSS2-20110607/visudet.html#inline-replaced-width" />
  6. <meta name="Description" content="Replaced elements should be correctly rendered when placed out-of-flow and in different formatting contexts." />
  7. <style>
  8. @spritesheet theme
  9. {
  10. src: /assets/invader.tga;
  11. invader: 179px 152px 50px 40px;
  12. progress: 103px 267px 80px 34px;
  13. progress-fill: 103px 302px 80px 34px;
  14. }
  15. img {
  16. margin: 10dp 5dp;
  17. vertical-align: bottom;
  18. }
  19. progress {
  20. decorator: image( progress );
  21. width: 80dp;
  22. height: 34dp;
  23. line-height: 32dp;
  24. fill-image: progress-fill;
  25. text-align: center;
  26. }
  27. textarea {
  28. background: #fff;
  29. border: 5dp #999;
  30. border-right: 17dp;
  31. padding: 2dp;
  32. height: 35dp;
  33. width: 100dp;
  34. cursor: text;
  35. vertical-align: bottom;
  36. }
  37. textarea scrollbarvertical {
  38. width: 12dp;
  39. margin-right: -12dp;
  40. cursor: arrow;
  41. }
  42. .float { float: left; }
  43. .block { display: block; }
  44. .flex {
  45. display: flex;
  46. justify-content: center;
  47. /* If we decide to support flex layout inside replaced elements, test
  48. with the below line uncommented. Then we know flex layout occurred if
  49. the text is still centered inside the element. */
  50. /*text-align: right;*/
  51. }
  52. .absolute { position: absolute; }
  53. </style>
  54. </head>
  55. <body>
  56. <div>
  57. <img style="float: right" sprite="invader"/>
  58. <img style="position: absolute; margin-left: auto; margin-right: auto;" sprite="invader"/>
  59. <table style="float: left; width: 60dp;"><td>
  60. <img sprite="invader"/>
  61. </td></table>
  62. </div>
  63. <hr/>
  64. <p>Replaced element with internal content.</p>
  65. <progress direction="right" value="0.6">60%</progress><br/>
  66. <progress direction="right" value="0.6" class="float">60%</progress>
  67. <progress direction="right" value="0.6" class="block">60%</progress>
  68. <progress direction="right" value="0.6" class="flex"><div>60%</div></progress>
  69. <table><td>
  70. <progress direction="right" value="0.6">60%</progress>
  71. </td></table>
  72. <progress direction="right" value="0.6" class="absolute">60%</progress>
  73. <hr style="margin-top: 40dp;"/>
  74. <p>Overflowing textarea.</p>
  75. <textarea>A
  76. B
  77. C</textarea>
  78. <br/>
  79. <textarea class="float">A
  80. B
  81. C</textarea>
  82. <textarea class="block">A
  83. B
  84. C</textarea>
  85. <textarea class="flex">A
  86. B
  87. C</textarea>
  88. <table><td>
  89. <textarea>A
  90. B
  91. C</textarea>
  92. </td></table>
  93. <textarea class="absolute">A
  94. B
  95. C</textarea>
  96. <hr style="margin-top: 80dp;"/>
  97. <p>Force overflow with the empty space below, to ensure that this does not trigger any clipping issues in the above elements.</p>
  98. <div style="height:300dp"/>
  99. <handle size_target="#parent"/>
  100. </body>
  101. </rml>