Last Comment Bug 1358479 - grid inspector fails on grid containers with no layout
: grid inspector fails on grid containers with no layout
Status: RESOLVED FIXED
:
Product: Firefox
Classification: Client Software
Component: Developer Tools: Inspector (show other bugs)
: unspecified
: Unspecified Unspecified
P3 normal (vote)
: Firefox 55
Assigned To: Patrick Brosset <:pbro>
:
: Gabriel [:gl] (ΦωΦ)
Mentors:
https://bug1358479.bmoattachments.org...
Depends on: 1297072
Blocks: 1181227 1347964
  Show dependency treegraph
 
Reported: 2017-04-21 06:28 PDT by Julian Descottes [:jdescottes]
Modified: 2017-05-14 03:45 PDT (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
fixed

MozReview Requests
Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:
Show discarded requests

Attachments
test_empty_grid_container.html (449 bytes, text/html)
2017-04-21 06:28 PDT, Julian Descottes [:jdescottes]
no flags Details
Bug 1358479 - Check if a grid fragment is valid before highlighting it; (59 bytes, text/x-review-board-request)
2017-05-04 00:49 PDT, Patrick Brosset <:pbro>
jdescottes: review+
Details | Review

Description User image Julian Descottes [:jdescottes] 2017-04-21 06:28:14 PDT
Created attachment 8860388 [details]
test_empty_grid_container.html

STRs: 
- open attached html test case
- open inspector
- select layout panel, scroll down to grids
- click checkbox for the second ".grid" element

ER: the checkbox should be checked
AR: nothing happens

The following exception is logged:

>   Message: TypeError: fragment.rows.lines[0] is undefined
>   Stack:
>     getFirstRowLinePos@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/server/actors/highlighters/css-grid.js:880:5
> renderFragment@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/server/actors/highlighters/css-grid.js:916:22
> _update@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/server/actors/highlighters/css-grid.js:669:7
> update@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/server/actors/highlighters/auto-refresh.js:240:5
> _startRefreshLoop@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/server/actors/highlighters/auto-refresh.js:276:5
> show@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/server/actors/highlighters/auto-refresh.js:110:5
> show@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/server/actors/highlighters.js:502:12
> handler@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/protocol.js:1082:19
> onPacket@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/server/main.js:1759:15
> receiveMessage@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/transport/transport.js:761:7
Comment 1 User image Patrick Brosset <:pbro> 2017-04-25 04:36:06 PDT
I'll take this one. Simple fix, we just need to check that grid fragments actually contain tracks before drawing them.
Comment 2 User image Patrick Brosset <:pbro> 2017-04-26 03:06:38 PDT
Bug 1297072 is almost ready to land and is changing quite a lot the file that I need to fix here.
So let's just depend on that bug.
Comment 3 User image Patrick Brosset <:pbro> 2017-05-04 00:49:22 PDT Comment hidden (mozreview-request)
Comment 5 User image Julian Descottes [:jdescottes] 2017-05-04 02:09:01 PDT
Comment on attachment 8864415 [details]
Bug 1358479 - Check if a grid fragment is valid before highlighting it;

https://reviewboard.mozilla.org/r/136106/#review139122

Great thanks!

::: commit-message-c4e3b:3
(Diff revision 1)
> +Bug 1358479 - Check if a grid fragment is valid before highlighting it; r=jdescottes
> +
> +Grid fragments returned by the chrome-only el.getGtidFragments() API

mega-nit: getGtidFragments -> getGridFragments

::: devtools/server/actors/highlighters/css-grid.js:756
(Diff revision 1)
>      this.updateCurrentMatrix();
>  
>      // Start drawing the grid fragments.
>      for (let i = 0; i < this.gridData.length; i++) {
>        let fragment = this.gridData[i];
> +      if (!this.isValidFragment(fragment)) {

Maybe move this check inside of renderFragment?

Although renderFragment is only called here so it doesn't really matter at the moment.
Comment 6 User image Patrick Brosset <:pbro> 2017-05-04 02:16:38 PDT Comment hidden (mozreview-request)
Comment 7 User image Pulsebot 2017-05-04 02:18:03 PDT
Pushed by pbrosset@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/73696a2f5ec6
Check if a grid fragment is valid before highlighting it; r=jdescottes
Comment 8 User image Carsten Book [:Tomcat] 2017-05-05 06:23:56 PDT
https://hg.mozilla.org/mozilla-central/rev/73696a2f5ec6
Comment 9 User image Md. Rahimul Islam 2017-05-14 03:45:31 PDT
I have successfully reproduced the bug in firefox Nightly 55.0a1 (2017-04-21) (32-bit) with windows 7 (32 bit) 

Verified as fixed with latest nightly 55.0a1 (2017-05-13) (32-bit)

Build ID:   20170513030205
Mozilla/5.0 (Windows NT 10.0; rv:55.0) Gecko/20100101 Firefox/55.0

[testday-20170512]

Note You need to log in before you can comment on or make changes to this bug.