test_object-delayed-intrinsic-size.html 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <!DOCTYPE html>
  2. <!--
  3. https://bugzilla.mozilla.org/show_bug.cgi?id=1063073
  4. -->
  5. <html>
  6. <head>
  7. <title>Test that &lt;object&gt; embedding SVG and using its intrinsic
  8. size will resize if the &lt;object&gt; gets a reflow before the
  9. root-&lt;svg&gt; gets its nsSVGOuterSVGFrame
  10. </title>
  11. <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  12. <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
  13. <script>
  14. // This test checks for a race condition. If it fails intermittently then it
  15. // may actually be a full failure.
  16. SimpleTest.waitForExplicitFinish();
  17. function runTest()
  18. {
  19. var object = document.querySelector("object");
  20. var cs = document.defaultView.getComputedStyle(object, "");
  21. var width = cs.getPropertyValue("width");
  22. is(width, "70px", "Check that the &lt;object&gt; size updated");
  23. SimpleTest.finish();
  24. }
  25. </script>
  26. </head>
  27. <body onload="runTest();">
  28. <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1063073">Mozilla Bug 1063073</a>
  29. <p id="display"></p>
  30. <div id="content">
  31. <object style="border:1px solid black" type="image/svg+xml"
  32. data="object-delayed-intrinsic-size.sjs"></object>
  33. </div>
  34. </body>
  35. </html>