mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-19 16:25:38 +00:00
Bug 1598026 - only reset panel state on document-ready event of the top level document. r=jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D78595
This commit is contained in:
parent
af845d619c
commit
30512f1f1c
@ -100,7 +100,7 @@ class MainFrame extends Component {
|
||||
"can-be-disabled-change": this.onCanBeDisabledChange,
|
||||
});
|
||||
this.props.startListeningForAccessibilityEvents({
|
||||
"document-ready": this.resetAccessibility,
|
||||
"top-level-document-ready": this.resetAccessibility,
|
||||
});
|
||||
window.addEventListener("resize", this.onPanelWindowResize, true);
|
||||
}
|
||||
@ -115,7 +115,7 @@ class MainFrame extends Component {
|
||||
"can-be-disabled-change": this.onCanBeDisabledChange,
|
||||
});
|
||||
this.props.stopListeningForAccessibilityEvents({
|
||||
"document-ready": this.resetAccessibility,
|
||||
"top-level-document-ready": this.resetAccessibility,
|
||||
});
|
||||
window.removeEventListener("resize", this.onPanelWindowResize, true);
|
||||
}
|
||||
|
@ -268,10 +268,28 @@ class AccessibleFront extends FrontClassWithSpec(accessibleSpec) {
|
||||
}
|
||||
|
||||
class AccessibleWalkerFront extends FrontClassWithSpec(accessibleWalkerSpec) {
|
||||
constructor(client, targetFront, parentFront) {
|
||||
super(client, targetFront, parentFront);
|
||||
|
||||
this.documentReady = this.documentReady.bind(this);
|
||||
this.on("document-ready", this.documentReady);
|
||||
}
|
||||
|
||||
destroy() {
|
||||
this.off("document-ready", this.documentReady);
|
||||
super.destroy();
|
||||
}
|
||||
|
||||
form(json) {
|
||||
this.actorID = json.actor;
|
||||
}
|
||||
|
||||
documentReady() {
|
||||
if (this.targetFront.isTopLevel) {
|
||||
this.emit("top-level-document-ready");
|
||||
}
|
||||
}
|
||||
|
||||
pick(doFocus) {
|
||||
if (doFocus) {
|
||||
return this.pickAndFocus();
|
||||
|
Loading…
Reference in New Issue
Block a user