Bug 1434593 - Ensure that browser.xml does not send APZ back a notification after APZ notifies it of canceling autoscroll. r=kats
The second notification is needless and can cause deadlocks. The code
previously tried to ensure it wasn't sent, but didn't account for
the possibility of a call to hidePopup() causing the 'popuphidden'
event to be handled synchronously.
MozReview-Commit-ID: BiMOFMMudIH
--- a/toolkit/content/widgets/browser.xml
+++ b/toolkit/content/widgets/browser.xml
@@ -1209,23 +1209,23 @@
<parameter name="aTopic"/>
<parameter name="aState"/>
<body>
<![CDATA[
if (aTopic == "browser:purge-session-history") {
this.purgeSessionHistory();
} else if (aTopic == "apz:cancel-autoscroll") {
if (aState == this._autoScrollScrollId) {
- this._autoScrollPopup.hidePopup();
-
// Set this._autoScrollScrollId to null, so in stopScroll() we
// don't call stopApzAutoscroll() (since it's APZ that
// initiated the stopping).
this._autoScrollScrollId = null;
this._autoScrollPresShellId = null;
+
+ this._autoScrollPopup.hidePopup();
}
}
]]>
</body>
</method>
<method name="purgeSessionHistory">
<body>