Closed Bug 1589858 Opened 5 years ago Closed 5 years ago

Blank Rules for some elements, "Error writing response to: getApplied"

Categories

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

defect

Tracking

(firefox-esr68 unaffected, firefox70 unaffected, firefox71+ fixed, firefox72+ fixed)

RESOLVED FIXED
Firefox 72
Tracking Status
firefox-esr68 --- unaffected
firefox70 --- unaffected
firefox71 + fixed
firefox72 + fixed

People

(Reporter: fvsch, Assigned: daisuke)

References

(Regression)

Details

(Keywords: regression)

Attachments

(2 files)

Seen on two different websites when inspecting elements (which were all <a> elements, but it could be a coincidence).

When selecting some elements, the Rules tab is blank and this error gets logged:

console.error: "Error writing response to: getApplied"
console.error: "Error while calling actor 'pagestyle's method 'getApplied'" "Argument 1 of InspectorUtils.getSelectorCount does not implement interface CSSStyleRule."
console.error: "CssLogic.getSelectors@resource://devtools/server/actors/inspector/css-logic.js:659:30\nisVisitedRule@resource://devtools/server/actors/utils/inactive-property-helper.js:669:32\nwhen@resource://devtools/server/actors/utils/inactive-property-helper.js:222:26\nisPropertyUsed/<@resource://devtools/server/actors/utils/inactive-property-helper.js:308:21\nisPropertyUsed@resource://devtools/server/actors/utils/inactive-property-helper.js:292:21\nform/form.declarations<@resource://devtools/server/actors/styles.js:1449:46\nform@resource://devtools/server/actors/styles.js:1444:40\nwrite@resource://devtools/shared/protocol/types.js:363: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 callback*generateRequestHandlers/</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:450:15\nconnectToParent@resource://devtools/server/debugger-server.js:331: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 InspectorUtils.getSelectorCount does not implement interface CSSStyleRule."
console.error: "Protocol error (unknownError): Argument 1 of InspectorUtils.getSelectorCount does not implement interface CSSStyleRule."
console.error: "Protocol error (unknownError): Argument 1 of InspectorUtils.getSelectorCount does not implement interface CSSStyleRule."

For instance, I'm seeing it for roughly half the links in this page:
https://assistance.thermor.fr/hc/fr

  • it doesn't seem to happen for other types of elements
  • links that are fine in one Firefox session may show a blank Rules in another, and vice versa

I've seen that bug happening since at least October 11.

I used mozregression and tested if the "Questions fréquentes" link in the header of https://assistance.thermor.fr/hc/fr would show a blank Rules or not.

In the end I got:

19:29.98 INFO: Narrowed inbound regression window from [15ffd69c, 1dc1a755] (3 builds) to [8b8ce461, 1dc1a755] (2 builds) (~1 steps left)
19:29.98 INFO: No more inbound revisions, bisection finished.
19:29.98 INFO: Last good revision: 8b8ce4612836d14a658c8c86763cd53a81c54372
19:29.98 INFO: First bad revision: 1dc1a755079a15e35cb234db511e52ab463b2f42
19:29.98 INFO: Pushlog:
https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=8b8ce4612836d14a658c8c86763cd53a81c54372&tochange=1dc1a755079a15e35cb234db511e52ab463b2f42

19:31.94 INFO: ************* Switching to mozilla-inbound by process of elimination (no branch detected in commit message)
19:32.60 ERROR: Unable to exploit the merge commit. Origin branch is mozilla-central, and the commit message for 1dc1a755 was:
Backed out changeset c2c9dbf826fe (bug 1581757) by dev's request

Looking at the pushlog, I wonder if bug 1581008 is related?
It's partly about :visited links, and the one link that consistently resulted in an empty Rules pane, the "Questions fréquentes" link, is a visited link since it links to the current page (https://assistance.thermor.fr/hc/fr).

Daisuke, does this error look like it might be related to your patches?

Flags: needinfo?(daisuke)

Getting a similar error in the Browser Toolbox when inspecting a text input from the Netmonitor (.request-blocking-add-form .devtools-searchinput). Error logged was:

console.error: "Error while calling actor 'pagestyle's method 'getApplied'" "couldn't find start of the rule"
console.error: "getRuleText@resource://devtools/server/actors/styles.js:2130:13\ngetAuthoredCssText/<@resource://devtools/server/actors/styles.js:1591:35\npromise callback*getAuthoredCssText@resource://devtools/server/actors/styles.js:1589:38\ngetApplied@resource://devtools/server/actors/styles.js:602:18\nasync*handler@resource://devtools/shared/protocol/Actor.js:154:37\nonPacket@resource://devtools/server/debugger-server-connection.js:378:58\n_onJSONObjectReady/<@resource://devtools/shared/transport/transport.js:464:22\nexports.makeInfallible/<@resource://devtools/shared/ThreadSafeDevToolsUtils.js:111:22\nexports.makeInfallible/<@resource://devtools/shared/ThreadSafeDevToolsUtils.js:111:22\n"
console.error: "Protocol error (unknownError): couldn't find start of the rule"
console.error: "Protocol error (unknownError): couldn't find start of the rule"
console.error: "Protocol error (unknownError): couldn't find start of the rule"

Thank you very much for your investigation, Florens!
I will take a look.

I can confirm this bug. Just bumped into it when inspecting the "meet the family" button on https://www.mozilla.org/en-US/

Raising priority to P1.

Priority: -- → P1

[Tracking Requested - why for this release]: Bug 1581008 regressed this apparently, and it landed in 71. So we want to track release 71 here, to make sure we uplift the fix if/when we find it.

Assignee: nobody → daisuke
Attachment #9103429 - Attachment description: Bug 1589858: Avoid parsing the declarations in @media rule. r?pbro → Bug 1589858: Guard from passing media rules to InspectorUtils.getSelectorCount(). r?pbro
Pushed by dakatsuka.birchill@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/02943868eb28 Guard from passing media rules to InspectorUtils.getSelectorCount(). r=pbro https://hg.mozilla.org/integration/autoland/rev/4c71960337b5 Add a test whether the rule view is available or not when plural styles which are defined in media query block are set for visited link. r=pbro
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 72
Flags: needinfo?(daisuke)

Comment on attachment 9103429 [details]
Bug 1589858: Guard from passing media rules to InspectorUtils.getSelectorCount(). r?pbro

Beta/Release Uplift Approval Request

  • User impact if declined: The ruleview in inspector will be broken if @media rule is parsed as a rule which has declarations and also the target element has ":visited" status.
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): The code we changed to fix is only a few lines and the changes affect only DevTools.
  • String changes made/needed:
Attachment #9103429 - Flags: approval-mozilla-beta?
Attachment #9103430 - Flags: approval-mozilla-beta?

Comment on attachment 9103429 [details]
Bug 1589858: Guard from passing media rules to InspectorUtils.getSelectorCount(). r?pbro

P1, has tests and fixes a 71 regression, uplift approved for 71 beta 5, thanks!

Attachment #9103429 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Attachment #9103430 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Has Regression Range: --- → yes
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: