Bug 1491278 Comment 14 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

Looking into fixing the intermittent for bug 1498336, which is suspiciously similar to the issue described one, I discovered there's is a [stray window "resize" event](https://searchfox.org/mozilla-central/rev/61f224ec08ddc6f9a93ac45c8c3c5f7159be7c2a/devtools/server/actors/reflow.js#483-489,506-514) which is [fired](https://searchfox.org/mozilla-central/rev/61f224ec08ddc6f9a93ac45c8c3c5f7159be7c2a/devtools/client/inspector/shared/style-change-tracker.js#96) during reload with RDM open. The Rules panel [reacts to that event](https://searchfox.org/mozilla-central/rev/61f224ec08ddc6f9a93ac45c8c3c5f7159be7c2a/devtools/client/inspector/rules/rules.js#1852) with trying to grab the latest applicable styles (for scenarios where a media query might begin to apply), but being in a state of flux during reload, the node front for the selected element doesn't seem to have a [corresponding DOM node](https://searchfox.org/mozilla-central/rev/61f224ec08ddc6f9a93ac45c8c3c5f7159be7c2a/devtools/server/actors/styles.js#582,593) (aka `rawNode`); the Rules panel swallows the error and shows an empty panel.

The issue in bug 1498336 happens intermittently. The window "resize" event is fired prematurely _sometimes_. This is perhaps an indication as to why the issue described in this bug has been difficult to reproduce.
Looking into fixing the intermittent for bug 1498336, which is suspiciously similar to the issue described in this one, I discovered there's is a [stray window "resize" event](https://searchfox.org/mozilla-central/rev/61f224ec08ddc6f9a93ac45c8c3c5f7159be7c2a/devtools/server/actors/reflow.js#483-489,506-514) which is [fired](https://searchfox.org/mozilla-central/rev/61f224ec08ddc6f9a93ac45c8c3c5f7159be7c2a/devtools/client/inspector/shared/style-change-tracker.js#96) during reload with RDM open. The Rules panel [reacts to that event](https://searchfox.org/mozilla-central/rev/61f224ec08ddc6f9a93ac45c8c3c5f7159be7c2a/devtools/client/inspector/rules/rules.js#1852) with trying to grab the latest applicable styles (for scenarios where a media query might begin to apply), but being in a state of flux during reload, the node front for the selected element doesn't seem to have a [corresponding DOM node](https://searchfox.org/mozilla-central/rev/61f224ec08ddc6f9a93ac45c8c3c5f7159be7c2a/devtools/server/actors/styles.js#582,593) (aka `rawNode`); the Rules panel swallows the error and shows an empty panel.

The issue in bug 1498336 happens intermittently. The window "resize" event is fired prematurely _sometimes_. This is perhaps an indication as to why the issue described in this bug has been difficult to reproduce.

Back to Bug 1491278 Comment 14