Changeset 100338 in webkit


Ignore:
Timestamp:
Nov 15, 2011 3:05:28 PM (12 years ago)
Author:
jchaffraix@webkit.org
Message:

Add the needed plumbing to parse display: -webkit-grid
https://bugs.webkit.org/show_bug.cgi?id=72331

Reviewed by Tony Chang.

Source/WebCore:

Test: fast/css-grid-layout/display-grid-set-get.html

Added parsing support for display: -webkit-grid. From a rendering perspective,
the value is equivalent to display: none until we properly implement it.

  • css/CSSParser.cpp:

(WebCore::CSSParser::parseValue):

  • css/CSSPrimitiveValueMappings.h:

(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):

  • css/CSSValueKeywords.in:
  • rendering/style/RenderStyleConstants.h:

Added the new CSS value and plumbed the parsing and style application of
the new value.

  • css/CSSPrimitiveValueMappings.h:

(WebCore::CSSPrimitiveValue::operator EDisplay):
Added an ASSERT here as I bumped into some non-trivial issues due to bug 72296.
-wap-marquee was offsetting the new value and was wrongly casted by the CSSPrimitiveValueMapping
logic outside the EDisplay range which would lead to crashes.

  • rendering/RenderObject.cpp:

(WebCore::RenderObject::createObject):
Fixed the indentation to follow our coding rules.

LayoutTests:

  • fast/css-grid-layout/display-grid-set-get-expected.txt: Added.
  • fast/css-grid-layout/display-grid-set-get.html: Added.
  • fast/css-grid-layout/resources/display-grid-set-get.js: Added.

Test that setting the display to -webkit-grid (from JS or CSS) works
and we get the right value back.

  • platform/chromium/test_expectations.txt:
  • platform/efl/Skipped:
  • platform/gtk/Skipped:
  • platform/mac/Skipped:
  • platform/qt/Skipped:
  • platform/win/Skipped:
  • platform/wincairo/Skipped:

SKIP the css-grid-layout tests on all platforms for now.

