flexbox-inlinecontent-horiz-1b.xhtml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Any copyright is dedicated to the Public Domain.
  4. http://creativecommons.org/publicdomain/zero/1.0/
  5. -->
  6. <!--
  7. This test inserts a new div into some inline content in a flex container.
  8. That should split the inline content into two flex items.
  9. -->
  10. <html xmlns="http://www.w3.org/1999/xhtml"
  11. class="reftest-wait">
  12. <head>
  13. <link rel="stylesheet" type="text/css" href="ahem.css" />
  14. <script>
  15. function tweak() {
  16. var flexbox = document.getElementsByClassName("flexbox")[0];
  17. var insertionPoint = flexbox.firstChild.nextSibling.nextSibling;
  18. var newDiv = document.createElement("div");
  19. newDiv.setAttribute("class", "b");
  20. flexbox.insertBefore(newDiv, insertionPoint);
  21. document.documentElement.removeAttribute("class");
  22. }
  23. window.addEventListener("MozReftestInvalidate", tweak, false);
  24. </script>
  25. <style>
  26. div { height: 100px; }
  27. div.flexbox {
  28. font: 10px Ahem;
  29. width: 200px;
  30. display: flex;
  31. }
  32. div.a {
  33. flex: 1 0 20px;
  34. background: lightgreen;
  35. }
  36. div.b {
  37. flex: 2 0 30px;
  38. background: yellow;
  39. }
  40. div.inflex {
  41. flex: 0 0 20px;
  42. background: gray;
  43. }
  44. </style>
  45. </head>
  46. <body>
  47. <div class="flexbox"
  48. ><div class="a"/>text<i>italic</i
  49. ><div class="inflex"/></div>
  50. </body>
  51. </html>