Changeset 189169 in webkit
- Timestamp:
- Aug 31, 2015 9:30:03 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r189167 r189169 1 2015-08-31 Javier Fernandez <jfernandez@igalia.com> 2 3 [CSS Grid Layout] auto-margins alignment does not work for heights 4 https://bugs.webkit.org/show_bug.cgi?id=148071 5 6 Reviewed by Sergio Villar Senin. 7 8 Updated some test cases to adapt them to the new row-axis auto-margin alignment. 9 10 * fast/css-grid-layout/grid-item-auto-margins-alignment-expected.txt: 11 * fast/css-grid-layout/grid-item-auto-margins-alignment-vertical-lr-expected.txt: 12 * fast/css-grid-layout/grid-item-auto-margins-alignment-vertical-lr.html: 13 * fast/css-grid-layout/grid-item-auto-margins-alignment-vertical-rl-expected.txt: 14 * fast/css-grid-layout/grid-item-auto-margins-alignment-vertical-rl.html: 15 * fast/css-grid-layout/grid-item-auto-margins-alignment.html: 16 * fast/css-grid-layout/grid-item-auto-margins-and-stretch.html: 17 1 18 2015-08-31 Enrica Casucci <enrica@apple.com> 2 19 -
trunk/LayoutTests/fast/css-grid-layout/grid-item-auto-margins-alignment-expected.txt
r186682 r189169 1 1 This test checks that aling-self and justify-self properties are not applied when there is auto-margin in the correponding axis. Instead, auto-margin alignment should be applied. 2 2 3 Direction: LTR | Self Aligmment: center | 1 auto-margin3 Direction: LTR | Self Aligmment: center | fixed size items | 1 auto-margin 4 4 5 5 PASS 6 Direction: LTR | Self Aligmment: start | 4 auto-margin6 Direction: LTR | Self Aligmment: start | fixed size items | 4 auto-margin 7 7 8 8 PASS 9 Direction: RTL | Self Aligmment: center| 1 auto-margin9 Direction: LTR | Self Aligmment: center | auto size items | 1 auto-margin 10 10 11 11 PASS 12 Direction: RTL | Self Aligmment: start| 4 auto-margin12 Direction: LTR | Self Aligmment: start | auto size items | 4 auto-margin 13 13 14 14 PASS 15 Direction: RTL | Self Aligmment: center | fixed size items | 1 auto-margin 16 17 PASS 18 Direction: RTL | Self Aligmment: start | fixed size items | 4 auto-margin 19 20 PASS 21 Direction: RTL | Self Aligmment: center | auto size items | 1 auto-margin 22 23 PASS 24 Direction: RTL | Self Aligmment: start | auto size items | 4 auto-margin 25 26 PASS -
trunk/LayoutTests/fast/css-grid-layout/grid-item-auto-margins-alignment-vertical-lr-expected.txt
r186682 r189169 1 1 This test checks that aling-self and justify-self properties are not applied when there is auto-margin in the correponding axis. Instead, auto-margin alignment should be applied. 2 2 3 Direction: LTR | Self Aligmment: center | 1 auto-margin3 Direction: LTR | Self Aligmment: center | fixed size items | 1 auto-margin 4 4 5 5 PASS 6 Direction: LTR | Self Aligmment: start | 4 auto-margin6 Direction: LTR | Self Aligmment: start | fixed size items | 4 auto-margin 7 7 8 8 PASS 9 Direction: RTL | Self Aligmment: center| 1 auto-margin9 Direction: LTR | Self Aligmment: center | auto size items | 1 auto-margin 10 10 11 11 PASS 12 Direction: RTL | Self Aligmment: start| 4 auto-margin12 Direction: LTR | Self Aligmment: start | auto size items | 4 auto-margin 13 13 14 14 PASS 15 Direction: RTL | Self Aligmment: center | fixed size items | 1 auto-margin 16 17 PASS 18 Direction: RTL | Self Aligmment: start | fixed size items | 4 auto-margin 19 20 PASS 21 Direction: RTL | Self Aligmment: center | auto size items | 1 auto-margin 22 23 PASS 24 Direction: RTL | Self Aligmment: start | auto size items | 4 auto-margin 25 26 PASS -
trunk/LayoutTests/fast/css-grid-layout/grid-item-auto-margins-alignment-vertical-lr.html
r186682 r189169 16 16 } 17 17 18 . cell{18 .item { 19 19 width: 20px; 20 20 height: 40px; 21 }22 23 .item {24 width: 8px;25 height: 16px;26 background: black;27 21 } 28 22 … … 43 37 <p>This test checks that aling-self and justify-self properties are not applied when there is auto-margin in the correponding axis. Instead, auto-margin alignment should be applied.</p> 44 38 45 <p>Direction: LTR | Self Aligmment: center | 1 auto-margin</p>39 <p>Direction: LTR | Self Aligmment: center | fixed size items | 1 auto-margin</p> 46 40 <div style="position: relative"> 47 41 <div class="grid verticalLR itemsCenter" data-expected-width="400" data-expected-height="200"> 48 <div class=" cellautoMarginTop firstRowFirstColumn" data-offset-x="90" data-offset-y="60" data-expected-width="20" data-expected-height="40"></div>49 <div class=" cellautoMarginRight firstRowSecondColumn" data-offset-x="0" data-offset-y="130" data-expected-width="20" data-expected-height="40"></div>50 <div class=" cellautoMarginLeft secondRowFirstColumn" data-offset-x="380" data-offset-y="30" data-expected-width="20" data-expected-height="40"></div>51 <div class=" cellautoMarginBottom secondRowSecondColumn" data-offset-x="290" data-offset-y="100" data-expected-width="20" data-expected-height="40"></div>42 <div class="item autoMarginTop firstRowFirstColumn" data-offset-x="90" data-offset-y="60" data-expected-width="20" data-expected-height="40"></div> 43 <div class="item autoMarginRight firstRowSecondColumn" data-offset-x="0" data-offset-y="130" data-expected-width="20" data-expected-height="40"></div> 44 <div class="item autoMarginLeft secondRowFirstColumn" data-offset-x="380" data-offset-y="30" data-expected-width="20" data-expected-height="40"></div> 45 <div class="item autoMarginBottom secondRowSecondColumn" data-offset-x="290" data-offset-y="100" data-expected-width="20" data-expected-height="40"></div> 52 46 </div> 53 47 </div> 54 48 55 <p>Direction: LTR | Self Aligmment: start | 4 auto-margin</p>49 <p>Direction: LTR | Self Aligmment: start | fixed size items | 4 auto-margin</p> 56 50 <div style="position: relative"> 57 51 <div class="grid verticalLR" data-expected-width="400" data-expected-height="200"> 58 <div class="cell autoMargin firstRowFirstColumn" data-offset-x="90" data-offset-y="30" data-expected-width="20" data-expected-height="40"></div> 59 <div class="cell autoMargin firstRowSecondColumn" data-offset-x="90" data-offset-y="130" data-expected-width="20" data-expected-height="40"></div> 60 <div class="cell autoMargin secondRowFirstColumn" data-offset-x="290" data-offset-y="30" data-expected-width="20" data-expected-height="40"></div> 61 <div class="cell autoMargin secondRowSecondColumn" data-offset-x="290" data-offset-y="130" data-expected-width="20" data-expected-height="40"></div> 52 <div class="item autoMargin firstRowFirstColumn" data-offset-x="90" data-offset-y="30" data-expected-width="20" data-expected-height="40"></div> 53 <div class="item autoMargin firstRowSecondColumn" data-offset-x="90" data-offset-y="130" data-expected-width="20" data-expected-height="40"></div> 54 <div class="item autoMargin secondRowFirstColumn" data-offset-x="290" data-offset-y="30" data-expected-width="20" data-expected-height="40"></div> 55 <div class="item autoMargin secondRowSecondColumn" data-offset-x="290" data-offset-y="130" data-expected-width="20" data-expected-height="40"></div> 56 </div> 57 </div> 58 59 <p>Direction: LTR | Self Aligmment: center | auto size items | 1 auto-margin</p> 60 <div style="position: relative"> 61 <div class="grid verticalLR itemsCenter" data-expected-width="400" data-expected-height="200"> 62 <div class="autoMarginTop firstRowFirstColumn" data-offset-x="90" data-offset-y="60" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> 63 <div class="autoMarginRight firstRowSecondColumn" data-offset-x="0" data-offset-y="130" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> 64 <div class="autoMarginLeft secondRowFirstColumn" data-offset-x="380" data-offset-y="30" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> 65 <div class="autoMarginBottom secondRowSecondColumn" data-offset-x="290" data-offset-y="100" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> 66 </div> 67 </div> 68 69 <p>Direction: LTR | Self Aligmment: start | auto size items | 4 auto-margin</p> 70 <div style="position: relative"> 71 <div class="grid verticalLR" data-expected-width="400" data-expected-height="200"> 72 <div class="autoMargin firstRowFirstColumn" data-offset-x="90" data-offset-y="30" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> 73 <div class="autoMargin firstRowSecondColumn" data-offset-x="90" data-offset-y="130" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> 74 <div class="autoMargin secondRowFirstColumn" data-offset-x="290" data-offset-y="30" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> 75 <div class="autoMargin secondRowSecondColumn" data-offset-x="290" data-offset-y="130" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> 62 76 </div> 63 77 </div> 64 78 65 79 <!-- direction RTL --> 66 <p>Direction: RTL | Self Aligmment: center | 1 auto-margin</p>80 <p>Direction: RTL | Self Aligmment: center | fixed size items | 1 auto-margin</p> 67 81 <div style="position: relative"> 68 82 <div class="grid verticalLR itemsCenter directionRTL" data-expected-width="400" data-expected-height="200"> 69 <div class=" cellautoMarginTop firstRowFirstColumn" data-offset-x="90" data-offset-y="160" data-expected-width="20" data-expected-height="40"></div>70 <div class=" cellautoMarginRight firstRowSecondColumn" data-offset-x="0" data-offset-y="30" data-expected-width="20" data-expected-height="40"></div>71 <div class=" cellautoMarginLeft secondRowFirstColumn" data-offset-x="380" data-offset-y="130" data-expected-width="20" data-expected-height="40"></div>72 <div class=" cellautoMarginBottom secondRowSecondColumn" data-offset-x="290" data-offset-y="0" data-expected-width="20" data-expected-height="40"></div>83 <div class="item autoMarginTop firstRowFirstColumn" data-offset-x="90" data-offset-y="160" data-expected-width="20" data-expected-height="40"></div> 84 <div class="item autoMarginRight firstRowSecondColumn" data-offset-x="0" data-offset-y="30" data-expected-width="20" data-expected-height="40"></div> 85 <div class="item autoMarginLeft secondRowFirstColumn" data-offset-x="380" data-offset-y="130" data-expected-width="20" data-expected-height="40"></div> 86 <div class="item autoMarginBottom secondRowSecondColumn" data-offset-x="290" data-offset-y="0" data-expected-width="20" data-expected-height="40"></div> 73 87 </div> 74 88 </div> 75 89 76 90 77 <p>Direction: RTL | Self Aligmment: start | 4 auto-margin</p>91 <p>Direction: RTL | Self Aligmment: start | fixed size items | 4 auto-margin</p> 78 92 <div style="position: relative"> 79 93 <div class="grid verticalLR directionRTL" data-expected-width="400" data-expected-height="200"> 80 <div class="cell autoMargin firstRowFirstColumn" data-offset-x="90" data-offset-y="130" data-expected-width="20" data-expected-height="40"></div> 81 <div class="cell autoMargin firstRowSecondColumn" data-offset-x="90" data-offset-y="30" data-expected-width="20" data-expected-height="40"></div> 82 <div class="cell autoMargin secondRowFirstColumn" data-offset-x="290" data-offset-y="130" data-expected-width="20" data-expected-height="40"></div> 83 <div class="cell autoMargin secondRowSecondColumn" data-offset-x="290" data-offset-y="30" data-expected-width="20" data-expected-height="40"></div> 94 <div class="item autoMargin firstRowFirstColumn" data-offset-x="90" data-offset-y="130" data-expected-width="20" data-expected-height="40"></div> 95 <div class="item autoMargin firstRowSecondColumn" data-offset-x="90" data-offset-y="30" data-expected-width="20" data-expected-height="40"></div> 96 <div class="item autoMargin secondRowFirstColumn" data-offset-x="290" data-offset-y="130" data-expected-width="20" data-expected-height="40"></div> 97 <div class="item autoMargin secondRowSecondColumn" data-offset-x="290" data-offset-y="30" data-expected-width="20" data-expected-height="40"></div> 98 </div> 99 </div> 100 101 <p>Direction: RTL | Self Aligmment: center | auto size items | 1 auto-margin</p> 102 <div style="position: relative"> 103 <div class="grid verticalLR itemsCenter directionRTL" data-expected-width="400" data-expected-height="200"> 104 <div class="autoMarginTop firstRowFirstColumn" data-offset-x="90" data-offset-y="160" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> 105 <div class="autoMarginRight firstRowSecondColumn" data-offset-x="0" data-offset-y="30" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> 106 <div class="autoMarginLeft secondRowFirstColumn" data-offset-x="380" data-offset-y="130" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> 107 <div class="autoMarginBottom secondRowSecondColumn" data-offset-x="290" data-offset-y="0" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> 84 108 </div> 85 109 </div> 86 110 87 111 112 <p>Direction: RTL | Self Aligmment: start | auto size items | 4 auto-margin</p> 113 <div style="position: relative"> 114 <div class="grid verticalLR directionRTL" data-expected-width="400" data-expected-height="200"> 115 <div class="autoMargin firstRowFirstColumn" data-offset-x="90" data-offset-y="130" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> 116 <div class="autoMargin firstRowSecondColumn" data-offset-x="90" data-offset-y="30" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> 117 <div class="autoMargin secondRowFirstColumn" data-offset-x="290" data-offset-y="130" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> 118 <div class="autoMargin secondRowSecondColumn" data-offset-x="290" data-offset-y="30" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> 119 </div> 120 </div> 121 88 122 </body> 89 123 </html> -
trunk/LayoutTests/fast/css-grid-layout/grid-item-auto-margins-alignment-vertical-rl-expected.txt
r186682 r189169 1 1 This test checks that aling-self and justify-self properties are not applied when there is auto-margin in the correponding axis. Instead, auto-margin alignment should be applied. 2 2 3 Direction: LTR | Self Aligmment: center | 1 auto-margin3 Direction: LTR | Self Aligmment: center | fixed size items | 1 auto-margin 4 4 5 5 PASS 6 Direction: LTR | Self Aligmment: start | 4 auto-margin6 Direction: LTR | Self Aligmment: start | fixed size items | 4 auto-margin 7 7 8 8 PASS 9 Direction: RTL | Self Aligmment: center| 1 auto-margin9 Direction: LTR | Self Aligmment: center | auto size items | 1 auto-margin 10 10 11 11 PASS 12 Direction: RTL | Self Aligmment: start| 4 auto-margin12 Direction: LTR | Self Aligmment: start | auto size items | 4 auto-margin 13 13 14 14 PASS 15 Direction: RTL | Self Aligmment: center | fixed size items | 1 auto-margin 16 17 PASS 18 Direction: RTL | Self Aligmment: start | fixed size items | 4 auto-margin 19 20 PASS 21 Direction: RTL | Self Aligmment: center | auto size items | 1 auto-margin 22 23 PASS 24 Direction: RTL | Self Aligmment: start | auto size items | 4 auto-margin 25 26 PASS -
trunk/LayoutTests/fast/css-grid-layout/grid-item-auto-margins-alignment-vertical-rl.html
r186682 r189169 16 16 } 17 17 18 . cell{18 .item { 19 19 width: 20px; 20 20 height: 40px; 21 }22 23 .item {24 width: 8px;25 height: 16px;26 background: black;27 21 } 28 22 … … 43 37 <p>This test checks that aling-self and justify-self properties are not applied when there is auto-margin in the correponding axis. Instead, auto-margin alignment should be applied.</p> 44 38 45 <p>Direction: LTR | Self Aligmment: center | 1 auto-margin</p>39 <p>Direction: LTR | Self Aligmment: center | fixed size items | 1 auto-margin</p> 46 40 <div style="position: relative"> 47 41 <div class="grid verticalRL itemsCenter" data-expected-width="400" data-expected-height="200"> 48 <div class=" cellautoMarginTop firstRowFirstColumn" data-offset-x="290" data-offset-y="60" data-expected-width="20" data-expected-height="40"></div>49 <div class=" cellautoMarginRight firstRowSecondColumn" data-offset-x="200" data-offset-y="130" data-expected-width="20" data-expected-height="40"></div>50 <div class=" cellautoMarginLeft secondRowFirstColumn" data-offset-x="180" data-offset-y="30" data-expected-width="20" data-expected-height="40"></div>51 <div class=" cellautoMarginBottom secondRowSecondColumn" data-offset-x="90" data-offset-y="100" data-expected-width="20" data-expected-height="40"></div>42 <div class="item autoMarginTop firstRowFirstColumn" data-offset-x="290" data-offset-y="60" data-expected-width="20" data-expected-height="40"></div> 43 <div class="item autoMarginRight firstRowSecondColumn" data-offset-x="200" data-offset-y="130" data-expected-width="20" data-expected-height="40"></div> 44 <div class="item autoMarginLeft secondRowFirstColumn" data-offset-x="180" data-offset-y="30" data-expected-width="20" data-expected-height="40"></div> 45 <div class="item autoMarginBottom secondRowSecondColumn" data-offset-x="90" data-offset-y="100" data-expected-width="20" data-expected-height="40"></div> 52 46 </div> 53 47 </div> 54 48 55 <p>Direction: LTR | Self Aligmment: start | 4 auto-margin</p>49 <p>Direction: LTR | Self Aligmment: start | fixed size items | 4 auto-margin</p> 56 50 <div style="position: relative"> 57 51 <div class="grid verticalRL" data-expected-width="400" data-expected-height="200"> 58 <div class="cell autoMargin firstRowFirstColumn" data-offset-x="290" data-offset-y="30" data-expected-width="20" data-expected-height="40"></div> 59 <div class="cell autoMargin firstRowSecondColumn" data-offset-x="290" data-offset-y="130" data-expected-width="20" data-expected-height="40"></div> 60 <div class="cell autoMargin secondRowFirstColumn" data-offset-x="90" data-offset-y="30" data-expected-width="20" data-expected-height="40"></div> 61 <div class="cell autoMargin secondRowSecondColumn" data-offset-x="90" data-offset-y="130" data-expected-width="20" data-expected-height="40"></div> 52 <div class="item autoMargin firstRowFirstColumn" data-offset-x="290" data-offset-y="30" data-expected-width="20" data-expected-height="40"></div> 53 <div class="item autoMargin firstRowSecondColumn" data-offset-x="290" data-offset-y="130" data-expected-width="20" data-expected-height="40"></div> 54 <div class="item autoMargin secondRowFirstColumn" data-offset-x="90" data-offset-y="30" data-expected-width="20" data-expected-height="40"></div> 55 <div class="item autoMargin secondRowSecondColumn" data-offset-x="90" data-offset-y="130" data-expected-width="20" data-expected-height="40"></div> 56 </div> 57 </div> 58 59 <p>Direction: LTR | Self Aligmment: center | auto size items | 1 auto-margin</p> 60 <div style="position: relative"> 61 <div class="grid verticalRL itemsCenter" data-expected-width="400" data-expected-height="200"> 62 <div class="item autoMarginTop firstRowFirstColumn" data-offset-x="290" data-offset-y="60" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> 63 <div class="item autoMarginRight firstRowSecondColumn" data-offset-x="200" data-offset-y="130" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> 64 <div class="item autoMarginLeft secondRowFirstColumn" data-offset-x="180" data-offset-y="30" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> 65 <div class="item autoMarginBottom secondRowSecondColumn" data-offset-x="90" data-offset-y="100" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> 66 </div> 67 </div> 68 69 <p>Direction: LTR | Self Aligmment: start | auto size items | 4 auto-margin</p> 70 <div style="position: relative"> 71 <div class="grid verticalRL" data-expected-width="400" data-expected-height="200"> 72 <div class="item autoMargin firstRowFirstColumn" data-offset-x="290" data-offset-y="30" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> 73 <div class="item autoMargin firstRowSecondColumn" data-offset-x="290" data-offset-y="130" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> 74 <div class="item autoMargin secondRowFirstColumn" data-offset-x="90" data-offset-y="30" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> 75 <div class="item autoMargin secondRowSecondColumn" data-offset-x="90" data-offset-y="130" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> 62 76 </div> 63 77 </div> 64 78 65 79 <!-- direction RTL --> 66 <p>Direction: RTL | Self Aligmment: center | 1 auto-margin</p>80 <p>Direction: RTL | Self Aligmment: center | fixed size items | 1 auto-margin</p> 67 81 <div style="position: relative"> 68 82 <div class="grid verticalRL itemsCenter directionRTL" data-expected-width="400" data-expected-height="200"> 69 <div class=" cellautoMarginTop firstRowFirstColumn" data-offset-x="290" data-offset-y="160" data-expected-width="20" data-expected-height="40"></div>70 <div class=" cellautoMarginRight firstRowSecondColumn" data-offset-x="200" data-offset-y="30" data-expected-width="20" data-expected-height="40"></div>71 <div class=" cellautoMarginLeft secondRowFirstColumn" data-offset-x="180" data-offset-y="130" data-expected-width="20" data-expected-height="40"></div>72 <div class=" cellautoMarginBottom secondRowSecondColumn" data-offset-x="90" data-offset-y="0" data-expected-width="20" data-expected-height="40"></div>83 <div class="item autoMarginTop firstRowFirstColumn" data-offset-x="290" data-offset-y="160" data-expected-width="20" data-expected-height="40"></div> 84 <div class="item autoMarginRight firstRowSecondColumn" data-offset-x="200" data-offset-y="30" data-expected-width="20" data-expected-height="40"></div> 85 <div class="item autoMarginLeft secondRowFirstColumn" data-offset-x="180" data-offset-y="130" data-expected-width="20" data-expected-height="40"></div> 86 <div class="item autoMarginBottom secondRowSecondColumn" data-offset-x="90" data-offset-y="0" data-expected-width="20" data-expected-height="40"></div> 73 87 </div> 74 88 </div> 75 89 76 90 77 <p>Direction: RTL | Self Aligmment: start | 4 auto-margin</p>91 <p>Direction: RTL | Self Aligmment: start | fixed size items | 4 auto-margin</p> 78 92 <div style="position: relative"> 79 93 <div class="grid verticalRL directionRTL" data-expected-width="400" data-expected-height="200"> 80 <div class="cell autoMargin firstRowFirstColumn" data-offset-x="290" data-offset-y="130" data-expected-width="20" data-expected-height="40"></div> 81 <div class="cell autoMargin firstRowSecondColumn" data-offset-x="290" data-offset-y="30" data-expected-width="20" data-expected-height="40"></div> 82 <div class="cell autoMargin secondRowFirstColumn" data-offset-x="90" data-offset-y="130" data-expected-width="20" data-expected-height="40"></div> 83 <div class="cell autoMargin secondRowSecondColumn" data-offset-x="90" data-offset-y="30" data-expected-width="20" data-expected-height="40"></div> 94 <div class="item autoMargin firstRowFirstColumn" data-offset-x="290" data-offset-y="130" data-expected-width="20" data-expected-height="40"></div> 95 <div class="item autoMargin firstRowSecondColumn" data-offset-x="290" data-offset-y="30" data-expected-width="20" data-expected-height="40"></div> 96 <div class="item autoMargin secondRowFirstColumn" data-offset-x="90" data-offset-y="130" data-expected-width="20" data-expected-height="40"></div> 97 <div class="item autoMargin secondRowSecondColumn" data-offset-x="90" data-offset-y="30" data-expected-width="20" data-expected-height="40"></div> 98 </div> 99 </div> 100 101 <p>Direction: RTL | Self Aligmment: center | auto size items | 1 auto-margin</p> 102 <div style="position: relative"> 103 <div class="grid verticalRL itemsCenter directionRTL" data-expected-width="400" data-expected-height="200"> 104 <div class="item autoMarginTop firstRowFirstColumn" data-offset-x="290" data-offset-y="160" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> 105 <div class="item autoMarginRight firstRowSecondColumn" data-offset-x="200" data-offset-y="30" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> 106 <div class="item autoMarginLeft secondRowFirstColumn" data-offset-x="180" data-offset-y="130" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> 107 <div class="item autoMarginBottom secondRowSecondColumn" data-offset-x="90" data-offset-y="0" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> 84 108 </div> 85 109 </div> 86 110 87 111 112 <p>Direction: RTL | Self Aligmment: start | auto size items | 4 auto-margin</p> 113 <div style="position: relative"> 114 <div class="grid verticalRL directionRTL" data-expected-width="400" data-expected-height="200"> 115 <div class="item autoMargin firstRowFirstColumn" data-offset-x="290" data-offset-y="130" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> 116 <div class="item autoMargin firstRowSecondColumn" data-offset-x="290" data-offset-y="30" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> 117 <div class="item autoMargin secondRowFirstColumn" data-offset-x="90" data-offset-y="130" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> 118 <div class="item autoMargin secondRowSecondColumn" data-offset-x="90" data-offset-y="30" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> 119 </div> 120 </div> 121 88 122 </body> 89 123 </html> -
trunk/LayoutTests/fast/css-grid-layout/grid-item-auto-margins-alignment.html
r186682 r189169 16 16 } 17 17 18 . cell{18 .item { 19 19 width: 20px; 20 20 height: 40px; 21 }22 23 .item {24 width: 8px;25 height: 16px;26 background: black;27 21 } 28 22 … … 43 37 <p>This test checks that aling-self and justify-self properties are not applied when there is auto-margin in the correponding axis. Instead, auto-margin alignment should be applied.</p> 44 38 45 <p>Direction: LTR | Self Aligmment: center | 1 auto-margin</p>39 <p>Direction: LTR | Self Aligmment: center | fixed size items | 1 auto-margin</p> 46 40 <div style="position: relative"> 47 41 <div class="grid itemsCenter" data-expected-width="200" data-expected-height="400"> 48 <div class=" cellautoMarginTop firstRowFirstColumn" data-offset-x="40" data-offset-y="160" data-expected-width="20" data-expected-height="40"></div>49 <div class=" cellautoMarginRight firstRowSecondColumn" data-offset-x="100" data-offset-y="80" data-expected-width="20" data-expected-height="40"></div>50 <div class=" cellautoMarginLeft secondRowFirstColumn" data-offset-x="80" data-offset-y="280" data-expected-width="20" data-expected-height="40"></div>51 <div class=" cellautoMarginBottom secondRowSecondColumn" data-offset-x="140" data-offset-y="200" data-expected-width="20" data-expected-height="40"></div>42 <div class="item autoMarginTop firstRowFirstColumn" data-offset-x="40" data-offset-y="160" data-expected-width="20" data-expected-height="40"></div> 43 <div class="item autoMarginRight firstRowSecondColumn" data-offset-x="100" data-offset-y="80" data-expected-width="20" data-expected-height="40"></div> 44 <div class="item autoMarginLeft secondRowFirstColumn" data-offset-x="80" data-offset-y="280" data-expected-width="20" data-expected-height="40"></div> 45 <div class="item autoMarginBottom secondRowSecondColumn" data-offset-x="140" data-offset-y="200" data-expected-width="20" data-expected-height="40"></div> 52 46 </div> 53 47 </div> 54 48 55 <p>Direction: LTR | Self Aligmment: start | 4 auto-margin</p>49 <p>Direction: LTR | Self Aligmment: start | fixed size items | 4 auto-margin</p> 56 50 <div style="position: relative"> 57 51 <div class="grid" data-expected-width="200" data-expected-height="400"> 58 <div class="cell autoMargin firstRowFirstColumn" data-offset-x="40" data-offset-y="80" data-expected-width="20" data-expected-height="40"></div> 59 <div class="cell autoMargin firstRowSecondColumn" data-offset-x="140" data-offset-y="80" data-expected-width="20" data-expected-height="40"></div> 60 <div class="cell autoMargin secondRowFirstColumn" data-offset-x="40" data-offset-y="280" data-expected-width="20" data-expected-height="40"></div> 61 <div class="cell autoMargin secondRowSecondColumn" data-offset-x="140" data-offset-y="280" data-expected-width="20" data-expected-height="40"></div> 52 <div class="item autoMargin firstRowFirstColumn" data-offset-x="40" data-offset-y="80" data-expected-width="20" data-expected-height="40"></div> 53 <div class="item autoMargin firstRowSecondColumn" data-offset-x="140" data-offset-y="80" data-expected-width="20" data-expected-height="40"></div> 54 <div class="item autoMargin secondRowFirstColumn" data-offset-x="40" data-offset-y="280" data-expected-width="20" data-expected-height="40"></div> 55 <div class="item autoMargin secondRowSecondColumn" data-offset-x="140" data-offset-y="280" data-expected-width="20" data-expected-height="40"></div> 56 </div> 57 </div> 58 59 <p>Direction: LTR | Self Aligmment: center | auto size items | 1 auto-margin</p> 60 <div style="position: relative"> 61 <div class="grid itemsCenter" data-expected-width="200" data-expected-height="400"> 62 <div class="autoMarginTop firstRowFirstColumn" data-offset-x="40" data-offset-y="160" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> 63 <div class="autoMarginRight firstRowSecondColumn" data-offset-x="100" data-offset-y="80" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> 64 <div class="autoMarginLeft secondRowFirstColumn" data-offset-x="80" data-offset-y="280" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> 65 <div class="autoMarginBottom secondRowSecondColumn" data-offset-x="140" data-offset-y="200" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> 66 </div> 67 </div> 68 69 <p>Direction: LTR | Self Aligmment: start | auto size items | 4 auto-margin</p> 70 <div style="position: relative"> 71 <div class="grid" data-expected-width="200" data-expected-height="400"> 72 <div class="autoMargin firstRowFirstColumn" data-offset-x="40" data-offset-y="80" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> 73 <div class="autoMargin firstRowSecondColumn" data-offset-x="140" data-offset-y="80" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> 74 <div class="autoMargin secondRowFirstColumn" data-offset-x="40" data-offset-y="280" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> 75 <div class="autoMargin secondRowSecondColumn" data-offset-x="140" data-offset-y="280" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> 62 76 </div> 63 77 </div> 64 78 65 79 <!-- direction RTL --> 66 <p>Direction: RTL | Self Aligmment: center | 1 auto-margin</p>80 <p>Direction: RTL | Self Aligmment: center | fixed size items | 1 auto-margin</p> 67 81 <div style="position: relative"> 68 82 <div class="grid itemsCenter directionRTL" data-expected-width="200" data-expected-height="400"> 69 <div class=" cellautoMarginTop firstRowFirstColumn" data-offset-x="140" data-offset-y="160" data-expected-width="20" data-expected-height="40"></div>70 <div class=" cellautoMarginRight firstRowSecondColumn" data-offset-x="0" data-offset-y="80" data-expected-width="20" data-expected-height="40"></div>71 <div class=" cellautoMarginLeft secondRowFirstColumn" data-offset-x="180" data-offset-y="280" data-expected-width="20" data-expected-height="40"></div>72 <div class=" cellautoMarginBottom secondRowSecondColumn" data-offset-x="40" data-offset-y="200" data-expected-width="20" data-expected-height="40"></div>83 <div class="item autoMarginTop firstRowFirstColumn" data-offset-x="140" data-offset-y="160" data-expected-width="20" data-expected-height="40"></div> 84 <div class="item autoMarginRight firstRowSecondColumn" data-offset-x="0" data-offset-y="80" data-expected-width="20" data-expected-height="40"></div> 85 <div class="item autoMarginLeft secondRowFirstColumn" data-offset-x="180" data-offset-y="280" data-expected-width="20" data-expected-height="40"></div> 86 <div class="item autoMarginBottom secondRowSecondColumn" data-offset-x="40" data-offset-y="200" data-expected-width="20" data-expected-height="40"></div> 73 87 </div> 74 88 </div> 75 89 76 77 <p>Direction: RTL | Self Aligmment: start | 4 auto-margin</p> 90 <p>Direction: RTL | Self Aligmment: start | fixed size items | 4 auto-margin</p> 78 91 <div style="position: relative"> 79 92 <div class="grid directionRTL" data-expected-width="200" data-expected-height="400"> 80 <div class=" cellautoMargin firstRowFirstColumn" data-offset-x="140" data-offset-y="80" data-expected-width="20" data-expected-height="40"></div>81 <div class=" cellautoMargin firstRowSecondColumn" data-offset-x="40" data-offset-y="80" data-expected-width="20" data-expected-height="40"></div>82 <div class=" cellautoMargin secondRowFirstColumn" data-offset-x="140" data-offset-y="280" data-expected-width="20" data-expected-height="40"></div>83 <div class=" cellautoMargin secondRowSecondColumn" data-offset-x="40" data-offset-y="280" data-expected-width="20" data-expected-height="40"></div>93 <div class="item autoMargin firstRowFirstColumn" data-offset-x="140" data-offset-y="80" data-expected-width="20" data-expected-height="40"></div> 94 <div class="item autoMargin firstRowSecondColumn" data-offset-x="40" data-offset-y="80" data-expected-width="20" data-expected-height="40"></div> 95 <div class="item autoMargin secondRowFirstColumn" data-offset-x="140" data-offset-y="280" data-expected-width="20" data-expected-height="40"></div> 96 <div class="item autoMargin secondRowSecondColumn" data-offset-x="40" data-offset-y="280" data-expected-width="20" data-expected-height="40"></div> 84 97 </div> 85 98 </div> 86 99 100 <p>Direction: RTL | Self Aligmment: center | auto size items | 1 auto-margin</p> 101 <div style="position: relative"> 102 <div class="grid itemsCenter directionRTL" data-expected-width="200" data-expected-height="400"> 103 <div class="autoMarginTop firstRowFirstColumn" data-offset-x="140" data-offset-y="160" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> 104 <div class="autoMarginRight firstRowSecondColumn" data-offset-x="0" data-offset-y="80" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> 105 <div class="autoMarginLeft secondRowFirstColumn" data-offset-x="180" data-offset-y="280" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> 106 <div class="autoMarginBottom secondRowSecondColumn" data-offset-x="40" data-offset-y="200" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> 107 </div> 108 </div> 109 110 <p>Direction: RTL | Self Aligmment: start | auto size items | 4 auto-margin</p> 111 <div style="position: relative"> 112 <div class="grid directionRTL" data-expected-width="200" data-expected-height="400"> 113 <div class="autoMargin firstRowFirstColumn" data-offset-x="140" data-offset-y="80" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> 114 <div class="autoMargin firstRowSecondColumn" data-offset-x="40" data-offset-y="80" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> 115 <div class="autoMargin secondRowFirstColumn" data-offset-x="140" data-offset-y="280" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> 116 <div class="autoMargin secondRowSecondColumn" data-offset-x="40" data-offset-y="280" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> 117 </div> 118 </div> 87 119 88 120 </body> -
trunk/LayoutTests/fast/css-grid-layout/grid-item-auto-margins-and-stretch.html
r188582 r189169 52 52 <div class="widthAndHeightSet"></div> 53 53 </div> 54 <div class="autoMargins firstRowSecondColumn" data-offset-x="1 00" data-offset-y="80" data-expected-width="20" data-expected-height="40">54 <div class="autoMargins firstRowSecondColumn" data-offset-x="140" data-offset-y="80" data-expected-width="20" data-expected-height="40"> 55 55 <div class="widthAndHeightSet"></div> 56 56 </div> 57 <div class="autoMarginsRightLeft secondRowFirstColumn" data-offset-x=" 0" data-offset-y="200" data-expected-width="20" data-expected-height="200">57 <div class="autoMarginsRightLeft secondRowFirstColumn" data-offset-x="40" data-offset-y="200" data-expected-width="20" data-expected-height="200"> 58 58 <div class="widthAndHeightSet"></div> 59 59 </div> … … 69 69 <div class="widthAndHeightSet"></div> 70 70 </div> 71 <div class="autoMargins firstRowSecondColumn" data-offset-x="290" data-offset-y="1 00" data-expected-width="20" data-expected-height="40">71 <div class="autoMargins firstRowSecondColumn" data-offset-x="290" data-offset-y="130" data-expected-width="20" data-expected-height="40"> 72 72 <div class="widthAndHeightSet"></div> 73 73 </div> … … 75 75 <div class="widthAndHeightSet"></div> 76 76 </div> 77 <div class="autoMarginsTopBottom secondRowSecondColumn" data-offset-x="0" data-offset-y="1 00" data-expected-width="200" data-expected-height="40">77 <div class="autoMarginsTopBottom secondRowSecondColumn" data-offset-x="0" data-offset-y="130" data-expected-width="200" data-expected-height="40"> 78 78 <div class="widthAndHeightSet"></div> 79 79 </div> … … 86 86 <div class="widthAndHeightSet"></div> 87 87 </div> 88 <div class="autoMargins firstRowSecondColumn" data-offset-x="90" data-offset-y="1 00" data-expected-width="20" data-expected-height="40">88 <div class="autoMargins firstRowSecondColumn" data-offset-x="90" data-offset-y="130" data-expected-width="20" data-expected-height="40"> 89 89 <div class="widthAndHeightSet"></div> 90 90 </div> … … 92 92 <div class="widthAndHeightSet"></div> 93 93 </div> 94 <div class="autoMarginsTopBottom secondRowSecondColumn" data-offset-x="200" data-offset-y="1 00" data-expected-width="200" data-expected-height="40">94 <div class="autoMarginsTopBottom secondRowSecondColumn" data-offset-x="200" data-offset-y="130" data-expected-width="200" data-expected-height="40"> 95 95 <div class="widthAndHeightSet"></div> 96 96 </div> … … 104 104 <div class="widthAndHeightSet"></div> 105 105 </div> 106 <div class="autoMargins firstRowSecondColumn" data-offset-x=" 80" data-offset-y="80" data-expected-width="20" data-expected-height="40">106 <div class="autoMargins firstRowSecondColumn" data-offset-x="40" data-offset-y="80" data-expected-width="20" data-expected-height="40"> 107 107 <div class="widthAndHeightSet"></div> 108 108 </div> 109 <div class="autoMarginsRightLeft secondRowFirstColumn" data-offset-x="1 80" data-offset-y="200" data-expected-width="20" data-expected-height="200">109 <div class="autoMarginsRightLeft secondRowFirstColumn" data-offset-x="140" data-offset-y="200" data-expected-width="20" data-expected-height="200"> 110 110 <div class="widthAndHeightSet"></div> 111 111 </div> … … 121 121 <div class="widthAndHeightSet"></div> 122 122 </div> 123 <div class="autoMargins firstRowSecondColumn" data-offset-x="290" data-offset-y=" 60" data-expected-width="20" data-expected-height="40">123 <div class="autoMargins firstRowSecondColumn" data-offset-x="290" data-offset-y="30" data-expected-width="20" data-expected-height="40"> 124 124 <div class="widthAndHeightSet"></div> 125 125 </div> … … 127 127 <div class="widthAndHeightSet"></div> 128 128 </div> 129 <div class="autoMarginsTopBottom secondRowSecondColumn" data-offset-x="0" data-offset-y=" 60" data-expected-width="200" data-expected-height="40">129 <div class="autoMarginsTopBottom secondRowSecondColumn" data-offset-x="0" data-offset-y="30" data-expected-width="200" data-expected-height="40"> 130 130 <div class="widthAndHeightSet"></div> 131 131 </div> … … 138 138 <div class="widthAndHeightSet"></div> 139 139 </div> 140 <div class="autoMargins firstRowSecondColumn" data-offset-x="90" data-offset-y=" 60" data-expected-width="20" data-expected-height="40">140 <div class="autoMargins firstRowSecondColumn" data-offset-x="90" data-offset-y="30" data-expected-width="20" data-expected-height="40"> 141 141 <div class="widthAndHeightSet"></div> 142 142 </div> … … 144 144 <div class="widthAndHeightSet"></div> 145 145 </div> 146 <div class="autoMarginsTopBottom secondRowSecondColumn" data-offset-x="200" data-offset-y=" 60" data-expected-width="200" data-expected-height="40">146 <div class="autoMarginsTopBottom secondRowSecondColumn" data-offset-x="200" data-offset-y="30" data-expected-width="200" data-expected-height="40"> 147 147 <div class="widthAndHeightSet"></div> 148 148 </div> -
trunk/Source/WebCore/ChangeLog
r189168 r189169 1 2015-08-31 Javier Fernandez <jfernandez@igalia.com> 2 3 [CSS Grid Layout] auto-margins alignment does not work for heights 4 https://bugs.webkit.org/show_bug.cgi?id=148071 5 6 Reviewed by Sergio Villar Senin. 7 8 We still had pending to align grid items horizontally via auto-margins 9 alignment. We already landed a patch in r188582 to implement the 10 column-axis alignment and this patch implements the expected behavior in 11 the row-axis. 12 13 This patch also removes the logic in RenderBox, so we reduce grid related 14 code dependencies in the general layout logic. We can do that because this 15 patch manages that in the layoutGridItems function by resetting grid item's 16 margin and logicalTop (if it does not need to perform a layout, which it 17 would do the job anyway). 18 19 No new tests, we just need to adapt some cases of the ones we already have. 20 21 * rendering/RenderBox.cpp: 22 (WebCore::RenderBox::styleDidChange): Deleted. 23 (WebCore::RenderBox::willBeRemovedFromTree): Deleted. 24 (WebCore::RenderBox::updateFromStyle): Deleted. 25 * rendering/RenderGrid.cpp: 26 (WebCore::RenderGrid::layoutGridItems): 27 (WebCore::RenderGrid::resetAutoMarginsAndLogicalTopInColumnAxis): 28 (WebCore::RenderGrid::updateAutoMarginsInRowAxisIfNeeded): 29 (WebCore::RenderGrid::updateAutoMarginsInColumnAxisIfNeeded): 30 (WebCore::RenderGrid::hasAutoMarginsInRowAxis): Deleted. 31 * rendering/RenderGrid.h: 32 1 33 2015-08-31 Alexey Proskuryakov <ap@apple.com> 2 34 -
trunk/Source/WebCore/rendering/RenderBox.cpp
r189144 r189169 434 434 updateShapeOutsideInfoAfterStyleChange(style(), oldStyle); 435 435 #endif 436 437 #if ENABLE(CSS_GRID_LAYOUT)438 updateGridAlignmentAfterStyleChange(oldStyle);439 #endif440 436 } 441 437 … … 474 470 if (shapeOutside || shapeOutside != oldShapeOutside) 475 471 markShapeOutsideDependentsForLayout(); 476 }477 #endif478 479 #if ENABLE(CSS_GRID_LAYOUT)480 void RenderBox::updateGridAlignmentAfterStyleChange(const RenderStyle* oldStyle)481 {482 if (!oldStyle || !parent() || !parent()->isRenderGrid())483 return;484 485 // auto-margin prevents alignment properties to be applied, which affects specially486 // to the stretching logic. We must detect and handling style changes like this.487 bool isHorizontalGrid = parent()->isHorizontalWritingMode();488 Length topOrLeft = isHorizontalGrid ? style().marginTop() : style().marginLeft();489 Length bottomOrRight = isHorizontalGrid ? style().marginBottom() : style().marginRight();490 Length oldTopOrLeft = isHorizontalGrid ? oldStyle->marginTop() : oldStyle->marginLeft();491 Length oldBottomOrRight = isHorizontalGrid ? oldStyle->marginBottom() : oldStyle->marginRight();492 if ((!topOrLeft.isAuto() && oldTopOrLeft.isAuto()) || (!bottomOrRight.isAuto() && oldBottomOrRight.isAuto()))493 updateLogicalHeight();494 472 } 495 473 #endif -
trunk/Source/WebCore/rendering/RenderBox.h
r189144 r189169 665 665 666 666 #if ENABLE(CSS_GRID_LAYOUT) 667 void updateGridAlignmentAfterStyleChange(const RenderStyle*);668 667 bool isGridItem() const { return parent() && parent()->isRenderGrid(); } 669 668 #endif -
trunk/Source/WebCore/rendering/RenderGrid.cpp
r189166 r189169 1167 1167 && child->hasRelativeLogicalHeight())) 1168 1168 child->setNeedsLayout(MarkOnlyThis); 1169 else 1170 resetAutoMarginsAndLogicalTopInColumnAxis(*child); 1169 1171 1170 1172 child->setOverrideContainingBlockContentLogicalWidth(overrideContainingBlockContentLogicalWidth); … … 1181 1183 1182 1184 // We need pending layouts to be done in order to compute auto-margins properly. 1183 updateAutoMarginsInColumnAxisIfNeeded(*child, overrideContainingBlockContentLogicalHeight); 1185 updateAutoMarginsInColumnAxisIfNeeded(*child); 1186 updateAutoMarginsInRowAxisIfNeeded(*child); 1184 1187 1185 1188 child->setLogicalLocation(findChildLogicalPosition(*child)); … … 1341 1344 1342 1345 // FIXME: This logic is shared by RenderFlexibleBox, so it should be moved to RenderBox. 1343 void RenderGrid::updateAutoMarginsInColumnAxisIfNeeded(RenderBox& child, LayoutUnit gridAreaBreadthForChild) 1346 void RenderGrid::resetAutoMarginsAndLogicalTopInColumnAxis(RenderBox& child) 1347 { 1348 if (hasAutoMarginsInColumnAxis(child) || child.needsLayout()) { 1349 child.clearOverrideLogicalContentHeight(); 1350 child.updateLogicalHeight(); 1351 if (isHorizontalWritingMode()) { 1352 if (child.style().marginTop().isAuto()) 1353 child.setMarginTop(0); 1354 if (child.style().marginBottom().isAuto()) 1355 child.setMarginBottom(0); 1356 } else { 1357 if (child.style().marginLeft().isAuto()) 1358 child.setMarginLeft(0); 1359 if (child.style().marginRight().isAuto()) 1360 child.setMarginRight(0); 1361 } 1362 1363 } 1364 } 1365 1366 // FIXME: This logic is shared by RenderFlexibleBox, so it should be moved to RenderBox. 1367 void RenderGrid::updateAutoMarginsInRowAxisIfNeeded(RenderBox& child) 1344 1368 { 1345 1369 ASSERT(!child.isOutOfFlowPositioned()); 1346 1347 LayoutUnit availableAlignmentSpace = gridAreaBreadthForChild - child.logicalHeight(); 1370 ASSERT(child.overrideContainingBlockContentLogicalWidth()); 1371 1372 LayoutUnit availableAlignmentSpace = child.overrideContainingBlockContentLogicalWidth().value() - child.logicalWidth(); 1373 if (availableAlignmentSpace <= 0) 1374 return; 1375 1376 bool isHorizontal = isHorizontalWritingMode(); 1377 Length topOrLeft = isHorizontal ? child.style().marginLeft() : child.style().marginTop(); 1378 Length bottomOrRight = isHorizontal ? child.style().marginRight() : child.style().marginBottom(); 1379 if (topOrLeft.isAuto() && bottomOrRight.isAuto()) { 1380 if (isHorizontal) { 1381 child.setMarginLeft(availableAlignmentSpace / 2); 1382 child.setMarginRight(availableAlignmentSpace / 2); 1383 } else { 1384 child.setMarginTop(availableAlignmentSpace / 2); 1385 child.setMarginBottom(availableAlignmentSpace / 2); 1386 } 1387 } else if (topOrLeft.isAuto()) { 1388 if (isHorizontal) 1389 child.setMarginLeft(availableAlignmentSpace); 1390 else 1391 child.setMarginTop(availableAlignmentSpace); 1392 } else if (bottomOrRight.isAuto()) { 1393 if (isHorizontal) 1394 child.setMarginRight(availableAlignmentSpace); 1395 else 1396 child.setMarginBottom(availableAlignmentSpace); 1397 } 1398 } 1399 1400 // FIXME: This logic is shared by RenderFlexibleBox, so it should be moved to RenderBox. 1401 void RenderGrid::updateAutoMarginsInColumnAxisIfNeeded(RenderBox& child) 1402 { 1403 ASSERT(!child.isOutOfFlowPositioned()); 1404 ASSERT(child.overrideContainingBlockContentLogicalHeight()); 1405 1406 LayoutUnit availableAlignmentSpace = child.overrideContainingBlockContentLogicalHeight().value() - child.logicalHeight(); 1348 1407 if (availableAlignmentSpace <= 0) 1349 1408 return; -
trunk/Source/WebCore/rendering/RenderGrid.h
r189166 r189169 137 137 bool hasAutoMarginsInColumnAxis(const RenderBox&) const; 138 138 bool hasAutoMarginsInRowAxis(const RenderBox&) const; 139 void updateAutoMarginsInColumnAxisIfNeeded(RenderBox&, LayoutUnit gridAreaBreadthForChild); 139 void resetAutoMarginsAndLogicalTopInColumnAxis(RenderBox& child); 140 void updateAutoMarginsInColumnAxisIfNeeded(RenderBox&); 141 void updateAutoMarginsInRowAxisIfNeeded(RenderBox&); 140 142 141 143 #ifndef NDEBUG
Note: See TracChangeset
for help on using the changeset viewer.