Changeset 183913 in webkit


Ignore:
Timestamp:
May 6, 2015 11:07:25 PM (9 years ago)
Author:
Manuel Rego Casasnovas
Message:

[CSS Grid Layout] Mark grid shorthands as layout dependent
https://bugs.webkit.org/show_bug.cgi?id=144687

Reviewed by Darin Adler.

Source/WebCore:

grid-template and grid shorthands were not marked us layout dependent,
so you can end up calling them before the grid has been laid out and
you'll get a crash at valueForGridTrackList() because of trackPositions
won't be initialized yet.

Tests: fast/css-grid-layout/grid-shorthand-computed-style-crash.html

fast/css-grid-layout/grid-template-shorthand-computed-style-crash.html

  • css/CSSComputedStyleDeclaration.cpp:

(WebCore::isLayoutDependent): Add the grid shorthands only if the object
is a RenderGrid as otherwise it's not needed (using the same condition
for grid-template-columns and grid-template-rows properties too).

LayoutTests:

  • fast/css-grid-layout/grid-shorthand-computed-style-crash-expected.txt: Added.
  • fast/css-grid-layout/grid-shorthand-computed-style-crash.html: Added.
  • fast/css-grid-layout/grid-template-shorthand-computed-style-crash-expected.txt: Added.
  • fast/css-grid-layout/grid-template-shorthand-computed-style-crash.html: Added.
Location:
trunk
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r183912 r183913  
     12015-05-06  Manuel Rego Casasnovas  <rego@igalia.com>
     2
     3        [CSS Grid Layout] Mark grid shorthands as layout dependent
     4        https://bugs.webkit.org/show_bug.cgi?id=144687
     5
     6        Reviewed by Darin Adler.
     7
     8        * fast/css-grid-layout/grid-shorthand-computed-style-crash-expected.txt: Added.
     9        * fast/css-grid-layout/grid-shorthand-computed-style-crash.html: Added.
     10        * fast/css-grid-layout/grid-template-shorthand-computed-style-crash-expected.txt: Added.
     11        * fast/css-grid-layout/grid-template-shorthand-computed-style-crash.html: Added.
     12
    1132015-05-06  Ryosuke Niwa  <rniwa@webkit.org>
    214
  • trunk/Source/WebCore/ChangeLog

    r183909 r183913  
     12015-05-06  Manuel Rego Casasnovas  <rego@igalia.com>
     2
     3        [CSS Grid Layout] Mark grid shorthands as layout dependent
     4        https://bugs.webkit.org/show_bug.cgi?id=144687
     5
     6        Reviewed by Darin Adler.
     7
     8        grid-template and grid shorthands were not marked us layout dependent,
     9        so you can end up calling them before the grid has been laid out and
     10        you'll get a crash at valueForGridTrackList() because of trackPositions
     11        won't be initialized yet.
     12
     13        Tests: fast/css-grid-layout/grid-shorthand-computed-style-crash.html
     14               fast/css-grid-layout/grid-template-shorthand-computed-style-crash.html
     15
     16        * css/CSSComputedStyleDeclaration.cpp:
     17        (WebCore::isLayoutDependent): Add the grid shorthands only if the object
     18        is a RenderGrid as otherwise it's not needed (using the same condition
     19        for grid-template-columns and grid-template-rows properties too).
     20
    1212015-05-06  Daniel Bates  <dabates@apple.com>
    222
  • trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp

    r183805 r183913  
    16531653    case CSSPropertyWidth:
    16541654    case CSSPropertyHeight:
    1655 #if ENABLE(CSS_GRID_LAYOUT)
    1656     case CSSPropertyWebkitGridTemplateColumns:
    1657     case CSSPropertyWebkitGridTemplateRows:
    1658 #endif
    16591655    case CSSPropertyPerspectiveOrigin:
    16601656    case CSSPropertyTransformOrigin:
     
    16931689    case CSSPropertyPaddingLeft:
    16941690        return paddingOrMarginIsRendererDependent<&RenderStyle::paddingLeft>(style, renderer);
     1691#if ENABLE(CSS_GRID_LAYOUT)
     1692    case CSSPropertyWebkitGridTemplateColumns:
     1693    case CSSPropertyWebkitGridTemplateRows:
     1694    case CSSPropertyWebkitGridTemplate:
     1695    case CSSPropertyWebkitGrid:
     1696        return renderer && renderer->isRenderGrid();
     1697#endif
    16951698    default:
    16961699        return false;
Note: See TracChangeset for help on using the changeset viewer.