Commit graph

171 commits

Author SHA1 Message Date
Kris Maglione
e930b89c34 Bug 1514594: Part 3 - Change ChromeUtils.import API.
***
Bug 1514594: Part 3a - Change ChromeUtils.import to return an exports object; not pollute global. r=mccr8

This changes the behavior of ChromeUtils.import() to return an exports object,
rather than a module global, in all cases except when `null` is passed as a
second argument, and changes the default behavior not to pollute the global
scope with the module's exports. Thus, the following code written for the old
model:

  ChromeUtils.import("resource://gre/modules/Services.jsm");

is approximately the same as the following, in the new model:

  var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");

Since the two behaviors are mutually incompatible, this patch will land with a
scripted rewrite to update all existing callers to use the new model rather
than the old.
***
Bug 1514594: Part 3b - Mass rewrite all JS code to use the new ChromeUtils.import API. rs=Gijs

This was done using the followng script:

https://bitbucket.org/kmaglione/m-c-rewrites/src/tip/processors/cu-import-exports.jsm
***
Bug 1514594: Part 3c - Update ESLint plugin for ChromeUtils.import API changes. r=Standard8

Differential Revision: https://phabricator.services.mozilla.com/D16747
***
Bug 1514594: Part 3d - Remove/fix hundreds of duplicate imports from sync tests. r=Gijs

Differential Revision: https://phabricator.services.mozilla.com/D16748
***
Bug 1514594: Part 3e - Remove no-op ChromeUtils.import() calls. r=Gijs

Differential Revision: https://phabricator.services.mozilla.com/D16749
***
Bug 1514594: Part 3f.1 - Cleanup various test corner cases after mass rewrite. r=Gijs
***
Bug 1514594: Part 3f.2 - Cleanup various non-test corner cases after mass rewrite. r=Gijs

Differential Revision: https://phabricator.services.mozilla.com/D16750

--HG--
extra : rebase_source : 359574ee3064c90f33bf36c2ebe3159a24cc8895
extra : histedit_source : b93c8f42808b1599f9122d7842d2c0b3e656a594%2C64a3a4e3359dc889e2ab2b49461bab9e27fc10a7
2019-01-17 10:18:31 -08:00
Gijs Kruitbosch
b1b30aa5dc Bug 1520607 - only disable and re-enable autopositioning while in the process of showing subviews, r=sfoster,mconley
Differential Revision: https://phabricator.services.mozilla.com/D17105

--HG--
extra : moz-landing-system : lando
2019-01-23 11:17:00 +00:00
Paolo Amadini
b646eedd75 Bug 1509388 - Part 1 - Don't use a toolbarbutton element for the download-subview-toolbarbutton binding. r=Gijs
Download items in the Downloads Subview of the Library Panel are implemented using a XBL binding that is associated to a "toolbarbutton" element, but inherits from "button-base" in order to avoid the display="xul:button" of the "toolbarbutton" binding. This is because the item contains an inner button, and using a button CSS frame for the outer element would break hover behavior and mouse events.

This changes the binding so it doesn't use a "toolbarbutton" element, which is a different way to avoid the outer button CSS frame, and eventually allows removing support for the "display" attribute in XBL.

Differential Revision: https://phabricator.services.mozilla.com/D14572

--HG--
extra : rebase_source : e0f907aea98419c6f7ee4b53f645e4cfe0fcdf5a
2018-12-13 18:47:28 +00:00
Dão Gottwald
9880945252 Bug 1509651 - Stop flushing style for knowing the UI direction. r=florian
Differential Revision: https://phabricator.services.mozilla.com/D12827

--HG--
extra : moz-landing-system : lando
2018-11-26 11:59:04 +00:00
Dorel Luca
e501f0a01e Backed out changeset fab7024e7658 (bug 1508446) for reftest failures in reftest/tests/layout/reftests/xul/accesskey.xul 2018-11-22 02:50:01 +02:00
Brian Grinstead
3f17f6b48b Bug 1508446 - Require that [accesskey] gets set on <xul:label> to enable formatting;r=paolo
Previously, if the accesskey attribute was missing then the label would reach up
to binding parent to find it's accesskey. In practice, bindings already do
[xbl:inherits=accesskey] to send it down to the label anyway.

