[CSS Grid Layout] Handle 2 positions with one 'auto' properly
https://bugs.webkit.org/show_bug.cgi?id=111653

Reviewed by Tony Chang.

Source/WebCore:

The rendering code was making the assumption that we have one position.
Thus it couldn't fully match what the specification wants as the 2 opposite
positions are required to resolve either position in several cases (e.g.
1 / span 2, auto / 'c').

This change introduces resolveGridPositionsFromStyle to do both opposite
positions resolution in one pass and thus handling more cases.

Test: fast/css-grid-layout/grid-item-spanning-resolution.html

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::maximumIndexInDirection):
(WebCore::RenderGrid::placeItemsOnGrid):
(WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid):
(WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid):
Updated the above functions to rely on resolveGridPositionsFromStyle.

(WebCore::RenderGrid::resolveGridPositionsFromStyle):
Added this new function that handle the correct resolution.

(WebCore::RenderGrid::resolveGridPositionFromStyle):
Updated the ASSERT to match the new code flow.

* rendering/RenderGrid.h:
(WebCore::RenderGrid::GridSpan::GridSpan):
Introduced this new struct to hold the 2 positions along one axis.

LayoutTests:

* fast/css-grid-layout/grid-auto-flow-resolution-expected.txt:
* fast/css-grid-layout/grid-auto-flow-resolution.html:
* fast/css-grid-layout/grid-item-spanning-resolution-expected.txt: Added.
* fast/css-grid-layout/grid-item-spanning-resolution.html: Added.
Extended and added a new test. Most of the new testing is failing as it
requires other changes to land. This will help us track our progress
towards fully supporting the new syntax and padding.

* fast/css-grid-layout/resources/grid.css:
Added the 2 new classes.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145240 268f45cc-cd09-0410-ab3c-d52691b4dbfc
RenderFullScreen needs to clear override sizes when exiting full screen
https://bugs.webkit.org/show_bug.cgi?id=111775

Patch by Christian Biesinger <cbiesinger@chromium.org> on 2013-03-08
Reviewed by Ojan Vafai.

Source/WebCore:

Test: fullscreen/full-screen-with-flex-item.html

* rendering/RenderFullScreen.cpp:
(RenderFullScreen::unwrapRenderer):
RenderFullScreen is a flexbox, so it will potentially set override
sizes on its children while in fullscreen mode. When we exit
fullscreen mode, we need to clear this override size, otherwise the
the leftover override size may affect layout. See the testcase for an
example.

LayoutTests:

* fullscreen/full-screen-with-flex-item-expected.txt: Added.
* fullscreen/full-screen-with-flex-item.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145241 268f45cc-cd09-0410-ab3c-d52691b4dbfc