Commit graph

96 commits

Author SHA1 Message Date
Paolo Amadini
0d7dab5bac Bug 1432016 - Part 4 - Move keyboard navigation to the PanelView class. r=Gijs
This allows removing the separate keyboard navigation map.

MozReview-Commit-ID: 2N0wflAvg7Y

--HG--
extra : rebase_source : 63b9ae6e4db0de1957cb011c69134894d311b703
2018-01-22 14:42:24 +00:00
Paolo Amadini
8297599fe3 Bug 1432016 - Part 3 - Use the PanelView class for knownViews and openViews. r=Gijs
MozReview-Commit-ID: CQ0Ao3FlRRc

--HG--
extra : rebase_source : 17fc6eeb96748028943708b83fc9fd5b6134d8b6
2018-01-22 13:06:55 +00:00
Paolo Amadini
449c7a5310 Bug 1432016 - Part 2 - Move descriptionHeightWorkaround and some other methods to the PanelView class. r=Gijs
MozReview-Commit-ID: 59fUuB35Ygy

--HG--
extra : rebase_source : 65133023f89241da1b8475b783ffc80e35ee3c28
2018-01-25 15:35:45 +00:00
Paolo Amadini
f26eb575e4 Bug 1432016 - Part 1 - Add a PanelView class using a base class shared with PanelMultiView. r=Gijs
Only one method is moved to the PanelView class to simplify the keyboard navigation test.

MozReview-Commit-ID: CHB5FiT9ptn

--HG--
extra : rebase_source : ec588beae9f1208a37ce85f9d28029dfd979db24
2018-01-22 12:46:48 +00:00
Paolo Amadini
8fb049f21b Bug 1432015 - Part 5 - Remove unused code. r=Gijs
MozReview-Commit-ID: IoURPSdQAiR

--HG--
extra : rebase_source : a52da95d14752726590035aa4adea5a7605aae50
2018-01-21 11:37:50 +00:00
Paolo Amadini
fce2b33bda Bug 1432015 - Part 4 - Separate the set of known views from the stack of open views. r=Gijs
This makes the code easier to follow and facilitates future refactoring, for example the set of known views can be removed entirely by making the clean up and navigation code use the stack of open views.

The SlidingPanelView class can thus be removed, saving various lines of code. The class implemented a small optimization for garbage collection, that was already less effective because various other objects are created during each view transition anyways.

MozReview-Commit-ID: Z4JJMklUMf

--HG--
extra : rebase_source : 8789a35c4234fc691c62efeb3445b776b14fc1f9
2018-01-21 17:27:11 +00:00
Paolo Amadini
26c7b11e09 Bug 1432015 - 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
MozReview-Commit-ID: Hld45ghdduv

--HG--
extra : rebase_source : e01d8facd56a4be21818879b21de75802d723db3
2018-01-17 15:04:18 +00:00
Paolo Amadini
11d708f26b Bug 1432015 - Part 2 - Remove the setMainView methods. r=Gijs
The setMainView method of PanelMultiView controls the "mainview" attribute, which is already set or removed later in the showSubView method. When called at construction time, it changes the mainViewId if there is at least one child in the "panelmultiview" element and the original mainViewId does not already reference the first child. This would be incorrect, but in practice it never happens for either ephemeral or static panels, and can be avoided for the throw-away activated page action panel.

The setMainView method of PanelUI is never called, and this makes the corresponding PanelMultiView method removable.

MozReview-Commit-ID: 5bNidHfKFTA

--HG--
extra : rebase_source : b527827d30d682d183981347c2caf3a8a5d81355
2018-01-21 15:59:41 +00:00
Kris Maglione
aec63e140c Backed out 3 changesets (bug 1431533) for Android mochitest bustage. CLOSED TREE
MozReview-Commit-ID: 5ubE9EMQpZ9

--HG--
extra : histedit_source : df68d7595925c07d9d6e8bacc2c46e69556f479a%2C72b768b9825e20ede6603ead75f871c50dc041f7
2018-01-24 22:04:59 -08:00
Kris Maglione
30b3a49bfd Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian
MozReview-Commit-ID: 8V1ZT53ReiP

--HG--
extra : rebase_source : 12b5f8c3e125111db7382eb3d7d20a99fb2c35b3
extra : absorb_source : e99fa7f6eee02e7e6cadeb898c7fcf6dac9c902a
extra : histedit_source : d0dfc31fadc2b81d341c9d0cd1efec02923c003b
2018-01-24 15:48:47 -08:00
Ian Moody
acb5488eff Bug 1425972 - Manually handle Tab navigation in PanelMultiView so it syncs with Arrow navigation. r=Gijs
MozReview-Commit-ID: 5PjXFZBeWzM

--HG--
extra : rebase_source : cd0e2176fed7f9808808e45ea4aef794450af43c
2017-12-19 19:37:34 +00:00
Paolo Amadini
d5768a5706 Bug 1423891 - Panel header is gone when going back from Bookmarks to Library. r=Gijs
MozReview-Commit-ID: Bfgg61BH9L8

--HG--
extra : rebase_source : aa50e87024c46f8337e806245a8aae34b5fa599f
2017-12-07 15:32:40 +00:00
Paolo Amadini
b12ae1861e Bug 1417042 - Remove the "panelview" binding. r=Gijs
MozReview-Commit-ID: 26uQb3pteQd

--HG--
extra : rebase_source : 93263ff4f1e0d38292dbfef3f7385ddd881b25ef
extra : source : bce38a7817ee39ccd38f57f73f5acf81a41e1f69
2017-12-06 10:37:25 +00:00
Paolo Amadini
fd72a1cb37 Bug 1392340 - Height jumps when opening subviews of different lengths. r=Gijs
The height of the subview being opened was supposedly calculated using an off-screen container independent from the currently displayed views, but this didn't work as expected because of the incorrect box alignment. This is now fixed and the correct minimum and maximum heights are set on the container separately, also preventing the current view from flickering before the transition in case the subview was taller.

With this issue fixed, the height can now be recalculated each time the subview is opened, without the caching that caused incorrect results when the same view was reopened with different elements or text.

Jumping could also occur because of a border applied only during the transition, which could influence the subview height in the presence of wrapping text.

MozReview-Commit-ID: EWHs1hFKXT4

--HG--
extra : rebase_source : 5b0bc4e5d4d2d10d684c2c2bf94a9030aadd09bd
2017-11-28 16:53:42 +00:00
Sebastian Hengst
f3e2f5f701 Backed out changeset bce38a7817ee (bug 1417042) for browser-chrome failures, e.g. browser/components/customizableui/test/browser_987640_charEncoding.js and browser/base/content/test/urlbar/browser_page_action_menu.js. r=backout on a CLOSED TREE 2017-11-27 18:03:15 +02:00
Paolo Amadini
a923fc09da Bug 1417042 - Remove the "panelview" binding. r=Gijs
MozReview-Commit-ID: 26uQb3pteQd

--HG--
extra : rebase_source : 1460c5538943b9b5a6c84a040b37e883a3276d9a
2017-11-23 18:07:15 +00:00
Paolo Amadini
166ddcece1 Bug 1414244 - Part 7 - Remove unused code paths from PanelMultiview.jsm. r=Gijs
MozReview-Commit-ID: 9cwaAZXqDGO

--HG--
extra : rebase_source : 90cf1a99c2ca1a64709abfa7383462480282ba0f
2017-11-23 15:18:14 +00:00
Paolo Amadini
90a19d3ca4 Bug 1414244 - Part 4 - Remove the "panel-clickcapturer" element. r=Gijs
MozReview-Commit-ID: 3aPVbnmr7QB

--HG--
extra : rebase_source : f59452147d08b3f75521c544f78f1c29b2c39814
2017-11-11 22:48:32 +00:00
Paolo Amadini
82f9f4f35d Bug 1414244 - Part 3 - Remove the "panel-subviews" container. r=Gijs
MozReview-Commit-ID: 2GGJ1myKuF5

--HG--
extra : rebase_source : e4089ae1ec828048f052932f13a687aca109b7c5
2017-11-11 22:09:30 +00:00
Paolo Amadini
b4f8aa9d1e Bug 1414244 - Part 2 - Remove the "viewtype" attribute. r=Gijs
MozReview-Commit-ID: 8fq0KLfYWnc

--HG--
extra : rebase_source : a75197f66d0b8699e1cad5640eb0bc20ee53ee0c
2017-11-21 13:22:47 +00:00
Paolo Amadini
46c88521a3 Bug 1414244 - Part 1 - Remove the "panelid" attribute. r=Gijs
MozReview-Commit-ID: 4o27h6PhCRg

--HG--
extra : rebase_source : 7be0dd97832033fa0d5304afd0def1cd3dcd3ddf
2017-11-11 13:05:51 +00:00
Sam Foster
c5c9a1666e Bug 1412364 - defer applying maxHeight in PanelMultiView until popup is positioned. r=Paolo
* Let popup code initially measure and place the panel without maxHeight, this ensures alignmentPosition is a reasonable value
* Assign maxHeight from a popuppositioned handler and update the comment explaining the role of the autoPosition property
* Refactor to move the maxHeight calculation into a method on PMV
* panel autoPosition now gets reset to false in popuppositioned (was popupshowing) as the ShowWithPositionedEvent on popupFrame sets it back to true every time
* Update reflow tests with new signatures, and elimination of 1 reflow
* In appMenu reflow test, we must now wait for popupshown before opening subviews

MozReview-Commit-ID: KfHxngnajM3

--HG--
extra : rebase_source : 2918a30f6ecdfded57fb7b93aba3f0479fd4635c
2017-11-16 17:12:06 -08:00
Gijs Kruitbosch
7cc3de1624 Bug 1388029 - remove dead CSS relating to the old panel, r=jaws
MozReview-Commit-ID: FoXjvWPc9in

--HG--
extra : rebase_source : b098e2efc8f154aaae5f4ddfd30558fb0f3299c1
2017-11-07 12:52:56 +00:00
Paolo Amadini
f735328150 Bug 1409301 - Update the site security subview to the Photon style. r=johannh
The site security subview is now implemented using the "photonpanelmultiview" element, replacing the last instance of the "panelmultiview" element. The subview features a standard Photon header, hence the connection state icon was moved to the element below it. This makes the styles more similar between the main view and the subview. The connection state styles are now applied using a class name, and the tests have been updated accordingly.

This change required some fixes in the "photonpanelmultiview" implementation to make sure the height of the subview is correct and to allow keyboard navigation back to the main view.

Since the expander button and the permission controls in the main view are not visible anymore after the subview is shown, some code related to focus and hover could be removed as well.

MozReview-Commit-ID: 4nIAPWJPV8k

--HG--
extra : rebase_source : 74d6d769421c0f8521bdfae249b4d111e630a3bd
2017-11-11 19:13:43 +00:00
Dan Banner
7caa92d5d8 Bug 1408777 - Automatically fix instances of missing semicolons in the tree. r=Standard8
MozReview-Commit-ID: Jm8BRgt6mIv
2017-10-15 20:50:39 +01:00
Mike de Boer
9fb6d528ad Bug 1407591 - Listen for the 'transitioncancel' event as well to ensure that a panel transition is also cleaned up properly in this rare case. r=Paolo
MozReview-Commit-ID: 2bph43ndzJJ

--HG--
extra : rebase_source : cc7d0def21df8b3c577b26546e8bf474faa58b3b
2017-10-12 13:26:04 +02:00
Mike de Boer
219c7f3d50 Bug 1405942 - Make sure to always apply the descriptionHeightWorkaround in Photon panels on popupshown, because it might've missed elements that were hidden. r=Paolo
MozReview-Commit-ID: 9xSqoZGJ3MF

--HG--
extra : rebase_source : ce3547992d86d1343f1e2ef9aff953819a283ad4
2017-10-10 12:42:43 +02:00
Mike de Boer
50959cb695 Bug 1387808 - Don't ever fixate the width and height of the main view, but leave it flexible. r=Gijs
MozReview-Commit-ID: AJw6yI6Onje

--HG--
extra : rebase_source : 144739ba16418ce0867a6dd7ac086c4ea4676c51
2017-10-05 13:14:02 +02:00
Mike de Boer
882fa06e25 Bug 1401991 - Ensure that we don't hide panelviews that are already reparented to another multi-view and ensure to hide other panels consistently. r=Gijs
* Harden the new `hideAllViewsExcept()` to not do erroneous things if called when
   the binding is already gone.
 * Generalize things into `hideAllViewsExcept(thisOne)`:
    - Clear `_viewShowing` in there and do the descriptionHeightWorkaround thing
      in there too,
    - For Photon panels, do all the 'current' attribute setting in there. To show
      a panel during transition, I introduced the 'in-transition' attribute.
 * I had to make sure not to over-eagerly dispatch 'ViewShowing' events, because
   that confuses some,
 * Move the temporary panel handling, which contains an ephemeral panelmultiview
   instance, internally. This cleans up the hacky, duplicate PanelUI.js code nicely.
 * Keep a local copy of `_transitionDetails` to ensure it's still there after transition,
 * Harden `_cleanupTransitionPhase()` to only clear the phase that belongs to a
   specific transition, _if_ that's passed in as an argument. This resolves any
   potential raciness that might occur when `showSubView()` is called again mid-transition.
 * Skip the UITour element visibility check when it's inside a panelview, because
   too many things need to happen and that check is too simple to be useful in
   that case.

