Changeset 118279 in webkit
- Timestamp:
- May 23, 2012 5:19:40 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r118267 r118279 1 2012-05-23 Tony Chang <tony@chromium.org> 2 3 auto margins on flexbox should allocate space in the cross direction 4 https://bugs.webkit.org/show_bug.cgi?id=86913 5 6 Reviewed by Ojan Vafai. 7 8 * css3/flexbox/auto-margins-expected.html: Added. 9 * css3/flexbox/auto-margins.html: Added. These are the test cases in the spec. 10 * css3/flexbox/flex-align-vertical-writing-mode.html: Fix tests with auto margins and add more tests. 11 Also reduce the height so it's easier to see the test cases (these vertical tests don't check the height). 12 * css3/flexbox/flex-align.html: Fix tests with auto margins and add more tests. 13 * css3/flexbox/flex-flow-auto-margins.html: Fix results now that we handle auto in the cross direction. 14 1 15 2012-05-23 Joshua Bell <jsbell@chromium.org> 2 16 -
trunk/LayoutTests/css3/flexbox/flex-align-vertical-writing-mode.html
r117385 r118279 6 6 } 7 7 .flexbox { 8 height: 600px;8 height: 100px; 9 9 display: -webkit-flex; 10 10 background-color: #aaa; … … 36 36 .flexbox :nth-child(7) { 37 37 background-color: lime; 38 } 39 .flexbox :nth-child(8) { 40 background-color: lightblue; 41 } 42 .flexbox :nth-child(9) { 43 background-color: darkred; 44 } 45 .flexbox :nth-child(10) { 46 background-color: gold; 47 } 48 .flexbox :nth-child(11) { 49 background-color: salmon; 38 50 } 39 51 </style> … … 53 65 54 66 <div class="flexbox"> 55 <div data-expected-width="60" data-offset-x="60" style="-webkit-flex: 1 0 0; width: 60px; margin: auto;"></div> 56 <div data-expected-width="120" data-offset-x="0" style="-webkit-flex: 1 0 0; margin: 0 auto;"></div> 67 <div data-expected-width="60" data-offset-x="60" style="-webkit-flex: 1 0 0; width: 60px;"></div> 68 <div data-expected-width="120" data-offset-x="0" style="-webkit-flex: 1 0 0;"></div> 69 <div data-expected-width="60" data-offset-x="30" style="-webkit-flex: 1 0 0; width: 60px; margin: auto;"></div> 70 <div data-expected-width="0" data-offset-x="60" style="-webkit-flex: 1 0 0; margin: 0 auto;"></div> 57 71 <div data-expected-width="100" data-offset-x="10" style="-webkit-flex: 1 0 0; width: 100px; margin: 0 10px;"></div> 58 72 <div data-expected-width="50" data-offset-x="50" style="-webkit-flex: 1 0 0; width: 50px; margin: 0 20px 0 10px;"></div> … … 80 94 <div data-expected-width="0" data-offset-x="100" style="-webkit-flex: 1 0 0; -webkit-flex-item-align: start;"></div> 81 95 <div data-expected-width="50" data-offset-x="50" style="-webkit-flex: 1 0 0; -webkit-flex-item-align: start; width: 50px;"></div> 82 <div data-expected-width="50" data-offset-x="50" style="-webkit-flex: 1 0 0; -webkit-flex-item-align: start; width: 50px; margin: 0 auto"></div> 83 <div data-expected-width="50" data-offset-x="50" style="-webkit-flex: 1 0 0; -webkit-flex-item-align: start; width: 50px; margin: auto 0 0"></div> 96 <div data-expected-width="50" data-offset-x="25" style="-webkit-flex: 1 0 0; -webkit-flex-item-align: start; width: 50px; margin: 0 auto"></div> 97 <div data-expected-width="50" data-offset-x="50" style="-webkit-flex: 1 0 0; -webkit-flex-item-align: start; width: 50px; margin: 0 auto 0 0"></div> 98 <div data-expected-width="50" data-offset-x="0" style="-webkit-flex: 1 0 0; -webkit-flex-item-align: start; width: 50px; margin: 0 0 0 auto"></div> 84 99 <div data-expected-width="50" data-offset-x="25" style="-webkit-flex: 1 0 0; -webkit-flex-item-align: start; width: 50px; margin: 0 25px"></div> 85 100 <div data-expected-width="50" data-offset-x="30" style="-webkit-flex: 1 0 0; -webkit-flex-item-align: start; width: 50px; margin: 0 20px 0 10px;"></div> … … 90 105 <div data-expected-width="0" data-offset-x="0" style="-webkit-flex: 1 0 0; -webkit-flex-item-align: end;"></div> 91 106 <div data-expected-width="50" data-offset-x="0" style="-webkit-flex: 1 0 0; -webkit-flex-item-align: end; width: 50px;"></div> 92 <div data-expected-width="50" data-offset-x="0" style="-webkit-flex: 1 0 0; -webkit-flex-item-align: end; width: 50px; margin: 0 auto"></div> 93 <div data-expected-width="50" data-offset-x="0" style="-webkit-flex: 1 0 0; -webkit-flex-item-align: end; width: 50px; margin: auto 0 0"></div> 107 <div data-expected-width="50" data-offset-x="25" style="-webkit-flex: 1 0 0; -webkit-flex-item-align: end; width: 50px; margin: 0 auto"></div> 108 <div data-expected-width="50" data-offset-x="50" style="-webkit-flex: 1 0 0; -webkit-flex-item-align: end; width: 50px; margin: 0 auto 0 0"></div> 109 <div data-expected-width="50" data-offset-x="0" style="-webkit-flex: 1 0 0; -webkit-flex-item-align: end; width: 50px; margin: 0 0 0 auto"></div> 94 110 <div data-expected-width="50" data-offset-x="25" style="-webkit-flex: 1 0 0; -webkit-flex-item-align: end; width: 50px; margin: 0 25px"></div> 95 111 <div data-expected-width="50" data-offset-x="10" style="-webkit-flex: 1 0 0; -webkit-flex-item-align: end; width: 50px; margin: 0 20px 0 10px;"></div> … … 101 117 <div data-expected-width="50" data-offset-x="25" style="-webkit-flex: 1 0 0; -webkit-flex-item-align: center; width: 50px;"></div> 102 118 <div data-expected-width="50" data-offset-x="25" style="-webkit-flex: 1 0 0; -webkit-flex-item-align: center; width: 50px; margin: 0 auto"></div> 103 <div data-expected-width="50" data-offset-x="25" style="-webkit-flex: 1 0 0; -webkit-flex-item-align: center; width: 50px; margin: auto 0 0"></div> 119 <div data-expected-width="50" data-offset-x="50" style="-webkit-flex: 1 0 0; -webkit-flex-item-align: center; width: 50px; margin: 0 auto 0 0"></div> 120 <div data-expected-width="50" data-offset-x="0" style="-webkit-flex: 1 0 0; -webkit-flex-item-align: center; width: 50px; margin: 0 0 0 auto"></div> 104 121 <div data-expected-width="50" data-offset-x="25" style="-webkit-flex: 1 0 0; -webkit-flex-item-align: center; width: 50px; margin: 0 25px"></div> 105 122 <div data-expected-width="50" data-offset-x="20" style="-webkit-flex: 1 0 0; -webkit-flex-item-align: center; width: 50px; margin: 0 20px 0 10px;"></div> -
trunk/LayoutTests/css3/flexbox/flex-align.html
r117385 r118279 35 35 .flexbox :nth-child(7) { 36 36 background-color: lime; 37 } 38 .flexbox :nth-child(8) { 39 background-color: lightblue; 40 } 41 .flexbox :nth-child(9) { 42 background-color: darkred; 43 } 44 .flexbox :nth-child(10) { 45 background-color: gold; 46 } 47 .flexbox :nth-child(11) { 48 background-color: salmon; 37 49 } 38 50 </style> … … 52 64 53 65 <div class="flexbox"> 54 <div data-expected-height="60" data-offset-y="0" style="-webkit-flex: 1 0 0; height: 60px; margin: auto 0;"></div> 55 <div data-expected-height="120" data-offset-y="0" style="-webkit-flex: 1 0 0; margin: auto 0 0;"></div> 56 <div data-expected-height="120" data-offset-y="0" style="-webkit-flex: 1 0 0; margin: auto 0;"></div> 66 <div data-expected-height="60" data-offset-y="0" style="-webkit-flex: 1 0 0; height: 60px;"></div> 67 <div data-expected-height="120" data-offset-y="0" style="-webkit-flex: 1 0 0;"></div> 68 <div data-expected-height="60" data-offset-y="30" style="-webkit-flex: 1 0 0; height: 60px; margin: auto 0;"></div> 69 <div data-expected-height="0" data-offset-y="120" style="-webkit-flex: 1 0 0; margin: auto 0 0;"></div> 70 <div data-expected-height="0" data-offset-y="60" style="-webkit-flex: 1 0 0; margin: auto 0;"></div> 57 71 <div data-expected-height="100" data-offset-y="10" style="-webkit-flex: 1 0 0; height: 100px; margin: 10px 0;"></div> 58 72 <div data-expected-height="50" data-offset-y="20" style="-webkit-flex: 1 0 0; height: 50px; margin: 20px 0 10px;"></div> … … 97 111 <div data-offset-y="20" style="-webkit-flex-item-align: baseline; -webkit-flex: 1 0 0;"><div style="display:inline-block;"></div></div> 98 112 <div data-offset-y="20" style="-webkit-flex-item-align: baseline; -webkit-flex: 1 0 0; margin: 20px;"><div style="display:inline-block;"></div></div> 113 <div data-offset-y="50" style="-webkit-flex-item-align: baseline; -webkit-flex: 1 0 0; margin: auto 0;"></div> 114 <div data-offset-y="30" style="-webkit-flex-item-align: baseline; -webkit-flex: 1 0 0; margin: 30px 0 auto;"><div style="display:inline-block;"></div></div> 115 <div data-offset-y="80" style="-webkit-flex-item-align: baseline; -webkit-flex: 1 0 0; margin: auto 0 20px;"></div> 99 116 <div data-expected-height="100" data-offset-y="0" style="-webkit-flex-item-align: stretch; -webkit-flex: 1 0 0;"></div> 100 117 </div> … … 158 175 159 176 <div class="flexbox"> 160 <div data-expected-height="50" data-offset-y="0" style="-webkit-flex: 1 0 0; height: 50px; margin: auto 0 0;"></div> 177 <div data-expected-height="50" data-offset-y="0" style="-webkit-flex: 1 0 0; height: 50px;"></div> 178 <div data-expected-height="70" data-offset-y="0" style="-webkit-flex: 1 0 0; height: 70px;"></div> 179 <div data-expected-height="50" data-offset-y="50" style="-webkit-flex: 1 0 0; height: 50px; margin: auto 0 0;"></div> 161 180 <div data-expected-height="70" data-offset-y="0" style="-webkit-flex: 1 0 0; height: 70px; margin: 0 0 auto"></div> 162 181 <div data-expected-height="70" data-offset-y="0" style="-webkit-flex: 1 0 0; height: 70px;"></div> … … 167 186 <div data-expected-height="0" data-offset-y="0" style="-webkit-flex: 1 0 0; -webkit-flex-item-align: start;"></div> 168 187 <div data-expected-height="50" data-offset-y="0" style="-webkit-flex: 1 0 0; -webkit-flex-item-align: start; height: 50px;"></div> 169 <div data-expected-height="50" data-offset-y="0" style="-webkit-flex: 1 0 0; -webkit-flex-item-align: start; height: 50px; margin: auto 0"></div> 170 <div data-expected-height="50" data-offset-y="0" style="-webkit-flex: 1 0 0; -webkit-flex-item-align: start; height: 50px; margin: auto 0 0"></div> 188 <div data-expected-height="50" data-offset-y="25" style="-webkit-flex: 1 0 0; -webkit-flex-item-align: start; height: 50px; margin: auto 0"></div> 189 <div data-expected-height="50" data-offset-y="50" style="-webkit-flex: 1 0 0; -webkit-flex-item-align: start; height: 50px; margin: auto 0 0"></div> 190 <div data-expected-height="50" data-offset-y="0" style="-webkit-flex: 1 0 0; -webkit-flex-item-align: start; height: 50px; margin: 0 0 auto"></div> 171 191 <div data-expected-height="50" data-offset-y="25" style="-webkit-flex: 1 0 0; -webkit-flex-item-align: start; height: 50px; margin: 25px 0"></div> 172 192 <div data-expected-height="50" data-offset-y="20" style="-webkit-flex: 1 0 0; -webkit-flex-item-align: start; height: 50px; margin: 20px 0 10px;"></div> … … 177 197 <div data-expected-height="0" data-offset-y="100" style="-webkit-flex: 1 0 0; -webkit-flex-item-align: end;"></div> 178 198 <div data-expected-height="50" data-offset-y="50" style="-webkit-flex: 1 0 0; -webkit-flex-item-align: end; height: 50px;"></div> 179 <div data-expected-height="50" data-offset-y=" 50" style="-webkit-flex: 1 0 0; -webkit-flex-item-align: end; height: 50px; margin: auto 0"></div>199 <div data-expected-height="50" data-offset-y="25" style="-webkit-flex: 1 0 0; -webkit-flex-item-align: end; height: 50px; margin: auto 0"></div> 180 200 <div data-expected-height="50" data-offset-y="50" style="-webkit-flex: 1 0 0; -webkit-flex-item-align: end; height: 50px; margin: auto 0 0"></div> 201 <div data-expected-height="50" data-offset-y="0" style="-webkit-flex: 1 0 0; -webkit-flex-item-align: end; height: 50px; margin: 0 0 auto"></div> 181 202 <div data-expected-height="50" data-offset-y="25" style="-webkit-flex: 1 0 0; -webkit-flex-item-align: end; height: 50px; margin: 25px 0"></div> 182 203 <div data-expected-height="50" data-offset-y="40" style="-webkit-flex: 1 0 0; -webkit-flex-item-align: end; height: 50px; margin: 20px 0 10px;"></div> … … 188 209 <div data-expected-height="50" data-offset-y="25" style="-webkit-flex: 1 0 0; -webkit-flex-item-align: center; height: 50px;"></div> 189 210 <div data-expected-height="50" data-offset-y="25" style="-webkit-flex: 1 0 0; -webkit-flex-item-align: center; height: 50px; margin: auto 0"></div> 190 <div data-expected-height="50" data-offset-y="25" style="-webkit-flex: 1 0 0; -webkit-flex-item-align: center; height: 50px; margin: auto 0 0"></div> 211 <div data-expected-height="50" data-offset-y="50" style="-webkit-flex: 1 0 0; -webkit-flex-item-align: center; height: 50px; margin: auto 0 0"></div> 212 <div data-expected-height="50" data-offset-y="0" style="-webkit-flex: 1 0 0; -webkit-flex-item-align: center; height: 50px; margin: 0 0 auto"></div> 213 <div data-expected-height="50" data-offset-y="0" style="-webkit-flex: 1 0 0; -webkit-flex-item-align: center; height: 50px; margin: 0 0 auto"></div> 191 214 <div data-expected-height="50" data-offset-y="25" style="-webkit-flex: 1 0 0; -webkit-flex-item-align: center; height: 50px; margin: 25px 0"></div> 192 215 <div data-expected-height="50" data-offset-y="30" style="-webkit-flex: 1 0 0; -webkit-flex-item-align: center; height: 50px; margin: 20px 0 10px;"></div> … … 198 221 <div data-expected-height="50" data-offset-y="25" style="-webkit-flex: 1 0 0; -webkit-flex-item-align: center; height: 50px; -webkit-writing-mode: vertical-rl;"></div> 199 222 <div data-expected-height="50" data-offset-y="50" style="-webkit-flex: 1 0 0; -webkit-flex-item-align: end; height: 50px; -webkit-writing-mode: vertical-rl;"></div> 200 <div data-expected-height="50" data-offset-y="0" style="-webkit-flex: 1 0 0; height: 50px; margin: auto 0; -webkit-writing-mode: vertical-rl;"></div> 223 <div data-expected-height="50" data-offset-y="0" style="-webkit-flex: 1 0 0; height: 50px; -webkit-writing-mode: vertical-rl;"></div> 224 <div data-expected-height="50" data-offset-y="25" style="-webkit-flex: 1 0 0; height: 50px; margin: auto 0; -webkit-writing-mode: vertical-rl;"></div> 201 225 <div data-expected-height="100" data-offset-y="0" style="-webkit-flex: 1 0 0; height: 100px; -webkit-writing-mode: vertical-rl;"></div> 202 226 </div> … … 206 230 <div data-expected-height="50" data-offset-y="25" style="-webkit-flex: 1 0 0; -webkit-flex-item-align: center; height: 50px;"></div> 207 231 <div data-expected-height="50" data-offset-y="50" style="-webkit-flex: 1 0 0; -webkit-flex-item-align: end; height: 50px;"></div> 208 <div data-expected-height="50" data-offset-y="0" style="-webkit-flex: 1 0 0; height: 50px; margin: auto 0"></div> 232 <div data-expected-height="50" data-offset-y="0" style="-webkit-flex: 1 0 0; height: 50px;"></div> 233 <div data-expected-height="50" data-offset-y="25" style="-webkit-flex: 1 0 0; height: 50px; margin: auto 0"></div> 209 234 <div data-expected-height="100" data-offset-y="0" style="-webkit-flex: 1 0 0;"></div> 210 235 <div data-expected-height="100" data-offset-y="0" style="-webkit-flex: 1 0 0; height: 100px;"></div> -
trunk/LayoutTests/css3/flexbox/flex-flow-auto-margins.html
r117897 r118279 138 138 flexbox: physicalFlexBoxPosition, 139 139 column: [20, 20, 80, 73], 140 row: [20, 20, 40, 73],140 row: [20, 20, 80, 73], 141 141 'column-reverse': [20, 20, 40, 73], 142 'row-reverse': [20, 20, 40, 23],143 }, 144 ltr : { 145 container: physicalContainerSize, 146 flexbox: physicalFlexBoxPosition, 147 column: [20, 20, 80, 23], 148 row: [20, 20, 40, 23],142 'row-reverse': [20, 20, 80, 23], 143 }, 144 ltr : { 145 container: physicalContainerSize, 146 flexbox: physicalFlexBoxPosition, 147 column: [20, 20, 80, 23], 148 row: [20, 20, 80, 23], 149 149 'column-reverse': [20, 20, 40, 23], 150 'row-reverse': [20, 20, 40, 73],150 'row-reverse': [20, 20, 80, 73], 151 151 } 152 152 }, … … 156 156 flexbox: physicalFlexBoxPosition, 157 157 column: [20, 20, 80, 73], 158 row: [20, 20, 120, 73],158 row: [20, 20, 80, 73], 159 159 'column-reverse': [20, 20, 48, 73], 160 'row-reverse': [20, 20, 120, 23],161 }, 162 ltr : { 163 container: physicalContainerSize, 164 flexbox: physicalFlexBoxPosition, 165 column: [20, 20, 80, 23], 166 row: [20, 20, 120, 23],160 'row-reverse': [20, 20, 80, 23], 161 }, 162 ltr : { 163 container: physicalContainerSize, 164 flexbox: physicalFlexBoxPosition, 165 column: [20, 20, 80, 23], 166 row: [20, 20, 80, 23], 167 167 'column-reverse': [20, 20, 48, 23], 168 'row-reverse': [20, 20, 120, 73],168 'row-reverse': [20, 20, 80, 73], 169 169 } 170 170 } … … 177 177 flexbox: [20, 10], 178 178 column: [20, 20, 22, 73], 179 row: [20, 20, 22, 10],179 row: [20, 20, 22, 73], 180 180 'column-reverse': [20, 20, 92, 10], 181 'row-reverse': [20, 20, 22, 10],181 'row-reverse': [20, 20, 22, 73], 182 182 }, 183 183 ltr : { … … 185 185 flexbox: [40, 10], 186 186 column: [20, 20, 118, 73], 187 row: [20, 20, 118, 10],187 row: [20, 20, 118, 73], 188 188 'column-reverse': [20, 20, 48, 10], 189 'row-reverse': [20, 20, 118, 10],189 'row-reverse': [20, 20, 118, 73], 190 190 } 191 191 }, … … 213 213 flexbox: [10, 20], 214 214 column: [20, 20, 73, 22], 215 row: [20, 20, 10, 22],215 row: [20, 20, 73, 22], 216 216 'column-reverse': [20, 20, 23, 92], 217 'row-reverse': [20, 20, 10, 22],217 'row-reverse': [20, 20, 73, 22], 218 218 }, 219 219 ltr : { … … 221 221 flexbox: [10, 40], 222 222 column: [20, 20, 73, 118], 223 row: [20, 20, 10, 118],223 row: [20, 20, 73, 118], 224 224 'column-reverse': [20, 20, 23, 48], 225 'row-reverse': [20, 20, 10, 118],225 'row-reverse': [20, 20, 73, 118], 226 226 } 227 227 }, -
trunk/Source/WebCore/ChangeLog
r118275 r118279 1 2012-05-23 Tony Chang <tony@chromium.org> 2 3 auto margins on flexbox should allocate space in the cross direction 4 https://bugs.webkit.org/show_bug.cgi?id=86913 5 6 Reviewed by Ojan Vafai. 7 8 Test: css3/flexbox/auto-margins.html 9 10 * rendering/RenderFlexibleBox.cpp: 11 (WebCore::RenderFlexibleBox::hasAutoMarginsInCrossAxis): 12 (WebCore): 13 (WebCore::RenderFlexibleBox::updateAutoMarginsInCrossAxis): 14 (WebCore::RenderFlexibleBox::layoutAndPlaceChildren): If we have flex-align: baseline and auto margins, we ignore flex-align: baseline. 15 (WebCore::RenderFlexibleBox::alignChildren): auto margins apply before flex-align. 16 * rendering/RenderFlexibleBox.h: 17 1 18 2012-05-23 Kentaro Hara <haraken@chromium.org> 2 19 -
trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp
r117897 r118279 689 689 } 690 690 691 bool RenderFlexibleBox::hasAutoMarginsInCrossAxis(RenderBox* child) 692 { 693 if (isHorizontalFlow()) 694 return child->style()->marginTop().isAuto() || child->style()->marginBottom().isAuto(); 695 return child->style()->marginLeft().isAuto() || child->style()->marginRight().isAuto(); 696 } 697 691 698 LayoutUnit RenderFlexibleBox::availableAlignmentSpaceForChild(LayoutUnit lineCrossAxisExtent, RenderBox* child) 692 699 { 693 700 LayoutUnit childCrossExtent = crossAxisMarginExtentForChild(child) + crossAxisExtentForChild(child); 694 701 return lineCrossAxisExtent - childCrossExtent; 702 } 703 704 bool RenderFlexibleBox::updateAutoMarginsInCrossAxis(RenderBox* child, LayoutUnit availableAlignmentSpace) 705 { 706 bool isHorizontal = isHorizontalFlow(); 707 Length start = isHorizontal ? child->style()->marginTop() : child->style()->marginLeft(); 708 Length end = isHorizontal ? child->style()->marginBottom() : child->style()->marginRight(); 709 if (start.isAuto() && end.isAuto()) { 710 adjustAlignmentForChild(child, availableAlignmentSpace / 2); 711 if (isHorizontal) { 712 child->setMarginTop(availableAlignmentSpace / 2); 713 child->setMarginBottom(availableAlignmentSpace / 2); 714 } else { 715 child->setMarginLeft(availableAlignmentSpace / 2); 716 child->setMarginRight(availableAlignmentSpace / 2); 717 } 718 return true; 719 } 720 if (start.isAuto()) { 721 adjustAlignmentForChild(child, availableAlignmentSpace); 722 if (isHorizontal) 723 child->setMarginTop(availableAlignmentSpace); 724 else 725 child->setMarginLeft(availableAlignmentSpace); 726 return true; 727 } 728 if (end.isAuto()) { 729 if (isHorizontal) 730 child->setMarginBottom(availableAlignmentSpace); 731 else 732 child->setMarginRight(availableAlignmentSpace); 733 return true; 734 } 735 return false; 695 736 } 696 737 … … 953 994 954 995 LayoutUnit childCrossAxisMarginBoxExtent; 955 if (flexAlignForChild(child) == AlignBaseline ) {996 if (flexAlignForChild(child) == AlignBaseline && !hasAutoMarginsInCrossAxis(child)) { 956 997 LayoutUnit ascent = marginBoxAscentForChild(child); 957 998 LayoutUnit descent = (crossAxisMarginExtentForChild(child) + crossAxisExtentForChild(child)) - ascent; … … 1097 1138 for (size_t childNumber = 0; childNumber < lineContexts[lineNumber].numberOfChildren; ++childNumber, child = iterator.next()) { 1098 1139 ASSERT(child); 1140 if (updateAutoMarginsInCrossAxis(child, availableAlignmentSpaceForChild(lineCrossAxisExtent, child))) 1141 continue; 1142 1099 1143 switch (flexAlignForChild(child)) { 1100 1144 case AlignAuto: … … 1140 1184 for (size_t childNumber = 0; childNumber < lineContexts[lineNumber].numberOfChildren; ++childNumber, child = iterator.next()) { 1141 1185 ASSERT(child); 1142 if (flexAlignForChild(child) == AlignBaseline && minMarginAfterBaseline)1186 if (flexAlignForChild(child) == AlignBaseline && !hasAutoMarginsInCrossAxis(child) && minMarginAfterBaseline) 1143 1187 adjustAlignmentForChild(child, minMarginAfterBaseline); 1144 1188 } -
trunk/Source/WebCore/rendering/RenderFlexibleBox.h
r117897 r118279 104 104 LayoutUnit autoMarginOffsetInMainAxis(const OrderedFlexItemList&, LayoutUnit& availableFreeSpace); 105 105 void updateAutoMarginsInMainAxis(RenderBox* child, LayoutUnit autoMarginOffset); 106 bool hasAutoMarginsInCrossAxis(RenderBox* child); 107 bool updateAutoMarginsInCrossAxis(RenderBox* child, LayoutUnit availableAlignmentSpace); 106 108 void repositionLogicalHeightDependentFlexItems(FlexOrderIterator&, WTF::Vector<LineContext>&, LayoutUnit& oldClientAfterEdge); 107 109
Note: See TracChangeset
for help on using the changeset viewer.