⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 236126 in webkit


Ignore:
Timestamp:
Sep 18, 2018, 8:13:40 AM (8 years ago)
Author:
Manuel Rego Casasnovas
Message:

[css-grid] Static position should use content-box, not padding-box
https://bugs.webkit.org/show_bug.cgi?id=189698

Reviewed by Javier Fernandez.

LayoutTests/imported/w3c:

  • web-platform-tests/css/css-grid/abspos/absolute-positioning-grid-container-parent-001.html:

Update tests from WPT.

Source/WebCore:

This is a recent change by the CSSWG:
https://github.com/w3c/csswg-drafts/issues/3020

The spec text (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 content edges
of the grid container."

Test: imported/w3c/web-platform-tests/css/css-grid/abspos/absolute-positioning-grid-container-parent-001.html

  • rendering/RenderGrid.cpp:

(WebCore::RenderGrid::prepareChildForPositionedLayout):
Simple change to use border and padding.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r236103 r236126  
     12018-09-18  Manuel Rego Casasnovas  <rego@igalia.com>
     2
     3        [css-grid] Static position should use content-box, not padding-box
     4        https://bugs.webkit.org/show_bug.cgi?id=189698
     5
     6        Reviewed by Javier Fernandez.
     7
     8        * web-platform-tests/css/css-grid/abspos/absolute-positioning-grid-container-parent-001.html:
     9        Update tests from WPT.
     10
    1112018-09-12  Ryosuke Niwa  <rniwa@webkit.org>
    212
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/absolute-positioning-grid-container-parent-001.html

    r230445 r236126  
    4242<div class="container relative">
    4343  <div class="grid">
    44     <div class="sizedToGridArea absolute autoRowAutoColumn" data-offset-x="35" data-offset-y="5" data-expected-width="500" data-expected-height="400"></div>
     44    <div class="sizedToGridArea absolute autoRowAutoColumn" data-offset-x="50" data-offset-y="10" 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 firstRowFirstColumn" data-offset-x="35" data-offset-y="5" data-expected-width="500" data-expected-height="400"></div>
     50    <div class="sizedToGridArea absolute firstRowFirstColumn" data-offset-x="50" data-offset-y="10" data-expected-width="500" data-expected-height="400"></div>
    5151  </div>
    5252</div>
     
    5454<div class="container relative">
    5555  <div class="grid">
    56     <div class="sizedToGridArea absolute secondRowSecondColumn" data-offset-x="35" data-offset-y="5" data-expected-width="500" data-expected-height="400"></div>
     56    <div class="sizedToGridArea absolute secondRowSecondColumn" data-offset-x="50" data-offset-y="10" data-expected-width="500" data-expected-height="400"></div>
    5757  </div>
    5858</div>
     
    7878<div class="container relative">
    7979  <div class="grid directionRTL">
    80     <div class="sizedToGridArea absolute autoRowAutoColumn" data-offset-x="-135" data-offset-y="5" data-expected-width="500" data-expected-height="400"></div>
     80    <div class="sizedToGridArea absolute autoRowAutoColumn" data-offset-x="-150" data-offset-y="10" 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 firstRowFirstColumn" data-offset-x="-135" data-offset-y="5" data-expected-width="500" data-expected-height="400"></div>
     86    <div class="sizedToGridArea absolute firstRowFirstColumn" data-offset-x="-150" data-offset-y="10" data-expected-width="500" data-expected-height="400"></div>
    8787  </div>
    8888</div>
     
    9090<div class="container relative">
    9191  <div class="grid directionRTL">
    92     <div class="sizedToGridArea absolute secondRowSecondColumn" data-offset-x="-135" data-offset-y="5" data-expected-width="500" data-expected-height="400"></div>
     92    <div class="sizedToGridArea absolute secondRowSecondColumn" data-offset-x="-150" data-offset-y="10" data-expected-width="500" data-expected-height="400"></div>
    9393  </div>
    9494</div>
  • trunk/Source/WebCore/ChangeLog

    r236104 r236126  
     12018-09-18  Manuel Rego Casasnovas  <rego@igalia.com>
     2
     3        [css-grid] Static position should use content-box, not padding-box
     4        https://bugs.webkit.org/show_bug.cgi?id=189698
     5
     6        Reviewed by Javier Fernandez.
     7
     8        This is a recent change by the CSSWG:
     9        https://github.com/w3c/csswg-drafts/issues/3020
     10
     11        The spec text (https://drafts.csswg.org/css-grid/#static-position):
     12          "The static position of an absolutely-positioned child
     13           of a grid container is determined as if it were the sole grid item
     14           in a grid area whose edges coincide with the content edges
     15           of the grid container."
     16
     17        Test: imported/w3c/web-platform-tests/css/css-grid/abspos/absolute-positioning-grid-container-parent-001.html
     18
     19        * rendering/RenderGrid.cpp:
     20        (WebCore::RenderGrid::prepareChildForPositionedLayout):
     21        Simple change to use border and padding.
     22
    1232018-09-18  Xabier Rodriguez Calvar  <calvaris@igalia.com>
    224
  • trunk/Source/WebCore/rendering/RenderGrid.cpp

    r234687 r236126  
    904904
    905905    RenderLayer* childLayer = child.layer();
    906     childLayer->setStaticInlinePosition(borderStart());
    907     childLayer->setStaticBlockPosition(borderBefore());
     906    // Static position of a positioned child should use the content-box (https://drafts.csswg.org/css-grid/#static-position).
     907    childLayer->setStaticInlinePosition(borderAndPaddingStart());
     908    childLayer->setStaticBlockPosition(borderAndPaddingBefore());
    908909}
    909910
Note: See TracChangeset for help on using the changeset viewer.