Changeset 205102 in webkit


Ignore:
Timestamp:
Aug 28, 2016 7:45:43 AM (8 years ago)
Author:
jfernandez@igalia.com
Message:

Should never be reached failure in WebCore::RenderFlexibleBox::alignChildren
https://bugs.webkit.org/show_bug.cgi?id=151591
<rdar://problem/27711829>

Reviewed by Darin Adler.

Source/WebCore:

The align-self and align-items CSS properties were originally defined in the
Flexbible Box specification. The new CSS Box Alignment specification tries
to generalize them so they can be used by other layout models, as it's the
case of the GridLayout spec.

Since we have implemented the Grid Layout spec behind a runtime flag, we should
do the same with the new syntax of these properties.

Test: css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled.html

  • css/CSSParser.cpp:

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

  • rendering/RenderFlexibleBox.cpp:

(WebCore::RenderFlexibleBox::alignChildren):

LayoutTests:

Test to verify that align-self and align-items CSS properties use the old
syntax when the Grid Layout feature is not enabled.

  • css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled-expected.txt: Added.
  • css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled.html: Added.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r205101 r205102  
     12016-08-28  Javier Fernandez  <jfernandez@igalia.com>
     2
     3        Should never be reached failure in WebCore::RenderFlexibleBox::alignChildren
     4        https://bugs.webkit.org/show_bug.cgi?id=151591
     5        <rdar://problem/27711829>
     6
     7        Reviewed by Darin Adler.
     8
     9        Test to verify that align-self and align-items CSS properties use the old
     10        syntax when the Grid Layout feature is not enabled.
     11
     12        * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled-expected.txt: Added.
     13        * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled.html: Added.
     14
    1152016-08-28  Frederic Wang  <fwang@igalia.com>
    216
  • trunk/Source/WebCore/ChangeLog

    r205101 r205102  
     12016-08-28  Javier Fernandez  <jfernandez@igalia.com>
     2
     3        Should never be reached failure in WebCore::RenderFlexibleBox::alignChildren
     4        https://bugs.webkit.org/show_bug.cgi?id=151591
     5        <rdar://problem/27711829>
     6
     7        Reviewed by Darin Adler.
     8
     9        The align-self and align-items CSS properties were originally defined in the
     10        Flexbible Box specification. The new CSS Box Alignment specification tries
     11        to generalize them so they can be used by other layout models, as it's  the
     12        case of the GridLayout spec.
     13
     14        Since we have implemented the Grid Layout spec behind a runtime flag, we should
     15        do the same with the new syntax of these properties.
     16
     17        Test: css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled.html
     18
     19        * css/CSSParser.cpp:
     20        (WebCore::isValidKeywordPropertyAndValue):
     21        (WebCore::isKeywordPropertyID):
     22        (WebCore::CSSParser::parseValue):
     23        * rendering/RenderFlexibleBox.cpp:
     24        (WebCore::RenderFlexibleBox::alignChildren):
     25
    1262016-08-28  Frederic Wang  <fwang@igalia.com>
    227
  • trunk/Source/WebCore/css/parser/CSSParser.cpp

    r204852 r205102  
    818818    case CSSPropertyColumnFill:
    819819        if (valueID == CSSValueAuto || valueID == CSSValueBalance)
     820            return true;
     821        break;
     822    case CSSPropertyAlignItems:
     823        // FIXME: Per CSS alignment, this property should accept the same arguments as 'justify-self' so we should share its parsing code.
     824        // FIXME: For now, we will do it behind the GRID_LAYOUT compile flag.
     825        if (valueID == CSSValueFlexStart || valueID == CSSValueFlexEnd || valueID == CSSValueCenter || valueID == CSSValueBaseline || valueID == CSSValueStretch)
     826            return true;
     827        break;
     828    case CSSPropertyAlignSelf:
     829        // FIXME: Per CSS alignment, this property should accept the same arguments as 'justify-self' so we should share its parsing code.
     830        // FIXME: For now, we will do it behind the GRID_LAYOUT compile flag.
     831        if (valueID == CSSValueAuto || valueID == CSSValueFlexStart || valueID == CSSValueFlexEnd || valueID == CSSValueCenter || valueID == CSSValueBaseline || valueID == CSSValueStretch)
    820832            return true;
    821833        break;
     
    11441156    case CSSPropertyFontVariantAlternates:
    11451157        return true;
     1158    case CSSPropertyAlignItems:
     1159    case CSSPropertyAlignSelf:
     1160        return !RuntimeEnabledFeatures::sharedFeatures().isCSSGridLayoutEnabled();
    11461161    default:
    11471162        return false;
     
    27242739        break;
    27252740    case CSSPropertyJustifySelf:
     2741        ASSERT(RuntimeEnabledFeatures::sharedFeatures().isCSSGridLayoutEnabled());
    27262742        return parseItemPositionOverflowPosition(propId, important);
    27272743    case CSSPropertyJustifyItems:
     2744        ASSERT(RuntimeEnabledFeatures::sharedFeatures().isCSSGridLayoutEnabled());
    27282745        if (parseLegacyPosition(propId, important))
    27292746            return true;
     
    31443161        break;
    31453162    case CSSPropertyAlignSelf:
     3163        ASSERT(RuntimeEnabledFeatures::sharedFeatures().isCSSGridLayoutEnabled());
    31463164        return parseItemPositionOverflowPosition(propId, important);
    31473165
    31483166    case CSSPropertyAlignItems:
     3167        ASSERT(RuntimeEnabledFeatures::sharedFeatures().isCSSGridLayoutEnabled());
    31493168        return parseItemPositionOverflowPosition(propId, important);
    31503169    case CSSPropertyBorderBottomStyle:
  • trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp

    r201516 r205102  
    3535#include "RenderLayer.h"
    3636#include "RenderView.h"
     37#include "RuntimeEnabledFeatures.h"
    3738#include <limits>
    3839#include <wtf/MathExtras.h>
     
    13981399                // Defaulting to Stretch for now, as it what most of FlexBox based renders
    13991400                // expect as default.
     1401                ASSERT(RuntimeEnabledFeatures::sharedFeatures().isCSSGridLayoutEnabled());
     1402                FALLTHROUGH;
    14001403            case ItemPositionStretch: {
    14011404                applyStretchAlignmentToChild(*child, lineCrossAxisExtent);
     
    14321435                // FIXME: https://webkit.org/b/135460 - The extended grammar is not supported
    14331436                // yet for FlexibleBox.
     1437                ASSERT(RuntimeEnabledFeatures::sharedFeatures().isCSSGridLayoutEnabled());
     1438                break;
    14341439            default:
    14351440                ASSERT_NOT_REACHED();
Note: See TracChangeset for help on using the changeset viewer.