Changeset 216916 in webkit


Ignore:
Timestamp:
May 16, 2017 12:50:32 AM (7 years ago)
Author:
Manuel Rego Casasnovas
Message:

[css-grid] Fix static position of positioned grid items
https://bugs.webkit.org/show_bug.cgi?id=172108

Reviewed by Sergio Villar Senin.

Source/WebCore:

This patch makes us follow the text on the spec
(https://drafts.csswg.org/css-grid/#static-position):
"The static position of an absolutely-positioned child

of a grid container is determined as if it were the sole grid item
in a grid area whose edges coincide with the padding edges
of the grid container."

Test: fast/css-grid-layout/absolute-positioning-grid-container-parent.html

  • rendering/RenderGrid.cpp:

(WebCore::RenderGrid::prepareChildForPositionedLayout): Modified to avoid
including padding to match the spec behavior.

LayoutTests:

The test is updated as the expected results were wrong.
Note that after this patch we match Chrome and Firefox behavior on this test.

  • fast/css-grid-layout/absolute-positioning-grid-container-parent.html:
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r216901 r216916  
     12017-05-16  Manuel Rego Casasnovas  <rego@igalia.com>
     2
     3        [css-grid] Fix static position of positioned grid items
     4        https://bugs.webkit.org/show_bug.cgi?id=172108
     5
     6        Reviewed by Sergio Villar Senin.
     7
     8        The test is updated as the expected results were wrong.
     9        Note that after this patch we match Chrome and Firefox behavior on this test.
     10
     11        * fast/css-grid-layout/absolute-positioning-grid-container-parent.html:
     12
    1132017-05-15  Said Abou-Hallawa  <sabouhallawa@apple.com>
    214
  • trunk/LayoutTests/fast/css-grid-layout/absolute-positioning-grid-container-parent.html

    r200572 r216916  
    3636<div class="container relative">
    3737    <div class="grid">
    38         <div class="sizedToGridArea absolute autoRowAutoColumn" data-offset-x="50" data-offset-y="10" data-expected-width="500" data-expected-height="400"></div>
     38        <div class="sizedToGridArea absolute autoRowAutoColumn" data-offset-x="35" data-offset-y="5" data-expected-width="500" data-expected-height="400"></div>
    3939    </div>
    4040</div>
     
    4242<div class="container relative">
    4343    <div class="grid">
    44         <div class="sizedToGridArea absolute firstRowFirstColumn" data-offset-x="50" data-offset-y="10" data-expected-width="500" data-expected-height="400"></div>
     44        <div class="sizedToGridArea absolute firstRowFirstColumn" data-offset-x="35" data-offset-y="5" data-expected-width="500" data-expected-height="400"></div>
    4545    </div>
    4646</div>
     
    4848<div class="container relative">
    4949    <div class="grid">
    50         <div class="sizedToGridArea absolute secondRowSecondColumn" data-offset-x="50" data-offset-y="10" data-expected-width="500" data-expected-height="400"></div>
     50        <div class="sizedToGridArea absolute secondRowSecondColumn" data-offset-x="35" data-offset-y="5" data-expected-width="500" data-expected-height="400"></div>
    5151    </div>
    5252</div>
     
    7272<div class="container relative">
    7373    <div class="grid directionRTL">
    74         <div class="sizedToGridArea absolute autoRowAutoColumn" data-offset-x="-150" data-offset-y="10" data-expected-width="500" data-expected-height="400"></div>
     74        <div class="sizedToGridArea absolute autoRowAutoColumn" data-offset-x="-135" data-offset-y="5" data-expected-width="500" data-expected-height="400"></div>
    7575    </div>
    7676</div>
     
    7878<div class="container relative">
    7979    <div class="grid directionRTL">
    80         <div class="sizedToGridArea absolute firstRowFirstColumn" data-offset-x="-150" data-offset-y="10" data-expected-width="500" data-expected-height="400"></div>
     80        <div class="sizedToGridArea absolute firstRowFirstColumn" data-offset-x="-135" data-offset-y="5" data-expected-width="500" data-expected-height="400"></div>
    8181    </div>
    8282</div>
     
    8484<div class="container relative">
    8585    <div class="grid directionRTL">
    86         <div class="sizedToGridArea absolute secondRowSecondColumn" data-offset-x="-150" data-offset-y="10" data-expected-width="500" data-expected-height="400"></div>
     86        <div class="sizedToGridArea absolute secondRowSecondColumn" data-offset-x="-135" data-offset-y="5" data-expected-width="500" data-expected-height="400"></div>
    8787    </div>
    8888</div>
  • trunk/Source/WebCore/ChangeLog

    r216912 r216916  
     12017-05-16  Manuel Rego Casasnovas  <rego@igalia.com>
     2
     3        [css-grid] Fix static position of positioned grid items
     4        https://bugs.webkit.org/show_bug.cgi?id=172108
     5
     6        Reviewed by Sergio Villar Senin.
     7
     8        This patch makes us follow the text on the spec
     9        (https://drafts.csswg.org/css-grid/#static-position):
     10        "The static position of an absolutely-positioned child
     11         of a grid container is determined as if it were the sole grid item
     12         in a grid area whose edges coincide with the padding edges
     13         of the grid container."
     14
     15        Test: fast/css-grid-layout/absolute-positioning-grid-container-parent.html
     16
     17        * rendering/RenderGrid.cpp:
     18        (WebCore::RenderGrid::prepareChildForPositionedLayout): Modified to avoid
     19        including padding to match the spec behavior.
     20
    1212017-05-16  Per Arne Vollan  <pvollan@apple.com>
    222
  • trunk/Source/WebCore/rendering/RenderGrid.cpp

    r215800 r216916  
    935935
    936936    RenderLayer* childLayer = child.layer();
    937     childLayer->setStaticInlinePosition(borderAndPaddingStart());
    938     childLayer->setStaticBlockPosition(borderAndPaddingBefore());
     937    childLayer->setStaticInlinePosition(borderStart());
     938    childLayer->setStaticBlockPosition(borderBefore());
    939939}
    940940
Note: See TracChangeset for help on using the changeset viewer.