Bug 1387511 - Part 1: Use the grid negative number platform API to render negative line numbers correctly in css grid inspector. r=pbro
authorGabriel Luong <gabriel.luong@gmail.com>
Tue, 14 Nov 2017 22:02:44 -0500
changeset 391764 b0780ac4a74e0416263db9496c2057b6126ced41
parent 391763 f79a12dc2c55be9111ae7bd6689e85d64c0e4979
child 391765 46a0be972d5ae92da4a6dacb21f6e6ff119eb970
push id97340
push usergabriel.luong@gmail.com
push dateWed, 15 Nov 2017 03:03:07 +0000
treeherdermozilla-inbound@46a0be972d5a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspbro
bugs1387511
milestone59.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1387511 - Part 1: Use the grid negative number platform API to render negative line numbers correctly in css grid inspector. r=pbro
devtools/server/actors/highlighters/css-grid.js
--- a/devtools/server/actors/highlighters/css-grid.js
+++ b/devtools/server/actors/highlighters/css-grid.js
@@ -856,17 +856,22 @@ class CssGridHighlighter extends AutoRef
 
     // Keep track of the number of collapsed lines per line position
     let stackedLines = [];
 
     const { lines } = gridDimension;
 
     for (let i = 0, line; (line = lines[i++]);) {
       let linePos = line.start;
-      let negativeLineNumber = i - lines.length - 1;
+      let negativeLineNumber = line.negativeNumber;
+
+      // Don't render any negative line number greater than -1.
+      if (negativeLineNumber == 0) {
+        break;
+      }
 
       // Check for overlapping lines. We render a second box beneath the last overlapping
       // line number to indicate there are lines beneath it.
       const gridLine = gridDimension.tracks[line.number - 1];
 
       if (gridLine) {
         const { breadth }  = gridLine;