Commit Graph

93 Commits

Author SHA1 Message Date
Kagami Sascha Rosylight
a37cf7833d Bug 1695435 - Part 2: Add more words to the chrome script heuristic in use-isInstance r=preferences-reviewers,Gijs,webdriver-reviewers,whimboo,sgalich
Differential Revision: https://phabricator.services.mozilla.com/D110932
2022-08-24 22:47:42 +00:00
Timothy Nikkel
17d5301073 Bug 1781962. Attempt to navigate in the correct diection when using swipe to nav in RTL. r=hiro
This is a bit of a hack, but a hack that works is better than not working.

Depends on D153845

Differential Revision: https://phabricator.services.mozilla.com/D153846
2022-08-08 10:12:32 +00:00
Timothy Nikkel
936f9ce7b1 Bug 1783411. Fix translate distance of swipe to nav arrows in RTL. r=hiro
If we negate translate before doing the clamp we don't get the correct distance.

Differential Revision: https://phabricator.services.mozilla.com/D153845
2022-08-07 23:58:29 +00:00
Timothy Nikkel
da0d78f303 Bug 1782206. Add an effect to distinguish swipe to nav animation at 100%. r=hiro,desktop-theme-reviewers,dao
Differential Revision: https://phabricator.services.mozilla.com/D153166
2022-08-03 04:20:39 +00:00
Hiroyuki Ikezoe
8ba6059e43 Bug 1776795 - Move the swipe-to-nav icon in response to the swipe gestures on Windows. r=tnikkel,desktop-theme-reviewers,sfoster
Both Chrome and Edge on Windows also move the swipe-to-nav arrow icon, the
distance of move seems to be a fixed value, it doesn't depend on the browser
window size. So we also use a fixed value, 100px here.

Chrome on Mac also moves the icon, but in a slightly different way. The icon is
a semicircle shape, it never leaves the edge of the browser window even if it's
moving during swipe gestures. So we introduce a new preference named
"browser.swipe.navigation-icon-move-distance" to implement platform dependent
swipe-to-nav icon behaviors. As of now the value on platforms other than Windows
is zero so that the icon never moves on the platforms.

Depends on D152951

Differential Revision: https://phabricator.services.mozilla.com/D150433
2022-08-02 23:08:46 +00:00
Norisz Fay
16ba02f092 Backed out 2 changesets (bug 1776795) for causing bc failures on browser_test_swipe_gesture.js CLOSED TREE
Backed out changeset 7bed4509ae7c (bug 1776795)
Backed out changeset 344336b54939 (bug 1776795)
2022-08-02 10:48:53 +03:00
Hiroyuki Ikezoe
c44c823ee9 Bug 1776795 - Move the swipe-to-nav icon in response to the swipe gestures on Windows. r=tnikkel,desktop-theme-reviewers,sfoster
Both Chrome and Edge on Windows also move the swipe-to-nav arrow icon, the
distance of move seems to be a fixed value, it doesn't depend on the browser
window size. So we also use a fixed value, 100px here.

Chrome on Mac also moves the icon, but in a slightly different way. The icon is
a semicircle shape, it never leaves the edge of the browser window even if it's
moving during swipe gestures. So we introduce a new preference named
"browser.swipe.navigation-icon-move-distance" to implement platform dependent
swipe-to-nav icon behaviors. As of now the value on platforms other than Windows
is zero so that the icon never moves on the platforms.

Differential Revision: https://phabricator.services.mozilla.com/D150433
2022-08-02 06:49:55 +00:00
Timothy Nikkel
993bf4f146 Bug 1762872. Increase length of time swipe to nav ui element is visible. r=hiro
I noticed that the current implementation is very short and easy to miss. Chrome is much longer. I tweaked it to what felt pretty good.

Although this seems like only an increase from 0.25s to 0.35s it's actually much longer than that because the cubic-bezier curve (viewable at https://cubic-bezier.com/#.07,.95,0,1 ) goes to zero almost immediately. The new curve (viewable at https://cubic-bezier.com/#.25,.1,.25,1 ) is closer to linear with an ease-in and an ease-out.

Differential Revision: https://phabricator.services.mozilla.com/D142818
2022-05-26 05:10:35 +00:00
Timothy Nikkel
c1892db1c7 Bug 1762885. Make sure the transition we use to fade out swipe to nav ui element will actually run. r=hiro
We can get into a state where box.style.opacity = 1 but that hasn't been flushed to the style system yet, the style system thinks the value is 0, so when we set box.style.opacity = 0 later it won't cause any transition to start and transitionend will never happen and the ui element will never been shown with non-zero opacity.

