Changeset 199223 in webkit


Ignore:
Timestamp:
Apr 8, 2016 1:52:17 AM (8 years ago)
Author:
Manuel Rego Casasnovas
Message:

[css-grid] Fix positioned items with grid gaps
https://bugs.webkit.org/show_bug.cgi?id=156288

Reviewed by Darin Adler.

Source/WebCore:

When we place a positioned items in a grid with gaps,
we were not taking into accounts the gutter size.
We've to use that size to properly place and size the item.

Tests: fast/css-grid-layout/grid-positioned-items-gaps-rtl.html

fast/css-grid-layout/grid-positioned-items-gaps.html

  • rendering/RenderGrid.cpp:

(WebCore::RenderGrid::offsetAndBreadthForPositionedChild):

LayoutTests:

Added new tests checking the right behavior.

  • fast/css-grid-layout/grid-positioned-items-gaps-expected.txt: Added.
  • fast/css-grid-layout/grid-positioned-items-gaps-rtl-expected.txt: Added.
  • fast/css-grid-layout/grid-positioned-items-gaps-rtl.html: Added.
  • fast/css-grid-layout/grid-positioned-items-gaps.html: Added.
Location:
trunk
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r199221 r199223  
     12016-04-08  Manuel Rego Casasnovas  <rego@igalia.com>
     2
     3        [css-grid] Fix positioned items with grid gaps
     4        https://bugs.webkit.org/show_bug.cgi?id=156288
     5
     6        Reviewed by Darin Adler.
     7
     8        Added new tests checking the right behavior.
     9
     10        * fast/css-grid-layout/grid-positioned-items-gaps-expected.txt: Added.
     11        * fast/css-grid-layout/grid-positioned-items-gaps-rtl-expected.txt: Added.
     12        * fast/css-grid-layout/grid-positioned-items-gaps-rtl.html: Added.
     13        * fast/css-grid-layout/grid-positioned-items-gaps.html: Added.
     14
    1152016-04-08  John Wilander  <wilander@apple.com>
    216
  • trunk/Source/WebCore/ChangeLog

    r199222 r199223  
     12016-04-08  Manuel Rego Casasnovas  <rego@igalia.com>
     2
     3        [css-grid] Fix positioned items with grid gaps
     4        https://bugs.webkit.org/show_bug.cgi?id=156288
     5
     6        Reviewed by Darin Adler.
     7
     8        When we place a positioned items in a grid with gaps,
     9        we were not taking into accounts the gutter size.
     10        We've to use that size to properly place and size the item.
     11
     12        Tests: fast/css-grid-layout/grid-positioned-items-gaps-rtl.html
     13               fast/css-grid-layout/grid-positioned-items-gaps.html
     14
     15        * rendering/RenderGrid.cpp:
     16        (WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
     17
    1182016-04-08  Javier Fernandez  <jfernandez@igalia.com>
    219
  • trunk/Source/WebCore/rendering/RenderGrid.cpp

    r199222 r199223  
    15331533        else
    15341534            end = m_rowPositions[endLine] - m_rowPositions[0] + paddingBefore();
     1535
     1536        // These vectors store line positions including gaps, but we shouldn't consider them for the edges of the grid.
     1537        if (endLine > firstExplicitLine && endLine < lastExplicitLine)
     1538            end -= guttersSize(direction, 2);
    15351539    }
    15361540
     
    15471551            LayoutUnit offsetFromLastLine = m_columnPositions[m_columnPositions.size() - 1] - m_columnPositions[endLine];
    15481552            offset = paddingLeft() +  alignmentOffset + offsetFromLastLine;
     1553
     1554            if (endLine > firstExplicitLine && endLine < lastExplicitLine)
     1555                offset += guttersSize(direction, 2);
    15491556        }
    15501557    }
Note: See TracChangeset for help on using the changeset viewer.