Closed Bug 1432015 Opened 8 years ago Closed 8 years ago

Separate the set of known views from the stack of open views in PanelMultiView

Categories

(Firefox :: Toolbars and Customization, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 60
Tracking Status
firefox59 --- wontfix
firefox60 --- fixed

People

(Reporter: Paolo, Assigned: Paolo)

References

Details

Attachments

(5 files)

This was originally part of bug 1428839.
Flags: qe-verify-
Comment on attachment 8944247 [details] Bug 1432015 - Part 2 - Remove the setMainView methods. Carrying over r+ from bug 1428839.
Attachment #8944247 - Flags: review?(gijskruitbosch+bugs) → review+
Attachment #8944248 - Flags: review?(gijskruitbosch+bugs) → review+
Attachment #8944249 - Flags: review?(gijskruitbosch+bugs) → review+
Comment on attachment 8944250 [details] Bug 1432015 - Part 5 - Remove unused code. I spotted this piece of unused code while moving state to the PanelView class. As this code can be removed at any point, I just added it to the end of this bug.
Let's check if there is any regression test to update following these changes: https://treeherder.mozilla.org/#/jobs?repo=try&revision=25478c01103f91f8948bb62025cbca5e41347b54
Attachment #8944248 - Flags: review?(gijskruitbosch+bugs) → review+
Attachment #8944250 - Flags: review?(gijskruitbosch+bugs) → review+
I had to add a missing mainViewId attribute for activated action panels, which are a special case of throw-away non-ephemeral panels, aligning them to what other similar code does. I had to fix one test for the feedback of the "Send to Device" action that weirdly stated failing after that change, although the original code under test apparently should not have handled the case correctly in the first place. I also fixed a null reference when using the "current" attribute on a PanelMultiView that was already destroyed. https://treeherder.mozilla.org/#/jobs?repo=try&revision=0f20d74f9bf27472726df19a4a353a6e2530f41d
Hm, the latest run is apparently hitting the same intermittent failures as the ones in bug 1402845 comment 45. These are probably entirely based on timing or on accessing properties of destroyed objects. These failures will be much easier to understand after the rest of the refactoring has been done and all the code using public members for cleanup purposes has been removed. In other words, I plan to ignore the browser_ext_browserAction_disabled.js and browser_ext_browserAction_popup.js failures that we have on Mac OS X in the try runs for now. This means that even though I split the work in multiple bugs, we may still have to land everything together to avoid this chicken-and-egg situation.
Curiously, and seemingly confirming the workability of the strategy in the previous comment, the failures in browser_ext_browserAction_popup_resize.js have gone away spontaneously after applying the four changesets in bug 1432016 on top of the ones in this bug.
I'm a little bit confused as to what happened to the flags here. Do I actually need to re-review parts 1, 2 and 4?
Flags: needinfo?(paolo.mozmail)
Part 1 is new so it needs a new review, while parts 2 and 4 have small changes for comment 14 that you may want to take a look at, although they're quite simple and likely don't need too much scrutiny. Thanks for the great reviews on bug 1432016, I'll move the resetting of openViews to one of the changesets here.
Flags: needinfo?(paolo.mozmail)
Comment on attachment 8944290 [details] Bug 1432015 - Part 1 - Fix anchor handling for the action feedback panel. https://reviewboard.mozilla.org/r/214536/#review220222 I mean, the theory of this makes sense to me, so rs=me for that. But it doesn't seem particularly related to the summary of this bug, right? Also, the net consequence is the horizontal shifting of a panel without an arrow that is now anchored on the main panel button even if it'd otherwise use the url bar button (I guess?), so the practical consequences are also limited... So why do this here/now? Am I misunderstanding what's being fixed? The first subsentence of the commit message ("Commands started from an activated action panel should not be anchored to the main button") doesn't really make sense to me wrt the test change. I guess this would more precisely apply to e.g. commands triggered from a separate synced tabs panel (if you pinned that action) which would have an ancestor panel (the synced tabs one) and shouldn't use the 'main' button for anchoring. But you don't seem to create a test for this case, instead leaving it with the url copy entry which *is* in the main panel. So I'm confused. :-)
Attachment #8944290 - Flags: review?(gijskruitbosch+bugs) → review+
Comment on attachment 8944247 [details] Bug 1432015 - Part 2 - Remove the setMainView methods. https://reviewboard.mozilla.org/r/214514/#review220228 ::: browser/base/content/browser-pageActions.js:237 (Diff revision 2) > let multiViewNode = document.createElement("panelmultiview"); > panelViewNode = this._makePanelViewNodeForAction(action, true); > + multiViewNode.setAttribute("mainViewId", panelViewNode.id); > multiViewNode.appendChild(panelViewNode); > panelNode.appendChild(multiViewNode); It would be nice if we could make this + PanelUI use a static method on PanelMultiView instead, or something (in a separate bug).
Attachment #8944247 - Flags: review?(gijskruitbosch+bugs) → review+
Comment on attachment 8944249 [details] Bug 1432015 - Part 4 - Separate the set of known views from the stack of open views. https://reviewboard.mozilla.org/r/214518/#review220230 ::: browser/components/customizableui/PanelMultiView.jsm:135 (Diff revisions 1 - 3) > * @return {panelview} the currently visible subview OR the subview that is > * about to be shown whilst a 'ViewShowing' event is being > * dispatched. > */ > get current() { > - return this._viewShowing || this._currentSubView; > + return this.node && (this._viewShowing || this._currentSubView); So I'm guessing this fixes the null reference. When did this actually happen?
Attachment #8944249 - Flags: review?(gijskruitbosch+bugs) → review+
(In reply to :Gijs from comment #21) > The first subsentence of the commit message ("Commands started from an > activated action panel should not be anchored to the main button") doesn't > really make sense to me wrt the test change. There are two issues being fixed here. I used only one changeset as they are related, but let me know if I should separate them. > I guess this would more > precisely apply to e.g. commands triggered from a separate synced tabs panel > (if you pinned that action) which would have an ancestor panel (the synced > tabs one) and shouldn't use the 'main' button for anchoring. But you don't > seem to create a test for this case, instead leaving it with the url copy > entry which *is* in the main panel. There is already a test for this case in the synced tabs panel. Given the mistake in the production code this test was supposed to fail already, but for some reason it only started failing after the other changes I made in this bug. I don't know why this happened, but it's not worth spending time finding out given that the test does the right thing. To fix the test, I initially tried removing the "event" argument entirely, as I supposed this was just leftover code, and all the tests still passed. For good measure I looked up the bug where this argument was added, and I found out that the tests added in that bug actually didn't cover the case that was being fixed there. Hence the test changes, that are not strictly related to the fix above but are still good to have. > So I'm confused. :-) Comment 14 wasn't that clear... hope this one clarifies better! :-)
(In reply to :Gijs from comment #23) > So I'm guessing this fixes the null reference. When did this actually happen? https://dxr.mozilla.org/mozilla-central/rev/9fe69ff0762da191fbd2b9fc0718e96f1ab4137e/browser/components/customizableui/content/panelUI.js#427-432 I'll definitely get rid of this piece of code by the end of bug 1428839, as "closing" the view in the old panel should be possible synchronously, and should be entirely handled by the PanelMultiView methods. This will probably facilitate removing the "current" property entirely, as it's ambiguous during asynchronous animation, and also the "showMainView" method.
Blocks: 1432016
Pushed by paolo.mozmail@amadzone.org: https://hg.mozilla.org/integration/mozilla-inbound/rev/ac47c9282115 Part 1 - Fix anchor handling for the action feedback panel. r=Gijs https://hg.mozilla.org/integration/mozilla-inbound/rev/62330176bbb8 Part 2 - Remove the setMainView methods. r=Gijs https://hg.mozilla.org/integration/mozilla-inbound/rev/0022830a87cb Part 3 - Ensure that views passed to showSubView are added to the list of known views without having to reset the internal _panelViews variable. r=Gijs https://hg.mozilla.org/integration/mozilla-inbound/rev/e1df27563323 Part 4 - Separate the set of known views from the stack of open views. r=Gijs https://hg.mozilla.org/integration/mozilla-inbound/rev/4db8bc4b474c Part 5 - Remove unused code. r=Gijs
Depends on: 1438815
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: