Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / css2.1 / 20110323 / absolute-non-replaced-width-005.htm
blobb88a3a60194c0e5ba3c0d8d0c39b49845daa52e7
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: Absolutely positioned non-replaced elements when both 'margin-left' and 'margin-right' are set to 'auto' 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#abs-non-replaced-width">
7 <meta name="flags" content="ahem">
8 <script src="../../resources/ahem.js"></script>
9 <meta name="assert" content="When direction is 'rtl' and 'left', 'width' and 'right' are not 'auto', solve for 'margin-right' and 'margin-left' to equal values. If this would make 'margin-left' and 'margin-right' negative, then set 'margin-right' to zero and solve for 'margin-left'.">
10 <style type="text/css">
11 #div1
13 border: solid black;
14 direction: rtl;
15 height: 2in;
16 position: relative;
17 width: 2in;
19 div div
21 background: red;
22 color: blue;
23 font: 1in/1em Ahem;
24 left: 1in;
25 margin-left: auto;
26 margin-right: auto;
27 position: absolute;
28 right: 1in;
29 width: 1in;
32 left : 1in
33 + margin-left : solve (auto)
34 + border-left-width : 0
35 + padding-left : 0
36 + width : 1in
37 + padding-right : 0
38 + border-right-width : 0
39 + margin-right : solve (auto)
40 + right : 1in
41 ====================================
42 width of containing block : 2in
44 So, margin-left and margin-right would be each -0.5in at this point.
46 "...unless this would make them (the two margins) negative in which case when direction of the containing block is 'ltr' ('rtl'), set 'margin-left' ('margin-right') to zero and solve for 'margin-right' ('margin-left')."
48 So, under such extra constraint, 'margin-right' must become 0 and 'margin-left' must become -1in.
50 </style>
51 </head>
52 <body>
53 <p>Test passes if the blue box fills the upper-left corner of the black box and there is no red visible on the page.</p>
54 <div id="div1">
55 <div>X</div>
56 </div>
57 </body>
58 </html>