Bug 1456590 Part 1: Omit line names from implicitly named areas, to avoid confusion.
MozReview-Commit-ID: 3vK2MUeEuqw
--- a/dom/grid/GridLines.cpp
+++ b/dom/grid/GridLines.cpp
@@ -140,16 +140,24 @@ GridLines::SetLineInfo(const ComputedGri
const nsTArray<nsString>& possiblyDuplicateLineNames(
aLineInfo->mNames.SafeElementAt(i, nsTArray<nsString>()));
nsTArray<nsString> lineNames;
AddLineNamesIfNotPresent(lineNames, possiblyDuplicateLineNames);
// Add in names from grid areas where this line is used as a boundary.
for (auto area : aAreas) {
+ // We specifically ignore line names from implicitly named areas,
+ // because it can be confusing for designers who might naturally use
+ // a named line of "-start" or "-end" and create an implicit named
+ // area without meaning to.
+ if (area->Type() == GridDeclaration::Implicit) {
+ continue;
+ }
+
bool haveNameToAdd = false;
nsAutoString nameToAdd;
area->GetName(nameToAdd);
if (aIsRow) {
if (area->RowStart() == line1Index) {
haveNameToAdd = true;
nameToAdd.AppendLiteral("-start");
} else if (area->RowEnd() == line1Index) {