block-non-replaced-width-004

Solving over-constrained situation for block-level non-replaced elements in normal flow and direction is right-to-left

WeasyPrint

This browser

Assertion
When direction is right-to-left, margin-left is ignored in an over-constrained situation.

Source

 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 2 <html>
 3     <head>
 4         <title>CSS Test: Solving over-constrained situation for block-level non-replaced elements in normal flow and direction is right-to-left</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#blockwidth">
 7         <meta name="flags" content="">
 8         <meta name="assert" content="When direction is right-to-left, margin-left is ignored in an over-constrained situation.">
 9         <style type="text/css">
10             div
11             {
12                 direction: rtl;
13                 position: relative;
14             }
15             #div1
16             {
17                 background: orange;
18                 width: 100px;
19             }
20             #div1 div
21             {
22                 background-color: orange;
23                 border-left: 10px solid orange;
24                 border-right: 10px solid orange;
25                 height: 30px;
26                 margin-left: 10px;
27                 margin-right: 10px;
28                 padding-left: 10px;
29                 padding-right: 10px;
30                 width: 100px;
31             }
32             #div2
33             {
34                 background-color: blue;
35                 height: 30px;
36                 position: absolute;
37                 width: 150px;
38             }
39         </style>
40     </head>
41     <body>
42         <p>Test passes if the orange and blue boxes below are the same width.</p>
43         <div>
44             <div id="div1">
45                 <div></div>
46             </div>
47             <div id="div2"></div>
48         </div>
49     </body>
50 </html>