Bug 1456590 Part 1: Omit line names from implicitly named areas, to avoid confusion. draft
authorBrad Werth <bwerth@mozilla.com>
Wed, 02 May 2018 16:24:20 -0700
changeset 790882 52984f8970a548cdb19f279fc0ac26cd21cfc3f3
parent 790721 f877359308b17e691209e1afb7193b8e86f175ce
child 790883 5032920ad5705227c0d445632e1ad28fb4d5684c
push id108620
push userbwerth@mozilla.com
push dateWed, 02 May 2018 23:38:59 +0000
bugs1456590
milestone61.0a1
Bug 1456590 Part 1: Omit line names from implicitly named areas, to avoid confusion. MozReview-Commit-ID: 3vK2MUeEuqw
dom/grid/GridLines.cpp
--- 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) {