Closed Bug 1333711 Opened 7 years ago Closed 7 years ago

Rule-view is empty after page refresh if it was focused

Categories

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

defect

Tracking

(firefox51 unaffected, firefox52 unaffected, firefox53 fixed, firefox54 verified)

VERIFIED FIXED
Firefox 54
Tracking Status
firefox51 --- unaffected
firefox52 --- unaffected
firefox53 --- fixed
firefox54 --- verified

People

(Reporter: pbro, Assigned: jdescottes)

References

Details

(Keywords: regression)

Attachments

(1 file)

STR:
- open the inspector on this page: http://labs.jensimmons.com/examples/grid-content-1.html
- click on a value in the rule-view, so the editor appears and is focused
- hit F5 (or ctrl+R) to refresh the page

==> The page refreshes, the inspector too, but the rule-view is completely empty. And the follow errors appear in the browser console:

<unavailable>  protocol.js:940
Protocol error (unknownError): A parameter or an operation is not supported by the underlying object utils.js:157
Protocol error (unknownError): A parameter or an operation is not supported by the underlying object  rules.js:801
Inspector bug triage (filter on CLIMBING SHOES).
Priority: -- → P2
Are we planning on fixing and uplifting?  Is this being worked anywhere else?
Flags: needinfo?(pbrosset)
Yes we are. No one is working on this right now though.
Julian: do you think you could add this to your list?
Flags: needinfo?(pbrosset) → needinfo?(jdescottes)
sure!
Assignee: nobody → jdescottes
Status: NEW → ASSIGNED
Flags: needinfo?(jdescottes)
Thanks for the regression window! Based on it I could find that the issue was introduced by : https://hg.mozilla.org/integration/autoland/rev/7f137d9fa7ba (Bug 1151909).

The relevant part of the changeset is that the inspector actor is now calling onFrameLoaded when receiving `window-ready` instead of `navigate`. `window-ready` is fired before `navigate` and from time to time, we will be initializing the inspector while some stylesheets are not fully loaded yet.

In this case we hit Bug 625013, which is that accessing cssRules on a styleSheet will trigger a DOMException if the stylesheet is not loaded yet. 

A note about the STRs, focusing a value is not mandatory to reproduce the bug. When reloading the page, the rule view will randomly be blank or not.
Blocks: 1151909
Comment on attachment 8836747 [details]
Bug 1333711 - guard against DOMExceptions when accessing stylesheet cssRules;

https://reviewboard.mozilla.org/r/112094/#review114030

Gonna steal the review from pbro. Looks good to me!
Attachment #8836747 - Flags: review+
Attachment #8836747 - Flags: review?(pbrosset)
Pushed by jdescottes@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/20e11ca9a35f
guard against DOMExceptions when accessing stylesheet cssRules;r=gl
https://hg.mozilla.org/mozilla-central/rev/20e11ca9a35f
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 54
Please request Aurora approval on this when you get a chance.
Flags: needinfo?(jdescottes)
Comment on attachment 8836747 [details]
Bug 1333711 - guard against DOMExceptions when accessing stylesheet cssRules;

Approval Request Comment
[Feature/Bug causing the regression]: Bug 1151909
[User impact if declined]: Devtools inspector : the rule view might be empty if a stylesheet is slow to load. 
[Is this code covered by automated tests?]: no
[Has the fix been verified in Nightly?]: not yet
[Needs manual test from QE? If yes, steps to reproduce]: 
- open the inspector on this page: http://labs.jensimmons.com/examples/grid-content-1.html
- select the rule view in the inspector sidebar
- reload the page (F5 or CTRL+R) a few times
- check that the rule view is not blank after each reload

[List of other uplifts needed for the feature/fix]: none
[Is the change risky?]: no 
[Why is the change risky/not risky?]: devtools only, simply guarding against accessing a property that could throw an exception.
[String changes made/needed]: no
Flags: needinfo?(jdescottes)
Attachment #8836747 - Flags: approval-mozilla-aurora?
Hi Brindusa, could you help find someone to verify if this issue was fixed as expected on a latest Nightly build? Thanks!
Flags: needinfo?(brindusa.tot)
Hi,

I tested this on Mac OS X 10.12, Ubuntu 16.04 and Windows 10 with FF Nightly 54.0a1 (2017-02-16) and I can confirm the fix.
Status: RESOLVED → VERIFIED
Flags: needinfo?(brindusa.tot)
Comment on attachment 8836747 [details]
Bug 1333711 - guard against DOMExceptions when accessing stylesheet cssRules;

Fix for minor regression, let's uplift to aurora.
Attachment #8836747 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
No longer blocks: top-inspector-bugs
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: