| OLD | NEW |
| (Empty) | |
| 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/x
html1/DTD/xhtml1-strict.dtd"> |
| 2 |
| 3 <html xmlns="http://www.w3.org/1999/xhtml"> |
| 4 |
| 5 <head> |
| 6 |
| 7 <title>CSS Writing Modes Test: position absolute and 'vertical-lr' - 'left: au
to', 'width: auto' and 'right: auto' with 'direction: ltr' in initial containing
block</title> |
| 8 |
| 9 <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserB
ugsSection/css21testsuite/" /> |
| 10 <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#vertical-layo
ut" title="7.1 Principles of Layout in Vertical Writing Modes" /> |
| 11 <link rel="match" href="../css21/reference/ref-filled-green-100px-square.xht"
/> |
| 12 |
| 13 <meta content="" name="flags" /> |
| 14 <meta content="This test checks that when the initial containing block's writi
ng-mode is 'horizontal-tb' and its 'direction' is 'ltr', then an absolutely posi
tioned box (with 'left: auto', 'width: auto' and 'right: auto') whose containing
block is the initial containing block must set 'left' to the static position. W
hether such absolutely positioned box's 'writing-mode' is vertical or not is irr
elevant." name="assert" /> |
| 15 |
| 16 <style type="text/css"><![CDATA[ |
| 17 html |
| 18 { |
| 19 direction: ltr; |
| 20 } |
| 21 |
| 22 div#green-overlapping-test |
| 23 { |
| 24 border-left: green solid 25px; |
| 25 border-right: green solid 75px; |
| 26 height: 100px; |
| 27 left: auto; |
| 28 position: absolute; |
| 29 right: auto; |
| 30 width: auto; |
| 31 -webkit-writing-mode: vertical-lr; |
| 32 } |
| 33 |
| 34 /* |
| 35 " |
| 36 If all three of 'left', 'width', and 'right' are 'auto': First set any 'auto'
values for 'margin-left' and 'margin-right' to 0. Then, if the 'direction' prope
rty of the element establishing the static-position containing block is 'ltr' se
t 'left' to the static position and apply rule number three below; otherwise, se
t 'right' to the static position and apply rule number one below. |
| 37 (...) |
| 38 3. 'width' and 'right' are 'auto' and 'left' is not 'auto', then the width is
shrink-to-fit . Then solve for 'right' |
| 39 " |
| 40 10.3.7 Absolutely positioned, non-replaced elements |
| 41 http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width |
| 42 |
| 43 So: |
| 44 |
| 45 auto : left |
| 46 + |
| 47 0px : margin-left |
| 48 + |
| 49 25px : border-left-width |
| 50 + |
| 51 0px : padding-left |
| 52 + |
| 53 auto : width |
| 54 + |
| 55 0px : padding-right |
| 56 + |
| 57 75px : border-right-width |
| 58 + |
| 59 0px : margin-right |
| 60 + |
| 61 auto : right |
| 62 ==================== |
| 63 : width of containing block (width of Initial Containing Block) |
| 64 |
| 65 becomes |
| 66 |
| 67 8px : left |
| 68 + |
| 69 0px : margin-left |
| 70 + |
| 71 25px : border-left-width |
| 72 + |
| 73 0px : padding-left |
| 74 + |
| 75 0px : width (shrink-to-fit) |
| 76 + |
| 77 0px : padding-right |
| 78 + |
| 79 75px : border-right-width |
| 80 + |
| 81 0px : margin-right |
| 82 + |
| 83 solve : right |
| 84 ==================== |
| 85 : width of containing block (width of Initial Containing Block) |
| 86 */ |
| 87 |
| 88 div#red-overlapped-reference |
| 89 { |
| 90 background-color: red; |
| 91 height: 100px; |
| 92 position: relative; |
| 93 width: 100px; |
| 94 z-index: -1; |
| 95 } |
| 96 ]]></style> |
| 97 </head> |
| 98 |
| 99 <body> |
| 100 |
| 101 <p>Test passes if there is a filled green square and <strong>no red</strong>.<
/p> |
| 102 |
| 103 <div id="green-overlapping-test"></div> |
| 104 |
| 105 <div id="red-overlapped-reference"></div> |
| 106 |
| 107 </body> |
| 108 </html> |
| OLD | NEW |