Bug 1341498 - Stringify grid areas for CSS Grid Fragments in css-grid-utils.js. r=gl
authorMicah Tigley <tigleym@gmail.com>
Tue, 21 Feb 2017 18:10:35 -0700
changeset 344197 afe3edac6acd6ee4c3832226c839ae9f4b3bcce7
parent 344196 18bc0b31d8c810180d445200a65c2ce18ad8c348
child 344198 bf67ad546e37a4dd2c1e0317b290d46f95d02688
push id31402
push usercbook@mozilla.com
push dateWed, 22 Feb 2017 13:33:50 +0000
treeherdermozilla-central@f5372cb6c3c7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgl
bugs1341498
milestone54.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 1341498 - Stringify grid areas for CSS Grid Fragments in css-grid-utils.js. r=gl MozReview-Commit-ID: 3CfoZM2YXjH
devtools/server/actors/utils/css-grid-utils.js
--- a/devtools/server/actors/utils/css-grid-utils.js
+++ b/devtools/server/actors/utils/css-grid-utils.js
@@ -32,30 +32,39 @@ function getStringifiableFragments(fragm
  * @return {String} representation of the CSS grid fragment data.
  */
 function stringifyGridFragments(fragments) {
   return JSON.stringify(getStringifiableFragments(fragments));
 }
 
 function getStringifiableFragment(fragment) {
   return {
+    areas: getStringifiableAreas(fragment.areas),
     cols: getStringifiableDimension(fragment.cols),
     rows: getStringifiableDimension(fragment.rows)
   };
 }
 
+function getStringifiableAreas(areas) {
+  return [...areas].map(getStringifiableArea);
+}
+
 function getStringifiableDimension(dimension) {
   return {
     lines: [...dimension.lines].map(getStringifiableLine),
     tracks: [...dimension.tracks].map(getStringifiableTrack),
   };
 }
 
-function getStringifiableLine({ breadth, number, start, names }) {
-  return { breadth, number, start, names };
+function getStringifiableArea({ columnEnd, columnStart, name, rowEnd, rowStart, type }) {
+  return { columnEnd, columnStart, name, rowEnd, rowStart, type };
+}
+
+function getStringifiableLine({ breadth, names, number, start }) {
+  return { breadth, names, number, start };
 }
 
 function getStringifiableTrack({ breadth, start, state, type }) {
   return { breadth, start, state, type };
 }
 
 exports.getStringifiableFragments = getStringifiableFragments;
 exports.stringifyGridFragments = stringifyGridFragments;