Thu, 15 Jan 2015 15:55:04 +0100
Back out 97036ab72558 which inappropriately compared turds to third parties.
michael@0 | 1 | <?xml version="1.0" encoding="UTF-8"?> |
michael@0 | 2 | <!-- |
michael@0 | 3 | Any copyright is dedicated to the Public Domain. |
michael@0 | 4 | http://creativecommons.org/publicdomain/zero/1.0/ |
michael@0 | 5 | --> |
michael@0 | 6 | <!-- |
michael@0 | 7 | This test has a number of tables, each with 2 flexboxes side-by-side, |
michael@0 | 8 | whose "width" values depend on the flexbox's min and/or pref widths. |
michael@0 | 9 | |
michael@0 | 10 | There's not enough space for both flexboxes to fit side-by-side, so their |
michael@0 | 11 | width preferences must be balanced. This exercises |
michael@0 | 12 | nsFlexContainerFrame::GetPrefWidth() & ::GetMinWidth(). |
michael@0 | 13 | |
michael@0 | 14 | IN EACH CASE, div.a has these intrinsic widths: |
michael@0 | 15 | Pref width: 2*40 + 1*50 + 2*10 = 150px (2*aaaa + 1*aaaaa + 2*space) |
michael@0 | 16 | Min width: 50px (width of "aaaaa") |
michael@0 | 17 | and div.b has these intrinsic widths: |
michael@0 | 18 | Pref width: 5*20 + 3*10 + 7*10 = 200px (5*bb + 3*b + 7*space) |
michael@0 | 19 | Min width: 20px (width "bb") |
michael@0 | 20 | --> |
michael@0 | 21 | <html xmlns="http://www.w3.org/1999/xhtml"> |
michael@0 | 22 | <head> |
michael@0 | 23 | <link rel="stylesheet" type="text/css" href="ahem.css" /> |
michael@0 | 24 | <style> |
michael@0 | 25 | table { |
michael@0 | 26 | width: 300px; |
michael@0 | 27 | font: 10px Ahem; |
michael@0 | 28 | margin-bottom: 2px; |
michael@0 | 29 | border: 1px dashed black; |
michael@0 | 30 | } |
michael@0 | 31 | |
michael@0 | 32 | div.a, div.b { display: flex; } |
michael@0 | 33 | |
michael@0 | 34 | div.a { background: lightgreen; } |
michael@0 | 35 | div.b { background: lightblue; } |
michael@0 | 36 | |
michael@0 | 37 | <!-- helper-classes for assigning pref / min / auto-width to our divs --> |
michael@0 | 38 | div.prefWidth { |
michael@0 | 39 | width: -moz-max-content; |
michael@0 | 40 | } |
michael@0 | 41 | div.minWidth { |
michael@0 | 42 | width: -moz-min-content; |
michael@0 | 43 | } |
michael@0 | 44 | div.autoWidth { |
michael@0 | 45 | width: auto; |
michael@0 | 46 | } |
michael@0 | 47 | </style> |
michael@0 | 48 | </head> |
michael@0 | 49 | <body> |
michael@0 | 50 | <!-- both auto width --> |
michael@0 | 51 | <table cellpadding="0" cellspacing="0"><tr> |
michael@0 | 52 | <td><div class="a autoWidth"><div>aaaa aaaa aaaaa</div></div></td> |
michael@0 | 53 | <td><div class="b autoWidth"><div>bb bb b bb bb b bb b</div></div></td> |
michael@0 | 54 | </tr></table> |
michael@0 | 55 | |
michael@0 | 56 | <!-- MIXING MIN WIDTH & AUTO --> |
michael@0 | 57 | <!-- both min width --> |
michael@0 | 58 | <table cellpadding="0" cellspacing="0"><tr> |
michael@0 | 59 | <td><div class="a minWidth"><div>aaaa aaaa aaaaa</div></div></td> |
michael@0 | 60 | <td><div class="b minWidth"><div>bb bb b bb bb b bb b</div></div></td> |
michael@0 | 61 | </tr></table> |
michael@0 | 62 | <!-- min,auto --> |
michael@0 | 63 | <table cellpadding="0" cellspacing="0"><tr> |
michael@0 | 64 | <td><div class="a minWidth"><div>aaaa aaaa aaaaa</div></div></td> |
michael@0 | 65 | <td><div class="b autoWidth"><div>bb bb b bb bb b bb b</div></div></td> |
michael@0 | 66 | </tr></table> |
michael@0 | 67 | <!-- auto,min --> |
michael@0 | 68 | <table cellpadding="0" cellspacing="0"><tr> |
michael@0 | 69 | <td><div class="a autoWidth"><div>aaaa aaaa aaaaa</div></div></td> |
michael@0 | 70 | <td><div class="b minWidth"><div>bb bb b bb bb b bb b</div></div></td> |
michael@0 | 71 | </tr></table> |
michael@0 | 72 | |
michael@0 | 73 | <!-- MIXING PREF WIDTH & AUTO --> |
michael@0 | 74 | <!-- both prefWidth (NOTE: makes the table larger than it wants to be --> |
michael@0 | 75 | <table cellpadding="0" cellspacing="0"><tr> |
michael@0 | 76 | <td><div class="a prefWidth"><div>aaaa aaaa aaaaa</div></div></td> |
michael@0 | 77 | <td><div class="b prefWidth"><div>bb bb b bb bb b bb b</div></div></td> |
michael@0 | 78 | </tr></table> |
michael@0 | 79 | <!-- pref,auto --> |
michael@0 | 80 | <table cellpadding="0" cellspacing="0"><tr> |
michael@0 | 81 | <td><div class="a prefWidth"><div>aaaa aaaa aaaaa</div></div></td> |
michael@0 | 82 | <td><div class="b autoWidth"><div>bb bb b bb bb b bb b</div></div></td> |
michael@0 | 83 | </tr></table> |
michael@0 | 84 | <!-- auto,pref --> |
michael@0 | 85 | <table cellpadding="0" cellspacing="0"><tr> |
michael@0 | 86 | <td><div class="a autoWidth"><div>aaaa aaaa aaaaa</div></div></td> |
michael@0 | 87 | <td><div class="b prefWidth"><div>bb bb b bb bb b bb b</div></div></td> |
michael@0 | 88 | </tr></table> |
michael@0 | 89 | |
michael@0 | 90 | <!-- MIXING PREF WIDTH & MIN WIDTH --> |
michael@0 | 91 | <!-- min,pref --> |
michael@0 | 92 | <table cellpadding="0" cellspacing="0"><tr> |
michael@0 | 93 | <td><div class="a minWidth"><div>aaaa aaaa aaaaa</div></div></td> |
michael@0 | 94 | <td><div class="b prefWidth"><div>bb bb b bb bb b bb b</div></div></td> |
michael@0 | 95 | </tr></table> |
michael@0 | 96 | <!-- pref,min --> |
michael@0 | 97 | <table cellpadding="0" cellspacing="0"><tr> |
michael@0 | 98 | <td><div class="a prefWidth"><div>aaaa aaaa aaaaa</div></div></td> |
michael@0 | 99 | <td><div class="b minWidth"><div>bb bb b bb bb b bb b</div></div></td> |
michael@0 | 100 | </tr></table> |
michael@0 | 101 | </body> |
michael@0 | 102 | </html> |