Location:
trunk
Files:
5 added
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r100337 r100338  
     12011-11-15  Julien Chaffraix  <jchaffraix@webkit.org>
     2
     3        Add the needed plumbing to parse display: -webkit-grid
     4        https://bugs.webkit.org/show_bug.cgi?id=72331
     5
     6        Reviewed by Tony Chang.
     7
     8        * fast/css-grid-layout/display-grid-set-get-expected.txt: Added.
     9        * fast/css-grid-layout/display-grid-set-get.html: Added.
     10        * fast/css-grid-layout/resources/display-grid-set-get.js: Added.
     11        Test that setting the display to -webkit-grid (from JS or CSS) works
     12        and we get the right value back.
     13
     14        * platform/chromium/test_expectations.txt:
     15        * platform/efl/Skipped:
     16        * platform/gtk/Skipped:
     17        * platform/mac/Skipped:
     18        * platform/qt/Skipped:
     19        * platform/win/Skipped:
     20        * platform/wincairo/Skipped:
     21        SKIP the css-grid-layout tests on all platforms for now.
     22
    1232011-11-15  James Robinson  <jamesr@chromium.org>
    224
  • trunk/LayoutTests/platform/chromium/test_expectations.txt

    r100325 r100338  
    32713271BUGCR85293 LINUX : svg/text/foreignObject-text-clipping-bug.xml = PASS IMAGE
    32723272
     3273// CSS Grid Layout is not enabled yet.
     3274BUGWK60731 SKIP : fast/css-grid-layout = PASS
     3275
    32733276// Need to evaluate and update regions and exclusions tests.
    32743277BUGWK57312 : fast/regions = PASS FAIL MISSING
  • trunk/LayoutTests/platform/efl/Skipped

    r100292 r100338  
    18901890# ------------------------------------
    18911891
     1892# CSS Grid Layout is not yet enabled. http://webkit.org/b/60731
     1893fast/css-grid-layout
     1894
    18921895# CSS Filters support not yet enabled (needs ENABLE_CSS_FILTERS).
    18931896# https://bugs.webkit.org/show_bug.cgi?id=68469
  • trunk/LayoutTests/platform/gtk/Skipped

    r100292 r100338  
    343343http/tests/security/webgl-remote-read-remote-image-allowed-with-credentials.html
    344344http/tests/security/webgl-remote-read-remote-image-blocked-no-crossorigin.html
     345
     346# CSS Grid Layout is not yet enabled. http://webkit.org/b/60731
     347fast/css-grid-layout
    345348
    346349# CSS Regions support not yet enabled. http://webkit.org/b/57312
  • trunk/LayoutTests/platform/mac/Skipped

    r100292 r100338  
    401401webarchive/loading/mainresource-null-mimetype-crash.html
    402402
     403# CSS Grid Layout is not yet enabled. http://webkit.org/b/60731
     404fast/css-grid-layout
     405
    403406# JSC does not support setIsolatedWorldSecurityOrigin (http://webkit.org/b/61540)
    404407http/tests/security/isolatedWorld/cross-origin-xhr.html
  • trunk/LayoutTests/platform/qt/Skipped

    r100292 r100338  
    155155svg/custom/manually-parsed-svg-disallowed-in-dashboard.html
    156156svg/custom/svg-disallowed-in-dashboard-object.html
     157
     158# CSS Grid Layout is not yet enabled. http://webkit.org/b/60731
     159fast/css-grid-layout
    157160
    158161# CSS Regions support not yet enabled. http://webkit.org/b/57312
  • trunk/LayoutTests/platform/win/Skipped

    r100292 r100338  
    13851385fast/dom/HTMLAnchorElement/anchor-download-unset.html
    13861386
     1387# CSS Grid Layout is not yet enabled. http://webkit.org/b/60731
     1388fast/css-grid-layout
     1389
    13871390# CSS Regions support not yet enabled. http://webkit.org/b/57312
    13881391fast/regions
  • trunk/LayoutTests/platform/wincairo/Skipped

    r100292 r100338  
    19021902fast/dom/HTMLAnchorElement/anchor-download-unset.html
    19031903
     1904# CSS Grid Layout is not yet enabled. http://webkit.org/b/60731
     1905fast/css-grid-layout
     1906
    19041907# CSS Regions support not yet enabled. http://webkit.org/b/57312
    19051908fast/regions
  • trunk/Source/WebCore/ChangeLog

    r100328 r100338  
     12011-11-15  Julien Chaffraix  <jchaffraix@webkit.org>
     2
     3        Add the needed plumbing to parse display: -webkit-grid
     4        https://bugs.webkit.org/show_bug.cgi?id=72331
     5
     6        Reviewed by Tony Chang.
     7
     8        Test: fast/css-grid-layout/display-grid-set-get.html
     9
     10        Added parsing support for display: -webkit-grid. From a rendering perspective,
     11        the value is equivalent to display: none until we properly implement it.
     12
     13        * css/CSSParser.cpp:
     14        (WebCore::CSSParser::parseValue):
     15        * css/CSSPrimitiveValueMappings.h:
     16        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
     17        * css/CSSValueKeywords.in:
     18        * rendering/style/RenderStyleConstants.h:
     19        Added the new CSS value and plumbed the parsing and style application of
     20        the new value.
     21
     22        * css/CSSPrimitiveValueMappings.h:
     23        (WebCore::CSSPrimitiveValue::operator EDisplay):
     24        Added an ASSERT here as I bumped into some non-trivial issues due to bug 72296.
     25        -wap-marquee was offsetting the new value and was wrongly casted by the CSSPrimitiveValueMapping
     26        logic outside the EDisplay range which would lead to crashes.
     27
     28        * rendering/RenderObject.cpp:
     29        (WebCore::RenderObject::createObject):
     30        Fixed the indentation to follow our coding rules.
     31
    1322011-11-15  Vincent Scheib  <scheib@chromium.org>
    233
  • trunk/Source/WebCore/css/CSSParser.cpp

    r100273 r100338  
    991991        if ((id >= CSSValueInline && id <= CSSValueWebkitInlineFlexbox) || id == CSSValueNone)
    992992            validPrimitive = true;
     993#if ENABLE(CSS_GRID_LAYOUT)
     994        if (id == CSSValueWebkitGrid)
     995            validPrimitive = true;
     996#endif
    993997        break;
    994998
  • trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h

    r100198 r100338  
    10671067            m_value.ident = CSSValueWebkitInlineFlexbox;
    10681068            break;
     1069#if ENABLE(CSS_GRID_LAYOUT)
     1070        case GRID:
     1071            m_value.ident = CSSValueWebkitGrid;
     1072            break;
     1073#endif
    10691074        case NONE:
    10701075            m_value.ident = CSSValueNone;
     
    10771082    if (m_value.ident == CSSValueNone)
    10781083        return NONE;
    1079     return static_cast<EDisplay>(m_value.ident - CSSValueInline);
     1084
     1085    EDisplay display = static_cast<EDisplay>(m_value.ident - CSSValueInline);
     1086    ASSERT(display >= INLINE && display <= NONE);
     1087    return display;
    10801088}
    10811089
  • trunk/Source/WebCore/css/CSSValueKeywords.in

    r100187 r100338  
    327327-webkit-flexbox
    328328-webkit-inline-flexbox
     329#if defined(ENABLE_CSS_GRID_LAYOUT) && ENABLE_CSS_GRID_LAYOUT
     330-webkit-grid
     331#endif
    329332//none
    330333//
  • trunk/Source/WebCore/rendering/RenderObject.cpp

    r100198 r100338  
    131131
    132132    switch (style->display()) {
    133         case NONE:
    134             return 0;
    135         case INLINE:
    136             return new (arena) RenderInline(node);
    137         case BLOCK:
    138         case INLINE_BLOCK:
    139         case RUN_IN:
    140         case COMPACT:
    141             // Only non-replaced block elements can become a region.
    142             if (!style->regionThread().isEmpty() && doc->renderView())
    143                 return new (arena) RenderRegion(node, doc->renderView()->renderFlowThreadWithName(style->regionThread()));
    144             return new (arena) RenderBlock(node);
    145         case LIST_ITEM:
    146             return new (arena) RenderListItem(node);
    147         case TABLE:
    148         case INLINE_TABLE:
    149             return new (arena) RenderTable(node);
    150         case TABLE_ROW_GROUP:
    151         case TABLE_HEADER_GROUP:
    152         case TABLE_FOOTER_GROUP:
    153             return new (arena) RenderTableSection(node);
    154         case TABLE_ROW:
    155             return new (arena) RenderTableRow(node);
    156         case TABLE_COLUMN_GROUP:
    157         case TABLE_COLUMN:
    158             return new (arena) RenderTableCol(node);
    159         case TABLE_CELL:
    160             return new (arena) RenderTableCell(node);
    161         case TABLE_CAPTION:
    162             return new (arena) RenderBlock(node);
    163         case BOX:
    164         case INLINE_BOX:
    165             return new (arena) RenderDeprecatedFlexibleBox(node);
    166         case FLEXBOX:
    167         case INLINE_FLEXBOX:
    168             return new (arena) RenderFlexibleBox(node);
     133#if ENABLE(CSS_GRID_LAYOUT)
     134    // For now, we don't show grid elements.
     135    case GRID:
     136#endif
     137    case NONE:
     138        return 0;
     139    case INLINE:
     140        return new (arena) RenderInline(node);
     141    case BLOCK:
     142    case INLINE_BLOCK:
     143    case RUN_IN:
     144    case COMPACT:
     145        // Only non-replaced block elements can become a region.
     146        if (!style->regionThread().isEmpty() && doc->renderView())
     147            return new (arena) RenderRegion(node, doc->renderView()->renderFlowThreadWithName(style->regionThread()));
     148        return new (arena) RenderBlock(node);
     149    case LIST_ITEM:
     150        return new (arena) RenderListItem(node);
     151    case TABLE:
     152    case INLINE_TABLE:
     153        return new (arena) RenderTable(node);
     154    case TABLE_ROW_GROUP:
     155    case TABLE_HEADER_GROUP:
     156    case TABLE_FOOTER_GROUP:
     157        return new (arena) RenderTableSection(node);
     158    case TABLE_ROW:
     159        return new (arena) RenderTableRow(node);
     160    case TABLE_COLUMN_GROUP:
     161    case TABLE_COLUMN:
     162        return new (arena) RenderTableCol(node);
     163    case TABLE_CELL:
     164        return new (arena) RenderTableCell(node);
     165    case TABLE_CAPTION:
     166        return new (arena) RenderBlock(node);
     167    case BOX:
     168    case INLINE_BOX:
     169        return new (arena) RenderDeprecatedFlexibleBox(node);
     170    case FLEXBOX:
     171    case INLINE_FLEXBOX:
     172        return new (arena) RenderFlexibleBox(node);
    169173    }
    170174
  • trunk/Source/WebCore/rendering/style/RenderStyleConstants.h

    r100198 r100338  
    414414    TABLE_CAPTION, BOX, INLINE_BOX,
    415415    FLEXBOX, INLINE_FLEXBOX,
     416#if ENABLE(CSS_GRID_LAYOUT)
     417    GRID,
     418#endif
    416419    NONE
    417420};
Note: See TracChangeset for help on using the changeset viewer.