Closed Bug 1228517 Opened 9 years ago Closed 8 years ago

We can't inspect rules on some nodes in air mozilla

Categories

(DevTools :: Inspector, defect)

defect
Not set
normal

Tracking

(firefox42 unaffected, firefox44 affected, firefox45 affected)

RESOLVED DUPLICATE of bug 1224121
Tracking Status
firefox42 --- unaffected
firefox44 --- affected
firefox45 --- affected

People

(Reporter: julienw, Assigned: tromey)

Details

(Keywords: regression)

STR:
1. go to https://air.mozilla.org/participation-call-20151126/
2. open the dev tools, and try to inspect the video itself
=> Notice we can't see anything in the "rules" panel.

It seems to start from the parent node that has the class ".jwplayer" (you can easily find it with the command `document.querySelector('.jwplayer')` in the console.
It works properly in Fx 42.
Damn, this is bad. Thanks for filing.
The following error appears in the log when you select the video element:
"Protocol error (unknownError): Error: couldn't find start of the rule rule-view.js:2030"

This is most probably a regression introduced when we worked on the as-authored project.
The server call that fails is PageStyleActor.getApplied(element), which is executed in the rule-view.

Note that the computed-view doesn't suffer from this because it does not go through authored styles.
I'm going to investigate a little bit more in the getApplied method, but cc'ing Tom here as he will probably be faster than me.
(In reply to Patrick Brosset [:pbrosset] [:pbro] from comment #2)
> This is most probably a regression introduced when we worked on the
> as-authored project.
That's bug PageStyleActor.
On the provided test URL: https://air.mozilla.org/participation-call-20151126/ the problem is caused by an empty <style></style> node in <head>. If you go in the inspector and delete that node, the problem goes away.

This <style> tag appears empty in the inspector, but it does contain rules. These rules are inserted with CSSOM functions.

Try this in the console: document.styleSheets[2].cssRules
You'll see all the rules that have been added.

That's why the call to getApplied fails because on one hand, it finds the list of rules that apply to the <video> element, but later, when it tries to get the authored text for them, it starts with styleEl.textContent (which is empty) and tries to parse that (in getRuleText in styles.js).

Tom: it looks like that bug you fixed in fx-team very recently, but I tried this in a local build and it fails there too. So we need a way to bail out of the as-authored mode when we detect a stylesheet that has been created and populated with javascript.
Flags: needinfo?(ttromey)
Assignee: nobody → ttromey
Status: NEW → ASSIGNED
Flags: needinfo?(ttromey)
This seems to work when I apply the patch from bug 1224121.
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → DUPLICATE
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.