MozReview-Commit-ID: 5HpJKs1Ny5j

--HG--
extra : rebase_source : b810e1de2dbd75932a42d68e751fdaecd9fee69a
2017-09-29 13:51:51 +02:00
Mike de Boer
f7dd6d2d6d Bug 1401383 - remove anchor state after transition even if the transition is canceled, and always set main view as current, r=Gijs
We weren't removing the 'open' attribute from the anchor if the transition didn't complete.
This patch fixes this by moving the addition of 'open' into _transitionViews, and its removal into
_cleanupTransitionPhase.

MozReview-Commit-ID: TS0CcwsHVN

--HG--
extra : rebase_source : 1bdace324f22ee95002024fe68b572a16dd25aac
2017-09-21 22:18:07 +02:00
Sebastian Hengst
7824630fde Backed out changeset 658b68ee4d0a (bug 1401383) for frequently failing browser-chrome's browser/components/extensions/test/browser/browser_ext_browserAction_popup_resize.js, especially on Linux x64 asan. r=backout 2017-09-20 17:28:51 +02:00
Gijs Kruitbosch
b078909af6 Bug 1401383 - remove anchor state after transition even if the transition is canceled, and always set main view as current, r=mikedeboer
Prior to this change, showMainView set the 'current' attribute on a main view, but then _cleanupTransitionPhase() would remove it again.
This patch fixes that by calling showMainView *after* _cleanupTransitionPhase.

Separately, we weren't removing the 'open' attribute from the anchor if the transition didn't complete.
This patch fixes this by moving the addition of 'open' into _transitionViews, and its removal into
_cleanupTransitionPhase.

MozReview-Commit-ID: 24FYaxDVlga

--HG--
extra : rebase_source : 41bb5ffe29ca8e0ec9acc1793ae87d63d28e1f43
2017-09-19 23:53:59 +01:00
Mike de Boer
aa0c3dc278 Bug 1374749 - Animate the panelviews differently to make it look as if the view to show is pushing the previous view out of the panel. r=jaws
MozReview-Commit-ID: Dy6UppV3xDH

--HG--
extra : rebase_source : 1c970efaa0b7162450d79f37633afacaadc8d19e
2017-09-12 21:33:25 +02:00
Sebastian Hengst
22c06f3a4b Backed out changeset f09b2b387751 (bug 1374749) for frequently failing browser-chrome's browser/components/extensions/test/browser/test-oop-extensions/browser_ext_browserAction_popup_resize.js on macOS. r=backout 2017-09-11 18:45:35 +02:00
Mike de Boer
bdb3034789 Bug 1374749 - Animate the panelviews differently to make it look as if the view to show is pushing the previous view out of the panel. r=jaws
MozReview-Commit-ID: Dy6UppV3xDH

--HG--
extra : rebase_source : 28e14f7e5764490c3a0a550cb230eb8a800647bf
2017-09-11 16:28:06 +02:00
Sebastian Hengst
5c5d753509 Backed out changeset 20f6207757f3 (bug 1374749) for failing browser-chrome's browser/base/content/test/urlbar/browser_page_action_menu.js. r=backout 2017-09-08 19:42:22 +02:00
Mike de Boer
dcde014112 Bug 1374749 - Animate the panelviews differently to make it look as if the view to show is pushing the previous view out of the panel. r=jaws
MozReview-Commit-ID: Dy6UppV3xDH

--HG--
extra : rebase_source : b473714a3de9ff34da8c936770d335b7e2ee01bd
2017-09-08 18:02:10 +02:00
Mike de Boer
02e344af23 Bug 1390336 - Disable panelview keyboard navigation using arrow keys in the overflow panel, because input boxes can be in there. r=Gijs
MozReview-Commit-ID: DxZv8JDp2Q2

--HG--
extra : rebase_source : b3bf90e60540a1b115a3bf2321fd4396863b5cce
2017-09-08 11:53:11 +02:00
Mike de Boer
df2fab0b05 Bug 1354532 - Part 3 - Ensure that the offscreen bounds check for panelviews does not cause temporary empty panels. r=Paolo
MozReview-Commit-ID: 8EACBXDekIW

--HG--
extra : rebase_source : d53f3461db931733a7d1e7722d0fa23ad659fa06
2017-09-06 17:21:24 +02:00
Sebastian Hengst
8aa94790d7 Backed out changeset 545712909b9b (bug 1354532) 2017-09-06 16:47:06 +02:00
Mike de Boer
781c585ac9 Bug 1354532 - Part 3 - Ensure that the offscreen bounds check for panelviews does not cause temporary empty panels. r=Paolo
MozReview-Commit-ID: 8EACBXDekIW

