New issue
Advanced search Search tips
Starred by 2 users

Issue metadata

Status: Fixed
Closed: Jun 2017
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Sign in to add a comment

Issue 733577: [css-grid] grid-template-areas makes grid placement to ignore the default index for line names

Reported by, Jun 15 2017 Project Member

Issue description

Chrome Version: 60.0.3112.20
OS: Linux

What steps will reproduce the problem?
(1) Load the attached test case

What is the expected result?

The red item should placed at the 1st column of second row.

What happens instead?

The red item is placed at the 4th column of second row.
561 bytes View Download

Comment 1 by, Jun 15 2017

According to the Grid specs, custom-ident line names must use "1" as default index for resolving conflicts when there are several lines with the same name.
"Otherwise, treat this as if the integer 1 had been specified along with the <custom-ident>."

Comment 2 by, Jun 15 2017

The issue is not reproducible if we don't use the grid-template-areas property.

It's also surprising that even using the grid-template-areas property, the issue is not reproducible when declaring only 4 items and 3 columns.

Comment 3 by, Jun 15 2017

Components: Blink>Layout>Grid

Comment 4 by, Jun 19 2017

Status: Available (was: Untriaged)

Comment 5 by, Jun 28 2017

Status: Assigned (was: Available)
I'm working on this and already found out a preliminary approach to solve the issue.

Comment 6 by, Jun 30 2017

Project Member
The following revision refers to this bug:

commit ccf30955351cc421d3ee6e334595e01f65fecc05
Author: Javier Fernandez <>
Date: Fri Jun 30 11:54:21 2017

[css-grid] Use a reference to sort the actual named grid lines vector

When using the grid-template-{columns,rows} properties we create
internally 2 hashmaps; 'NamedGridLines' associates a named line with the
different grid lines such name is used, and 'OrderedNamedGridLines' that
associates a grid line with the different names it has.

When using the grid-template-areas we use the 'OrderedNamedGridLines' to
extract the information about which names are associated to each grid

The spec states that when using the same name for different lines, an
item located a such name will be placed in the first line associated to
that name. Because of this, we need to internally create an index vector
from the 'OrderedNamedGridLines' and we need to sort it ascendantly.

We were wrongly using a copy of the index vector, so we weren't actually
sorting the actual indexes. This patch solves the issue by using a
reference type for the indexes variable, hence, sorting the actual data
of the hashmap.

Bug:  733577 
Change-Id: I4af516420c04565ba4f5b9fc0d267e7c63a2b7aa
Commit-Queue: Javier Fernandez <>
Reviewed-by: Christian Biesinger <>
Cr-Commit-Position: refs/heads/master@{#483679}

Comment 7 by, Jun 30 2017

This issue should be FIXED now.

Comment 8 by, Jun 30 2017

Status: Fixed (was: Assigned)

Sign in to add a comment