Changeset 201498 in webkit


Ignore:
Timestamp:
May 30, 2016 1:14:31 AM (8 years ago)
Author:
jfernandez@igalia.com
Message:

[CSS Box Alignment] New CSS Value 'normal' for Self Alignment
https://bugs.webkit.org/show_bug.cgi?id=156254

Reviewed by Darin Adler.

Source/WebCore:

The Box Alignment specification defines a new value 'normal' to be used
as default for the different layout models, which will define the
specific behavior for each case. This patch adds a new CSS value in the
parsing logic and adapts the Self Alignment properties to the new
value.

The 'auto' value is no longer valid for the 'align-items' property and
the Computed Value will be always the specified value. Hence, I removed
the StyleResolver logic because is not required now; the specific
behavior of the 'normal' value will be resolved at layout time.

Additionally, this patch updates the layout logic as well, for both
Flexbox and Grid layout models.

Test: css3/parse-alignment-of-root-elements.html

  • css/CSSComputedStyleDeclaration.cpp:

(WebCore::resolveLegacyJustifyItems): Added.
(WebCore::resolveJustifyItemsAuto): Added.
(WebCore::resolveJustifySelfAuto): Added.
(WebCore::resolveAlignSelfAuto): Added.
(WebCore::valueForItemPositionWithOverflowAlignment): Using a StyleSelfAlignmentData argument.
(WebCore::ComputedStyleExtractor::propertyValue): Using the new resolving functions.

  • css/CSSParser.cpp:

(WebCore::CSSParser::parseItemPositionOverflowPosition): A new value 'normal' is now valid.

  • css/CSSPrimitiveValueMappings.h:

(WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Mappings for the new value 'normal'.
(WebCore::CSSPrimitiveValue::operator ItemPosition): Mappings for the new value 'normal'.

  • css/CSSPropertyNames.in:
  • css/StyleResolver.cpp:

(WebCore::StyleResolver::adjustRenderStyle): We don't need to resolve 'legacy" keyword.

  • rendering/RenderBox.cpp:

(WebCore::flexItemHasStretchAlignment):
(WebCore::RenderBox::hasStretchedLogicalWidth):

  • rendering/RenderFlexibleBox.cpp:

(WebCore::RenderFlexibleBox::styleDidChange):
(WebCore::RenderFlexibleBox::alignmentForChild):
(WebCore::contentAlignmentNormalBehaviorFlexibleBox):
(WebCore::RenderFlexibleBox::layoutAndPlaceChildren):
(WebCore::RenderFlexibleBox::layoutColumnReverse):
(WebCore::RenderFlexibleBox::alignFlexLines):
(WebCore::RenderFlexibleBox::alignChildren):

  • rendering/RenderGrid.cpp:

(WebCore::defaultAlignmentChangedToStretchInRowAxis):
(WebCore::defaultAlignmentChangedFromStretchInRowAxis):
(WebCore::defaultAlignmentChangedFromStretchInColumnAxis):
(WebCore::selfAlignmentChangedToStretchInRowAxis):
(WebCore::selfAlignmentChangedFromStretchInRowAxis):
(WebCore::selfAlignmentChangedFromStretchInColumnAxis):
(WebCore::contentAlignmentNormalBehaviorGrid):
(WebCore::RenderGrid::applyStretchAlignmentToTracksIfNeeded):
(WebCore::RenderGrid::needToStretchChildLogicalHeight):
(WebCore::RenderGrid::applyStretchAlignmentToChildIfNeeded):
(WebCore::RenderGrid::columnAxisPositionForChild):
(WebCore::RenderGrid::rowAxisPositionForChild):
(WebCore::RenderGrid::columnAxisOffsetForChild):
(WebCore::RenderGrid::rowAxisOffsetForChild):
(WebCore::RenderGrid::computeContentPositionAndDistributionOffset):

  • rendering/style/RenderStyle.cpp:

(WebCore::resolvedSelfAlignment):
(WebCore::RenderStyle::resolvedAlignItems):
(WebCore::RenderStyle::resolvedAlignSelf):
(WebCore::RenderStyle::resolvedJustifyItems):
(WebCore::RenderStyle::resolvedJustifySelf):

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

(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): align-items uses now a different initial function.

LayoutTests:

Changes in the already defined tests for the alignment properties to
consider the new CSS value 'normal', which is the default for align-items
and the value to resolve 'auto' when there is no parent.

Added a new test to verify the Self-Alignment properties work as expected
with root elements.

  • css3/flexbox/css-properties-expected.txt:
  • css3/flexbox/css-properties.html:
  • css3/parse-align-items-expected.txt:
  • css3/parse-align-items.html:
  • css3/parse-align-self-expected.txt:
  • css3/parse-align-self.html:
  • css3/parse-alignment-of-root-elements-expected.txt: Added.
  • css3/parse-alignment-of-root-elements.html: Added.
  • fast/css/getComputedStyle/computed-style-expected.txt:
  • fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:
  • fast/css/parse-justify-items-expected.txt:
  • fast/css/parse-justify-items.html:
  • fast/css/parse-justify-self-expected.txt:
  • fast/css/parse-justify-self.html:
  • fast/css/resources/alignment-parsing-utils.js:
  • svg/css/getComputedStyle-basic-expected.txt:

(checkBadValues):

  • svg/css/getComputedStyle-basic-expected.txt:
Location:
trunk
Files:
2 added
28 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r201488 r201498  
     12016-05-30  Javier Fernandez  <jfernandez@igalia.com>
     2
     3        [CSS Box Alignment] New CSS Value 'normal' for Self Alignment
     4        https://bugs.webkit.org/show_bug.cgi?id=156254
     5
     6        Reviewed by Darin Adler.
     7
     8        Changes in the already defined tests for the alignment properties to
     9        consider the new CSS value 'normal', which is the default for align-items
     10        and the value to resolve 'auto' when there is no parent.
     11
     12        Added a new test to verify the Self-Alignment properties work as expected
     13        with root elements.
     14
     15        * css3/flexbox/css-properties-expected.txt:
     16        * css3/flexbox/css-properties.html:
     17        * css3/parse-align-items-expected.txt:
     18        * css3/parse-align-items.html:
     19        * css3/parse-align-self-expected.txt:
     20        * css3/parse-align-self.html:
     21        * css3/parse-alignment-of-root-elements-expected.txt: Added.
     22        * css3/parse-alignment-of-root-elements.html: Added.
     23        * fast/css/getComputedStyle/computed-style-expected.txt:
     24        * fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:
     25        * fast/css/parse-justify-items-expected.txt:
     26        * fast/css/parse-justify-items.html:
     27        * fast/css/parse-justify-self-expected.txt:
     28        * fast/css/parse-justify-self.html:
     29        * fast/css/resources/alignment-parsing-utils.js:
     30        * svg/css/getComputedStyle-basic-expected.txt:
     31        (checkBadValues):
     32        * svg/css/getComputedStyle-basic-expected.txt:
     33
    1342016-05-25  Skachkov Oleksandr  <gskachkov@gmail.com>
    235
  • trunk/LayoutTests/css3/flexbox/css-properties-expected.txt

    r197503 r201498  
    3030PASS window.getComputedStyle(flexbox, null).webkitJustifyContent is "normal"
    3131PASS flexbox.style.webkitAlignSelf is ""
    32 PASS window.getComputedStyle(flexbox, null).webkitAlignSelf is "start"
    33 PASS window.getComputedStyle(document.documentElement, null).webkitAlignSelf is "start"
     32PASS window.getComputedStyle(flexbox, null).webkitAlignSelf is "normal"
     33PASS window.getComputedStyle(document.documentElement, null).webkitAlignSelf is "normal"
    3434PASS flexbox.style.webkitAlignSelf is ""
    35 PASS window.getComputedStyle(flexbox, null).webkitAlignSelf is "start"
     35PASS window.getComputedStyle(flexbox, null).webkitAlignSelf is "normal"
    3636PASS flexbox.style.webkitAlignSelf is "auto"
    37 PASS window.getComputedStyle(flexbox, null).webkitAlignSelf is "start"
     37PASS window.getComputedStyle(flexbox, null).webkitAlignSelf is "normal"
    3838PASS flexbox.style.webkitAlignSelf is "flex-start"
    3939PASS window.getComputedStyle(flexbox, null).webkitAlignSelf is "flex-start"
     
    4747PASS window.getComputedStyle(flexbox, null).webkitAlignSelf is "baseline"
    4848PASS flexbox.style.webkitAlignSelf is ""
    49 PASS window.getComputedStyle(flexbox, null).webkitAlignSelf is "start"
    50 PASS flexbox.style.webkitAlignItems is ""
    51 PASS flexitem.style.webkitAlignSelf is ""
    52 PASS window.getComputedStyle(flexbox, null).webkitAlignItems is "stretch"
    53 PASS window.getComputedStyle(flexitem, null).webkitAlignSelf is "stretch"
    54 PASS flexbox.style.webkitAlignItems is ""
    55 PASS flexitem.style.webkitAlignSelf is ""
    56 PASS window.getComputedStyle(flexbox, null).webkitAlignItems is "stretch"
    57 PASS window.getComputedStyle(flexitem, null).webkitAlignSelf is "stretch"
    58 PASS flexbox.style.webkitAlignItems is "auto"
    59 PASS flexitem.style.webkitAlignSelf is ""
    60 PASS window.getComputedStyle(flexbox, null).webkitAlignItems is "stretch"
    61 PASS window.getComputedStyle(flexitem, null).webkitAlignSelf is "stretch"
     49PASS window.getComputedStyle(flexbox, null).webkitAlignSelf is "normal"
     50PASS flexbox.style.webkitAlignItems is ""
     51PASS flexitem.style.webkitAlignSelf is ""
     52PASS window.getComputedStyle(flexbox, null).webkitAlignItems is "normal"
     53PASS window.getComputedStyle(flexitem, null).webkitAlignSelf is "normal"
     54PASS flexbox.style.webkitAlignItems is ""
     55PASS flexitem.style.webkitAlignSelf is ""
     56PASS window.getComputedStyle(flexbox, null).webkitAlignItems is "normal"
     57PASS window.getComputedStyle(flexitem, null).webkitAlignSelf is "normal"
     58PASS flexbox.style.webkitAlignItems is ""
     59PASS flexitem.style.webkitAlignSelf is ""
     60PASS window.getComputedStyle(flexbox, null).webkitAlignItems is "normal"
     61PASS window.getComputedStyle(flexitem, null).webkitAlignSelf is "normal"
    6262PASS flexbox.style.webkitAlignItems is "flex-start"
    6363PASS flexitem.style.webkitAlignSelf is ""
     
    7777PASS window.getComputedStyle(flexitem, null).webkitAlignSelf is "baseline"
    7878PASS flexbox.style.webkitAlignItems is ""
    79 PASS window.getComputedStyle(flexbox, null).webkitAlignItems is "stretch"
    80 PASS window.getComputedStyle(flexitem, null).webkitAlignSelf is "stretch"
    81 PASS flexbox.style.webkitAlignItems is ""
    82 PASS window.getComputedStyle(flexbox, null).webkitAlignItems is "auto"
    83 PASS window.getComputedStyle(flexitem, null).webkitAlignSelf is "auto"
     79PASS window.getComputedStyle(flexbox, null).webkitAlignItems is "normal"
     80PASS window.getComputedStyle(flexitem, null).webkitAlignSelf is "normal"
     81PASS flexbox.style.webkitAlignItems is ""
     82PASS window.getComputedStyle(flexbox, null).webkitAlignItems is "normal"
     83PASS window.getComputedStyle(flexitem, null).webkitAlignSelf is "normal"
    8484PASS window.getComputedStyle(detachedFlexbox, null).webkitAlignSelf is ""
    8585PASS window.getComputedStyle(detachedFlexItem, null).webkitAlignSelf is ""
  • trunk/LayoutTests/css3/flexbox/css-properties.html

    r197503 r201498  
    8383shouldBeEqualToString('flexbox.style.webkitAlignSelf', '');
    8484// The initial value is 'auto', which will be resolved depending on parent's style (except for the 'document' element).
    85 shouldBeEqualToString('window.getComputedStyle(flexbox, null).webkitAlignSelf', 'start');
    86 shouldBeEqualToString('window.getComputedStyle(document.documentElement, null).webkitAlignSelf', 'start');
     85shouldBeEqualToString('window.getComputedStyle(flexbox, null).webkitAlignSelf', 'normal');
     86shouldBeEqualToString('window.getComputedStyle(document.documentElement, null).webkitAlignSelf', 'normal');
    8787
    8888flexbox.style.webkitAlignSelf = 'foo';
    8989shouldBeEqualToString('flexbox.style.webkitAlignSelf', '');
    90 shouldBeEqualToString('window.getComputedStyle(flexbox, null).webkitAlignSelf', 'start');
     90shouldBeEqualToString('window.getComputedStyle(flexbox, null).webkitAlignSelf', 'normal');
    9191
    9292flexbox.style.webkitAlignSelf = 'auto';
    9393shouldBeEqualToString('flexbox.style.webkitAlignSelf', 'auto');
    94 shouldBeEqualToString('window.getComputedStyle(flexbox, null).webkitAlignSelf', 'start');
     94shouldBeEqualToString('window.getComputedStyle(flexbox, null).webkitAlignSelf', 'normal');
    9595
    9696flexbox.style.webkitAlignSelf = 'flex-start';
     
    116116flexbox.style.webkitAlignSelf = '';
    117117shouldBeEqualToString('flexbox.style.webkitAlignSelf', '');
    118 shouldBeEqualToString('window.getComputedStyle(flexbox, null).webkitAlignSelf', 'start');
     118shouldBeEqualToString('window.getComputedStyle(flexbox, null).webkitAlignSelf', 'normal');
    119119
    120120shouldBeEqualToString('flexbox.style.webkitAlignItems', '');
    121121shouldBeEqualToString('flexitem.style.webkitAlignSelf', '');
    122 // The initial value is 'auto', which will be resolved to 'stretch' in case of flexbox containers.
    123 shouldBeEqualToString('window.getComputedStyle(flexbox, null).webkitAlignItems', 'stretch');
    124 shouldBeEqualToString('window.getComputedStyle(flexitem, null).webkitAlignSelf', 'stretch');
     122// The initial value is 'auto', which will be resolved to 'normal' in case of flexbox containers.
     123shouldBeEqualToString('window.getComputedStyle(flexbox, null).webkitAlignItems', 'normal');
     124shouldBeEqualToString('window.getComputedStyle(flexitem, null).webkitAlignSelf', 'normal');
    125125
    126126flexbox.style.webkitAlignItems = 'foo';
    127127shouldBeEqualToString('flexbox.style.webkitAlignItems', '');
    128128shouldBeEqualToString('flexitem.style.webkitAlignSelf', '');
    129 shouldBeEqualToString('window.getComputedStyle(flexbox, null).webkitAlignItems', 'stretch');
    130 shouldBeEqualToString('window.getComputedStyle(flexitem, null).webkitAlignSelf', 'stretch');
    131 
     129shouldBeEqualToString('window.getComputedStyle(flexbox, null).webkitAlignItems', 'normal');
     130shouldBeEqualToString('window.getComputedStyle(flexitem, null).webkitAlignSelf', 'normal');
     131
     132// The 'auto' value is not valid for the align-items property.
    132133flexbox.style.webkitAlignItems = 'auto';
    133 shouldBeEqualToString('flexbox.style.webkitAlignItems', 'auto');
     134shouldBeEqualToString('flexbox.style.webkitAlignItems', '');
    134135shouldBeEqualToString('flexitem.style.webkitAlignSelf', '');
    135 shouldBeEqualToString('window.getComputedStyle(flexbox, null).webkitAlignItems', 'stretch');
    136 shouldBeEqualToString('window.getComputedStyle(flexitem, null).webkitAlignSelf', 'stretch');
     136shouldBeEqualToString('window.getComputedStyle(flexbox, null).webkitAlignItems', 'normal');
     137shouldBeEqualToString('window.getComputedStyle(flexitem, null).webkitAlignSelf', 'normal');
    137138
    138139flexbox.style.webkitAlignItems = 'flex-start';
     
    164165flexbox.style.webkitAlignItems = '';
    165166shouldBeEqualToString('flexbox.style.webkitAlignItems', '');
    166 shouldBeEqualToString('window.getComputedStyle(flexbox, null).webkitAlignItems', 'stretch');
    167 shouldBeEqualToString('window.getComputedStyle(flexitem, null).webkitAlignSelf', 'stretch');
     167shouldBeEqualToString('window.getComputedStyle(flexbox, null).webkitAlignItems', 'normal');
     168shouldBeEqualToString('window.getComputedStyle(flexitem, null).webkitAlignSelf', 'normal');
    168169
    169170flexbox.style.display = 'none';
    170171shouldBeEqualToString('flexbox.style.webkitAlignItems', '');
    171 shouldBeEqualToString('window.getComputedStyle(flexbox, null).webkitAlignItems', 'auto');
    172 shouldBeEqualToString('window.getComputedStyle(flexitem, null).webkitAlignSelf', 'auto');
     172shouldBeEqualToString('window.getComputedStyle(flexbox, null).webkitAlignItems', 'normal');
     173shouldBeEqualToString('window.getComputedStyle(flexitem, null).webkitAlignSelf', 'normal');
    173174flexbox.style.display = '';
    174175
  • trunk/LayoutTests/css3/parse-align-items-expected.txt

    r194104 r201498  
    2727
    2828Test initial value of align-items through JS
    29 PASS getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is 'start'
     29PASS getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is 'normal'
    3030
    3131Test getting and setting align-items through JS
     
    4242PASS element.style.webkitAlignItems is "self-start"
    4343PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "self-start"
    44 PASS element.style.webkitAlignItems is "auto"
    45 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "start"
    46 PASS element.style.webkitAlignItems is "auto"
    47 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "stretch"
    48 PASS element.style.webkitAlignItems is "auto"
    49 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "stretch"
     44PASS element.style.webkitAlignItems is ""
     45PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "normal"
     46PASS element.style.webkitAlignItems is ""
     47PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "normal"
     48PASS element.style.webkitAlignItems is ""
     49PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "normal"
    5050PASS element.style.webkitAlignItems is "self-end"
    5151PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "self-end"
     
    5353Test bad combinations of align-items
    5454PASS element.style.webkitAlignItems is ""
    55 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "start"
     55PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "normal"
    5656PASS element.style.webkitAlignItems is ""
    57 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "start"
     57PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "normal"
    5858PASS element.style.webkitAlignItems is ""
    59 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "start"
     59PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "normal"
    6060PASS element.style.webkitAlignItems is ""
    61 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "start"
     61PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "normal"
    6262PASS element.style.webkitAlignItems is ""
    63 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "start"
     63PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "normal"
    6464PASS element.style.webkitAlignItems is ""
    65 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "start"
     65PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "normal"
    6666PASS element.style.webkitAlignItems is ""
    67 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "start"
     67PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "normal"
    6868PASS element.style.webkitAlignItems is ""
    69 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "start"
     69PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "normal"
    7070PASS element.style.webkitAlignItems is ""
    71 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "start"
     71PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "normal"
    7272PASS element.style.webkitAlignItems is ""
    73 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "start"
     73PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "normal"
    7474PASS element.style.webkitAlignItems is ""
    75 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "start"
     75PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "normal"
    7676PASS element.style.webkitAlignItems is ""
    77 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "start"
     77PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "normal"
    7878PASS element.style.webkitAlignItems is ""
    79 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "start"
     79PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "normal"
    8080PASS element.style.webkitAlignItems is ""
    81 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "start"
     81PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "normal"
    8282PASS element.style.webkitAlignItems is ""
    83 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "start"
     83PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "normal"
    8484PASS element.style.webkitAlignItems is ""
    85 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "start"
     85PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "normal"
    8686PASS element.style.webkitAlignItems is ""
    87 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "start"
     87PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "normal"
    8888PASS element.style.webkitAlignItems is ""
    89 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "start"
     89PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "normal"
    9090PASS element.style.webkitAlignItems is ""
    91 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "start"
     91PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "normal"
    9292PASS element.style.webkitAlignItems is ""
    93 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "start"
     93PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "normal"
    9494PASS element.style.webkitAlignItems is ""
    95 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "start"
     95PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "normal"
    9696PASS element.style.webkitAlignItems is ""
    97 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "start"
     97PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "normal"
    9898PASS element.style.webkitAlignItems is ""
    99 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "start"
     99PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "normal"
    100100PASS element.style.webkitAlignItems is ""
    101 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "start"
     101PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "normal"
     102PASS element.style.webkitAlignItems is ""
     103PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "normal"
    102104
    103105Test the value 'initial'
     
    105107PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "center"
    106108PASS element.style.webkitAlignItems is "initial"
    107 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "start"
     109PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "normal"
    108110
    109111Test the value 'initial' for grid containers
     
    111113PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "left safe"
    112114PASS element.style.webkitAlignItems is "initial"
    113 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "stretch"
     115PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "normal"
    114116
    115117Test the value 'initial' for flex containers
     
    117119PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "right unsafe"
    118120PASS element.style.webkitAlignItems is "initial"
    119 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "stretch"
     121PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-items') is "normal"
    120122
    121123Test the value 'inherit'
  • trunk/LayoutTests/css3/parse-align-items.html

    r200510 r201498  
    177177element = document.createElement("div");
    178178document.body.appendChild(element);
    179 shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-align-items')", "'start'");
     179shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-align-items')", "'normal'");
    180180
    181181debug("");
     
    201201checkValues(element, "webkitAlignItems", "-webkit-align-items",  "self-start", "self-start");
    202202
     203<!-- The 'auto' value is no valid for the align-items property. -->
     204element.style.webkitAlignItems = "";
    203205element.style.webkitAlignItems = "auto";
    204 checkValues(element, "webkitAlignItems", "-webkit-align-items",  "auto", "start");
     206checkValues(element, "webkitAlignItems", "-webkit-align-items",  "", "normal");
    205207
    206208element.style.display = "-webkit-flex";
    207209element.style.webkitAlignItems = "auto";
    208 checkValues(element, "webkitAlignItems", "-webkit-align-items",  "auto", "stretch");
     210checkValues(element, "webkitAlignItems", "-webkit-align-items",  "", "normal");
    209211
    210212element.style.display = "grid";
    211213element.style.webkitAlignItems = "auto";
    212 checkValues(element, "webkitAlignItems", "-webkit-align-items",  "auto", "stretch");
     214checkValues(element, "webkitAlignItems", "-webkit-align-items",  "", "normal");
    213215
    214216element.style.webkitAlignItems = "self-end";
     
    220222document.body.appendChild(element);
    221223
     224checkBadValues(element, "webkitAlignItems", "-webkit-align-items",  "auto");
    222225checkBadValues(element, "webkitAlignItems", "-webkit-align-items",  "unsafe auto");
    223226checkBadValues(element, "webkitAlignItems", "-webkit-align-items",  "auto safe");
     
    248251debug("Test the value 'initial'");
    249252element.style.display = "";
    250 checkInitialValues(element, "webkitAlignItems", "-webkit-align-items", "center", "start");
     253checkInitialValues(element, "webkitAlignItems", "-webkit-align-items", "center", "normal");
    251254
    252255debug("");
    253256debug("Test the value 'initial' for grid containers");
    254 element.style.display = "grid";
    255 checkInitialValues(element, "webkitAlignItems", "-webkit-align-items", "left safe", "stretch");
     257element.style.display = "-webkit-grid";
     258checkInitialValues(element, "webkitAlignItems", "-webkit-align-items", "left safe", "normal");
    256259
    257260debug("");
    258261debug("Test the value 'initial' for flex containers");
    259262element.style.display = "-webkit-flex";
    260 checkInitialValues(element, "webkitAlignItems", "-webkit-align-items", "right unsafe", "stretch");
     263checkInitialValues(element, "webkitAlignItems", "-webkit-align-items", "right unsafe", "normal");
    261264
    262265debug("");
  • trunk/LayoutTests/css3/parse-align-self-expected.txt

    r194104 r201498  
    2727
    2828Test initial value of align-self through JS
    29 PASS getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is 'start'
     29PASS getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is 'normal'
    3030
    3131Test getting and setting align-self through JS
     
    4343PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "self-start"
    4444PASS element.style.webkitAlignSelf is "auto"
    45 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "start"
     45PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "normal"
    4646PASS element.style.webkitAlignSelf is "auto"
    47 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "stretch"
     47PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "normal"
    4848PASS element.style.webkitAlignSelf is "auto"
    49 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "stretch"
     49PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "normal"
    5050PASS element.style.webkitAlignSelf is "self-end"
    5151PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "self-end"
    5252
     53Test 'auto' value resolution for the root node
     54PASS element.style.webkitAlignSelf is "auto"
     55PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "normal"
     56
    5357Test bad combinations of align-self
    5458PASS element.style.webkitAlignSelf is ""
    55 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "start"
     59PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "normal"
    5660PASS element.style.webkitAlignSelf is ""
    57 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "start"
     61PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "normal"
    5862PASS element.style.webkitAlignSelf is ""
    59 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "start"
     63PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "normal"
    6064PASS element.style.webkitAlignSelf is ""
    61 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "start"
     65PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "normal"
    6266PASS element.style.webkitAlignSelf is ""
    63 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "start"
     67PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "normal"
    6468PASS element.style.webkitAlignSelf is ""
    65 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "start"
     69PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "normal"
    6670PASS element.style.webkitAlignSelf is ""
    67 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "start"
     71PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "normal"
    6872PASS element.style.webkitAlignSelf is ""
    69 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "start"
     73PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "normal"
    7074PASS element.style.webkitAlignSelf is ""
    71 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "start"
     75PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "normal"
    7276PASS element.style.webkitAlignSelf is ""
    73 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "start"
     77PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "normal"
    7478PASS element.style.webkitAlignSelf is ""
    75 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "start"
     79PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "normal"
    7680PASS element.style.webkitAlignSelf is ""
    77 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "start"
     81PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "normal"
    7882PASS element.style.webkitAlignSelf is ""
    79 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "start"
     83PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "normal"
    8084PASS element.style.webkitAlignSelf is ""
    81 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "start"
     85PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "normal"
    8286PASS element.style.webkitAlignSelf is ""
    83 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "start"
     87PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "normal"
    8488PASS element.style.webkitAlignSelf is ""
    85 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "start"
     89PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "normal"
    8690PASS element.style.webkitAlignSelf is ""
    87 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "start"
     91PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "normal"
    8892PASS element.style.webkitAlignSelf is ""
    89 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "start"
     93PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "normal"
    9094PASS element.style.webkitAlignSelf is ""
    91 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "start"
     95PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "normal"
    9296PASS element.style.webkitAlignSelf is ""
    93 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "start"
     97PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "normal"
    9498PASS element.style.webkitAlignSelf is ""
    95 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "start"
     99PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "normal"
    96100PASS element.style.webkitAlignSelf is ""
    97 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "start"
     101PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "normal"
    98102PASS element.style.webkitAlignSelf is ""
    99 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "start"
     103PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "normal"
    100104PASS element.style.webkitAlignSelf is ""
    101 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "start"
     105PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "normal"
    102106
    103107Test the value 'initial'
     
    105109PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "center"
    106110PASS element.style.webkitAlignSelf is "initial"
    107 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "start"
     111PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "normal"
    108112
    109113Test the value 'initial' for grid containers
     
    111115PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "left safe"
    112116PASS element.style.webkitAlignSelf is "initial"
    113 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "stretch"
     117PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "normal"
    114118
    115119Test the value 'initial' for flex containers
     
    117121PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "right unsafe"
    118122PASS element.style.webkitAlignSelf is "initial"
    119 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "stretch"
     123PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "normal"
    120124
    121125Test the value 'initial' for positioned elements
     
    123127PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "left"
    124128PASS element.style.webkitAlignSelf is "initial"
    125 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "auto"
     129PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "normal"
    126130
    127131Test the value 'initial' for positioned elements in grid containers
     
    129133PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "right"
    130134PASS element.style.webkitAlignSelf is "initial"
    131 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "auto"
     135PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "normal"
    132136
    133137Test the value 'initial' for positioned elements in grid containers
     
    135139PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "end"
    136140PASS element.style.webkitAlignSelf is "initial"
    137 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "auto"
     141PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-align-self') is "normal"
    138142
    139143Test the value 'inherit'
  • trunk/LayoutTests/css3/parse-align-self.html

    r200510 r201498  
    6161#alignSelfSelfEndSafe {
    6262    -webkit-align-self: self-end safe;
    63 }
     63x}
    6464
    6565#alignSelfSelfStartSafe {
     
    176176element = document.createElement("div");
    177177document.body.appendChild(element);
    178 shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-align-self')", "'start'");
     178shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-align-self')", "'normal'");
    179179
    180180debug("");
     
    203203
    204204element.style.webkitAlignSelf = "auto";
    205 checkValues(element, "webkitAlignSelf", "-webkit-align-self",  "auto", "start");
     205checkValues(element, "webkitAlignSelf", "-webkit-align-self",  "auto", "normal");
    206206
    207207container.style.display = "-webkit-flex";
    208208element.style.webkitAlignSelf = "auto";
    209 checkValues(element, "webkitAlignSelf", "-webkit-align-self",  "auto", "stretch");
     209checkValues(element, "webkitAlignSelf", "-webkit-align-self",  "auto", "normal");
    210210
    211211container.style.display = "grid";
    212212element.style.webkitAlignSelf = "auto";
    213 checkValues(element, "webkitAlignSelf", "-webkit-align-self",  "auto", "stretch");
     213checkValues(element, "webkitAlignSelf", "-webkit-align-self",  "auto", "normal");
    214214
    215215element.style.webkitAlignSelf = "self-end";
    216216checkValues(element, "webkitAlignSelf", "-webkit-align-self",  "self-end", "self-end");
     217
     218debug("");
     219debug("Test 'auto' value resolution for the root node");
     220document.documentElement.style.webkitAlignSelf = "auto";
     221checkValues(document.documentElement, "webkitAlignSelf", "-webkit-align-self",  "auto", "normal");
    217222
    218223debug("");
     
    251256debug("Test the value 'initial'");
    252257container.style.display = "";
    253 checkInitialValues(element, "webkitAlignSelf", "-webkit-align-self", "center", "start");
     258checkInitialValues(element, "webkitAlignSelf", "-webkit-align-self", "center", "normal");
    254259
    255260debug("");
    256261debug("Test the value 'initial' for grid containers");
    257 container.style.display = "grid";
    258 checkInitialValues(element, "webkitAlignSelf", "-webkit-align-self", "left safe", "stretch");
     262container.style.display = "-webkit-grid";
     263checkInitialValues(element, "webkitAlignSelf", "-webkit-align-self", "left safe", "normal");
    259264
    260265debug("");
    261266debug("Test the value 'initial' for flex containers");
    262267container.style.display = "-webkit-flex";
    263 checkInitialValues(element, "webkitAlignSelf", "-webkit-align-self", "right unsafe", "stretch");
     268checkInitialValues(element, "webkitAlignSelf", "-webkit-align-self", "right unsafe", "normal");
    264269
    265270debug("");
     
    267272container.style.display = "";
    268273element.style.position = "absolute";
    269 checkInitialValues(element, "webkitAlignSelf", "-webkit-align-self", "left", "auto");
     274checkInitialValues(element, "webkitAlignSelf", "-webkit-align-self", "left", "normal");
    270275
    271276debug("");
     
    273278container.style.display = "grid";
    274279element.style.position = "absolute";
    275 checkInitialValues(element, "webkitAlignSelf", "-webkit-align-self", "right", "auto");
     280checkInitialValues(element, "webkitAlignSelf", "-webkit-align-self", "right", "normal");
    276281
    277282debug("");
     
    279284container.style.display = "-webkit-flex";
    280285element.style.position = "absolute";
    281 checkInitialValues(element, "webkitAlignSelf", "-webkit-align-self", "end", "auto");
     286checkInitialValues(element, "webkitAlignSelf", "-webkit-align-self", "end", "normal");
    282287
    283288debug("");
  • trunk/LayoutTests/fast/css/getComputedStyle/computed-style-expected.txt

    r200510 r201498  
    150150column-width: auto;
    151151align-content: normal;
    152 align-items: start;
    153 align-self: start;
     152align-items: normal;
     153align-self: normal;
    154154filter: none;
    155155flex-direction: row;
    156156flex-wrap: nowrap;
    157157justify-content: normal;
    158 justify-self: start;
    159 justify-items: start;
     158justify-self: normal;
     159justify-items: normal;
    160160-webkit-font-kerning: auto;
    161161-webkit-font-smoothing: auto;
  • trunk/LayoutTests/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt

    r200510 r201498  
    149149column-width: auto
    150150align-content: normal
    151 align-items: auto
    152 align-self: auto
     151align-items: normal
     152align-self: normal
    153153filter: none
    154154flex-direction: row
    155155flex-wrap: nowrap
    156156justify-content: normal
    157 justify-self: auto
    158 justify-items: auto
     157justify-self: normal
     158justify-items: normal
    159159-webkit-font-kerning: auto
    160160-webkit-font-smoothing: auto
  • trunk/LayoutTests/fast/css/parse-justify-items-expected.txt

    r194104 r201498  
    3333
    3434Test initial value of justify-items through JS
    35 PASS getComputedStyle(element, '').getPropertyValue('justify-items') is 'start'
     35PASS getComputedStyle(element, '').getPropertyValue('justify-items') is 'normal'
    3636
    3737Test getting and setting justify-items through JS
     
    4949PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "legacy left"
    5050PASS element.style.justifyItems is "auto"
    51 PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "start"
     51PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "normal"
    5252PASS element.style.justifyItems is "auto"
    53 PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "stretch"
     53PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "normal"
    5454PASS element.style.justifyItems is "auto"
    55 PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "stretch"
    56 PASS getComputedStyle(element, '').getPropertyValue('justify-items') is 'stretch'
    57 PASS element.style.justifyItems is 'auto'
     55PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "normal"
    5856PASS element.style.justifyItems is "self-end"
    5957PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "self-end"
     
    6159Test bad combinations of justify-items
    6260PASS element.style.justifyItems is ""
    63 PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "start"
     61PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "normal"
    6462PASS element.style.justifyItems is ""
    65 PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "start"
     63PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "normal"
    6664PASS element.style.justifyItems is ""
    67 PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "start"
     65PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "normal"
    6866PASS element.style.justifyItems is ""
    69 PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "start"
     67PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "normal"
    7068PASS element.style.justifyItems is ""
    71 PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "start"
     69PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "normal"
    7270PASS element.style.justifyItems is ""
    73 PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "start"
     71PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "normal"
    7472PASS element.style.justifyItems is ""
    75 PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "start"
     73PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "normal"
    7674PASS element.style.justifyItems is ""
    77 PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "start"
     75PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "normal"
    7876PASS element.style.justifyItems is ""
    79 PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "start"
     77PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "normal"
    8078PASS element.style.justifyItems is ""
    81 PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "start"
     79PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "normal"
    8280PASS element.style.justifyItems is ""
    83 PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "start"
     81PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "normal"
    8482PASS element.style.justifyItems is ""
    85 PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "start"
     83PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "normal"
    8684PASS element.style.justifyItems is ""
    87 PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "start"
     85PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "normal"
    8886PASS element.style.justifyItems is ""
    89 PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "start"
     87PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "normal"
    9088PASS element.style.justifyItems is ""
    91 PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "start"
     89PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "normal"
    9290PASS element.style.justifyItems is ""
    93 PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "start"
     91PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "normal"
    9492PASS element.style.justifyItems is ""
    95 PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "start"
     93PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "normal"
    9694PASS element.style.justifyItems is ""
    97 PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "start"
     95PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "normal"
    9896PASS element.style.justifyItems is ""
    99 PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "start"
     97PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "normal"
    10098PASS element.style.justifyItems is ""
    101 PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "start"
     99PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "normal"
    102100PASS element.style.justifyItems is ""
    103 PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "start"
     101PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "normal"
    104102PASS element.style.justifyItems is ""
    105 PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "start"
     103PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "normal"
    106104PASS element.style.justifyItems is ""
    107 PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "start"
     105PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "normal"
    108106PASS element.style.justifyItems is ""
    109 PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "start"
     107PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "normal"
    110108
    111109Test the value 'initial'
    112 PASS element.style.justifyItems is "center"
    113 PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "center"
     110PASS element.style.justifyItems is "legacy center"
     111PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "legacy center"
    114112PASS element.style.justifyItems is "initial"
    115 PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "start"
     113PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "normal"
    116114
    117115Test the value 'initial' for grid containers
     
    119117PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "left safe"
    120118PASS element.style.justifyItems is "initial"
    121 PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "stretch"
     119PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "normal"
    122120
    123121Test the value 'initial' for flex containers
     
    125123PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "right unsafe"
    126124PASS element.style.justifyItems is "initial"
    127 PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "stretch"
     125PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "normal"
    128126
    129127Test the value 'inherit'
     
    136134PASS element.style.justifyItems is "inherit"
    137135PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "left safe"
    138 PASS element.style.justifyItems is "center unsafe"
    139 PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "center unsafe"
     136PASS element.style.justifyItems is "legacy center"
     137PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "legacy center"
    140138PASS element.style.justifyItems is "inherit"
    141 PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "center unsafe"
     139PASS window.getComputedStyle(element, '').getPropertyValue('justify-items') is "legacy center"
    142140
    143141Test the value 'legacy'
  • trunk/LayoutTests/fast/css/parse-justify-items.html

    r200510 r201498  
    224224element = document.createElement("div");
    225225document.body.appendChild(element);
    226 shouldBe("getComputedStyle(element, '').getPropertyValue('justify-items')", "'start'");
     226shouldBe("getComputedStyle(element, '').getPropertyValue('justify-items')", "'normal'");
    227227
    228228debug("");
     
    249249
    250250element.style.justifyItems = "auto";
    251 checkValues(element, "justifyItems", "justify-items",  "auto", "start");
     251checkValues(element, "justifyItems", "justify-items",  "auto", "normal");
    252252
    253253element.style.display = "flex";
    254254element.style.justifyItems = "auto";
    255 checkValues(element, "justifyItems", "justify-items",  "auto", "stretch");
     255checkValues(element, "justifyItems", "justify-items",  "auto", "normal");
    256256
    257257element.style.display = "grid";
    258258element.style.justifyItems = "auto";
    259 checkValues(element, "justifyItems", "justify-items",  "auto", "stretch");
    260 shouldBe("getComputedStyle(element, '').getPropertyValue('justify-items')", "'stretch'");
    261 shouldBe("element.style.justifyItems", "'auto'");
     259checkValues(element, "justifyItems", "justify-items",  "auto", "normal");
    262260
    263261element.style.justifyItems = "self-end";
     
    297295debug("Test the value 'initial'");
    298296element.style.display = "";
    299 checkInitialValues(element, "justifyItems", "justify-items", "center", "start");
     297checkInitialValues(element, "justifyItems", "justify-items", "legacy center", "normal");
    300298
    301299debug("");
    302300debug("Test the value 'initial' for grid containers");
    303301element.style.display = "grid";
    304 checkInitialValues(element, "justifyItems", "justify-items", "left safe", "stretch");
     302checkInitialValues(element, "justifyItems", "justify-items", "left safe", "normal");
    305303
    306304debug("");
    307305debug("Test the value 'initial' for flex containers");
    308 element.style.display = "-webkit-flex";
    309 checkInitialValues(element, "justifyItems", "justify-items", "right unsafe", "stretch");
     306element.style.display = "flex";
     307checkInitialValues(element, "justifyItems", "justify-items", "right unsafe", "normal");
    310308
    311309debug("");
    312310debug("Test the value 'inherit'");
    313 parentElement = document.createElement("div");
    314311checkInheritValues("justifyItems", "justify-items", "end");
    315312checkInheritValues("justifyItems", "justify-items", "left safe");
    316 checkInheritValues("justifyItems", "justify-items", "center unsafe");
     313checkInheritValues("justifyItems", "justify-items", "legacy center");
    317314
    318315debug("");
  • trunk/LayoutTests/fast/css/parse-justify-self-expected.txt

    r194104 r201498  
    66Test getting justify-self set through CSS
    77PASS getComputedStyle(justifySelfBaseline, '').getPropertyValue('justify-self') is 'baseline'
     8PASS getComputedStyle(justifySelfLastBaseline, '').getPropertyValue('justify-self') is 'last-baseline'
    89PASS getComputedStyle(justifySelfStretch, '').getPropertyValue('justify-self') is 'stretch'
    910PASS getComputedStyle(justifySelfStart, '').getPropertyValue('justify-self') is 'start'
     
    1415PASS getComputedStyle(justifySelfLeft, '').getPropertyValue('justify-self') is 'left'
    1516PASS getComputedStyle(justifySelfRight, '').getPropertyValue('justify-self') is 'right'
     17PASS getComputedStyle(justifySelfFlexStart, '').getPropertyValue('justify-self') is 'flex-start'
     18PASS getComputedStyle(justifySelfFlexEnd, '').getPropertyValue('justify-self') is 'flex-end'
    1619PASS getComputedStyle(justifySelfEndUnsafe, '').getPropertyValue('justify-self') is 'end unsafe'
    1720PASS getComputedStyle(justifySelfCenterUnsafe, '').getPropertyValue('justify-self') is 'center unsafe'
     
    2023PASS getComputedStyle(justifySelfRightSafe, '').getPropertyValue('justify-self') is 'right safe'
    2124PASS getComputedStyle(justifySelfLeftUnsafe, '').getPropertyValue('justify-self') is 'left unsafe'
     25PASS getComputedStyle(justifySelfFlexStartUnsafe, '').getPropertyValue('justify-self') is 'flex-start unsafe'
     26PASS getComputedStyle(justifySelfFlexEndSafe, '').getPropertyValue('justify-self') is 'flex-end safe'
    2227
    2328Test initial value of justify-self through JS
    24 PASS getComputedStyle(element, '').getPropertyValue('justify-self') is 'start'
     29PASS getComputedStyle(element, '').getPropertyValue('justify-self') is 'normal'
    2530
    2631Test getting and setting justify-self through JS
    27 PASS getComputedStyle(element, '').getPropertyValue('justify-self') is 'center'
    28 PASS getComputedStyle(element, '').getPropertyValue('justify-self') is 'start unsafe'
    29 PASS getComputedStyle(element, '').getPropertyValue('justify-self') is 'start'
     32PASS element.style.justifySelf is "center"
     33PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is "center"
     34PASS element.style.justifySelf is "start unsafe"
     35PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is "start unsafe"
     36PASS element.style.justifySelf is "flex-end safe"
     37PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is "flex-end safe"
     38PASS element.style.justifySelf is "right"
     39PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is "right"
     40PASS element.style.justifySelf is "center"
     41PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is "center"
     42PASS element.style.justifySelf is "self-start"
     43PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is "self-start"
     44PASS element.style.justifySelf is "auto"
     45PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is "normal"
     46PASS element.style.justifySelf is "auto"
     47PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is "normal"
     48PASS element.style.justifySelf is "auto"
     49PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is "normal"
     50PASS element.style.justifySelf is "self-end"
     51PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is "self-end"
    3052
    3153Test bad combinations of justify-self
    32 PASS getComputedStyle(element, '').getPropertyValue('justify-self') is 'start'
    33 PASS getComputedStyle(element, '').getPropertyValue('justify-self') is 'start'
    34 PASS getComputedStyle(element, '').getPropertyValue('justify-self') is 'start'
    35 PASS getComputedStyle(element, '').getPropertyValue('justify-self') is 'start'
    36 PASS getComputedStyle(element, '').getPropertyValue('justify-self') is 'start'
    37 PASS getComputedStyle(element, '').getPropertyValue('justify-self') is 'start'
    38 PASS getComputedStyle(element, '').getPropertyValue('justify-self') is 'start'
    39 PASS getComputedStyle(element, '').getPropertyValue('justify-self') is 'start'
    40 PASS getComputedStyle(element, '').getPropertyValue('justify-self') is 'start'
    41 PASS getComputedStyle(element, '').getPropertyValue('justify-self') is 'start'
    42 PASS getComputedStyle(element, '').getPropertyValue('justify-self') is 'start'
    43 PASS getComputedStyle(element, '').getPropertyValue('justify-self') is 'start'
    44 PASS getComputedStyle(element, '').getPropertyValue('justify-self') is 'start'
    45 PASS getComputedStyle(element, '').getPropertyValue('justify-self') is 'start'
    46 PASS getComputedStyle(element, '').getPropertyValue('justify-self') is 'start'
    47 PASS getComputedStyle(element, '').getPropertyValue('justify-self') is 'start'
    48 PASS getComputedStyle(element, '').getPropertyValue('justify-self') is 'start'
     54PASS element.style.justifySelf is ""
     55PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is "normal"
     56PASS element.style.justifySelf is ""
     57PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is "normal"
     58PASS element.style.justifySelf is ""
     59PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is "normal"
     60PASS element.style.justifySelf is ""
     61PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is "normal"
     62PASS element.style.justifySelf is ""
     63PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is "normal"
     64PASS element.style.justifySelf is ""
     65PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is "normal"
     66PASS element.style.justifySelf is ""
     67PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is "normal"
     68PASS element.style.justifySelf is ""
     69PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is "normal"
     70PASS element.style.justifySelf is ""
     71PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is "normal"
     72PASS element.style.justifySelf is ""
     73PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is "normal"
     74PASS element.style.justifySelf is ""
     75PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is "normal"
     76PASS element.style.justifySelf is ""
     77PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is "normal"
     78PASS element.style.justifySelf is ""
     79PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is "normal"
     80PASS element.style.justifySelf is ""
     81PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is "normal"
     82PASS element.style.justifySelf is ""
     83PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is "normal"
     84PASS element.style.justifySelf is ""
     85PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is "normal"
     86PASS element.style.justifySelf is ""
     87PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is "normal"
     88PASS element.style.justifySelf is ""
     89PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is "normal"
     90PASS element.style.justifySelf is ""
     91PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is "normal"
     92PASS element.style.justifySelf is ""
     93PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is "normal"
     94PASS element.style.justifySelf is ""
     95PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is "normal"
     96PASS element.style.justifySelf is ""
     97PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is "normal"
     98PASS element.style.justifySelf is ""
     99PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is "normal"
     100PASS element.style.justifySelf is ""
     101PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is "normal"
    49102
    50103Test the value 'initial'
    51 PASS getComputedStyle(element, '').getPropertyValue('justify-self') is 'center'
    52 PASS getComputedStyle(element, '').getPropertyValue('justify-self') is 'start'
     104PASS element.style.justifySelf is "center"
     105PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is "center"
     106PASS element.style.justifySelf is "initial"
     107PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is "normal"
     108
     109Test the value 'initial' for grid containers
     110PASS element.style.justifySelf is "left safe"
     111PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is "left safe"
     112PASS element.style.justifySelf is "initial"
     113PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is "normal"
     114
     115Test the value 'initial' for flex containers
     116PASS element.style.justifySelf is "right unsafe"
     117PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is "right unsafe"
     118PASS element.style.justifySelf is "initial"
     119PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is "normal"
     120
     121Test the value 'initial' for positioned elements
     122PASS element.style.justifySelf is "left"
     123PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is "left"
     124PASS element.style.justifySelf is "initial"
     125PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is "normal"
     126
     127Test the value 'initial' for positioned elements in grid containers
     128PASS element.style.justifySelf is "right"
     129PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is "right"
     130PASS element.style.justifySelf is "initial"
     131PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is "normal"
     132
     133Test the value 'initial' for positioned elements in grid containers
     134PASS element.style.justifySelf is "end"
     135PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is "end"
     136PASS element.style.justifySelf is "initial"
     137PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is "normal"
    53138
    54139Test the value 'inherit'
    55 PASS getComputedStyle(parentElement, '').getPropertyValue('justify-self') is 'end'
    56 PASS getComputedStyle(element, '').getPropertyValue('justify-self') is 'end'
     140PASS element.style.justifySelf is "end"
     141PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is "end"
     142PASS element.style.justifySelf is "inherit"
     143PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is "end"
     144PASS element.style.justifySelf is "left safe"
     145PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is "left safe"
     146PASS element.style.justifySelf is "inherit"
     147PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is "left safe"
     148PASS element.style.justifySelf is "center unsafe"
     149PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is "center unsafe"
     150PASS element.style.justifySelf is "inherit"
     151PASS window.getComputedStyle(element, '').getPropertyValue('justify-self') is "center unsafe"
    57152PASS successfullyParsed is true
    58153
  • trunk/LayoutTests/fast/css/parse-justify-self.html

    r194104 r201498  
    77}
    88
     9#justifySelfLastBaseline {
     10    justify-self: last-baseline;
     11}
     12
    913#justifySelfStretch {
    1014    justify-self: stretch;
     
    3943}
    4044
     45#justifySelfFlexStart {
     46    justify-self: flex-start;
     47}
     48
     49#justifySelfFlexEnd {
     50    justify-self: flex-end;
     51}
     52
    4153#justifySelfEndUnsafe {
    4254    justify-self: end unsafe;
     
    6173#justifySelfLeftUnsafe {
    6274    justify-self: left unsafe;
     75}
     76
     77#justifySelfFlexStartUnsafe {
     78    justify-self: flex-start unsafe;
     79}
     80
     81#justifySelfFlexEndSafe {
     82    justify-self: flex-end safe;
    6383}
    6484</style>
     
    6787<body>
    6888<div id="justifySelfBaseline"></div>
     89<div id="justifySelfLastBaseline"></div>
    6990<div id="justifySelfStretch"></div>
    7091<div id="justifySelfStart"></div>
     
    7596<div id="justifySelfLeft"></div>
    7697<div id="justifySelfRight"></div>
     98<div id="justifySelfFlexStart"></div>
     99<div id="justifySelfFlexEnd"></div>
    77100
    78101<div id="justifySelfEndUnsafe"></div>
     
    82105<div id="justifySelfRightSafe"></div>
    83106<div id="justifySelfLeftUnsafe"></div>
     107<div id="justifySelfFlexStartUnsafe"></div>
     108<div id="justifySelfFlexEndSafe"></div>
     109<script src="resources/alignment-parsing-utils.js"></script>
    84110<script>
    85111description('Test that setting and getting justify-self works as expected');
     
    89115shouldBe("getComputedStyle(justifySelfBaseline, '').getPropertyValue('justify-self')", "'baseline'");
    90116
     117var justifySelfLastBaseline = document.getElementById("justifySelfLastBaseline");
     118shouldBe("getComputedStyle(justifySelfLastBaseline, '').getPropertyValue('justify-self')", "'last-baseline'");
     119
    91120var justifySelfStretch = document.getElementById("justifySelfStretch");
    92121shouldBe("getComputedStyle(justifySelfStretch, '').getPropertyValue('justify-self')", "'stretch'");
     
    113142shouldBe("getComputedStyle(justifySelfRight, '').getPropertyValue('justify-self')", "'right'");
    114143
     144var justifySelfFlexStart = document.getElementById("justifySelfFlexStart");
     145shouldBe("getComputedStyle(justifySelfFlexStart, '').getPropertyValue('justify-self')", "'flex-start'");
     146
     147var justifySelfFlexEnd = document.getElementById("justifySelfFlexEnd");
     148shouldBe("getComputedStyle(justifySelfFlexEnd, '').getPropertyValue('justify-self')", "'flex-end'");
     149
    115150var justifySelfEndUnsafe = document.getElementById("justifySelfEndUnsafe");
    116151shouldBe("getComputedStyle(justifySelfEndUnsafe, '').getPropertyValue('justify-self')", "'end unsafe'");
     
    130165var justifySelfLeftUnsafe = document.getElementById("justifySelfLeftUnsafe");
    131166shouldBe("getComputedStyle(justifySelfLeftUnsafe, '').getPropertyValue('justify-self')", "'left unsafe'");
     167
     168var justifySelfFlexStartUnsafe = document.getElementById("justifySelfFlexStartUnsafe");
     169shouldBe("getComputedStyle(justifySelfFlexStartUnsafe, '').getPropertyValue('justify-self')", "'flex-start unsafe'");
     170
     171var justifySelfFlexEndSafe = document.getElementById("justifySelfFlexEndSafe");
     172shouldBe("getComputedStyle(justifySelfFlexEndSafe, '').getPropertyValue('justify-self')", "'flex-end safe'");
    132173
    133174debug("");
     
    135176element = document.createElement("div");
    136177document.body.appendChild(element);
    137 shouldBe("getComputedStyle(element, '').getPropertyValue('justify-self')", "'start'");
     178shouldBe("getComputedStyle(element, '').getPropertyValue('justify-self')", "'normal'");
    138179
    139180debug("");
    140181debug("Test getting and setting justify-self through JS");
     182container = document.createElement("div");
    141183element = document.createElement("div");
    142 document.body.appendChild(element);
     184container.appendChild(element);
     185document.body.appendChild(container);
    143186element.style.justifySelf = "center";
    144 shouldBe("getComputedStyle(element, '').getPropertyValue('justify-self')", "'center'");
    145 
     187checkValues(element, "justifySelf", "justify-self",  "center", "center");
     188
     189element.style.justifySelf = "unsafe start";
     190checkValues(element, "justifySelf", "justify-self",  "start unsafe", "start unsafe");
     191
     192element.style.justifySelf = "flex-end safe";
     193checkValues(element, "justifySelf", "justify-self",  "flex-end safe", "flex-end safe");
     194
     195element.style.justifySelf = "right";
     196checkValues(element, "justifySelf", "justify-self",  "right", "right");
     197
     198element.style.justifySelf = "center";
     199checkValues(element, "justifySelf", "justify-self",  "center", "center");
     200
     201element.style.justifySelf = "self-start";
     202checkValues(element, "justifySelf", "justify-self",  "self-start", "self-start");
     203
     204element.style.justifySelf = "auto";
     205checkValues(element, "justifySelf", "justify-self",  "auto", "normal");
     206
     207container.style.display = "flex";
     208element.style.justifySelf = "auto";
     209checkValues(element, "justifySelf", "justify-self",  "auto", "normal");
     210
     211container.style.display = "grid";
     212element.style.justifySelf = "auto";
     213checkValues(element, "justifySelf", "justify-self",  "auto", "normal");
     214
     215element.style.justifySelf = "self-end";
     216checkValues(element, "justifySelf", "justify-self",  "self-end", "self-end");
     217
     218debug("");
     219debug("Test bad combinations of justify-self");
     220container = document.createElement("div");
    146221element = document.createElement("div");
    147 document.body.appendChild(element);
    148 element.style.justifySelf = "unsafe start";
    149 shouldBe("getComputedStyle(element, '').getPropertyValue('justify-self')", "'start unsafe'");
    150 
    151 element.style.justifySelf = "start";
    152 shouldBe("getComputedStyle(element, '').getPropertyValue('justify-self')", "'start'");
    153 
    154 debug("");
    155 debug("Test bad combinations of justify-self");
    156 element = document.createElement("div");
    157 document.body.appendChild(element);
    158 element.style.justifySelf = "start left";
    159 shouldBe("getComputedStyle(element, '').getPropertyValue('justify-self')", "'start'");
    160 
    161 element.style.justifySelf = "baseline safe";
    162 shouldBe("getComputedStyle(element, '').getPropertyValue('justify-self')", "'start'");
    163 
    164 element.style.justifySelf = "baseline center";
    165 shouldBe("getComputedStyle(element, '').getPropertyValue('justify-self')", "'start'");
    166 
    167 element.style.justifySelf = "stretch unsafe";
    168 shouldBe("getComputedStyle(element, '').getPropertyValue('justify-self')", "'start'");
    169 
    170 element.style.justifySelf = "stretch right";
    171 shouldBe("getComputedStyle(element, '').getPropertyValue('justify-self')", "'start'");
    172 
    173 element.style.justifySelf = "unsafe unsafe";
    174 shouldBe("getComputedStyle(element, '').getPropertyValue('justify-self')", "'start'");
    175 
    176 element.style.justifySelf = "unsafe";
    177 shouldBe("getComputedStyle(element, '').getPropertyValue('justify-self')", "'start'");
    178 
    179 element.style.justifySelf = "unsafe safe";
    180 shouldBe("getComputedStyle(element, '').getPropertyValue('justify-self')", "'start'");
    181 
    182 element.style.justifySelf = "center start";
    183 shouldBe("getComputedStyle(element, '').getPropertyValue('justify-self')", "'start'");
    184 
    185 element.style.justifySelf = "stretch unsafe";
    186 shouldBe("getComputedStyle(element, '').getPropertyValue('justify-self')", "'start'");
    187 
    188 element.style.justifySelf = "safe stretch";
    189 shouldBe("getComputedStyle(element, '').getPropertyValue('justify-self')", "'start'");
    190 
    191 element.style.justifySelf = "baseline safe";
    192 shouldBe("getComputedStyle(element, '').getPropertyValue('justify-self')", "'start'");
    193 
    194 element.style.justifySelf = "unsafe baseline";
    195 shouldBe("getComputedStyle(element, '').getPropertyValue('justify-self')", "'start'");
    196 
    197 element.style.justifySelf = "unsafe safe";
    198 shouldBe("getComputedStyle(element, '').getPropertyValue('justify-self')", "'start'");
    199 
    200 element.style.justifySelf = "unsafe safe left";
    201 shouldBe("getComputedStyle(element, '').getPropertyValue('justify-self')", "'start'");
    202 
    203 element.style.justifySelf = "unsafe left safe";
    204 shouldBe("getComputedStyle(element, '').getPropertyValue('justify-self')", "'start'");
    205 
    206 element.style.justifySelf = "left safe unsafe safe";
    207 shouldBe("getComputedStyle(element, '').getPropertyValue('justify-self')", "'start'");
     222container.appendChild(element);
     223document.body.appendChild(container);
     224
     225checkBadValues(element, "justifySelf", "justify-self",  "unsafe auto");
     226checkBadValues(element, "justifySelf", "justify-self",  "auto safe");
     227checkBadValues(element, "justifySelf", "justify-self",  "auto left");
     228checkBadValues(element, "justifySelf", "justify-self",  "baseline safe");
     229checkBadValues(element, "justifySelf", "justify-self",  "baseline center");
     230checkBadValues(element, "justifySelf", "justify-self",  "stretch unsafe");
     231checkBadValues(element, "justifySelf", "justify-self",  "stretch right");
     232checkBadValues(element, "justifySelf", "justify-self",  "unsafe unsafe");
     233checkBadValues(element, "justifySelf", "justify-self",  "unsafe safe");
     234checkBadValues(element, "justifySelf", "justify-self",  "center start");
     235checkBadValues(element, "justifySelf", "justify-self",  "stretch unsafe");
     236checkBadValues(element, "justifySelf", "justify-self",  "safe stretch");
     237checkBadValues(element, "justifySelf", "justify-self",  "baseline safe");
     238checkBadValues(element, "justifySelf", "justify-self",  "unsafe baseline");
     239checkBadValues(element, "justifySelf", "justify-self",  "unsafe safe left");
     240checkBadValues(element, "justifySelf", "justify-self",  "unsafe left safe");
     241checkBadValues(element, "justifySelf", "justify-self",  "left safe unsafe safe");
     242checkBadValues(element, "justifySelf", "justify-self",  "legacy start");
     243checkBadValues(element, "justifySelf", "justify-self",  "legacy end");
     244checkBadValues(element, "justifySelf", "justify-self",  "legacy right unsafe");
     245checkBadValues(element, "justifySelf", "justify-self",  "legacy auto");
     246checkBadValues(element, "justifySelf", "justify-self",  "legacy stretch");
     247checkBadValues(element, "justifySelf", "justify-self",  "legacy");
     248checkBadValues(element, "justifySelf", "justify-self",  "legacy left right");
    208249
    209250debug("");
    210251debug("Test the value 'initial'");
    211 element.style.justifySelf = "center";
    212 shouldBe("getComputedStyle(element, '').getPropertyValue('justify-self')", "'center'");
    213 element.style.justifySelf = "initial";
    214 shouldBe("getComputedStyle(element, '').getPropertyValue('justify-self')", "'start'");
     252container.style.display = "";
     253checkInitialValues(element, "justifySelf", "justify-self", "center", "normal");
     254
     255debug("");
     256debug("Test the value 'initial' for grid containers");
     257container.style.display = "grid";
     258checkInitialValues(element, "justifySelf", "justify-self", "left safe", "normal");
     259
     260debug("");
     261debug("Test the value 'initial' for flex containers");
     262container.style.display = "flex";
     263checkInitialValues(element, "justifySelf", "justify-self", "right unsafe", "normal");
     264
     265debug("");
     266debug("Test the value 'initial' for positioned elements");
     267container.style.display = "";
     268element.style.position = "absolute";
     269checkInitialValues(element, "justifySelf", "justify-self", "left", "normal");
     270
     271debug("");
     272debug("Test the value 'initial' for positioned elements in grid containers");
     273container.style.display = "grid";
     274element.style.position = "absolute";
     275checkInitialValues(element, "justifySelf", "justify-self", "right", "normal");
     276
     277debug("");
     278debug("Test the value 'initial' for positioned elements in grid containers");
     279container.style.display = "flex";
     280element.style.position = "absolute";
     281checkInitialValues(element, "justifySelf", "justify-self", "end", "normal");
    215282
    216283debug("");
    217284debug("Test the value 'inherit'");
    218 parentElement = document.createElement("div");
    219 document.body.appendChild(parentElement);
    220 parentElement.style.justifySelf = "end";
    221 shouldBe("getComputedStyle(parentElement, '').getPropertyValue('justify-self')", "'end'");
    222 
    223 element = document.createElement("div");
    224 parentElement.appendChild(element);
    225 element.style.justifySelf = "inherit";
    226 shouldBe("getComputedStyle(element, '').getPropertyValue('justify-self')", "'end'");
     285checkInheritValues("justifySelf", "justify-self", "end");
     286checkInheritValues("justifySelf", "justify-self", "left safe");
     287checkInheritValues("justifySelf", "justify-self", "center unsafe");
     288
    227289</script>
    228290</body>
  • trunk/LayoutTests/fast/css/resources/alignment-parsing-utils.js

    r182613 r201498  
    99function checkBadValues(element, property, propertyID, value)
    1010{
     11    var elementID = element.id || "element";
     12    var initialValue = eval("window.getComputedStyle(" + elementID + " , '').getPropertyValue('" + propertyID + "')");
    1113    element.style[property] = value;
    12     checkValues(element, property, propertyID, "", "start");
     14    checkValues(element, property, propertyID, "", initialValue);
    1315}
    1416
  • trunk/LayoutTests/svg/css/getComputedStyle-basic-expected.txt

    r200510 r201498  
    297297rect: style.getPropertyValue(align-content) : normal
    298298rect: style.getPropertyCSSValue(align-content) : [object CSSValueList]
    299 rect: style.getPropertyValue(align-items) : start
     299rect: style.getPropertyValue(align-items) : normal
    300300rect: style.getPropertyCSSValue(align-items) : [object CSSValueList]
    301 rect: style.getPropertyValue(align-self) : start
     301rect: style.getPropertyValue(align-self) : normal
    302302rect: style.getPropertyCSSValue(align-self) : [object CSSValueList]
    303303rect: style.getPropertyValue(filter) : none
     
    309309rect: style.getPropertyValue(justify-content) : normal
    310310rect: style.getPropertyCSSValue(justify-content) : [object CSSValueList]
    311 rect: style.getPropertyValue(justify-self) : start
     311rect: style.getPropertyValue(justify-self) : normal
    312312rect: style.getPropertyCSSValue(justify-self) : [object CSSValueList]
    313 rect: style.getPropertyValue(justify-items) : start
     313rect: style.getPropertyValue(justify-items) : normal
    314314rect: style.getPropertyCSSValue(justify-items) : [object CSSValueList]
    315315rect: style.getPropertyValue(-webkit-font-kerning) : auto
     
    831831g: style.getPropertyValue(align-content) : normal
    832832g: style.getPropertyCSSValue(align-content) : [object CSSValueList]
    833 g: style.getPropertyValue(align-items) : start
     833g: style.getPropertyValue(align-items) : normal
    834834g: style.getPropertyCSSValue(align-items) : [object CSSValueList]
    835 g: style.getPropertyValue(align-self) : start
     835g: style.getPropertyValue(align-self) : normal
    836836g: style.getPropertyCSSValue(align-self) : [object CSSValueList]
    837837g: style.getPropertyValue(filter) : none
     
    843843g: style.getPropertyValue(justify-content) : normal
    844844g: style.getPropertyCSSValue(justify-content) : [object CSSValueList]
    845 g: style.getPropertyValue(justify-self) : start
     845g: style.getPropertyValue(justify-self) : normal
    846846g: style.getPropertyCSSValue(justify-self) : [object CSSValueList]
    847 g: style.getPropertyValue(justify-items) : start
     847g: style.getPropertyValue(justify-items) : normal
    848848g: style.getPropertyCSSValue(justify-items) : [object CSSValueList]
    849849g: style.getPropertyValue(-webkit-font-kerning) : auto
  • trunk/Source/WebCore/ChangeLog

    r201497 r201498  
     12016-05-30  Javier Fernandez  <jfernandez@igalia.com>
     2
     3        [CSS Box Alignment] New CSS Value 'normal' for Self Alignment
     4        https://bugs.webkit.org/show_bug.cgi?id=156254
     5
     6        Reviewed by Darin Adler.
     7
     8        The Box Alignment specification defines a new value 'normal' to be used
     9        as default for the different layout models, which will define the
     10        specific behavior for each case. This patch adds a new CSS value in the
     11        parsing logic and adapts the Self Alignment properties to the new
     12        value.
     13
     14        The 'auto' value is no longer valid for the 'align-items' property and
     15        the Computed Value will be always the specified value. Hence, I removed
     16        the StyleResolver logic because is not required now; the specific
     17        behavior of the 'normal' value will be resolved at layout time.
     18
     19        Additionally, this patch updates the layout logic as well, for both
     20        Flexbox and Grid layout models.
     21
     22        Test: css3/parse-alignment-of-root-elements.html
     23
     24        * css/CSSComputedStyleDeclaration.cpp:
     25        (WebCore::resolveLegacyJustifyItems): Added.
     26        (WebCore::resolveJustifyItemsAuto): Added.
     27        (WebCore::resolveJustifySelfAuto): Added.
     28        (WebCore::resolveAlignSelfAuto): Added.
     29        (WebCore::valueForItemPositionWithOverflowAlignment): Using a StyleSelfAlignmentData argument.
     30        (WebCore::ComputedStyleExtractor::propertyValue): Using the new resolving functions.
     31        * css/CSSParser.cpp:
     32        (WebCore::CSSParser::parseItemPositionOverflowPosition): A new value 'normal' is now valid.
     33        * css/CSSPrimitiveValueMappings.h:
     34        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Mappings for the new value 'normal'.
     35        (WebCore::CSSPrimitiveValue::operator ItemPosition): Mappings for the new value 'normal'.
     36        * css/CSSPropertyNames.in:
     37        * css/StyleResolver.cpp:
     38        (WebCore::StyleResolver::adjustRenderStyle): We don't need to resolve 'legacy" keyword.
     39        * rendering/RenderBox.cpp:
     40        (WebCore::flexItemHasStretchAlignment):
     41        (WebCore::RenderBox::hasStretchedLogicalWidth):
     42        * rendering/RenderFlexibleBox.cpp:
     43        (WebCore::RenderFlexibleBox::styleDidChange):
     44        (WebCore::RenderFlexibleBox::alignmentForChild):
     45        (WebCore::contentAlignmentNormalBehaviorFlexibleBox):
     46        (WebCore::RenderFlexibleBox::layoutAndPlaceChildren):
     47        (WebCore::RenderFlexibleBox::layoutColumnReverse):
     48        (WebCore::RenderFlexibleBox::alignFlexLines):
     49        (WebCore::RenderFlexibleBox::alignChildren):
     50        * rendering/RenderGrid.cpp:
     51        (WebCore::defaultAlignmentChangedToStretchInRowAxis):
     52        (WebCore::defaultAlignmentChangedFromStretchInRowAxis):
     53        (WebCore::defaultAlignmentChangedFromStretchInColumnAxis):
     54        (WebCore::selfAlignmentChangedToStretchInRowAxis):
     55        (WebCore::selfAlignmentChangedFromStretchInRowAxis):
     56        (WebCore::selfAlignmentChangedFromStretchInColumnAxis):
     57        (WebCore::contentAlignmentNormalBehaviorGrid):
     58        (WebCore::RenderGrid::applyStretchAlignmentToTracksIfNeeded):
     59        (WebCore::RenderGrid::needToStretchChildLogicalHeight):
     60        (WebCore::RenderGrid::applyStretchAlignmentToChildIfNeeded):
     61        (WebCore::RenderGrid::columnAxisPositionForChild):
     62        (WebCore::RenderGrid::rowAxisPositionForChild):
     63        (WebCore::RenderGrid::columnAxisOffsetForChild):
     64        (WebCore::RenderGrid::rowAxisOffsetForChild):
     65        (WebCore::RenderGrid::computeContentPositionAndDistributionOffset):
     66        * rendering/style/RenderStyle.cpp:
     67        (WebCore::resolvedSelfAlignment):
     68        (WebCore::RenderStyle::resolvedAlignItems):
     69        (WebCore::RenderStyle::resolvedAlignSelf):
     70        (WebCore::RenderStyle::resolvedJustifyItems):
     71        (WebCore::RenderStyle::resolvedJustifySelf):
     72        * rendering/style/RenderStyle.h:
     73        * rendering/style/RenderStyleConstants.h:
     74        * rendering/style/StyleRareNonInheritedData.cpp:
     75        (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): align-items uses now a different initial function.
     76
    1772016-05-29  Brady Eidson  <beidson@apple.com>
    278
  • trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp

    r201290 r201498  
    22762276}
    22772277
    2278 static ItemPosition resolveContainerAlignmentAuto(ItemPosition position, RenderObject* element)
    2279 {
    2280     if (position != ItemPositionAuto || !element)
    2281         return position;
    2282 
    2283     return element->style().isDisplayFlexibleOrGridBox() ? ItemPositionStretch : ItemPositionStart;
    2284 }
    2285 
    2286 static ItemPosition resolveSelfAlignmentAuto(ItemPosition position, OverflowAlignment& overflow, RenderObject* element)
    2287 {
    2288     if (position != ItemPositionAuto || !element || element->isOutOfFlowPositioned())
    2289         return position;
    2290 
    2291     RenderBlock* parent = element->containingBlock();
    2292     if (!parent)
    2293         return ItemPositionStart;
    2294 
    2295     overflow = parent->style().alignItemsOverflowAlignment();
    2296     return resolveContainerAlignmentAuto(parent->style().alignItemsPosition(), parent);
     2278static StyleSelfAlignmentData resolveLegacyJustifyItems(const StyleSelfAlignmentData& data)
     2279{
     2280    if (data.positionType() == LegacyPosition)
     2281        return { data.position(), OverflowAlignmentDefault };
     2282    return data;
     2283}
     2284
     2285static StyleSelfAlignmentData resolveJustifyItemsAuto(const StyleSelfAlignmentData& data, Node* parent)
     2286{
     2287    if (data.position() != ItemPositionAuto)
     2288        return data;
     2289
     2290    // If the inherited value of justify-items includes the 'legacy' keyword, 'auto' computes to the inherited value.
     2291    const auto& inheritedValue = (!parent || !parent->computedStyle()) ? RenderStyle::initialDefaultAlignment() : parent->computedStyle()->justifyItems();
     2292    if (inheritedValue.positionType() == LegacyPosition)
     2293        return inheritedValue;
     2294    if (inheritedValue.position() == ItemPositionAuto)
     2295        return resolveJustifyItemsAuto(inheritedValue, parent->parentNode());
     2296    return { ItemPositionNormal, OverflowAlignmentDefault };
     2297}
     2298
     2299static StyleSelfAlignmentData resolveJustifySelfAuto(const StyleSelfAlignmentData& data, Node* parent)
     2300{
     2301    if (data.position() != ItemPositionAuto)
     2302        return data;
     2303
     2304    // The 'auto' keyword computes to the computed value of justify-items on the parent or 'normal' if the box has no parent.
     2305    if (!parent || !parent->computedStyle())
     2306        return { ItemPositionNormal, OverflowAlignmentDefault };
     2307    return resolveLegacyJustifyItems(resolveJustifyItemsAuto(parent->computedStyle()->justifyItems(), parent->parentNode()));
     2308}
     2309
     2310static StyleSelfAlignmentData resolveAlignSelfAuto(const StyleSelfAlignmentData& data, Node* parent)
     2311{
     2312    if (data.position() != ItemPositionAuto)
     2313        return data;
     2314
     2315    // The 'auto' keyword computes to the computed value of align-items on the parent or 'normal' if the box has no parent.
     2316    if (!parent || !parent->computedStyle())
     2317        return { ItemPositionNormal, OverflowAlignmentDefault };
     2318    return parent->computedStyle()->alignItems();
    22972319}
    22982320
     
    23772399#endif
    23782400
    2379 static RefPtr<CSSValueList> valueForItemPositionWithOverflowAlignment(ItemPosition itemPosition, OverflowAlignment overflowAlignment, ItemPositionType positionType)
     2401static Ref<CSSValueList> valueForItemPositionWithOverflowAlignment(const StyleSelfAlignmentData& data)
    23802402{
    23812403    auto& cssValuePool = CSSValuePool::singleton();
    2382     RefPtr<CSSValueList> result = CSSValueList::createSpaceSeparated();
    2383     if (positionType == LegacyPosition)
    2384         result->append(CSSPrimitiveValue::createIdentifier(CSSValueLegacy));
    2385     result->append(cssValuePool.createValue(itemPosition));
    2386     if (overflowAlignment != OverflowAlignmentDefault)
    2387         result->append(cssValuePool.createValue(overflowAlignment));
    2388     ASSERT(result->length() <= 2);
     2404    auto result = CSSValueList::createSpaceSeparated();
     2405    if (data.positionType() == LegacyPosition)
     2406        result.get().append(cssValuePool.createIdentifierValue(CSSValueLegacy));
     2407    result.get().append(cssValuePool.createValue(data.position()));
     2408    if (data.position() >= ItemPositionCenter && data.overflow() != OverflowAlignmentDefault)
     2409        result.get().append(cssValuePool.createValue(data.overflow()));
     2410    ASSERT(result.get().length() <= 2);
    23892411    return result;
    23902412}
    23912413
    2392 static RefPtr<CSSValueList> valueForContentPositionAndDistributionWithOverflowAlignment(const StyleContentAlignmentData& data)
    2393 {
    2394     RefPtr<CSSValueList> result = CSSValueList::createSpaceSeparated();
     2414static Ref<CSSValueList> valueForContentPositionAndDistributionWithOverflowAlignment(const StyleContentAlignmentData& data)
     2415{
     2416    auto& cssValuePool = CSSValuePool::singleton();
     2417    auto result = CSSValueList::createSpaceSeparated();
    23952418    if (data.distribution() != ContentDistributionDefault)
    2396         result->append(CSSPrimitiveValue::create(data.distribution()));
     2419        result.get().append(cssValuePool.createValue(data.distribution()));
    23972420    if (data.distribution() == ContentDistributionDefault || data.position() != ContentPositionNormal)
    2398         result->append(CSSPrimitiveValue::create(data.position()));
     2421        result.get().append(cssValuePool.createValue(data.position()));
    23992422    if ((data.position() >= ContentPositionCenter || data.distribution() != ContentDistributionDefault) && data.overflow() != OverflowAlignmentDefault)
    2400         result->append(CSSPrimitiveValue::create(data.overflow()));
    2401     ASSERT(result->length() > 0);
    2402     ASSERT(result->length() <= 3);
     2423        result.get().append(cssValuePool.createValue(data.overflow()));
     2424    ASSERT(result.get().length() > 0);
     2425    ASSERT(result.get().length() <= 3);
    24032426    return result;
    24042427}
     
    27802803            return valueForContentPositionAndDistributionWithOverflowAlignment(style->alignContent());
    27812804        case CSSPropertyAlignItems:
    2782             return valueForItemPositionWithOverflowAlignment(resolveContainerAlignmentAuto(style->alignItemsPosition(), renderer), style->alignItemsOverflowAlignment(), NonLegacyPosition);
    2783         case CSSPropertyAlignSelf: {
    2784             OverflowAlignment overflow = style->alignSelfOverflowAlignment();
    2785             ItemPosition alignSelf = resolveSelfAlignmentAuto(style->alignSelfPosition(), overflow, renderer);
    2786             return valueForItemPositionWithOverflowAlignment(alignSelf, overflow, NonLegacyPosition);
    2787         }
     2805            return valueForItemPositionWithOverflowAlignment(style->alignItems());
     2806        case CSSPropertyAlignSelf:
     2807            return valueForItemPositionWithOverflowAlignment(resolveAlignSelfAuto(style->alignSelf(), styledNode->parentNode()));
    27882808        case CSSPropertyFlex:
    27892809            return getCSSPropertyValuesForShorthandProperties(flexShorthand());
     
    28032823            return valueForContentPositionAndDistributionWithOverflowAlignment(style->justifyContent());
    28042824        case CSSPropertyJustifyItems:
    2805             return valueForItemPositionWithOverflowAlignment(resolveContainerAlignmentAuto(style->justifyItemsPosition(), renderer), style->justifyItemsOverflowAlignment(), style->justifyItemsPositionType());
    2806         case CSSPropertyJustifySelf: {
    2807             OverflowAlignment overflow = style->justifySelfOverflowAlignment();
    2808             ItemPosition justifySelf = resolveSelfAlignmentAuto(style->justifySelfPosition(), overflow, renderer);
    2809             return valueForItemPositionWithOverflowAlignment(justifySelf, overflow, NonLegacyPosition);
    2810         }
     2825            return valueForItemPositionWithOverflowAlignment(resolveJustifyItemsAuto(style->justifyItems(), styledNode->parentNode()));
     2826        case CSSPropertyJustifySelf:
     2827            return valueForItemPositionWithOverflowAlignment(resolveJustifySelfAuto(style->justifySelf(), styledNode->parentNode()));
    28112828        case CSSPropertyOrder:
    28122829            return cssValuePool.createValue(style->order(), CSSPrimitiveValue::CSS_NUMBER);
  • trunk/Source/WebCore/css/CSSParser.cpp

    r201441 r201498  
    34243424bool CSSParser::parseItemPositionOverflowPosition(CSSPropertyID propId, bool important)
    34253425{
    3426     // auto | stretch | <baseline-position> | [<item-position> && <overflow-position>? ]
     3426    // auto | normal | stretch | <baseline-position> | [<item-position> && <overflow-position>? ]
    34273427    // <baseline-position> = baseline | last-baseline;
    34283428    // <item-position> = center | start | end | self-start | self-end | flex-start | flex-end | left | right;
    3429     // <overflow-position> = true | safe
     3429    // <overflow-position> = unsafe | safe
    34303430
    34313431    CSSParserValue* value = m_valueList->current();
     
    34333433        return false;
    34343434
    3435     if (value->id == CSSValueAuto || value->id == CSSValueStretch || isBaselinePositionKeyword(value->id)) {
     3435    if (value->id == CSSValueAuto || value->id == CSSValueNormal || value->id == CSSValueStretch || isBaselinePositionKeyword(value->id)) {
     3436        // align-items property does not allow the 'auto' value.
     3437        if (value->id == CSSValueAuto && propId == CSSPropertyAlignItems)
     3438            return false;
    34363439        if (m_valueList->next())
    34373440            return false;
  • trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h

    r200510 r201498  
    51195119        m_value.valueID = CSSValueAuto;
    51205120        break;
     5121    case ItemPositionNormal:
     5122        m_value.valueID = CSSValueNormal;
     5123        break;
    51215124    case ItemPositionStretch:
    51225125        m_value.valueID = CSSValueStretch;
     
    51635166    case CSSValueAuto:
    51645167        return ItemPositionAuto;
     5168    case CSSValueNormal:
     5169        return ItemPositionNormal;
    51655170    case CSSValueStretch:
    51665171        return ItemPositionStretch;
  • trunk/Source/WebCore/css/CSSPropertyNames.in

    r200769 r201498  
    469469align-content [Initial=initialContentAlignment, Converter=ContentAlignmentData]
    470470-webkit-align-content = align-content
    471 align-items [Initial=initialSelfAlignment, Converter=SelfOrDefaultAlignmentData]
     471align-items [Initial=initialDefaultAlignment, Converter=SelfOrDefaultAlignmentData]
    472472-webkit-align-items = align-items
    473473align-self [Initial=initialSelfAlignment, Converter=SelfOrDefaultAlignmentData]
  • trunk/Source/WebCore/css/StyleResolver.cpp

    r201441 r201498  
    10101010            style.setDisplay(BLOCK);
    10111011    }
    1012 
    1013     // If the inherited value of justify-items includes the legacy keyword, 'auto'
    1014     // computes to the the inherited value.
    1015     if (parentStyle.justifyItemsPositionType() == LegacyPosition && style.justifyItemsPosition() == ItemPositionAuto)
    1016         style.setJustifyItems(parentStyle.justifyItems());
    10171012}
    10181013
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r201407 r201498  
    25202520{
    25212521    auto parent = flexitem.parent();
    2522     return RenderStyle::resolveAlignment(parent->style(), flexitem.style(), ItemPositionStretch) == ItemPositionStretch;
     2522    return flexitem.style().resolvedAlignSelf(parent->style(), ItemPositionStretch).position() == ItemPositionStretch;
    25232523}
    25242524
     
    25482548    }
    25492549    if (containingBlock->isHorizontalWritingMode() != isHorizontalWritingMode())
    2550         return RenderStyle::resolveAlignment(containingBlock->style(), style, ItemPositionStretch) == ItemPositionStretch;
    2551     return RenderStyle::resolveJustification(containingBlock->style(), style, ItemPositionStretch) == ItemPositionStretch;
     2550        return style.resolvedAlignSelf(containingBlock->style(), ItemPositionStretch).position() == ItemPositionStretch;
     2551    return style.resolvedJustifySelf(containingBlock->style(), ItemPositionStretch).position() == ItemPositionStretch;
    25522552}
    25532553
  • trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp

    r201218 r201498  
    4040namespace WebCore {
    4141
     42static constexpr ItemPosition selfAlignmentNormalBehaviorFlexibleBox = ItemPositionStretch;
     43
    4244struct RenderFlexibleBox::LineContext {
    4345    LineContext(LayoutUnit crossAxisOffset, LayoutUnit crossAxisExtent, size_t numberOfChildren, LayoutUnit maxAscent)
     
    232234    RenderBlock::styleDidChange(diff, oldStyle);
    233235
    234     if (oldStyle && (oldStyle->alignItemsPosition() == ItemPositionStretch || oldStyle->alignItemsPosition() == ItemPositionAuto) && diff == StyleDifferenceLayout) {
     236    if (oldStyle && oldStyle->resolvedAlignItems(selfAlignmentNormalBehaviorFlexibleBox).position() == ItemPositionStretch && diff == StyleDifferenceLayout) {
    235237        // Flex items that were previously stretching need to be relayed out so we can compute new available cross axis space.
    236238        // This is only necessary for stretching since other alignment values don't change the size of the box.
     239        auto& newStyle = style();
    237240        for (RenderBox* child = firstChildBox(); child; child = child->nextSiblingBox()) {
    238             ItemPosition previousAlignment = RenderStyle::resolveAlignment(*oldStyle, child->style(), ItemPositionStretch);
    239             if (previousAlignment == ItemPositionStretch && previousAlignment != RenderStyle::resolveAlignment(style(), child->style(), ItemPositionStretch))
     241            auto& childStyle = child->style();
     242            auto previousAlignment = childStyle.resolvedAlignSelf(*oldStyle, selfAlignmentNormalBehaviorFlexibleBox).position();
     243            if (previousAlignment == ItemPositionStretch && previousAlignment != childStyle.resolvedAlignSelf(newStyle, selfAlignmentNormalBehaviorFlexibleBox).position())
    240244                child->setChildNeedsLayout(MarkOnlyThis);
    241245        }
     
    10471051ItemPosition RenderFlexibleBox::alignmentForChild(RenderBox& child) const
    10481052{
    1049     ItemPosition align = RenderStyle::resolveAlignment(style(), child.style(), ItemPositionStretch);
     1053    ItemPosition align = child.style().resolvedAlignSelf(style(), selfAlignmentNormalBehaviorFlexibleBox).position();
    10501054
    10511055    if (align == ItemPositionBaseline && hasOrthogonalFlow(child))
     
    10951099}
    10961100
    1097 static const StyleContentAlignmentData& normalValueBehaviorFlexibleBox()
     1101static const StyleContentAlignmentData& contentAlignmentNormalBehaviorFlexibleBox()
    10981102{
    10991103    // The justify-content property applies along the main axis, but since flexing
     
    11091113    ASSERT(childSizes.size() == children.size());
    11101114
    1111     ContentPosition position = style().resolvedJustifyContentPosition(normalValueBehaviorFlexibleBox());
    1112     ContentDistributionType distribution = style().resolvedJustifyContentDistribution(normalValueBehaviorFlexibleBox());
     1115    auto position = style().resolvedJustifyContentPosition(contentAlignmentNormalBehaviorFlexibleBox());
     1116    auto distribution = style().resolvedJustifyContentDistribution(contentAlignmentNormalBehaviorFlexibleBox());
    11131117
    11141118    size_t numberOfChildrenForJustifyContent = numberOfInFlowPositionedChildren(children);
     
    11931197void RenderFlexibleBox::layoutColumnReverse(const OrderedFlexItemList& children, LayoutUnit crossAxisOffset, LayoutUnit availableFreeSpace)
    11941198{
    1195     ContentPosition position = style().resolvedJustifyContentPosition(normalValueBehaviorFlexibleBox());
    1196     ContentDistributionType distribution = style().resolvedJustifyContentDistribution(normalValueBehaviorFlexibleBox());
     1199    auto position = style().resolvedJustifyContentPosition(contentAlignmentNormalBehaviorFlexibleBox());
     1200    auto distribution = style().resolvedJustifyContentDistribution(contentAlignmentNormalBehaviorFlexibleBox());
    11971201
    11981202    // This is similar to the logic in layoutAndPlaceChildren, except we place the children
     
    12511255void RenderFlexibleBox::alignFlexLines(Vector<LineContext>& lineContexts)
    12521256{
    1253     ContentPosition position = style().resolvedAlignContentPosition(normalValueBehaviorFlexibleBox());
    1254     ContentDistributionType distribution = style().resolvedAlignContentDistribution(normalValueBehaviorFlexibleBox());
     1257    ContentPosition position = style().resolvedAlignContentPosition(contentAlignmentNormalBehaviorFlexibleBox());
     1258    ContentDistributionType distribution = style().resolvedAlignContentDistribution(contentAlignmentNormalBehaviorFlexibleBox());
    12551259
    12561260    if (!isMultiline() || position == ContentPositionFlexStart)
     
    13141318            switch (alignmentForChild(*child)) {
    13151319            case ItemPositionAuto:
     1320            case ItemPositionNormal:
    13161321                ASSERT_NOT_REACHED();
    13171322                break;
  • trunk/Source/WebCore/rendering/RenderGrid.cpp

    r201399 r201498  
    4040
    4141static const int infinity = -1;
     42static constexpr ItemPosition selfAlignmentNormalBehavior = ItemPositionStretch;
    4243
    4344class GridTrack {
     
    265266static inline bool defaultAlignmentChangedToStretchInRowAxis(const RenderStyle& oldStyle, const RenderStyle& newStyle)
    266267{
    267     return !defaultAlignmentIsStretch(oldStyle.justifyItemsPosition()) && defaultAlignmentIsStretch(newStyle.justifyItemsPosition());
     268    return !defaultAlignmentIsStretch(oldStyle.justifyItems().position()) && defaultAlignmentIsStretch(newStyle.justifyItems().position());
    268269}
    269270
    270271static inline bool defaultAlignmentChangedFromStretchInRowAxis(const RenderStyle& oldStyle, const RenderStyle& newStyle)
    271272{
    272     return defaultAlignmentIsStretch(oldStyle.justifyItemsPosition()) && !defaultAlignmentIsStretch(newStyle.justifyItemsPosition());
     273    return defaultAlignmentIsStretch(oldStyle.justifyItems().position()) && !defaultAlignmentIsStretch(newStyle.justifyItems().position());
    273274}
    274275
    275276static inline bool defaultAlignmentChangedFromStretchInColumnAxis(const RenderStyle& oldStyle, const RenderStyle& newStyle)
    276277{
    277     return defaultAlignmentIsStretch(oldStyle.alignItemsPosition()) && !defaultAlignmentIsStretch(newStyle.alignItemsPosition());
     278    return defaultAlignmentIsStretch(oldStyle.alignItems().position()) && !defaultAlignmentIsStretch(newStyle.alignItems().position());
    278279}
    279280
    280281static inline bool selfAlignmentChangedToStretchInRowAxis(const RenderStyle& oldStyle, const RenderStyle& newStyle, const RenderStyle& childStyle)
    281282{
    282     return RenderStyle::resolveJustification(oldStyle, childStyle, ItemPositionStretch) != ItemPositionStretch
    283         && RenderStyle::resolveJustification(newStyle, childStyle, ItemPositionStretch) == ItemPositionStretch;
     283    return childStyle.resolvedJustifySelf(oldStyle, selfAlignmentNormalBehavior).position() != ItemPositionStretch
     284        && childStyle.resolvedJustifySelf(newStyle, selfAlignmentNormalBehavior).position() == ItemPositionStretch;
    284285}
    285286
    286287static inline bool selfAlignmentChangedFromStretchInRowAxis(const RenderStyle& oldStyle, const RenderStyle& newStyle, const RenderStyle& childStyle)
    287288{
    288     return RenderStyle::resolveJustification(oldStyle, childStyle, ItemPositionStretch) == ItemPositionStretch
    289         && RenderStyle::resolveJustification(newStyle, childStyle, ItemPositionStretch) != ItemPositionStretch;
     289    return childStyle.resolvedJustifySelf(oldStyle, selfAlignmentNormalBehavior).position() == ItemPositionStretch
     290        && childStyle.resolvedJustifySelf(newStyle, selfAlignmentNormalBehavior).position() != ItemPositionStretch;
    290291}
    291292
    292293static inline bool selfAlignmentChangedFromStretchInColumnAxis(const RenderStyle& oldStyle, const RenderStyle& newStyle, const RenderStyle& childStyle)
    293294{
    294     return RenderStyle::resolveAlignment(oldStyle, childStyle, ItemPositionStretch) == ItemPositionStretch
    295         && RenderStyle::resolveAlignment(newStyle, childStyle, ItemPositionStretch) != ItemPositionStretch;
     295    return childStyle.resolvedAlignSelf(oldStyle, selfAlignmentNormalBehavior).position() == ItemPositionStretch
     296        && childStyle.resolvedAlignSelf(newStyle, selfAlignmentNormalBehavior).position() != ItemPositionStretch;
    296297}
    297298
     
    15121513}
    15131514
    1514 static const StyleContentAlignmentData& normalValueBehaviorGrid()
     1515static const StyleContentAlignmentData& contentAlignmentNormalBehaviorGrid()
    15151516{
    15161517    static const StyleContentAlignmentData normalBehavior = {ContentPositionNormal, ContentDistributionStretch};
     
    15231524    if (!freeSpace
    15241525        || freeSpace.value() <= 0
    1525         || (direction == ForColumns && style().resolvedJustifyContentDistribution(normalValueBehaviorGrid()) != ContentDistributionStretch)
    1526         || (direction == ForRows && style().resolvedAlignContentDistribution(normalValueBehaviorGrid()) != ContentDistributionStretch))
     1526        || (direction == ForColumns && style().resolvedJustifyContentDistribution(contentAlignmentNormalBehaviorGrid()) != ContentDistributionStretch)
     1527        || (direction == ForRows && style().resolvedAlignContentDistribution(contentAlignmentNormalBehaviorGrid()) != ContentDistributionStretch))
    15271528        return;
    15281529
     
    18041805bool RenderGrid::needToStretchChildLogicalHeight(const RenderBox& child) const
    18051806{
    1806     if (RenderStyle::resolveAlignment(style(), child.style(), ItemPositionStretch) != ItemPositionStretch)
     1807    if (child.style().resolvedAlignSelf(style(), selfAlignmentNormalBehavior).position() != ItemPositionStretch)
    18071808        return false;
    18081809
     
    18531854    bool hasAutoSizeInColumnAxis = isHorizontalMode ? childStyle.height().isAuto() : childStyle.width().isAuto();
    18541855    bool allowedToStretchChildAlongColumnAxis = hasAutoSizeInColumnAxis && !childStyle.marginBeforeUsing(&gridStyle).isAuto() && !childStyle.marginAfterUsing(&gridStyle).isAuto();
    1855     if (allowedToStretchChildAlongColumnAxis && RenderStyle::resolveAlignment(gridStyle, childStyle, ItemPositionStretch) == ItemPositionStretch) {
     1856    if (allowedToStretchChildAlongColumnAxis && childStyle.resolvedAlignSelf(style(), selfAlignmentNormalBehavior).position() == ItemPositionStretch) {
    18561857        // TODO (lajava): If the child has orthogonal flow, then it already has an override height set, so use it.
    18571858        // TODO (lajava): grid track sizing and positioning do not support orthogonal modes yet.
     
    19341935    bool hasSameWritingMode = child.style().writingMode() == style().writingMode();
    19351936
    1936     switch (RenderStyle::resolveAlignment(style(), child.style(), ItemPositionStretch)) {
     1937    switch (child.style().resolvedAlignSelf(style(), selfAlignmentNormalBehavior).position()) {
    19371938    case ItemPositionSelfStart:
    19381939        // If orthogonal writing-modes, this computes to 'start'.
     
    19701971        return GridAxisStart;
    19711972    case ItemPositionAuto:
     1973    case ItemPositionNormal:
    19721974        break;
    19731975    }
     
    19831985    bool isLTR = style().isLeftToRightDirection();
    19841986
    1985     switch (RenderStyle::resolveJustification(style(), child.style(), ItemPositionStretch)) {
     1987    switch (child.style().resolvedJustifySelf(style(), selfAlignmentNormalBehavior).position()) {
    19861988    case ItemPositionSelfStart:
    19871989        // For orthogonal writing-modes, this computes to 'start'
     
    20122014        return GridAxisStart;
    20132015    case ItemPositionAuto:
     2016    case ItemPositionNormal:
    20142017        break;
    20152018    }
     
    20412044            endOfRow -= guttersSize(ForRows, 2) + m_offsetBetweenRows;
    20422045        LayoutUnit childBreadth = child.logicalHeight() + child.marginLogicalHeight();
    2043         LayoutUnit offsetFromStartPosition = computeOverflowAlignmentOffset(RenderStyle::resolveAlignmentOverflow(style(), child.style()), endOfRow - startOfRow, childBreadth);
     2046        auto overflow = child.style().resolvedAlignSelf(style(), selfAlignmentNormalBehavior).overflow();
     2047        LayoutUnit offsetFromStartPosition = computeOverflowAlignmentOffset(overflow, endOfRow - startOfRow, childBreadth);
    20442048        return startPosition + (axisPosition == GridAxisEnd ? offsetFromStartPosition : offsetFromStartPosition / 2);
    20452049    }
     
    20732077            endOfColumn -= guttersSize(ForColumns, 2) + m_offsetBetweenColumns;
    20742078        LayoutUnit childBreadth = child.logicalWidth() + child.marginLogicalWidth();
    2075         LayoutUnit offsetFromStartPosition = computeOverflowAlignmentOffset(RenderStyle::resolveJustificationOverflow(style(), child.style()), endOfColumn - startOfColumn, childBreadth);
     2079        auto overflow = child.style().resolvedJustifySelf(style(), selfAlignmentNormalBehavior).overflow();
     2080        LayoutUnit offsetFromStartPosition = computeOverflowAlignmentOffset(overflow, endOfColumn - startOfColumn, childBreadth);
    20762081        return startPosition + (axisPosition == GridAxisEnd ? offsetFromStartPosition : offsetFromStartPosition / 2);
    20772082    }
     
    21352140{
    21362141    bool isRowAxis = direction == ForColumns;
    2137     ContentPosition position = isRowAxis ? style().resolvedJustifyContentPosition(normalValueBehaviorGrid()) : style().resolvedAlignContentPosition(normalValueBehaviorGrid());
    2138     ContentDistributionType distribution = isRowAxis ? style().resolvedJustifyContentDistribution(normalValueBehaviorGrid()) : style().resolvedAlignContentDistribution(normalValueBehaviorGrid());
     2142    auto position = isRowAxis ? style().resolvedJustifyContentPosition(contentAlignmentNormalBehaviorGrid()) : style().resolvedAlignContentPosition(contentAlignmentNormalBehaviorGrid());
     2143    auto distribution = isRowAxis ? style().resolvedJustifyContentDistribution(contentAlignmentNormalBehaviorGrid()) : style().resolvedAlignContentDistribution(contentAlignmentNormalBehaviorGrid());
    21392144    // If <content-distribution> value can't be applied, 'position' will become the associated
    21402145    // <content-position> fallback value.
    2141     ContentAlignmentData contentAlignment = contentDistributionOffset(availableFreeSpace, position, distribution, numberOfGridTracks);
     2146    auto contentAlignment = contentDistributionOffset(availableFreeSpace, position, distribution, numberOfGridTracks);
    21422147    if (contentAlignment.isValid())
    21432148        return contentAlignment;
    21442149
    2145     OverflowAlignment overflow = isRowAxis ? style().justifyContentOverflowAlignment() : style().alignContentOverflowAlignment();
     2150    auto overflow = isRowAxis ? style().justifyContentOverflowAlignment() : style().alignContentOverflowAlignment();
    21462151    if (availableFreeSpace <= 0 && overflow == OverflowAlignmentSafe)
    21472152        return {0, 0};
  • trunk/Source/WebCore/rendering/style/RenderStyle.cpp

    r201290 r201498  
    191191}
    192192
    193 static inline StyleSelfAlignmentData resolveAlignmentData(const RenderStyle& parentStyle, const RenderStyle& childStyle, ItemPosition resolvedAutoPositionForRenderer)
    194 {
    195     // The auto keyword computes to the parent's align-items computed value, or to "stretch", if not set or "auto".
    196     if (childStyle.alignSelfPosition() == ItemPositionAuto)
    197         return (parentStyle.alignItemsPosition() == ItemPositionAuto) ? StyleSelfAlignmentData(resolvedAutoPositionForRenderer, OverflowAlignmentDefault) : parentStyle.alignItems();
    198     return childStyle.alignSelf();
    199 }
    200 
    201 static inline StyleSelfAlignmentData resolveJustificationData(const RenderStyle& parentStyle, const RenderStyle& childStyle, ItemPosition resolvedAutoPositionForRenderer)
    202 {
    203     // The auto keyword computes to the parent's justify-items computed value, or to "stretch", if not set or "auto".
    204     if (childStyle.justifySelfPosition() == ItemPositionAuto)
    205         return (parentStyle.justifyItemsPosition() == ItemPositionAuto) ? StyleSelfAlignmentData(resolvedAutoPositionForRenderer, OverflowAlignmentDefault) : parentStyle.justifyItems();
    206     return childStyle.justifySelf();
    207 }
    208 
    209 ItemPosition RenderStyle::resolveAlignment(const RenderStyle& parentStyle, const RenderStyle& childStyle, ItemPosition resolvedAutoPositionForRenderer)
    210 {
    211     return resolveAlignmentData(parentStyle, childStyle, resolvedAutoPositionForRenderer).position();
    212 }
    213 
    214 OverflowAlignment RenderStyle::resolveAlignmentOverflow(const RenderStyle& parentStyle, const RenderStyle& childStyle)
    215 {
    216     return resolveAlignmentData(parentStyle, childStyle, ItemPositionStretch).overflow();
    217 }
    218 
    219 ItemPosition RenderStyle::resolveJustification(const RenderStyle& parentStyle, const RenderStyle& childStyle, ItemPosition resolvedAutoPositionForRenderer)
    220 {
    221     return resolveJustificationData(parentStyle, childStyle, resolvedAutoPositionForRenderer).position();
    222 }
    223 
    224 OverflowAlignment RenderStyle::resolveJustificationOverflow(const RenderStyle& parentStyle, const RenderStyle& childStyle)
    225 {
    226     return resolveJustificationData(parentStyle, childStyle, ItemPositionStretch).overflow();
     193static StyleSelfAlignmentData resolvedSelfAlignment(const StyleSelfAlignmentData& value, ItemPosition normalValueBehavior)
     194{
     195    ASSERT(value.position() != ItemPositionAuto);
     196    if (value.position() == ItemPositionNormal)
     197        return { normalValueBehavior, OverflowAlignmentDefault };
     198    return value;
     199}
     200
     201StyleSelfAlignmentData RenderStyle::resolvedAlignItems(ItemPosition normalValueBehaviour) const
     202{
     203    return resolvedSelfAlignment(alignItems(), normalValueBehaviour);
     204}
     205
     206StyleSelfAlignmentData RenderStyle::resolvedAlignSelf(const RenderStyle& parentStyle, ItemPosition normalValueBehaviour) const
     207{
     208    // The auto keyword computes to the parent's align-items computed value.
     209    // We will return the behaviour of 'normal' value if needed, which is specific of each layout model.
     210    if (alignSelfPosition() == ItemPositionAuto)
     211        return parentStyle.resolvedAlignItems(normalValueBehaviour);
     212    return resolvedSelfAlignment(alignSelf(), normalValueBehaviour);
     213}
     214
     215StyleSelfAlignmentData RenderStyle::resolvedJustifyItems(ItemPosition normalValueBehaviour) const
     216{
     217    // FIXME: justify-items 'auto' value is allowed only to provide the 'legacy' keyword's behavior, which it's still not implemented for layout.
     218    // "If the inherited value of justify-items includes the legacy keyword, auto computes to the inherited value."
     219    // https://drafts.csswg.org/css-align/#justify-items-property
     220    if (justifyItemsPosition() == ItemPositionAuto)
     221        return { normalValueBehaviour, OverflowAlignmentDefault };
     222
     223    return resolvedSelfAlignment(justifyItems(), normalValueBehaviour);
     224}
     225
     226StyleSelfAlignmentData RenderStyle::resolvedJustifySelf(const RenderStyle& parentStyle, ItemPosition normalValueBehaviour) const
     227{
     228    // The auto keyword computes to the parent's justify-items computed value.
     229    // We will return the behaviour of 'normal' value if needed, which is specific of each layout model.
     230    if (justifySelfPosition() == ItemPositionAuto)
     231        return parentStyle.resolvedJustifyItems(normalValueBehaviour);
     232    return resolvedSelfAlignment(justifySelf(), normalValueBehaviour);
    227233}
    228234
  • trunk/Source/WebCore/rendering/style/RenderStyle.h

    r201086 r201498  
    509509    ContentPosition resolvedAlignContentPosition(const StyleContentAlignmentData& normalValueBehavior) const;
    510510    ContentDistributionType resolvedAlignContentDistribution(const StyleContentAlignmentData& normalValueBehavior) const;
    511     static ItemPosition resolveAlignment(const RenderStyle& parentStyle, const RenderStyle& childStyle, ItemPosition resolvedAutoPositionForRenderer);
    512     static OverflowAlignment resolveAlignmentOverflow(const RenderStyle& parentStyle, const RenderStyle& childStyle);
    513     static ItemPosition resolveJustification(const RenderStyle& parentStyle, const RenderStyle& childStyle, ItemPosition resolvedAutoPositionForRenderer);
    514     static OverflowAlignment resolveJustificationOverflow(const RenderStyle& parentStyle, const RenderStyle& childStyle);
     511    StyleSelfAlignmentData resolvedAlignItems(ItemPosition normalValueBehaviour) const;
     512    StyleSelfAlignmentData resolvedAlignSelf(const RenderStyle& parentStyle, ItemPosition normalValueBehaviour) const;
     513    StyleSelfAlignmentData resolvedJustifyItems(ItemPosition normalValueBehaviour) const;
     514    StyleSelfAlignmentData resolvedJustifySelf(const RenderStyle& parentStyle, ItemPosition normalValueBehaviour) const;
    515515
    516516    enum IsAtShadowBoundary {
     
    20052005    static int initialOrder() { return 0; }
    20062006    static StyleSelfAlignmentData initialSelfAlignment() { return StyleSelfAlignmentData(ItemPositionAuto, OverflowAlignmentDefault); }
     2007    static StyleSelfAlignmentData initialDefaultAlignment() { return StyleSelfAlignmentData(ItemPositionNormal, OverflowAlignmentDefault); }
    20072008    static StyleContentAlignmentData initialContentAlignment() { return StyleContentAlignmentData(ContentPositionNormal, ContentDistributionDefault, OverflowAlignmentDefault); }
    20082009    static EFlexDirection initialFlexDirection() { return FlowRow; }
  • trunk/Source/WebCore/rendering/style/RenderStyleConstants.h

    r200182 r201498  
    255255enum EFlexDirection { FlowRow, FlowRowReverse, FlowColumn, FlowColumnReverse };
    256256enum EFlexWrap { FlexNoWrap, FlexWrap, FlexWrapReverse };
    257 enum ItemPosition {ItemPositionAuto, ItemPositionStretch, ItemPositionBaseline, ItemPositionLastBaseline, ItemPositionCenter, ItemPositionStart, ItemPositionEnd, ItemPositionSelfStart, ItemPositionSelfEnd, ItemPositionFlexStart, ItemPositionFlexEnd, ItemPositionLeft, ItemPositionRight};
    258 enum OverflowAlignment {OverflowAlignmentDefault, OverflowAlignmentUnsafe, OverflowAlignmentSafe};
    259 enum ItemPositionType {NonLegacyPosition, LegacyPosition};
    260 enum ContentPosition {ContentPositionNormal, ContentPositionBaseline, ContentPositionLastBaseline, ContentPositionCenter, ContentPositionStart, ContentPositionEnd, ContentPositionFlexStart, ContentPositionFlexEnd, ContentPositionLeft, ContentPositionRight};
    261 enum ContentDistributionType {ContentDistributionDefault, ContentDistributionSpaceBetween, ContentDistributionSpaceAround, ContentDistributionSpaceEvenly, ContentDistributionStretch};
     257enum ItemPosition { ItemPositionAuto, ItemPositionNormal, ItemPositionStretch, ItemPositionBaseline, ItemPositionLastBaseline, ItemPositionCenter, ItemPositionStart, ItemPositionEnd, ItemPositionSelfStart, ItemPositionSelfEnd, ItemPositionFlexStart, ItemPositionFlexEnd, ItemPositionLeft, ItemPositionRight };
     258enum OverflowAlignment { OverflowAlignmentDefault, OverflowAlignmentUnsafe, OverflowAlignmentSafe };
     259enum ItemPositionType { NonLegacyPosition, LegacyPosition };
     260enum ContentPosition { ContentPositionNormal, ContentPositionBaseline, ContentPositionLastBaseline, ContentPositionCenter, ContentPositionStart, ContentPositionEnd, ContentPositionFlexStart, ContentPositionFlexEnd, ContentPositionLeft, ContentPositionRight };
     261enum ContentDistributionType { ContentDistributionDefault, ContentDistributionSpaceBetween, ContentDistributionSpaceAround, ContentDistributionSpaceEvenly, ContentDistributionStretch };
    262262
    263263enum ETextSecurity {
  • trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp

    r201086 r201498  
    7676    , m_regionThread(RenderStyle::initialRegionThread())
    7777    , m_alignContent(RenderStyle::initialContentAlignment())
    78     , m_alignItems(RenderStyle::initialSelfAlignment())
     78    , m_alignItems(RenderStyle::initialDefaultAlignment())
    7979    , m_alignSelf(RenderStyle::initialSelfAlignment())
    8080    , m_justifyContent(RenderStyle::initialContentAlignment())
Note: See TracChangeset for help on using the changeset viewer.