Changeset 183805 in webkit


Ignore:
Timestamp:
May 5, 2015 8:15:38 AM (9 years ago)
Author:
jfernandez@igalia.com
Message:

[CSS Box Alignment] Upgrade align-content parsing to CSS3 Box Alignment spec
https://bugs.webkit.org/show_bug.cgi?id=144443

Reviewed by Darin Adler.

Source/WebCore:

Upgrade the align-content property to the last CSS3 Box
Alignment specification. As it uses a different enumeration for
Positional and Distribution alignment, it implies some changes in
the FlexibleBox implementation.

Test: css3/parse-align-content.html

  • css/CSSComputedStyleDeclaration.cpp:

(WebCore::resolveContentAlignmentAuto):
(WebCore::ComputedStyleExtractor::propertyValue):

  • css/CSSParser.cpp:

(WebCore::isValidKeywordPropertyAndValue):
(WebCore::isKeywordPropertyID):
(WebCore::CSSParser::parseValue):

  • css/CSSPropertyNames.in:
  • rendering/RenderFlexibleBox.cpp:

(WebCore::RenderFlexibleBox::layoutAndPlaceChildren):
(WebCore::RenderFlexibleBox::layoutColumnReverse):
(WebCore::initialAlignContentOffset):
(WebCore::alignContentSpaceBetweenChildren):
(WebCore::RenderFlexibleBox::alignFlexLines):

  • rendering/style/RenderStyle.cpp:

(WebCore::RenderStyle::resolveContentAlignment):
(WebCore::RenderStyle::resolveContentJustification):

  • rendering/style/RenderStyle.h:
  • rendering/style/StyleRareNonInheritedData.cpp:

(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator==):

  • rendering/style/StyleRareNonInheritedData.h:

LayoutTests:

Tests to verify the align-content parsing logic. The new Box Alignment spec
requires some changes in the flexbox tests.

  • css3/flexbox/css-properties-expected.txt:
  • css3/flexbox/css-properties.html:
  • css3/parse-align-content-expected.txt: Added.
  • css3/parse-align-content.html: Added.
Location:
trunk
Files:
2 added
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r183803 r183805  
     12015-05-05  Javier Fernandez  <jfernandez@igalia.com>
     2
     3        [CSS Box Alignment] Upgrade align-content parsing to CSS3 Box Alignment spec
     4        https://bugs.webkit.org/show_bug.cgi?id=144443
     5
     6        Reviewed by Darin Adler.
     7
     8        Tests to verify the align-content parsing logic. The new Box Alignment spec
     9        requires some changes in the flexbox tests.
     10
     11        * css3/flexbox/css-properties-expected.txt:
     12        * css3/flexbox/css-properties.html:
     13        * css3/parse-align-content-expected.txt: Added.
     14        * css3/parse-align-content.html: Added.
     15
    1162015-05-05  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
    217
  • trunk/LayoutTests/css3/flexbox/css-properties-expected.txt

    r182147 r183805  
    1717PASS flexitem.style.webkitOrder is ""
    1818PASS flexbox.style.webkitJustifyContent is ""
    19 PASS window.getComputedStyle(flexbox, null).webkitJustifyContent is "flex-start"
     19PASS window.getComputedStyle(flexbox, null).webkitJustifyContent is "stretch"
    2020PASS flexbox.style.webkitJustifyContent is ""
    2121PASS flexbox.style.webkitJustifyContent is "flex-start"
     
    2828PASS window.getComputedStyle(flexbox, null).webkitJustifyContent is "space-between"
    2929PASS flexbox.style.webkitJustifyContent is ""
    30 PASS window.getComputedStyle(flexbox, null).webkitJustifyContent is "flex-start"
     30PASS window.getComputedStyle(flexbox, null).webkitJustifyContent is "stretch"
    3131PASS flexbox.style.webkitAlignSelf is ""
    3232PASS window.getComputedStyle(flexbox, null).webkitAlignSelf is "start"
  • trunk/LayoutTests/css3/flexbox/css-properties.html

    r183748 r183805  
    5555
    5656shouldBeEqualToString('flexbox.style.webkitJustifyContent', '');
    57 // The initial value is 'flex-start'.
    58 shouldBeEqualToString('window.getComputedStyle(flexbox, null).webkitJustifyContent', 'flex-start');
     57// The initial value is 'auto' which, will be resolve to 'stretch' for flexbox containes (behaving like 'flex-start' for the justify-content property).
     58shouldBeEqualToString('window.getComputedStyle(flexbox, null).webkitJustifyContent', 'stretch');
    5959
    6060flexbox.style.webkitJustifyContent = 'foo';
     
    7979flexbox.style.webkitJustifyContent = '';
    8080shouldBeEqualToString('flexbox.style.webkitJustifyContent', '');
    81 shouldBeEqualToString('window.getComputedStyle(flexbox, null).webkitJustifyContent', 'flex-start');
     81shouldBeEqualToString('window.getComputedStyle(flexbox, null).webkitJustifyContent', 'stretch');
    8282
    8383shouldBeEqualToString('flexbox.style.webkitAlignSelf', '');
     
    278278shouldBeFalse('foundFlexFlow');
    279279
     280flexbox.style.display = '-webkit-flex';
     281
    280282// The initial value is 'stretch'.
    281283shouldBeEqualToString('flexbox.style.webkitAlignContent', '');
  • trunk/LayoutTests/css3/parse-justify-content-expected.txt

    r183748 r183805  
    5656PASS window.getComputedStyle(element, '').getPropertyValue('justify-content') is "start"
    5757PASS element.style.justifyContent is "auto"
    58 PASS window.getComputedStyle(element, '').getPropertyValue('justify-content') is "flex-start"
     58PASS window.getComputedStyle(element, '').getPropertyValue('justify-content') is "stretch"
    5959PASS element.style.justifyContent is "auto"
    6060PASS window.getComputedStyle(element, '').getPropertyValue('justify-content') is "start"
     
    122122PASS window.getComputedStyle(element, '').getPropertyValue('justify-content') is "right true"
    123123PASS element.style.justifyContent is "initial"
    124 PASS window.getComputedStyle(element, '').getPropertyValue('justify-content') is "flex-start"
     124PASS window.getComputedStyle(element, '').getPropertyValue('justify-content') is "stretch"
    125125
    126126Test the value 'inherit'
  • trunk/LayoutTests/css3/parse-justify-content.html

    r183748 r183805  
    295295element.style.display = "-webkit-flex";
    296296element.style.justifyContent = "auto";
    297 checkValues(element, "justifyContent", "justify-content",  "auto", "flex-start");
     297checkValues(element, "justifyContent", "justify-content",  "auto", "stretch");
    298298
    299299element.style.display = "-webkit-grid";
     
    344344debug("Test the value 'initial' for flex containers");
    345345element.style.display = "-webkit-flex";
    346 checkInitialValues(element, "justifyContent", "justify-content", "right true", "flex-start");
     346checkInitialValues(element, "justifyContent", "justify-content", "right true", "stretch");
    347347
    348348debug("");
  • trunk/LayoutTests/fast/css/getComputedStyle/computed-style-expected.txt

    r183748 r183805  
    147147column-span: none;
    148148column-width: auto;
    149 align-content: stretch;
     149align-content: start;
    150150align-items: start;
    151151align-self: start;
  • trunk/LayoutTests/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt

    r183748 r183805  
    146146column-span: none
    147147column-width: auto
    148 align-content: stretch
     148align-content: auto
    149149align-items: auto
    150150align-self: auto
  • trunk/LayoutTests/svg/css/getComputedStyle-basic-expected.txt

    r183748 r183805  
    291291rect: style.getPropertyValue(column-width) : auto
    292292rect: style.getPropertyCSSValue(column-width) : [object CSSPrimitiveValue]
    293 rect: style.getPropertyValue(align-content) : stretch
    294 rect: style.getPropertyCSSValue(align-content) : [object CSSPrimitiveValue]
     293rect: style.getPropertyValue(align-content) : start
     294rect: style.getPropertyCSSValue(align-content) : [object CSSValueList]
    295295rect: style.getPropertyValue(align-items) : start
    296296rect: style.getPropertyCSSValue(align-items) : [object CSSValueList]
     
    809809g: style.getPropertyValue(column-width) : auto
    810810g: style.getPropertyCSSValue(column-width) : [object CSSPrimitiveValue]
    811 g: style.getPropertyValue(align-content) : stretch
    812 g: style.getPropertyCSSValue(align-content) : [object CSSPrimitiveValue]
     811g: style.getPropertyValue(align-content) : start
     812g: style.getPropertyCSSValue(align-content) : [object CSSValueList]
    813813g: style.getPropertyValue(align-items) : start
    814814g: style.getPropertyCSSValue(align-items) : [object CSSValueList]
  • trunk/Source/WebCore/ChangeLog

    r183803 r183805  
     12015-05-05  Javier Fernandez  <jfernandez@igalia.com>
     2
     3        [CSS Box Alignment] Upgrade align-content parsing to CSS3 Box Alignment spec
     4        https://bugs.webkit.org/show_bug.cgi?id=144443
     5
     6        Reviewed by Darin Adler.
     7
     8        Upgrade the align-content property to the last CSS3 Box
     9        Alignment specification. As it uses a different enumeration for
     10        Positional and Distribution alignment, it implies some changes in
     11        the FlexibleBox implementation.
     12
     13        Test: css3/parse-align-content.html
     14
     15        * css/CSSComputedStyleDeclaration.cpp:
     16        (WebCore::resolveContentAlignmentAuto):
     17        (WebCore::ComputedStyleExtractor::propertyValue):
     18        * css/CSSParser.cpp:
     19        (WebCore::isValidKeywordPropertyAndValue):
     20        (WebCore::isKeywordPropertyID):
     21        (WebCore::CSSParser::parseValue):
     22        * css/CSSPropertyNames.in:
     23        * rendering/RenderFlexibleBox.cpp:
     24        (WebCore::RenderFlexibleBox::layoutAndPlaceChildren):
     25        (WebCore::RenderFlexibleBox::layoutColumnReverse):
     26        (WebCore::initialAlignContentOffset):
     27        (WebCore::alignContentSpaceBetweenChildren):
     28        (WebCore::RenderFlexibleBox::alignFlexLines):
     29        * rendering/style/RenderStyle.cpp:
     30        (WebCore::RenderStyle::resolveContentAlignment):
     31        (WebCore::RenderStyle::resolveContentJustification):
     32        * rendering/style/RenderStyle.h:
     33        * rendering/style/StyleRareNonInheritedData.cpp:
     34        (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
     35        (WebCore::StyleRareNonInheritedData::operator==):
     36        * rendering/style/StyleRareNonInheritedData.h:
     37
    1382015-05-05  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
    239
  • trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp

    r183748 r183805  
    17341734}
    17351735
    1736 static ContentPosition resolveContentAlignmentAuto(ContentPosition position, ContentDistributionType distribution, RenderObject* element)
     1736static void resolveContentAlignmentAuto(ContentPosition& position, ContentDistributionType& distribution, RenderObject* element)
    17371737{
    17381738    if (position != ContentPositionAuto || distribution != ContentDistributionDefault || !element)
    1739         return position;
    1740 
    1741     return element->style().isDisplayFlexibleBox() ? ContentPositionFlexStart : ContentPositionStart;
     1739        return;
     1740
     1741    // Even that both align-content and justify-content 'auto' values are resolved to 'stretch'
     1742    // in case of flexbox containers, 'stretch' value in justify-content will behave like 'flex-start'.
     1743    if (element->style().isDisplayFlexibleBox())
     1744        distribution = ContentDistributionStretch;
     1745    else
     1746        position = ContentPositionStart;
    17421747}
    17431748
     
    22082213        case CSSPropertyEmptyCells:
    22092214            return cssValuePool().createValue(style->emptyCells());
    2210         case CSSPropertyAlignContent:
    2211             return cssValuePool().createValue(style->alignContent());
     2215        case CSSPropertyAlignContent: {
     2216            ContentPosition position = style->alignContentPosition();
     2217            ContentDistributionType distribution = style->alignContentDistribution();
     2218            resolveContentAlignmentAuto(position, distribution, renderer);
     2219            return valueForContentPositionAndDistributionWithOverflowAlignment(position, distribution, style->alignContentOverflowAlignment());
     2220        }
    22122221        case CSSPropertyAlignItems:
    22132222            return valueForItemPositionWithOverflowAlignment(resolveContainerAlignmentAuto(style->alignItemsPosition(), renderer), style->alignItemsOverflowAlignment(), NonLegacyPosition);
     
    22312240        case CSSPropertyFlexWrap:
    22322241            return cssValuePool().createValue(style->flexWrap());
    2233         case CSSPropertyJustifyContent:
    2234             return valueForContentPositionAndDistributionWithOverflowAlignment(resolveContentAlignmentAuto(style->justifyContentPosition(), style->justifyContentDistribution(), renderer), style->justifyContentDistribution(), style->justifyContentOverflowAlignment());
     2242        case CSSPropertyJustifyContent: {
     2243            ContentPosition position = style->justifyContentPosition();
     2244            ContentDistributionType distribution = style->justifyContentDistribution();
     2245            resolveContentAlignmentAuto(position, distribution, renderer);
     2246            return valueForContentPositionAndDistributionWithOverflowAlignment(position, distribution, style->justifyContentOverflowAlignment());
     2247        }
    22352248        case CSSPropertyJustifyItems:
    22362249            return valueForItemPositionWithOverflowAlignment(resolveContainerAlignmentAuto(style->justifyItemsPosition(), renderer), style->justifyItemsOverflowAlignment(), style->justifyItemsPositionType());
  • trunk/Source/WebCore/css/CSSParser.cpp

    r183765 r183805  
    881881            return true;
    882882        break;
    883     case CSSPropertyAlignContent:
    884         // FIXME: Per CSS alignment, this property should accept an optional <overflow-position>. We should share this parsing code with 'justify-self'.
    885         if (valueID == CSSValueFlexStart || valueID == CSSValueFlexEnd || valueID == CSSValueCenter || valueID == CSSValueSpaceBetween || valueID == CSSValueSpaceAround || valueID == CSSValueStretch)
    886             return true;
    887         break;
    888883    case CSSPropertyFlexDirection:
    889884        if (valueID == CSSValueRow || valueID == CSSValueRowReverse || valueID == CSSValueColumn || valueID == CSSValueColumnReverse)
     
    11221117    case CSSPropertyColumnFill:
    11231118    case CSSPropertyColumnRuleStyle:
    1124     case CSSPropertyAlignContent:
    11251119    case CSSPropertyFlexDirection:
    11261120    case CSSPropertyFlexWrap:
     
    30443038        break;
    30453039#endif
     3040    case CSSPropertyAlignContent:
     3041        parsedValue = parseContentDistributionOverflowPosition();
     3042        break;
    30463043    case CSSPropertyAlignSelf:
    30473044        return parseItemPositionOverflowPosition(propId, important);
     
    31093106    case CSSPropertyColumnFill:
    31103107    case CSSPropertyColumnRuleStyle:
    3111     case CSSPropertyAlignContent:
    31123108    case CSSPropertyFlexDirection:
    31133109    case CSSPropertyFlexWrap:
  • trunk/Source/WebCore/css/CSSPropertyNames.in

    r183748 r183805  
    454454#endif
    455455-webkit-filter [ConditionalConverter=FilterOperations]
    456 align-content
     456align-content [Initial=initialContentAlignment, Converter=ContentAlignmentData]
    457457-webkit-align-content = align-content
    458458align-items [Initial=initialSelfAlignment, Converter=SelfOrDefaultAlignmentData]
  • trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp

    r183748 r183805  
    10581058    ASSERT(childSizes.size() == children.size());
    10591059
     1060    ContentPosition position = style().justifyContentPosition();
     1061    ContentDistributionType distribution = style().justifyContentDistribution();
     1062    RenderStyle::resolveContentJustification(style(), position);
     1063
    10601064    size_t numberOfChildrenForJustifyContent = numberOfInFlowPositionedChildren(children);
    10611065    LayoutUnit autoMarginOffset = autoMarginOffsetInMainAxis(children, availableFreeSpace);
    10621066    LayoutUnit mainAxisOffset = flowAwareBorderStart() + flowAwarePaddingStart();
    1063     mainAxisOffset += initialJustifyContentOffset(availableFreeSpace, style().justifyContentPosition(), style().justifyContentDistribution(), numberOfChildrenForJustifyContent);
     1067    mainAxisOffset += initialJustifyContentOffset(availableFreeSpace, position, distribution, numberOfChildrenForJustifyContent);
    10641068    if (style().flexDirection() == FlowRowReverse)
    10651069        mainAxisOffset += isHorizontalFlow() ? verticalScrollbarWidth() : horizontalScrollbarHeight();
     
    11181122        ++seenInFlowPositionedChildren;
    11191123        if (seenInFlowPositionedChildren < numberOfChildrenForJustifyContent)
    1120             mainAxisOffset += justifyContentSpaceBetweenChildren(availableFreeSpace, style().justifyContentDistribution(), numberOfChildrenForJustifyContent);
     1124            mainAxisOffset += justifyContentSpaceBetweenChildren(availableFreeSpace, distribution, numberOfChildrenForJustifyContent);
    11211125    }
    11221126
     
    11391143void RenderFlexibleBox::layoutColumnReverse(const OrderedFlexItemList& children, LayoutUnit crossAxisOffset, LayoutUnit availableFreeSpace)
    11401144{
     1145    ContentPosition position = style().justifyContentPosition();
     1146    ContentDistributionType distribution = style().justifyContentDistribution();
     1147    RenderStyle::resolveContentJustification(style(), position);
     1148
    11411149    // This is similar to the logic in layoutAndPlaceChildren, except we place the children
    11421150    // starting from the end of the flexbox. We also don't need to layout anything since we're
     
    11441152    size_t numberOfChildrenForJustifyContent = numberOfInFlowPositionedChildren(children);
    11451153    LayoutUnit mainAxisOffset = logicalHeight() - flowAwareBorderEnd() - flowAwarePaddingEnd();
    1146     mainAxisOffset -= initialJustifyContentOffset(availableFreeSpace, style().justifyContentPosition(), style().justifyContentDistribution(), numberOfChildrenForJustifyContent);
     1154    mainAxisOffset -= initialJustifyContentOffset(availableFreeSpace, position, distribution, numberOfChildrenForJustifyContent);
    11471155    mainAxisOffset -= isHorizontalFlow() ? verticalScrollbarWidth() : horizontalScrollbarHeight();
    11481156
     
    11621170        ++seenInFlowPositionedChildren;
    11631171        if (seenInFlowPositionedChildren < numberOfChildrenForJustifyContent)
    1164             mainAxisOffset -= justifyContentSpaceBetweenChildren(availableFreeSpace, style().justifyContentDistribution(), numberOfChildrenForJustifyContent);
    1165     }
    1166 }
    1167 
    1168 static LayoutUnit initialAlignContentOffset(LayoutUnit availableFreeSpace, EAlignContent alignContent, unsigned numberOfLines)
    1169 {
    1170     if (alignContent == AlignContentFlexEnd)
     1172            mainAxisOffset -= justifyContentSpaceBetweenChildren(availableFreeSpace, distribution, numberOfChildrenForJustifyContent);
     1173    }
     1174}
     1175
     1176static LayoutUnit initialAlignContentOffset(LayoutUnit availableFreeSpace, ContentPosition alignContent, ContentDistributionType alignContentDistribution, unsigned numberOfLines)
     1177{
     1178    if (alignContent == ContentPositionFlexEnd)
    11711179        return availableFreeSpace;
    1172     if (alignContent == AlignContentCenter)
     1180    if (alignContent == ContentPositionCenter)
    11731181        return availableFreeSpace / 2;
    1174     if (alignContent == AlignContentSpaceAround) {
     1182    if (alignContentDistribution == ContentDistributionSpaceAround) {
    11751183        if (availableFreeSpace > 0 && numberOfLines)
    11761184            return availableFreeSpace / (2 * numberOfLines);
     
    11811189}
    11821190
    1183 static LayoutUnit alignContentSpaceBetweenChildren(LayoutUnit availableFreeSpace, EAlignContent alignContent, unsigned numberOfLines)
     1191static LayoutUnit alignContentSpaceBetweenChildren(LayoutUnit availableFreeSpace, ContentDistributionType alignContentDistribution, unsigned numberOfLines)
    11841192{
    11851193    if (availableFreeSpace > 0 && numberOfLines > 1) {
    1186         if (alignContent == AlignContentSpaceBetween)
     1194        if (alignContentDistribution == ContentDistributionSpaceBetween)
    11871195            return availableFreeSpace / (numberOfLines - 1);
    1188         if (alignContent == AlignContentSpaceAround || alignContent == AlignContentStretch)
     1196        if (alignContentDistribution == ContentDistributionSpaceAround || alignContentDistribution == ContentDistributionStretch)
    11891197            return availableFreeSpace / numberOfLines;
    11901198    }
     
    11941202void RenderFlexibleBox::alignFlexLines(Vector<LineContext>& lineContexts)
    11951203{
    1196     if (!isMultiline() || style().alignContent() == AlignContentFlexStart)
     1204    ContentPosition position = style().alignContentPosition();
     1205    ContentDistributionType distribution = style().alignContentDistribution();
     1206    RenderStyle::resolveContentAlignment(style(), position, distribution);
     1207
     1208    if (!isMultiline() || position == ContentPositionFlexStart)
    11971209        return;
    11981210
     
    12021214
    12031215    RenderBox* child = m_orderIterator.first();
    1204     LayoutUnit lineOffset = initialAlignContentOffset(availableCrossAxisSpace, style().alignContent(), lineContexts.size());
     1216    LayoutUnit lineOffset = initialAlignContentOffset(availableCrossAxisSpace, position, distribution, lineContexts.size());
    12051217    for (unsigned lineNumber = 0; lineNumber < lineContexts.size(); ++lineNumber) {
    12061218        lineContexts[lineNumber].crossAxisOffset += lineOffset;
     
    12081220            adjustAlignmentForChild(*child, lineOffset);
    12091221
    1210         if (style().alignContent() == AlignContentStretch && availableCrossAxisSpace > 0)
     1222        if (distribution == ContentDistributionStretch && availableCrossAxisSpace > 0)
    12111223            lineContexts[lineNumber].crossAxisExtent += availableCrossAxisSpace / static_cast<unsigned>(lineContexts.size());
    12121224
    1213         lineOffset += alignContentSpaceBetweenChildren(availableCrossAxisSpace, style().alignContent(), lineContexts.size());
     1225        lineOffset += alignContentSpaceBetweenChildren(availableCrossAxisSpace, distribution, lineContexts.size());
    12141226    }
    12151227}
  • trunk/Source/WebCore/rendering/style/RenderStyle.cpp

    r183660 r183805  
    209209}
    210210
     211void RenderStyle::resolveContentAlignment(const RenderStyle& style, ContentPosition& position, ContentDistributionType& distribution)
     212{
     213    if (position != ContentPositionAuto || distribution != ContentDistributionDefault)
     214        return;
     215
     216    if (style.isDisplayFlexibleBox())
     217        distribution = ContentDistributionStretch;
     218    else
     219        position = ContentPositionStart;
     220}
     221
     222void RenderStyle::resolveContentJustification(const RenderStyle& style, ContentPosition& position)
     223{
     224    if (position != ContentPositionAuto || style.justifyContentDistribution() != ContentDistributionDefault)
     225        return;
     226
     227    if (style.isDisplayFlexibleBox())
     228        position = ContentPositionFlexStart;
     229    else
     230        position = ContentPositionStart;
     231}
     232
    211233void RenderStyle::inheritFrom(const RenderStyle* inheritParent, IsAtShadowBoundary isAtShadowBoundary)
    212234{
  • trunk/Source/WebCore/rendering/style/RenderStyle.h

    r183748 r183805  
    492492    static Ref<RenderStyle> createStyleInheritingFromPseudoStyle(const RenderStyle& pseudoStyle);
    493493
     494    static void resolveContentAlignment(const RenderStyle&, ContentPosition&, ContentDistributionType&);
     495    static void resolveContentJustification(const RenderStyle&, ContentPosition&);
    494496    static ItemPosition resolveAlignment(const RenderStyle& parentStyle, const RenderStyle& childStyle, ItemPosition resolvedAutoPositionForRenderer);
    495497    static OverflowAlignment resolveAlignmentOverflow(const RenderStyle& parentStyle, const RenderStyle& childStyle);
     
    912914    float flexShrink() const { return rareNonInheritedData->m_flexibleBox->m_flexShrink; }
    913915    const Length& flexBasis() const { return rareNonInheritedData->m_flexibleBox->m_flexBasis; }
    914     EAlignContent alignContent() const { return static_cast<EAlignContent>(rareNonInheritedData->m_alignContent); }
     916    const StyleContentAlignmentData& alignContent() const { return rareNonInheritedData->m_alignContent; }
     917    ContentPosition alignContentPosition() const { return rareNonInheritedData->m_alignContent.position(); }
     918    ContentDistributionType alignContentDistribution() const { return rareNonInheritedData->m_alignContent.distribution(); }
     919    OverflowAlignment alignContentOverflowAlignment() const { return rareNonInheritedData->m_alignContent.overflow(); }
    915920    const StyleSelfAlignmentData& alignItems() const { return rareNonInheritedData->m_alignItems; }
    916921    ItemPosition alignItemsPosition() const { return rareNonInheritedData->m_alignItems.position(); }
     
    15051510    void setFlexBasis(Length length) { SET_VAR(rareNonInheritedData.access()->m_flexibleBox, m_flexBasis, WTF::move(length)); }
    15061511    void setOrder(int o) { SET_VAR(rareNonInheritedData, m_order, o); }
    1507     void setAlignContent(EAlignContent p) { SET_VAR(rareNonInheritedData, m_alignContent, p); }
     1512    void setAlignContent(const StyleContentAlignmentData& data) { SET_VAR(rareNonInheritedData, m_alignContent, data); }
     1513    void setAlignContentPosition(ContentPosition position) { rareNonInheritedData.access()->m_alignContent.setPosition(position); }
     1514    void setAlignContentOverflow(OverflowAlignment overflow) { rareNonInheritedData.access()->m_alignContent.setOverflow(overflow); }
     1515    void setAlignContentDistribution(ContentDistributionType distribution) { rareNonInheritedData.access()->m_alignContent.setDistribution(distribution); }
    15081516    void setAlignItems(const StyleSelfAlignmentData& data) { SET_VAR(rareNonInheritedData, m_alignItems, data); }
    15091517    void setAlignItemsPosition(ItemPosition position) { rareNonInheritedData.access()->m_alignItems.setPosition(position); }
     
    19341942    static Length initialFlexBasis() { return Length(Auto); }
    19351943    static int initialOrder() { return 0; }
    1936     static EAlignContent initialAlignContent() { return AlignContentStretch; }
    19371944    static StyleSelfAlignmentData initialSelfAlignment() { return StyleSelfAlignmentData(ItemPositionAuto, OverflowAlignmentDefault); }
    19381945    static StyleContentAlignmentData initialContentAlignment() { return StyleContentAlignmentData(ContentPositionAuto, ContentDistributionDefault, OverflowAlignmentDefault); }
  • trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp

    r183748 r183805  
    7272    , m_flowThread(RenderStyle::initialFlowThread())
    7373    , m_regionThread(RenderStyle::initialRegionThread())
     74    , m_alignContent(RenderStyle::initialContentAlignment())
    7475    , m_alignItems(RenderStyle::initialSelfAlignment())
    7576    , m_alignSelf(RenderStyle::initialSelfAlignment())
     
    8788    , m_transformStyle3D(RenderStyle::initialTransformStyle3D())
    8889    , m_backfaceVisibility(RenderStyle::initialBackfaceVisibility())
    89     , m_alignContent(RenderStyle::initialAlignContent())
    9090    , userDrag(RenderStyle::initialUserDrag())
    9191    , textOverflow(RenderStyle::initialTextOverflow())
     
    160160    , m_flowThread(o.m_flowThread)
    161161    , m_regionThread(o.m_regionThread)
     162    , m_alignContent(o.m_alignContent)
    162163    , m_alignItems(o.m_alignItems)
    163164    , m_alignSelf(o.m_alignSelf)
     
    175176    , m_transformStyle3D(o.m_transformStyle3D)
    176177    , m_backfaceVisibility(o.m_backfaceVisibility)
    177     , m_alignContent(o.m_alignContent)
    178178    , userDrag(o.userDrag)
    179179    , textOverflow(o.textOverflow)
     
    257257        && m_order == o.m_order
    258258        && m_flowThread == o.m_flowThread
     259        && m_alignContent == o.m_alignContent
    259260        && m_alignItems == o.m_alignItems
    260261        && m_alignSelf == o.m_alignSelf
     
    270271        && m_transformStyle3D == o.m_transformStyle3D
    271272        && m_backfaceVisibility == o.m_backfaceVisibility
    272         && m_alignContent == o.m_alignContent
    273273        && userDrag == o.userDrag
    274274        && textOverflow == o.textOverflow
  • trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h

    r183748 r183805  
    178178    AtomicString m_regionThread;
    179179
     180    StyleContentAlignmentData m_alignContent;
    180181    StyleSelfAlignmentData m_alignItems;
    181182    StyleSelfAlignmentData m_alignSelf;
     
    198199    unsigned m_backfaceVisibility : 1; // EBackfaceVisibility
    199200
    200     unsigned m_alignContent : 3; // EAlignContent
    201201
    202202    unsigned userDrag : 2; // EUserDrag
Note: See TracChangeset for help on using the changeset viewer.