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

RESOLVED DUPLICATE of bug 1224121

Status

DevTools
Inspector
RESOLVED DUPLICATE of bug 1224121
3 years ago
5 days ago

People

(Reporter: julienw, Assigned: tromey)

Tracking

({regression})

unspecified
regression

Firefox Tracking Flags

(firefox42 unaffected, firefox44 affected, firefox45 affected)

Details

(Reporter)

Description

3 years ago
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.
(Reporter)

Updated

3 years ago
status-firefox44: --- → affected
status-firefox45: --- → affected
(Reporter)

Comment 1

3 years ago
It works properly in Fx 42.
status-firefox42: --- → unaffected
Keywords: regression
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)

Updated

3 years ago
Assignee: nobody → ttromey
Status: NEW → ASSIGNED
Flags: needinfo?(ttromey)
(Assignee)

Comment 5

3 years ago
This seems to work when I apply the patch from bug 1224121.
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1224121

Updated

5 days ago
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.