mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-01 05:48:26 +00:00
Bug 1582750 - Ensure descriptionHeightWorkaround is called for multiple consecutive content blocking events. r=johannh
Differential Revision: https://phabricator.services.mozilla.com/D47817 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
128617cd51
commit
43452f1ef3
@ -1628,19 +1628,13 @@ var gProtectionsHandler = {
|
||||
if (["showing", "open"].includes(this._protectionsPopup.state)) {
|
||||
this.reorderCategoryItems();
|
||||
|
||||
if (!this._descriptionHeightWorkaroundCalled) {
|
||||
// The first time the panel is opened, the category items are still
|
||||
// invisible when descriptionHeightWorkaround gets called, i.e. they
|
||||
// are omitted from the workaround and the content overflows the panel.
|
||||
// We can fix this by calling the function manually the first time we
|
||||
// call reorderCategoryItems(). Since we have set all the relevant
|
||||
// attributes and hidden the "No Trackers Found" description at this
|
||||
// point, the items are guaranteed to be visible when we call it below.
|
||||
PanelMultiView.forNode(
|
||||
this._protectionsPopupMainView
|
||||
).descriptionHeightWorkaround();
|
||||
this._descriptionHeightWorkaroundCalled = true;
|
||||
}
|
||||
// Until we encounter a site that triggers them, category elements might
|
||||
// be invisible when descriptionHeightWorkaround gets called, i.e. they
|
||||
// are omitted from the workaround and the content overflows the panel.
|
||||
// Solution: call it manually here.
|
||||
PanelMultiView.forNode(
|
||||
this._protectionsPopupMainView
|
||||
).descriptionHeightWorkaround();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user