absolute-replaced-height-032

Absolute replaced elements without intrinsic ratios, 'height' set to 'auto' and over-constrained values

WeasyPrint

This browser

Assertion
For an absolutely positioned replaced element the 'height' is set to the largest rectangle that has a 2:1 ratio that is not greater than 150px and has a 'width' not greater than the device width. And with over-constrained values element solves for 'bottom'.

Source

 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 2 <html>
 3     <head>
 4         <title>CSS Test: Absolute replaced elements without intrinsic ratios, 'height' set to 'auto' and over-constrained values</title>
 5         <link rel="author" title="Microsoft" href="http://www.microsoft.com/">
 6         <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-replaced-height">
 7         <meta name="flags" content="">
 8         <meta name="assert" content="For an absolutely positioned replaced element the 'height' is set to the largest rectangle that has a 2:1 ratio that is not greater than 150px and has a 'width' not greater than the device width. And with over-constrained values element solves for 'bottom'.">
 9         <style type="text/css">
10             div
11             {
12                 position: relative;
13             }
14             div div
15             {
16                 border: solid green;
17                 height: 150px;
18                 position: absolute;
19                 top: 1in;
20                 width: 300px;
21             }
22             iframe
23             {
24                 border: solid red;
25                 bottom: 1in;
26                 height: auto;
27                 margin-bottom: 0.5in;
28                 margin-top: 0.5in;
29                 position: absolute;
30                 top: 0.5in;
31                 width: auto;
32             }
33         </style>
34     </head>
35     <body>
36         <p>Test passes if there is no red visible on the page.</p>
37         <div>
38             <iframe></iframe>
39             <div></div>
40         </div>
41     </body>
42 </html>