New issue
Advanced search Search tips

Issue 607137 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug

Blocking:
issue 273898



Sign in to add a comment

[css-grid] Wrong static position for positioned grid items

Project Member Reported by r...@igalia.com, Apr 27 2016

Issue description


The spec was updated (almost 1 year ago) to define properly
the static position of the positioned grid items:
https://drafts.csswg.org/css-grid-1/issues-wd-20150108#issue-1

But we didn't apply this change in our implementation.

The specific wording from the spec (https://drafts.csswg.org/css-grid/#static-position):
"The static position [CSS21] 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.
 However, if the grid container parent is also the generator of
 the absolutely positioned element’s containing block, instead use the grid area
 determined in §11.1 With a Grid Container as Containing Block."

I'm attaching a simple example of a grid with just 1 cell and with padding.
Right now we're setting the static position like if it was a regular block,
but we should follow the rules in 11.1.

You can check the example live in:
http://jsbin.com/reseqa/1/edit?html,css,output

Firefox renders this properly.
 
static-position.html
328 bytes View Download
static-position-current.png
1.6 KB View Download
static-position-expected.png
1.3 KB View Download
Project Member

Comment 1 by bugdroid1@chromium.org, Apr 27 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/92d518467d7a6ff962ae2c3c8c44c903e9472ef0

commit 92d518467d7a6ff962ae2c3c8c44c903e9472ef0
Author: rego <rego@igalia.com>
Date: Wed Apr 27 22:24:16 2016

[css-grid] Fix static position for positioned grid items

The spec was updated to define properly the static position
for positioned grid items, but we didn't update the implementation yet:
https://drafts.csswg.org/css-grid-1/issues-wd-20150108#issue-1

We were only setting the static position when the start line
was not auto. Otherwise we were using the default one
which includes the padding.
With the spec change we need to set it always,
even if the start line is auto.

Updated several tests to follow the new expected behavior.

BUG= 607137 

Review-Url: https://codereview.chromium.org/1929483002
Cr-Commit-Position: refs/heads/master@{#390215}

[modify] https://crrev.com/92d518467d7a6ff962ae2c3c8c44c903e9472ef0/third_party/WebKit/LayoutTests/fast/css-grid-layout/absolute-positioning-grid-container-containing-block.html
[modify] https://crrev.com/92d518467d7a6ff962ae2c3c8c44c903e9472ef0/third_party/WebKit/LayoutTests/fast/css-grid-layout/absolute-positioning-grid-container-parent.html
[modify] https://crrev.com/92d518467d7a6ff962ae2c3c8c44c903e9472ef0/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-positioned-items-gaps-rtl.html
[modify] https://crrev.com/92d518467d7a6ff962ae2c3c8c44c903e9472ef0/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-positioned-items-gaps.html
[modify] https://crrev.com/92d518467d7a6ff962ae2c3c8c44c903e9472ef0/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-positioned-items-implicit-grid-line.html
[modify] https://crrev.com/92d518467d7a6ff962ae2c3c8c44c903e9472ef0/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-positioned-items-implicit-grid.html
[modify] https://crrev.com/92d518467d7a6ff962ae2c3c8c44c903e9472ef0/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-positioned-items-unknown-named-grid-line.html
[modify] https://crrev.com/92d518467d7a6ff962ae2c3c8c44c903e9472ef0/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-sizing-positioned-items.html
[modify] https://crrev.com/92d518467d7a6ff962ae2c3c8c44c903e9472ef0/third_party/WebKit/Source/core/layout/LayoutGrid.cpp

Comment 2 by r...@igalia.com, Apr 28 2016

Status: Fixed (was: Started)

Sign in to add a comment