The problem with this is that for controls without accesskeys, the attribute doesn't get set,
so the label will access the control from JS. This is fine for XBL, since typically
the label XBL will construct at the same time as the control, but when migrating
to Custom Elements, the label gets connected even when the control is hidden.

Differential Revision: https://phabricator.services.mozilla.com/D12355

--HG--
extra : moz-landing-system : lando
2018-11-21 22:35:44 +00:00
James Teh
382c02eef0 Bug 1506503: PanelMultiView: Automatically focus the first item if a panel is opened via the keyboard. r=johannh,paolo
Previously, we had specific code to do this for the "View site information" button (#identity-box) when activated via the keyboard.
To work well for keyboard and screen reader users, all such popups (e.g. Firefox menu, Page Actions, etc.) should do this.
These are all based on panelMultiView.
The arguments passed to PanelMultiView.openPopup can include the event which triggered the popup.
We now use this to detect keypress events and focus the first item in the panel in that case.

Differential Revision: https://phabricator.services.mozilla.com/D11605

--HG--
extra : moz-landing-system : lando
2018-11-16 22:51:59 +00:00
Mark Banner
691543ee89 Bug 1486739 - Add missing dangling commas in browser/, services/, taskcluster/ and toolkit/. r=mossop
Automatic changes by ESLint, except for manual corrections for .xml files.

Differential Revision: https://phabricator.services.mozilla.com/D4439

--HG--
extra : moz-landing-system : lando
2018-08-31 05:59:17 +00:00
Mark Striemer
dedae0369d Bug 1482731 - Support Home and End in PanelMultiView navigation r=dao
Differential Revision: https://phabricator.services.mozilla.com/D4087

--HG--
extra : moz-landing-system : lando
2018-08-28 09:17:56 +00:00
Paolo Amadini
866357cbca Bug 1484275 - Fix opening the main menu while another popup is open on Windows. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D3979

--HG--
extra : rebase_source : 5cf5b9fe368de3c78765cb154ef6532e2340d400
2018-08-23 14:04:43 +01:00
Brendan Dahl
4b4b2327fe Bug 1485147 - Fix app menu for browser.xhtml. r=bgrins
The XUL elements were not being created because of the wrong createElement
call.

MozReview-Commit-ID: 54RqUJQAqHq

Differential Revision: https://phabricator.services.mozilla.com/D3998

--HG--
extra : moz-landing-system : lando
2018-08-22 17:04:52 +00:00
Sahil Bhosale
f644c54e3a Bug 1481401 - PanelMultiView.jsm: replace _dwu getter with _getBoundsWithoutFlushing method. r=dao 2018-08-10 02:27:00 +03:00
Brian Grinstead
abf1620630 Bug 1479125 - Migrate calls that expect an element to be returned to use element variation firstChild etc to firstElementChild etc;r=Paolo
This allows the JS to work in HTML documents, where whitespace is preserved. In XUL
documents, whitespace is ignored when parsing so text nodes are generally not returned.

The following changes were made, with manual cleanups as necessary (i.e. when firstChild actually
refers to a text node, or when firstChild is used in a loop to empty out an element):

  firstChild->firstElementChild
  lastChild->lastElementChild
  nextSibling->nextElementSibling
  previousSibling->previousElementSibling
  childNodes->children

MozReview-Commit-ID: 95NQ8syBhYw

--HG--
extra : rebase_source : 186d805f7a2a56694dda9032aceac2dfe5424753
2018-08-08 15:22:53 -07:00
Paolo Amadini
f06351c23c Bug 1473748 - Part 2 - Simplify how navigable elements are initialized. r=johannh
MozReview-Commit-ID: HN2ZYXNVi6m

--HG--
extra : rebase_source : 4373f26b679296d6f2237640dd248ce5bf8dd63c
2018-07-23 11:28:23 +01:00
Paolo Amadini
7328341032 Bug 1473748 - Part 1 - Use the type of element instead of the "subviewbutton" and "subviewkeynav" classes to initialize the list of navigable elements. r=johannh
MozReview-Commit-ID: IgxwGRNLsct

--HG--
extra : rebase_source : edc897a0c0ac7a8b7b551759a8d69b7c3d3659d5
2018-07-26 14:58:43 +01:00
Boris Zbarsky
270fa12c79 Bug 1476145 part 3. Stop using getInterface(nsIDOMWindowUtils) in browser/. r=gijs 2018-07-24 19:47:41 -04:00
Johann Hofmann
e7b9853987 Bug 1467385 - Use PanelMultiView APIs for keyboard navigation in the identity popup. r=Paolo
PanelMultiView has its own concept of "selected", so we should use this rather than move focus
using advanceFocusIntoSubTree.

MozReview-Commit-ID: DW2JqqggLl1

--HG--
extra : rebase_source : ec7a6f83fdda176f3286cf4395dc72de6cad2466
2018-07-02 14:34:25 +02:00
James Teh
8b233f97a0 Bug 1454866 part 1: PanelMultiView: Provide a way to allow keyboard navigation to an element without affecting visual presentation. r=johannh
PanelMultiView has specific code to support keyboard navigation.
However, it only includes elements with class subviewbutton, which has visual styling.
Some views have controls which should be included in keyboard navigation, but for which the subviewbutton styling is not appropriate.
Therefore, also include elements with the new class subviewkeynav, which is specific to keyboard navigation and has no visual styling.

MozReview-Commit-ID: 8A5q9nbGpdc

--HG--
extra : rebase_source : 431fd2b1e2926e53002a45c290f9d88e8463c42c
2018-04-23 10:37:42 +10:00
Neil Deakin
cf9835ac8b Bug 1446961, remove obsolete calls to showPopup and replace usages of the popup box object with the same methods defined on popups, r=paolo 2018-04-27 11:04:36 -04:00
Kris Maglione
a7b308c3a2 Bug 1456686: Part 1 - Fix unused and shadowed explicit imports. r=standard8
These issues were previously ignored due to the nature of our global import
rules. They need to be fixed before that rule can be updated.

MozReview-Commit-ID: DCChktTc5TW

--HG--
extra : rebase_source : cffb1c9762191c579d1397c8169e6e7635d229da
extra : histedit_source : dea59ddd2daaae52069c5faceae9149a4f08dd73
2018-04-24 20:18:09 -07:00
Mike Conley
4b6fb934f7 Bug 1442020 - Make PanelMultiView's description height workaround account for the possibility that panels have closed before a refresh driver tick. r=Paolo
MozReview-Commit-ID: IIjGYjoxMx5

--HG--
extra : rebase_source : 6e4f64576296e01deb6af0b8a1911b4da934e48d
2018-03-08 14:24:18 -05:00
Sam Foster
c11210d2df Bug 1402845 - Fix panelview sizing when customRectGetter is used. r=mikedeboer,Paolo
* The extension content drives the sizing of the browser and popup that contains it via the Extension:BrowserResized message. The ignoreResizes property throttles/debounces this initially, stashing the dimensions received rather than triggering resize of the popup for every message. When the popup is a subview and fixedWidth, we ignore width but *do* want to use the stashed height value.

* Until the panel is given visibility, it has 0 height, so after setting visibility, wait until the next refresh-driver tick before measuring any header which should get added to the overall view height

MozReview-Commit-ID: AgcruVb9QPA

--HG--
extra : rebase_source : 429503a7d38559cc8670a3205b3290b8e0bbbfa2
2017-10-05 10:23:53 -07:00
Mark Banner
a32bc883e7 Bug 1434446 - Enable no-unused-vars for global scope on jsm files in browser/. r=mossop
MozReview-Commit-ID: ERT1Fili25d

--HG--
extra : rebase_source : c62ad4e97fc5da7c59cbb03ba08928f7bbe5be6b
2018-03-01 20:06:06 +00:00
Tooru Fujisawa
d0ece36aa1 Backed out changeset 29e1fceaf48d (bug 1193394) 2018-03-01 19:55:08 +09:00
Tooru Fujisawa
25a9f5bb72 Bug 1193394 - Part 4: Wait for the next event tick before calling promiseDocumentFlushed in descriptionHeightWorkaround. r=bustage CLOSED TREE 2018-03-01 18:44:38 +09:00
Paolo Amadini
01dda8797e Bug 1420939 - Add an asynchronous version of the description height workaround. r=Gijs
This prevents synchronous reflows when opening subviews. This also removes a superfluous invocation of the workaround while the panel is still hidden.

MozReview-Commit-ID: DohLjntVaPU

--HG--
extra : rebase_source : 8cd1b86168aee23d4e75556c2b11baf2c8dd0b9c
2018-02-27 22:02:55 +00:00
Paolo Amadini
86df7b05eb Bug 1428839 - Part 8 - Fix the sliding transition when views are reordered. r=Gijs
Views moved to a different panel and then moved back could be placed after the subviews they give access to, if the other subviews were not moved. The transition would be incorrect when these subviews are opened later.

MozReview-Commit-ID: 6JJa0p0McxL

--HG--
extra : rebase_source : 7e28c0638c46b26c45b1073d8a76173fa75fd5fa
2018-02-28 13:43:51 +00:00
Paolo Amadini
29a9ce32a3 Bug 1428839 - Part 7 - Reduce calls to _cleanupTransitionPhase. r=Gijs
The transition code now returns early if the panel was closed during an "await" statement.

Given that transitions can only be interrupted when closing the panel, and the _cleanupTransitionPhase method handles exclusively state related to the panel rather than the individual views, it is now possible to call the _cleanupTransitionPhase method only when the panel is hidden or at the end of a transition.

MozReview-Commit-ID: GYRKyyhJBPK

--HG--
extra : rebase_source : cd66a1e68d0f6cf0a371d7216d54e7d07b576529
2018-02-27 22:56:15 +00:00
Paolo Amadini
ceb5caf0c5 Bug 1428839 - Part 6 - Remove previous workaround for the panel resizing at the end of the transition. r=Gijs
This was added in bug 1354141 and is not needed anymore.

MozReview-Commit-ID: 42oF7LpCa6R

--HG--
extra : rebase_source : cd002b7052d14318efe4ef1ac6cc48fe30467265
2018-02-27 16:13:48 +00:00
Paolo Amadini
389c9b6df4 Bug 1428839 - Part 5 - Open the anchor when subview navigation starts and close it asynchronously afterwards. r=Gijs
The anchor state does not need to be cleaned up synchronously, so we can handle it seperately from the transition state.

MozReview-Commit-ID: 1CBP9OS5WmM

--HG--
extra : rebase_source : 533cee34a8f8e0e4bae00a4ff4eb00b9f330f7c1
2018-02-27 15:52:07 +00:00
Paolo Amadini
91212fa6b1 Bug 1428839 - Part 4 - Avoid re-entrancy in PanelMultiView navigation functions. r=Gijs
We now use the "active" property of views to track whether navigation is possible. This has the advantage of being already handled correctly when views are moved to a different panel, and is in line with the purpose of the "active" state. The note about using the "popupshown" event for navigation has been updated accordingly.

Keyboard navigation is also linked to the "active" property now, so there is no need to track the state of the "_transitioning" property anymore.

Since the goBack and showSubView methods can only be called when the view is active, we don't need to check for attempts to start a transition while the panel is closed anymore.

MozReview-Commit-ID: 3KT3A5EwGFy

--HG--
extra : rebase_source : c338362923a7574210c7329bb84316d549898fdc
2018-02-27 15:33:33 +00:00
Paolo Amadini
613236ab39 Bug 1428839 - Part 3 - Clean up view properties when opening them. r=Gijs
This allows the state to be handled correctly when views are moved to a different panel.

The "margin-inline-start" style property on the view stack is also reset unconditionally, allowing less state to be stored in the transition details object.

MozReview-Commit-ID: IpgnYsVvx0w

--HG--
extra : rebase_source : 222a398546da3c142f4051c88f5cf9b4da2b8e98
2018-02-27 15:35:42 +00:00
Paolo Amadini
af1087eff8 Bug 1428839 - Part 2 - Add a function to determine if a view is still open. r=Gijs
This makes the intent of the code clearer and hides the details of how the association is made.

MozReview-Commit-ID: C2L0vsjhxNO

--HG--
extra : rebase_source : 8ff0ef3463470ed909a60c788ec59eaefa6795a9
2018-02-27 15:27:27 +00:00
Paolo Amadini
5a7e8bc917 Bug 1428839 - Part 1 - Remove previous workaround for flickering at the end of the transition. r=Gijs
This was originally introduced in bug 1374749 but isn't needed anymore, and removing this allows making the _cleanupTransitionPhase method synchronous.

MozReview-Commit-ID: 6v78QoPXZoU

--HG--
extra : rebase_source : 1c089d8a9e4e6a1031a7d0337f3459b7c1e37117
2018-02-27 15:17:29 +00:00
Paolo Amadini
a524280e41 Bug 1441284 - Part 8 - Remove the "_mainView" and "_mainViewId" properties. r=Gijs
The null check for the "node" property can also be removed since the caller already checks it synchronously.

MozReview-Commit-ID: 7FaCdtWTz20

--HG--
extra : rebase_source : 9162b3588b6085da5385a63401457192b1d9e690
2018-02-27 14:17:10 +00:00
Paolo Amadini
357704dead Bug 1441284 - Part 7 - Remove the "_ephemeral" property. r=Gijs
The "ephemeral" attribute was not actually used anymore, because it is redundant with the "viewCacheId" attribute.

MozReview-Commit-ID: 6zxf2DmcEfI

--HG--
extra : rebase_source : b3fb5381152c8baaf8f77549e87723e1815f945f
2018-02-26 19:50:19 +00:00
Paolo Amadini
01883a026c Bug 1441284 - Part 6 - Do not move out subviews when the window is closing. r=Gijs
Since we control the code path that invokes the PanelMultiView destructor, it is now possible to call the _moveOutKids function only as needed, avoiding some unnecessary DOM modifications when the browser window is closing.

MozReview-Commit-ID: JTJQmhZKFOh

--HG--
extra : rebase_source : cc3f1843cfd57e94bdf657aa033fbc9d5a086bf7
2018-02-26 19:47:29 +00:00
Paolo Amadini
a52806ca23 Bug 1441284 - Part 5 - Remove the "_panelViewCache" property. r=Gijs
MozReview-Commit-ID: IjTCdzr6gZ5

--HG--
extra : rebase_source : 1fece9694dfa2be6120230935af2c41f8efd26fb
2018-02-26 19:36:12 +00:00
Paolo Amadini
6a40e40b80 Bug 1441284 - Part 4 - Remove redundant calls before _moveOutKids and simplify the function. r=Gijs
The main view is already included in the children of the view stack, so the code that moves it out separately can be removed. The "mainview" attribute is already set to the correct value the next time the view is opened.

MozReview-Commit-ID: B8LMAxWvvTb

--HG--
extra : rebase_source : ae8afd201782346e63772cdb62797b7069e0d3ac
2018-02-26 19:14:31 +00:00
Paolo Amadini
d46beaba6f Bug 1441284 - Part 3 - Remove the "showingSubView" property. r=Gijs
The value "single" for the "closemenu" attribute on panel buttons is unused, so the only consumer of the "showingSubView" property can be removed.

MozReview-Commit-ID: 2jf5YE4Uyd

--HG--
extra : rebase_source : d1940fb7a470b42e0550c0e2876ad947d1c85d9d
2018-02-27 14:08:58 +00:00
Paolo Amadini
228213e40d Bug 1441284 - Part 2 - Remove the "_currentSubView" property. r=Gijs
MozReview-Commit-ID: Aua3V8hOT39

--HG--
extra : rebase_source : 08d506c3d65b3e2e72532183e776f8aa1c6c0975
2018-02-26 18:43:43 +00:00
Paolo Amadini
2d4d390d41 Bug 1441284 - Part 1 - Remove the "current" property. r=Gijs
MozReview-Commit-ID: GyqI8N3JQ9O

--HG--
extra : rebase_source : c2ac400d601c259ce17852a85d01230355885454
2018-02-26 18:36:59 +00:00
Paolo Amadini
53d37c96a7 Bug 1440333 - Part 3 - Raise the ViewShown event after the main view is active. r=Gijs
This also adds a new "active" property that can be used by regression tests to determine whether they should still wait for the ViewShown event.

MozReview-Commit-ID: K25F09llooj

--HG--
extra : rebase_source : 9f6dad605243fcd3633260c4fa34011f9cfab27c
extra : source : 2dad70b2a723e67b45563dd3ac254911dd193439
2018-02-26 13:18:22 +00:00
Paolo Amadini
acc856e8d4 Bug 1440333 - Part 2 - Rename the "current" attribute to "visible". r=Gijs
MozReview-Commit-ID: EazXDT6JC3M

--HG--
extra : rebase_source : ecaba689f94e26dcb20321bf51cd1b76d22ac2e8
extra : source : c705b49c2bae3301998df83dc0b883d0fb4e5219
2018-02-26 14:31:35 +00:00
Paolo Amadini
c359f82b1a Bug 1440333 - Part 1 - Remove the "in-transition" attribute. r=Gijs
This is made possible by a new workaround for a layout issue with panels that would prevent the main view from being displayed.

MozReview-Commit-ID: 3LGzq50QXt2

--HG--
extra : rebase_source : 2af636d4d93bf760b9ec4fd8b31ed77c715ab93f
extra : source : 9906b468eb78016aa4994b674da85bf7663c0285
2018-02-25 20:37:55 +00:00
Paolo Amadini
ffc1649aa1 Bug 1441154 - Start the PanelMultiView sliding transition together with the height transition. r=Gijs
This fixes an issue where the two transition are not simultaneous.

MozReview-Commit-ID: 8JKunQV3MDI

--HG--
extra : rebase_source : f272ab4c60de4361b44e71403806cd84436280db
2018-02-26 15:13:29 +00:00
Brindusan Cristian
81684073f2 Backed out 3 changesets (bug 1440333) for firefox-functional-test failures on test_no_certificate.py on a CLOSED TREE
Backed out changeset 2dad70b2a723 (bug 1440333)
Backed out changeset c705b49c2bae (bug 1440333)
Backed out changeset 9906b468eb78 (bug 1440333)
2018-02-26 16:19:18 +02:00
Paolo Amadini
885de209fb Bug 1440333 - Part 3 - Raise the ViewShown event after the main view is active. r=Gijs
This also adds a new "active" property that can be used by regression tests to determine whether they should still wait for the ViewShown event.

MozReview-Commit-ID: K25F09llooj

--HG--
extra : rebase_source : 8c9e2a86285be6453cd60b3da448876e6dfa7e8a
2018-02-26 13:18:22 +00:00
Paolo Amadini
76ef799b86 Bug 1440333 - Part 2 - Rename the "current" attribute to "visible". r=Gijs
MozReview-Commit-ID: EazXDT6JC3M

--HG--
extra : rebase_source : 5cca4cd0cf565ffbdf75a9777dfc15b359dcda57
2018-02-23 15:54:08 +00:00
Paolo Amadini
337d163883 Bug 1440333 - Part 1 - Remove the "in-transition" attribute. r=Gijs
This is made possible by a new workaround for a layout issue with panels that would prevent the main view from being displayed.

MozReview-Commit-ID: 3LGzq50QXt2

--HG--
extra : rebase_source : 5e594347fc612af2b3ee44748dd44383aa08f1a5
2018-02-25 20:37:55 +00:00