intra-level-whitespace-2.html 1.4 KB

12345678910111213141516171819202122232425262728293031323334
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Bug 1099807 - Intra-level whitespace pairing</title>
  6. <link rel="stylesheet" href="common.css">
  7. <style>
  8. body { font-family: monospace; }
  9. .container { border: 1px solid blue; margin: 20px; }
  10. </style>
  11. <style id="style"></style>
  12. </head>
  13. <body>
  14. <span id="ref1">12345</span> <span id="ref2">12345 67890</span>
  15. <div class="container"><ruby><rb>12345</rb> <rb>67890</rb><rt>09876</rt><rt>54321</rt></ruby></div>
  16. <div class="container"><ruby><rb>12345</rb><rb>67890</rb><rt>09876</rt> <rt>54321</rt></ruby></div>
  17. <div class="container"><ruby><rb>12345</rb> <rb>67890</rb><rt>09876</rt> <rt>54321</rt></ruby></div>
  18. <script type="text/javascript">
  19. var ref1 = document.getElementById('ref1');
  20. var ref2 = document.getElementById('ref2');
  21. var style = document.getElementById('style');
  22. var width1 = ref1.getBoundingClientRect().width + 'px';
  23. var width2 = ref2.getBoundingClientRect().width + 'px';
  24. // It changes the width of the containers to test incremental
  25. // layout with intra-level whitespace columns being pushed and
  26. // pulled up across a line-break.
  27. style.textContent = '.container { width: ' + width1 + '; }';
  28. document.body.offsetHeight; // force reflow
  29. style.textContent = '.container { width: ' + width2 + '; }';
  30. document.body.offsetHeight; // force reflow
  31. </script>
  32. </body>
  33. </html>