Commit graph

93 commits

Author SHA1 Message Date
Kagami Sascha Rosylight
102bd338be 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
5cdcbc12c8 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
6a64823237 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
77a741e235 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
74df765210 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
17e1015627 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
0cc2a4681a 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
1b696e02e9 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
db2d09013c 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
c2bb02d580 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
b27cec1892 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
3b86f7a465 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
2f3a3e6336 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
a5ceb4d5dd 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
f1ced6e117 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
daa77699e2 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
81d211846c 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
c3496ae6ca 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
903f8b2eb4 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
c4afa9e9ad 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
70ab748bed 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
c793c1efb7 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
7a22496951 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
f9f5914039 Bug 1561435 - Format browser/base/, a=automatic-formatting
# ignore-this-changeset

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

--HG--
extra : source : 96b3895a3b2aa2fcb064c85ec5857b7216884556
2019-07-05 09:48:57 +02:00
Myk Melez
25349d2601 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

--HG--
extra : moz-landing-system : lando
2019-01-30 17:26:25 +00:00
Paolo Amadini
9fac32795a Bug 1506125 - Fix gesture support broken by bug 1506125. r=dao
Differential Revision: https://phabricator.services.mozilla.com/D11478

--HG--
extra : source : 9b6da7c89a30ab2df91fe4b2e760b2add43daaf7
extra : amend_source : 68e9b23122e4f204073d55e565483a9eeb0a2877
2018-11-09 14:44:58 +00:00
Paolo Amadini
4270e25239 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

--HG--
extra : rebase_source : e311dd7144cf9f7cd513761f97bb3dd0a35dce71
extra : source : 9532194794ba9c87025da92cf70f76c21a277220
2018-11-08 15:31:37 +00:00
Brian Grinstead
829d7647d3 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

--HG--
extra : moz-landing-system : lando
2018-08-14 16:22:44 +00:00
Stephen A Pohl
325481c026 Bug 860493: Add pref to disable history swipe animations. r=felipe 2018-05-16 23:09:45 -04:00
Stephen A Pohl
8e75c6c6bc Bug 860493: Add arrow indicators for history swipes on macOS. r=felipe,bram 2018-05-16 23:09:39 -04:00
Florian Quèze
1158645bdd Bug 592653 - script-generated patch to replace gPrefService with Services.prefs, r=Standard8. 2017-12-19 23:45:10 +01: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
Rajesh Kathiriya
48e6bc2124 Bug 1374620 - Enabled the ESLint dot-notation rule across mozilla-central r=standard8
MozReview-Commit-ID: FadrI2li43G

--HG--
extra : rebase_source : b455e846ab79c8141150517e67e542e3e06d630e
2017-07-25 23:45:41 +05:30
Sebastian Hengst
804a36e668 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
22dfa54ef4 Bug 1374620 - Enabled the ESLint dot-notation rule across mozilla-central r=standard8
MozReview-Commit-ID: FadrI2li43G

--HG--
extra : rebase_source : 5992bdde34bcc2421350433bc8c1e498a6bba848
2017-07-25 23:45:41 +05:30
Florian Quèze
7dddee4b69 Bug 1381853 - lazy load browser-gestureSupport.js into the browser window, r=mconley. 2017-07-23 00:17:58 +02:00
Johann Hofmann
3eac596d72 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

--HG--
extra : rebase_source : c455c8ec77e439bf02c1e3e8d34a36e1fb5e3bd0
2017-07-20 17:45:56 +02:00
Mark Banner
427e3b23dc Bug 1342459 - Fix various no-undef issues in browser/base. r=mossop
MozReview-Commit-ID: CRYxu7copKb

--HG--
extra : rebase_source : bc176c5e6890ffc6a4e26cb9bc9d441d9486ce7b
2017-04-04 13:42:33 +01:00
Mark Banner
1087fc1884 Bug 1352969 - Fix various ESLint no-undef issues in browser/base (no-undef is not enabled yet). r=mossop
MozReview-Commit-ID: BuTyJAfUoWR

--HG--
extra : rebase_source : 482bdc039362347f35aec9fd15e07a143dccb860
2017-02-22 17:02:59 +00:00
Florian Quèze
bdc1ffa608 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
be4dbae285 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
85611a7b6d Bug 1331081 - script generated patch to omit addEventListener/removeEventListener's third parameter when it's false, r=jaws.
--HG--
extra : rebase_source : a22344ee1569f58f1f0a01017bfe0d46a6a14602
2017-01-17 11:50:25 +01:00
Jared Wein
60b5555bc2 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

--HG--
extra : rebase_source : b31f86341571ec6928caea130597e6c918a34636
2017-01-05 00:38:24 -05:00
Jared Wein
9141469edf Bug 1326511 - Enable brace-style and no-multi-spaces eslint rules for toolkit. r=MattN
MozReview-Commit-ID: FuVu8skcqOe

--HG--
extra : rebase_source : 8ab34c4e46a7c3075b459bf44786ec184d10d203
2016-12-30 21:47:25 -05:00
Jared Wein
ecab54a7c9 Bug 1325464 - Enable object-shorthand rule and run 'mach eslint --fix' with the rule enabled. r=MattN
MozReview-Commit-ID: 7E7LPorrEje

--HG--
extra : rebase_source : 0572a35415a766a3f31d266760ecd07f0dcc3f72
2016-12-29 18:34:54 -05:00
Wes Kocher
0dfb7c2b5c 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
7255df4e9a Bug 1325464 - Enable object-shorthand rule and run 'mach eslint --fix' with the rule enabled. r=MattN
MozReview-Commit-ID: 8WoGr8i6oCR

--HG--
extra : rebase_source : da7172285d43b820421557ed3b05887e091ff939
2016-12-29 15:20:47 -05:00
Jared Wein
3718f00db1 Bug 1316870 - Enable no-shadow eslint rule for browser/. r=mossop 2016-11-15 22:58:30 -05:00
Dave Townsend
8de07a19a0 Bug 1316882: Turn on space-before-function-paren eslint rule (browser). r=jaws
MozReview-Commit-ID: 2ZvTiZDHchz

--HG--
extra : rebase_source : db6482481b7338df491afd6f6fd376eccec84d7e
2016-11-11 08:10:51 -08:00
Dave Townsend
6a07a42125 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

--HG--
extra : rebase_source : eb5fdb1157cac6e447492ac89bb15d83dc32eef6
2016-11-01 10:58:35 -07:00