[CSS Grid Layout] 2 span positions are not resolved correctly
https://bugs.webkit.org/show_bug.cgi?id=119717

Reviewed by Andreas Kling.

From Blink r155397 by <jchaffraix@chromium.org>

Source/WebCore:

Test: fast/css-grid-layout/grid-item-bad-resolution-double-span.html

Two opposite 'span' or 'auto' positions should be resolved using
the auto placement algorithm. We were only checking for the 'auto'
case. This also covers the case of other positions that, according
to the spec, should be treated as 'auto'.

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::resolveGridPositionsFromStyle):

LayoutTests:

Added a new test case to check bad grid items resolution with two
opposite span positions. Also added a real grid container to check
also the resolution code path in some other tests.

* fast/css-grid-layout/grid-item-area-get-set.html: Added a grid container.
* fast/css-grid-layout/grid-item-bad-resolution-double-span-expected.txt: Added.
* fast/css-grid-layout/grid-item-bad-resolution-double-span.html: Added.
* fast/css-grid-layout/grid-item-end-after-get-set.html: Added a grid container.
* fast/css-grid-layout/grid-item-start-before-get-set.html: Ditto.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157389 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Be more efficient about passing RenderStyle to attachRenderTree().
<https://webkit.org/b/122743>

Reviewed by Antti Koivisto.

Have attachRenderTree() and createRendererTreeIfNeeded() pass the
RenderStyle in a PassRefPtr to avoid churning the ref count.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157390 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unexpected word wrapping for wrapped content then raw content.
https://bugs.webkit.org/show_bug.cgi?id=121130

Reviewed by Antti Koivisto.

When deciding whether a line is considered empty, we need to check if the current
object is fully responsible for the currently uncommitted width. It helps differentiating
<span></span><span>abcd</span> from <span>a</span><span>bcd</span>, where in the first
case when we hit the second <span> the line is still considered empty, as opposed to the
second example.

Source/WebCore:

Test: fast/css/unexpected-word-wrapping-with-non-empty-spans.html

* rendering/RenderBlockLineLayout.cpp:
(WebCore::LineBreaker::nextSegmentBreak):

LayoutTests:

* fast/css/unexpected-word-wrapping-with-non-empty-spans-expected.html: Added.
* fast/css/unexpected-word-wrapping-with-non-empty-spans.html: Added.


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