We use getComputedStyle to flush the value to the style system, this has two positive effects. It means we will show the ui element with non-zero opacity as well as making sure the transition will happen and transitionend will be called.

I think getComputedStyle should only flush in the relevant subtree (two elements total) so this should be fine.

Differential Revision: https://phabricator.services.mozilla.com/D142822
2022-05-25 05:00:33 +00:00
Timothy Nikkel
508ab3e70e Bug 1767933. Improvements to start and end of swipe gesture animation. r=hiro
The patch for bug 1762875 stops us from calling SwipeTracker::StartAnimation if we are performing a navigation (but still call it if we aren't performing a navigation). This also has the effect of not calling SwipeTracker::SwipeFinished since it is triggered from StartAnimation. This means we don't null out nsBaseWidget::mSwipeTracker from the mWidget.SwipeFinished() call. This means that when the next pan that we want to track as a swipe then when we call nsBaseWidget::TrackScrollEventAsSwipe it will find the existing mSwipeTracker and call mSwipeTracker->CancelSwipe(), which sends a MozSwipeGestureEnd event. It would be okay if we didn't send the MozSwipeGestureEnd event in the case of a succesful navigation, the MozSwipeGesture event can serve the same purpose, but to send a MozSwipeGestureEnd when the _next_ swipe gesture is started does not seem like a good idea.

I noticed this while writing the test for bug 1762875.

To fix it just call SwipeFinished immediately when we get a successful swipe navigation. There are two side effects to consider: nulling out mSwipeTracker on the widget, and sending the MozSwipeGestureEnd event.

Nulling out mSwipeTracker on the widget seems fine, it's only there to track ongoing swipes. Since the current swipe is finished we don't need it anymore. However it brought up an issue where existing tests in widget/tests/browser/browser_test_swipe_gesture.js started failing. A test would finished immediately after a successful swipe navigation, remove the tab, and move on to the next test before the fade out animation could run. If the fade out animation had finished it would have called removeBoxes and removed the dom elements for the visual swipe arrows. So they stick around instead. Removing the tab seems to have disconnected these elements from the DOM. The structure above the swipe elements goes up to the hbox created here https://searchfox.org/mozilla-central/rev/dd404f43c7198b1076fe5d7e05b1e6b1a03bdfeb/browser/base/content/tabbrowser.js#2182 I don't know the tabbrowser code but I'm guessing that gets removed on removing a tab. So in order to fix this we always remove and re-create the boxes when we start a new animation. It should be safe to always do this and remove the isAnimationRunning early exit because we don't call startAnimation when we get a MozSwipeGestureStart event, so we should always want to start fresh when we get that event.

Sending the MozSwipeGestureEnd event means we need to be a bit more careful in stopAnimation. We don't want to do anything in stopAnimation if we are already stopping animation because the fade out will handle it, so we add a early return so that another stopAnimation call (which can come from a MozSwipeGestureEnd) won't cut off the animation prematurely.

Differential Revision: https://phabricator.services.mozilla.com/D145545
2022-05-06 05:55:52 +00:00
Timothy Nikkel
516d0816d2 Bug 1762881. Make sure swipe to nav _completeFadeOut is called. r=hiro
I think this is because this._completeFadeOut is a function but calling it from to handle the event isn't going to have any reference to this so it doesn't do anything.

Differential Revision: https://phabricator.services.mozilla.com/D142821
2022-05-03 08:56:47 +00:00
Timothy Nikkel
17ae03d40a Bug 1756801. Correctly handle transitioning from stopping (but not stopped yet) to starting a new swipe in browser-gestureSupport.js. r=hiro
Differential Revision: https://phabricator.services.mozilla.com/D139596
2022-02-25 07:53:34 +00:00
Hiroyuki Ikezoe
5a5dfc7dd6 Bug 1746944 - Initialize gHistorySwipeAnimation.isLTR in HSA_init even if ui.swipeAnimationEnabled is disabled. r=spohl
gHistorySwipeAnimation.isLTR is used to tell the navigation direction [1],
it needs to be independent from the fact whether the swipe animation is
supported or not.


[1] https://searchfox.org/mozilla-central/rev/125116c312b0a9c438d44e16011b116950caf17e/browser/base/content/browser-gestureSupport.js#240

Differential Revision: https://phabricator.services.mozilla.com/D134329
2021-12-21 01:32:54 +00:00
Hiroyuki Ikezoe
17f5b145da Bug 1704065 - Don't start navigation swipe gestures where there is no navigation history. r=spohl
Apparently we should check each command specified by
browser.gesture.swipe.left or browser.gesture.swipe.right, it will be fixed
in bug 1707118.

Differential Revision: https://phabricator.services.mozilla.com/D113635
2021-04-30 09:08:08 +00:00
Markus Stange
4b2c5e6c55 Bug 1704948 - Give XULCommandEvent a button property. r=smaug,preferences-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D111955
2021-04-20 17:44:16 +00:00
Narcis Beleuzu
2fd43d5a0b Backed out 7 changesets (bug 1704948, bug 1704879) for bc failures on browser_ext_menus_capture_secondary_click.js
Backed out changeset 02705918c4bf (bug 1704879)
Backed out changeset 79945b876a1d (bug 1704879)
Backed out changeset eb725de20b11 (bug 1704948)
Backed out changeset 454597ac2ba3 (bug 1704948)
Backed out changeset a43a8ef206ea (bug 1704948)
Backed out changeset 2369e321069e (bug 1704948)
Backed out changeset bdf396edd692 (bug 1704948)
2021-04-15 03:30:52 +03:00
Markus Stange
7f0c1757af Bug 1704948 - Give XULCommandEvent a button property. r=smaug,preferences-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D111955
2021-04-14 21:23:27 +00:00
Dão Gottwald
e0c3f7fad4 Bug 1690849 - Remove obsolete comment. r=mstange DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D106035
2021-02-22 22:18:17 +00:00
Markus Stange
ad720567b1 Bug 1690849 - Only trigger back/forward swipes when the mouse is over the content area. r=dao
Differential Revision: https://phabricator.services.mozilla.com/D105874
2021-02-22 17:42:51 +00:00
Mark Banner
8a9fc4165b Bug 1687235 - Enable ESLint rule no-setter-return for browser/. r=mossop,preferences-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D102152
2021-01-26 13:42:38 +00:00
Brindusan Cristian
201069fdac Backed out 5 changesets (bug 1687235) for mochitest failures at test_menulist_null_value.xhtml. CLOSED TREE
Backed out changeset 638c802ca1d1 (bug 1687235)
Backed out changeset ec830b771bce (bug 1687235)
Backed out changeset a7c933ddecfd (bug 1687235)
Backed out changeset c36493fb0599 (bug 1687235)
Backed out changeset 6eb33ad5d460 (bug 1687235)
2021-01-26 10:58:43 +02:00
Mark Banner
36cf48f89d Bug 1687235 - Enable ESLint rule no-setter-return for browser/. r=mossop,preferences-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D102152
2021-01-25 22:27:19 +00:00
Kartikaya Gupta
e20dafe2b5 Bug 1636473 - Use the APZ machinery to dispatch magnifygesture events. r=dao,tnikkel
Unify two separate codepaths that do conceptually identical things. That is,
instead of having the widget code directly dispatch wheel and pinch gesture
events to Gecko, allow APZ to do it as part of it's handling of pinch inputs
when zooming is disabled.

The main difference is that the WidgetSimpleGestureEvent delta values come out
different, because they are based on the macOS event's magnification value,
rather than the (now deprecated) deltaZ value. This is actually better since it
makes the values consistent across platforms and allows removal of some ifdefs.

Differential Revision: https://phabricator.services.mozilla.com/D74640
2020-05-12 00:46:34 +00:00
Victor Porof
a3641f184a Bug 1561435 - Format browser/base/, a=automatic-formatting
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D36041
2019-07-05 09:48:57 +02:00
Myk Melez
5ecc2c1225 Bug 1518283 - prohibit blank lines at the beginning and end of blocks (eslint padded-blocks) r=mossop,Standard8
Differential Revision: https://phabricator.services.mozilla.com/D17526
2019-01-30 17:26:25 +00:00
Paolo Amadini
d668ea1231 Bug 1506125 - Fix gesture support broken by bug 1506125. r=dao
Differential Revision: https://phabricator.services.mozilla.com/D11478
2018-11-09 14:44:58 +00:00
Paolo Amadini
3bd8feb52d Bug 1505791 - Separate the browser panel from the notification box. r=dao,bgrins
This clarifies the intention of each caller, and opens up the possibility of converting the notificationbox element to a class that creates the DOM nodes on demand.

Differential Revision: https://phabricator.services.mozilla.com/D10577
2018-11-08 15:31:37 +00:00
Brian Grinstead
c8b3483e82 Bug 1479538 - Rewrite non-test callers of document.createElementNS(XUL_NS, ...) to use document.createXULElement(...);r=paolo
Differential Revision: https://phabricator.services.mozilla.com/D3275
2018-08-14 16:22:44 +00:00
Stephen A Pohl
238964876c Bug 860493: Add pref to disable history swipe animations. r=felipe 2018-05-16 23:09:45 -04:00
Stephen A Pohl
da7a15b56e Bug 860493: Add arrow indicators for history swipes on macOS. r=felipe,bram 2018-05-16 23:09:39 -04:00
Florian Quèze
3f662053f3 Bug 592653 - script-generated patch to replace gPrefService with Services.prefs, r=Standard8. 2017-12-19 23:45:10 +01:00
Dan Banner
5af4450327 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
Rajesh Kathiriya
fefc455410 Bug 1374620 - Enabled the ESLint dot-notation rule across mozilla-central r=standard8
MozReview-Commit-ID: FadrI2li43G
2017-07-25 23:45:41 +05:30
Sebastian Hengst
1326418a49 Backed out changeset f5922a7ed25a (bug 1374620) for failing eslint at telemetry/tests/unit/test_TelemetrySend.js:358: ["os"] is better written in dot notation. r=backout 2017-07-31 14:44:34 +02:00
Rajesh Kathiriya
0d920ece6a Bug 1374620 - Enabled the ESLint dot-notation rule across mozilla-central r=standard8
MozReview-Commit-ID: FadrI2li43G
2017-07-25 23:45:41 +05:30
Florian Quèze
a72f907c5f Bug 1381853 - lazy load browser-gestureSupport.js into the browser window, r=mconley. 2017-07-23 00:17:58 +02:00
Johann Hofmann
3fca548c18 Bug 1371219 - Add an inputSource attribute to XULCommandEvent. r=smaug
In the frontend we need to know if XUL buttons in the toolbar were
triggered by a touch event, so we're passing on the inputSource
in the command event.

MozReview-Commit-ID: DMvgZULk9hT
2017-07-20 17:45:56 +02:00
Mark Banner
d150a4fcd6 Bug 1342459 - Fix various no-undef issues in browser/base. r=mossop
MozReview-Commit-ID: CRYxu7copKb
2017-04-04 13:42:33 +01:00
Mark Banner
1b6f3efb6e Bug 1352969 - Fix various ESLint no-undef issues in browser/base (no-undef is not enabled yet). r=mossop
MozReview-Commit-ID: BuTyJAfUoWR
2017-02-22 17:02:59 +00:00
Florian Quèze
c32c931bc9 Bug 1334831 - script-generated patch to use .remove() instead of .parentNode.removeChild, r=jaws. 2017-01-30 08:10:22 +01:00
Florian Quèze
0a4ee94a29 Bug 1334199 - script-generated patch to omit getComputedStyle's second argument when it's falsy, r=jaws. 2017-01-27 10:51:02 +01:00
Florian Quèze
63de711857 Bug 1331081 - script generated patch to omit addEventListener/removeEventListener's third parameter when it's false, r=jaws. 2017-01-17 11:50:25 +01:00
Jared Wein
9f9dbce16a Bug 1328802 - Enable the no-unsafe-finally rule for eslint and fix the four errors that are triggered by it by moving the control flow statement outside of the finally block. r=mossop
MozReview-Commit-ID: 7UFBBpvptdd
2017-01-05 00:38:24 -05:00
Jared Wein
242ab87626 Bug 1326511 - Enable brace-style and no-multi-spaces eslint rules for toolkit. r=MattN
MozReview-Commit-ID: FuVu8skcqOe
2016-12-30 21:47:25 -05:00
Jared Wein
e3149c378f Bug 1325464 - Enable object-shorthand rule and run 'mach eslint --fix' with the rule enabled. r=MattN
MozReview-Commit-ID: 7E7LPorrEje
2016-12-29 18:34:54 -05:00
Wes Kocher
2d7553dcfd Backed out 3 changesets (bug 1325464) for xpcshell failures a=backout
Backed out changeset 562ddc32cc21 (bug 1325464)
Backed out changeset cd10db6087dd (bug 1325464)
Backed out changeset 4079437c4648 (bug 1325464)
2016-12-29 14:05:44 -08:00
Jared Wein
34e228f767 Bug 1325464 - Enable object-shorthand rule and run 'mach eslint --fix' with the rule enabled. r=MattN
MozReview-Commit-ID: 8WoGr8i6oCR
2016-12-29 15:20:47 -05:00
Jared Wein
ef8b1e86ca Bug 1316870 - Enable no-shadow eslint rule for browser/. r=mossop 2016-11-15 22:58:30 -05:00
Dave Townsend
4e295aa48d Bug 1316882: Turn on space-before-function-paren eslint rule (browser). r=jaws
MozReview-Commit-ID: 2ZvTiZDHchz
2016-11-11 08:10:51 -08:00
Dave Townsend
dc3810c548 Bug 1314343: Turn on no-unreachable in eslint. r=standard8
Unreachable code can be a sign of a mistake so we should turn this rule on.

MozReview-Commit-ID: LQphsNL7HBX
2016-11-01 10:58:35 -07:00