[css-grid] CRASH when getting the computed style of a grid with only absolutely posit...
authorsvillar@igalia.com <svillar@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Jun 2016 07:41:23 +0000 (07:41 +0000)
committersvillar@igalia.com <svillar@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Jun 2016 07:41:23 +0000 (07:41 +0000)
commit7a4b8daaa511c8ebb54bba8142e70aa6643abd49
treed570d8f01923c19510e3371b0d516e9025557f51
parent825ab90cf5391d8a87408c6b6c95aa3565b35281
[css-grid] CRASH when getting the computed style of a grid with only absolutely positioned children
https://bugs.webkit.org/show_bug.cgi?id=158537

Reviewed by Darin Adler.

Source/WebCore:

Absolute positioning occurs after layout of the grid and its in-flow contents, and does not
contribute to the sizing of any grid tracks or affect the size/configuration of the grid in
any way. This means that we should treat as empty any grid whose only children are
absolutely positioned items.

Since r201510 empty grids are no longer internally represented by a 1x1 matrix. As we were
not considering grids-with-only-absolutely-positioned-children as empty, we were trying to
access some invalid position in the internal representation of the grid triggering an ASSERT
in debug builds and a crash in release.

Test: fast/css-grid-layout/grid-only-abspos-item-computed-style-crash.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::valueForGridTrackList):

LayoutTests:

* fast/css-grid-layout/grid-only-abspos-item-computed-style-crash-expected.txt: Added.
* fast/css-grid-layout/grid-only-abspos-item-computed-style-crash.html: Added.
* fast/css-grid-layout/grid-template-shorthand-get-set-expected.txt: Adjusted, grid-template
does create explicit tracks so we should return 0px instead of none.
* fast/css-grid-layout/grid-template-shorthand-get-set.html: Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@201919 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/css-grid-layout/grid-only-abspos-item-computed-style-crash-expected.txt [new file with mode: 0644]
LayoutTests/fast/css-grid-layout/grid-only-abspos-item-computed-style-crash.html [new file with mode: 0644]
LayoutTests/fast/css-grid-layout/grid-template-shorthand-get-set-expected.txt
LayoutTests/fast/css-grid-layout/grid-template-shorthand-get-set.html
Source/WebCore/ChangeLog
Source/WebCore/css/CSSComputedStyleDeclaration.cpp