--HG--
extra : rebase_source : 6c067ddfbac4462f26600083c1b0ee2adea33d36
2017-09-06 16:23:08 +02:00
Blake Winton
ad9fe7889e Bug 1392332 - Set the viewtype attribute correctly when going back to the main view. r=Gijs.
MozReview-Commit-ID: KMK4fQn5DwZ

--HG--
extra : rebase_source : bc06a9659112b6a74099c85e88c1cc636a625884
2017-08-21 13:09:37 -04:00
Gijs Kruitbosch
b308974089 Bug 1366207 - remember previous view's selection when keyboard navigating panels, r=mikedeboer
MozReview-Commit-ID: 14U7hkrBbJq

--HG--
extra : rebase_source : c6a0439d253d38a776445793b235b93ba5873f48
2017-08-15 15:21:15 +01:00
Mike de Boer
2859ef0a38 Backed out changeset a528b4400362 (bug 1382243) for causing bug 1390753.
MozReview-Commit-ID: 57KH3vQGeSe
2017-08-16 13:49:59 +02:00
Mike de Boer
25583e0eda Bug 1377968 - Add a tools section and subview to the Bookmarks subview inside the Library widget. r=Gijs
MozReview-Commit-ID: GqbUMbuvYoO

--HG--
extra : rebase_source : 09f489b9b558a9b8dfc0aecbf1ab863d816ee43b
2017-08-15 13:34:41 +02:00
Gijs Kruitbosch
a06ede1bf2 Bug 1382243 - Refactor panelmultiview code to reduce complexity and length of functions, r=mikedeboer
While this creates several methods with just 1 callsite, given the previous length of the
showSubView method (230 lines), it seems wise to split this up and to try to reduce the
nesting, as well as making it easier to reason about what happens if we hide the panel
mid-transition.

MozReview-Commit-ID: 9Vf4p4fVBSs

--HG--
extra : rebase_source : f21ca55eaeb4bda49ba51f2694ecb5620f47e941
2017-08-04 11:33:55 +02:00
Gijs Kruitbosch
ad0e178cad Bug 1388753 - unbreak bookmarks/history item clicks and tidy up code in browserPlacesViews.js, r=mikedeboer
MozReview-Commit-ID: 1vjP6IeIiPz

--HG--
extra : rebase_source : e3ef4468299adfd0b874ba2f44a034c2655ecd6f
2017-08-10 23:04:54 +01:00
Sebastian Hengst
6081d7a11e Backed out changeset bf603affd1e0 (bug 1388753) for failing browser-chrome's browser_947914_button_history.js. r=backout a=merge
MozReview-Commit-ID: AHOsaTvCWms

--HG--
extra : source : 5475c7748903350a91842046eeb614880738b83e
2017-08-10 20:02:44 +02:00
Gijs Kruitbosch
12b877d713 Bug 1388753 - unbreak bookmarks/history item clicks and tidy up code in browserPlacesViews.js, r=mikedeboer
MozReview-Commit-ID: 1vjP6IeIiPz

--HG--
extra : rebase_source : 1bf36537326b86fff6e3db814908cb64aaad3e57
2017-08-09 18:02:36 +01:00
Gijs Kruitbosch
c4fb9878e0 Bug 1354117 - only dispatch view events once, and fix synced tabs button test, r=jaws
Prior to this patch, both CustomizableUI itself and the PanelMultiView module
tried to ensure that onViewShowing/Shown/Hiding/Hidden listeners were invoked
when the relevant DOM events fired.

PanelMultiView was doing this manually because CUI was only adding listeners
once the corresponding widget was created. Now that the relevant views can be
accessed without the corresponding widgets (via the fixed appMenu), there was
no guarantee that the listeners would be attached, and this caused empty
subviews.

Unfortunately, if the widget *was* present, it caused events to fire more than
once, which understandably broke consumers like the sync remote tabs widget,
which broke the test we're fixing up here. For other views, even if they were
not completely broken it at least did busy-work.

This patch removes the manual event invocation, and delegates the event
listener work to CUI from the PanelMultiView side. This ensures events fire,
and fire only once.

MozReview-Commit-ID: 94GhcrdcBuB

--HG--
extra : rebase_source : 4df42939aa06ec10b7f86c3c2e4fe75160c7e7bd
2017-08-01 12:45:55 +01:00