Closed Bug 1576484 Opened 3 months ago Closed 3 months ago

Exception in getParentGridElement with subgrid style on root element

Categories

(DevTools :: Inspector: Layout, defect, P1)

defect

Tracking

(firefox70 verified)

VERIFIED FIXED
Firefox 70
Tracking Status
firefox70 --- verified

People

(Reporter: mats, Assigned: pbro)

Details

(Keywords: testcase)

Attachments

(1 file)

STR
0. (use a recent Nightly build, or the testcase might crash the tab)

  1. load the testcase in bug 1569628
  2. open Inspector and select the HTML element

ACTUAL RESULTS
The rules panel becomes empty.
In the Terminal window I see:
console.error: "Error writing response to: getApplied"
console.error: "Error while calling actor 'pagestyle's method 'getApplied'" "Argument 1 of Window.getComputedStyle does not implement interface Element."
console.error: "getParentGridElement@resource://devtools/server/actors/utils/inactive-property-helper.js:604:38\nisGridItem@resource://devtools/server/actors/utils/inactive-property-helper.js:574:19\nget gridItem@resource://devtools/server/actors/utils/inactive-property-helper.js:410:17\nwhen@resource://devtools/server/actors/utils/inactive-property-helper.js:106:21\nisPropertyUsed/<@resource://devtools/server/actors/utils/inactive-property-helper.js:259:21\nisPropertyUsed@resource://devtools/server/actors/utils/inactive-property-helper.js:239:21\nform/form.declarations<@resource://devtools/server/actors/styles.js:1438:46\nform@resource://devtools/server/actors/styles.js:1433:40\nwrite@resource://devtools/shared/protocol/types.js:358:32\ntypes.addArrayType/write/<@resource://devtools/shared/protocol/types.js:220:33\nwrite@resource://devtools/shared/protocol/types.js:220:16\nwrite@resource://devtools/shared/protocol/types.js:268:39\nwrite@resource://devtools/shared/protocol/Response.js:98:22\nwrite@resource://devtools/shared/protocol/Response.js:43:28\nsendReturn@resource://devtools/shared/protocol/Actor.js:164:38\npromise callbackgenerateRequestHandlers/</handler/<@resource://devtools/shared/protocol/Actor.js:186:14\n_queueResponse@resource://devtools/shared/protocol/Actor.js:107:28\nhandler@resource://devtools/shared/protocol/Actor.js:183:14\nonPacket@resource://devtools/server/debugger-server-connection.js:378:58\nreceiveMessage@resource://devtools/shared/transport/child-transport.js:66:16\nMessageListener.receiveMessage_addListener@resource://devtools/shared/transport/child-transport.js:40:14\nready@resource://devtools/shared/transport/child-transport.js:57:10\n_onConnection@resource://devtools/server/debugger-server.js:491:15\nconnectToParent@resource://devtools/server/debugger-server.js:349:17\nonConnect<@resource://devtools/server/startup/frame.js:62:35\nexports.makeInfallible/<@resource://devtools/shared/ThreadSafeDevToolsUtils.js:111:22\nMessageListener.receiveMessage*@resource://devtools/server/startup/frame.js:92:23\n@resource://devtools/server/startup/frame.js:174:5\n"
console.error: "Protocol error (unknownError): Argument 1 of Window.getComputedStyle does not implement interface Element."
console.error: "Protocol error (unknownError): Argument 1 of Window.getComputedStyle does not implement interface Element."
console.error: "Protocol error (unknownError): Argument 1 of Window.getComputedStyle does not implement interface Element."

Component: Inspector: Rules → Inspector: Layout
Assignee: nobody → bwerth
Assignee: bwerth → nobody

The problem is on this line of code.

If the element we try to get the computed style for is actually not an ElementNode but a Document, then the call fails.

In this for loop we go up the DOM tree to find the parent grid container for an element. But the element in question is already the documentElement (the <html> node), which can't be a grid item itself, it can only be a container. So we should just bail out to prevent the breakage.

I'll take this.

Assignee: nobody → pbrosset
Severity: minor → normal
Status: NEW → ASSIGNED
Priority: -- → P1

FYI, in this situation, the element will still be a grid container, just not a subgrid.

Pushed by pbrosset@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/3d56bbe0a97d
Bail out of getParentGridElement when the element is <html>; r=rcaliman
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 70
Flags: qe-verify+

Confirmed issue with 70.0a1 (2019-08-25).
Verified fix with 70.0b14.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.