LayoutTests/ChangeLog

 12012-12-04 Carlos Garcia Campos <cgarcia@igalia.com>
 2
 3 Flex item auto margins in the cross direction should safe center
 4 https://bugs.webkit.org/show_bug.cgi?id=103919
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 * css3/flexbox/flex-flow-auto-margins-no-available-space-expected.txt: Added.
 9 * css3/flexbox/flex-flow-auto-margins-no-available-space.html: Added.
 10
1112012-12-04 Zan Dobersek <zandobersek@gmail.com>
212
313 Unreviewed GTK gardening.

Source/WebCore/ChangeLog

112012-12-04 Carlos Garcia Campos <cgarcia@igalia.com>
22
 3 Flex item auto margins in the cross direction should safe center
 4 https://bugs.webkit.org/show_bug.cgi?id=103919
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 Do not apply auto margins for cross axis if there's no alignment
 9 space available.
 10
 11 Test: css3/flexbox/flex-flow-auto-margins-no-available-space.html
 12
 13 * rendering/RenderFlexibleBox.cpp:
 14 (WebCore::RenderFlexibleBox::alignChildren): Make sure we pass a
 15 positive value for availableAlignmentSpace to
 16 updateAutoMarginsInCrossAxis().
 17
 182012-12-04 Carlos Garcia Campos <cgarcia@igalia.com>
 19
320 [GTK] Use a private struct and placement new syntax in GObject DOM bindings
421 https://bugs.webkit.org/show_bug.cgi?id=101074
522

LayoutTests/css3/flexbox/flex-flow-auto-margins-no-available-space-expected.txt

 1PASS
 2 PASS
 3 PASS
 4 PASS
 5

LayoutTests/css3/flexbox/flex-flow-auto-margins-no-available-space.html

 1<!DOCTYPE html>
 2<html>
 3<style>
 4body {
 5 margin: 0;
 6}
 7.container {
 8 position: relative;
 9 background-color: pink;
 10 outline: 1px solid black;
 11 display: inline-block;
 12}
 13.flexbox {
 14 display: -webkit-flex;
 15 background-color: grey;
 16 width: 100px;
 17 height: 100px;
 18 margin: 20px;
 19}
 20.flexbox > * {
 21 -webkit-flex: none;
 22}
 23.row {
 24 -webkit-flex-flow: row;
 25}
 26.row-reverse {
 27 -webkit-flex-flow: row-reverse;
 28}
 29.column {
 30 -webkit-flex-flow: column;
 31}
 32.column-reverse {
 33 -webkit-flex-flow: column-reverse;
 34}
 35.flexbox > :nth-child(1) {
 36 background-color: blue;
 37 margin: auto;
 38}
 39</style>
 40<script src="../../resources/check-layout.js"></script>
 41<body onload="checkLayout('.flexbox')">
 42
 43<div class="container">
 44 <div class="flexbox row">
 45 <div data-offset-x=60 data-offset-y=20 style="width: 20px; height: 120px"></div>
 46 </div>
 47</div>
 48
 49<div class="container">
 50 <div class="flexbox row-reverse">
 51 <div data-offset-x=60 data-offset-y=20 style="width: 20px; height: 120px"></div>
 52 </div>
 53</div>
 54
 55<div class="container">
 56 <div class="flexbox column">
 57 <div data-offset-x=20 data-offset-y=60 style="width: 120px; height: 20px"></div>
 58 </div>
 59</div>
 60
 61<div class="container">
 62 <div class="flexbox column-reverse">
 63 <div data-offset-x=20 data-offset-y=60 style="width: 120px; height: 20px"></div>
 64 </div>
 65</div>
 66</body>
 67</html>

Source/WebCore/rendering/RenderFlexibleBox.cpp

@@void RenderFlexibleBox::alignChildren(OrderIterator& iterator, const WTF::Vector
12731273 continue;
12741274 }
12751275
1276  if (updateAutoMarginsInCrossAxis(child, availableAlignmentSpaceForChild(lineCrossAxisExtent, child)))
 1276 if (updateAutoMarginsInCrossAxis(child, std::max(LayoutUnit(0), availableAlignmentSpaceForChild(lineCrossAxisExtent, child))))
12771277 continue;
12781278
12791279 switch (alignmentForChild(child)) {