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)
This commit is contained in:
Norisz Fay 2022-08-02 10:48:53 +03:00
Родитель f411d84051
Коммит 17e1015627
14 изменённых файлов: 19 добавлений и 137 удалений

Просмотреть файл

@ -733,51 +733,23 @@ var gHistorySwipeAnimation = {
return; return;
} }
const translateDistance = Services.prefs.getIntPref( // We use the following value to set the opacity of the swipe arrows. It was
"browser.swipe.navigation-icon-move-distance", // determined experimentally that absolute values of 0.25 (or greater)
0 // trigger history navigation, hence the multiplier 4 to set the arrows to
); // full opacity at 0.25 or greater.
// We use the following value to set the opacity (and translate on Windows)
// of the swipe arrows. Absolute values of 0.25 (or greater) trigger
// history navigation, hence the multiplier 4 to set the arrows to full
// opacity at 0.25 or greater.
let opacity = Math.abs(aVal) * 4; let opacity = Math.abs(aVal) * 4;
// If we move the icon along with the opacity change, we make the opacity
// change 2x faster so that it will avoid appearing the icon suddenly away
// from the browser edge.
if (translateDistance > 0) {
opacity *= 2;
}
// The icon moves from -20% of |translateDistance| so that it will be
// partially out of the viewport.
let translate =
Math.abs(aVal) * 4 * translateDistance - 0.2 * translateDistance;
if (!this.isLTR) {
translate = -translate;
}
// Clamp inside [-20% of translateDistance, 80% of translateDistance].
translate = Math.min(
Math.max(-translateDistance * 0.2, translate),
translateDistance * 0.8
);
if ((aVal >= 0 && this.isLTR) || (aVal <= 0 && !this.isLTR)) { if ((aVal >= 0 && this.isLTR) || (aVal <= 0 && !this.isLTR)) {
// The intention is to go back. // The intention is to go back.
if (this._canGoBack) { if (this._canGoBack) {
this._prevBox.collapsed = false; this._prevBox.collapsed = false;
this._nextBox.collapsed = true; this._nextBox.collapsed = true;
this._prevBox.style.opacity = opacity > 1 ? 1 : opacity; this._prevBox.style.opacity = opacity > 1 ? 1 : opacity;
this._prevBox.style.translate = `${translate}px 0px`;
} }
} else if (this._canGoForward) { } else if (this._canGoForward) {
// The intention is to go forward. // The intention is to go forward.
this._nextBox.collapsed = false; this._nextBox.collapsed = false;
this._prevBox.collapsed = true; this._prevBox.collapsed = true;
this._nextBox.style.opacity = opacity > 1 ? 1 : opacity; this._nextBox.style.opacity = opacity > 1 ? 1 : opacity;
this._nextBox.style.translate = `${-translate}px 0px`;
} }
}, },

Просмотреть файл

@ -864,6 +864,16 @@ menupopup[emptyplacesresult="true"] > .hide-if-empty-places-result {
pointer-events: none; pointer-events: none;
} }
#historySwipeAnimationPreviousArrow {
background: url("chrome://browser/content/history-swipe-arrow.svg")
center left / 64px 128px no-repeat transparent;
}
#historySwipeAnimationNextArrow {
background: url("chrome://browser/content/history-swipe-arrow.svg")
center left / 64px 128px no-repeat transparent;
transform: rotate(180deg);
}
/* Full Screen UI */ /* Full Screen UI */
#fullscr-toggler { #fullscr-toggler {

Просмотреть файл

До

Ширина:  |  Высота:  |  Размер: 703 B

После

Ширина:  |  Высота:  |  Размер: 703 B

Просмотреть файл

@ -64,6 +64,7 @@ browser.jar:
content/browser/browser-thumbnails.js (content/browser-thumbnails.js) content/browser/browser-thumbnails.js (content/browser-thumbnails.js)
content/browser/browser-graphics-utils.js (content/browser-graphics-utils.js) content/browser/browser-graphics-utils.js (content/browser-graphics-utils.js)
content/browser/browser-webrtc.js (content/browser-webrtc.js) content/browser/browser-webrtc.js (content/browser-webrtc.js)
content/browser/history-swipe-arrow.svg (content/history-swipe-arrow.svg)
* content/browser/pageinfo/pageInfo.xhtml (content/pageinfo/pageInfo.xhtml) * content/browser/pageinfo/pageInfo.xhtml (content/pageinfo/pageInfo.xhtml)
content/browser/pageinfo/pageInfo.js (content/pageinfo/pageInfo.js) content/browser/pageinfo/pageInfo.js (content/pageinfo/pageInfo.js)
content/browser/pageinfo/pageInfo.css (content/pageinfo/pageInfo.css) content/browser/pageinfo/pageInfo.css (content/pageinfo/pageInfo.css)

Просмотреть файл

@ -454,20 +454,3 @@ menuitem.bookmark-item {
} }
} }
} }
#historySwipeAnimationPreviousArrow {
background: url("chrome://browser/skin/history-swipe-arrow.svg")
center left / 64px 128px no-repeat transparent;
will-change: transform;
}
#historySwipeAnimationPreviousArrow:-moz-locale-dir(rtl) {
transform: scaleX(-1);
}
#historySwipeAnimationNextArrow {
background: url("chrome://browser/skin/history-swipe-arrow.svg")
center left / 64px 128px no-repeat transparent;
will-change: transform;
}
#historySwipeAnimationNextArrow:-moz-locale-dir(ltr) {
transform: scaleX(-1);
}

Просмотреть файл

@ -24,5 +24,5 @@ browser.jar:
skin/classic/browser/window-controls/maximize.svg (../windows/window-controls/maximize.svg) skin/classic/browser/window-controls/maximize.svg (../windows/window-controls/maximize.svg)
skin/classic/browser/window-controls/minimize.svg (../windows/window-controls/minimize.svg) skin/classic/browser/window-controls/minimize.svg (../windows/window-controls/minimize.svg)
skin/classic/browser/window-controls/restore.svg (../windows/window-controls/restore.svg) skin/classic/browser/window-controls/restore.svg (../windows/window-controls/restore.svg)
skin/classic/browser/e10s-64@2x.png (../shared/e10s-64@2x.png)
skin/classic/browser/history-swipe-arrow.svg (../shared/swipe-gesture-icons/history-swipe-arrow.svg) skin/classic/browser/e10s-64@2x.png (../shared/e10s-64@2x.png)

Просмотреть файл

@ -480,20 +480,3 @@ moz-input-box > menupopup .context-menu-add-engine > .menu-iconic-left {
.webextension-popup-stack { .webextension-popup-stack {
border-radius: inherit; border-radius: inherit;
} }
#historySwipeAnimationPreviousArrow {
background: url("chrome://browser/skin/history-swipe-arrow.svg")
center left / 64px 128px no-repeat transparent;
will-change: transform;
}
#historySwipeAnimationPreviousArrow:-moz-locale-dir(rtl) {
transform: scaleX(-1);
}
#historySwipeAnimationNextArrow {
background: url("chrome://browser/skin/history-swipe-arrow.svg")
center left / 64px 128px no-repeat transparent;
will-change: transform;
}
#historySwipeAnimationNextArrow:-moz-locale-dir(ltr) {
transform: scaleX(-1);
}

Просмотреть файл

@ -21,6 +21,5 @@ browser.jar:
skin/classic/browser/preferences/saveFile.png (preferences/saveFile.png) skin/classic/browser/preferences/saveFile.png (preferences/saveFile.png)
skin/classic/browser/preferences/applications.css (preferences/applications.css) skin/classic/browser/preferences/applications.css (preferences/applications.css)
skin/classic/browser/share.svg (share.svg) skin/classic/browser/share.svg (share.svg)
skin/classic/browser/e10s-64@2x.png (../shared/e10s-64@2x.png) skin/classic/browser/e10s-64@2x.png (../shared/e10s-64@2x.png)
skin/classic/browser/webRTC-menubar-indicator.css (../shared/webRTC-menubar-indicator.css) skin/classic/browser/webRTC-menubar-indicator.css (../shared/webRTC-menubar-indicator.css)
skin/classic/browser/history-swipe-arrow.svg (../shared/swipe-gesture-icons/history-swipe-arrow.svg)

Просмотреть файл

@ -593,20 +593,3 @@ menupopup[touchmode] menuitem {
.webextension-popup-stack { .webextension-popup-stack {
border-radius: inherit; border-radius: inherit;
} }
#historySwipeAnimationPreviousArrow {
background: url("chrome://browser/skin/history-swipe-arrow.svg")
center left / 128px 128px no-repeat transparent;
will-change: transform;
}
#historySwipeAnimationPreviousArrow:-moz-locale-dir(rtl) {
transform: scaleX(-1);
}
#historySwipeAnimationNextArrow {
background: url("chrome://browser/skin/history-swipe-arrow.svg")
center left / 128px 128px no-repeat transparent;
will-change: transform;
}
#historySwipeAnimationNextArrow:-moz-locale-dir(ltr) {
transform: scaleX(-1);
}

Просмотреть файл

@ -40,4 +40,3 @@ browser.jar:
skin/classic/browser/window-controls/restore-highcontrast.svg (window-controls/restore-highcontrast.svg) skin/classic/browser/window-controls/restore-highcontrast.svg (window-controls/restore-highcontrast.svg)
skin/classic/browser/window-controls/restore-themes.svg (window-controls/restore-themes.svg) skin/classic/browser/window-controls/restore-themes.svg (window-controls/restore-themes.svg)
skin/classic/browser/e10s-64@2x.png (../shared/e10s-64@2x.png) skin/classic/browser/e10s-64@2x.png (../shared/e10s-64@2x.png)
skin/classic/browser/history-swipe-arrow.svg (swipe-gesture-icons/history-swipe-arrow.svg)

Просмотреть файл

@ -1,7 +0,0 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<svg width="512" height="512" xmlns="http://www.w3.org/2000/svg">
<ellipse ry="256" rx="256" cy="256" cx="256" stroke-width="0" stroke="#000" fill="#38383d"/>
<path d="M 368.10297,240.34523 H 182.64452 l 68.71849,-68.71857 a 16.007116,16.007116 0 0 0 -22.63403,-22.63404 l -96.04269,96.04264 a 16.007116,16.007116 0 0 0 0,22.63331 l 96.04269,96.04274 a 16.007116,16.007116 0 0 0 22.63403,-22.63405 L 182.64452,272.3587 h 185.45845 a 16.007116,16.007116 0 0 0 0,-32.01347 z" fill="rgba(249, 249, 250, .8)" />
</svg>

До

Ширина:  |  Высота:  |  Размер: 731 B

Просмотреть файл

@ -1481,16 +1481,6 @@
value: false value: false
mirror: always mirror: always
#
- name: browser.swipe.navigation-icon-move-distance
type: uint32_t
#ifdef XP_WIN
value: 100
#else
value: 0
#endif
mirror: always
# Whether we should draw the tabs on top of the titlebar. # Whether we should draw the tabs on top of the titlebar.
# #
# no (0), yes (1), or default (2), which is true everywhere except Linux. # no (0), yes (1), or default (2), which is true everywhere except Linux.

Просмотреть файл

@ -10,7 +10,6 @@
#include "mozilla/FlushType.h" #include "mozilla/FlushType.h"
#include "mozilla/PresShell.h" #include "mozilla/PresShell.h"
#include "mozilla/StaticPrefs_widget.h" #include "mozilla/StaticPrefs_widget.h"
#include "mozilla/StaticPrefs_browser.h"
#include "mozilla/TimeStamp.h" #include "mozilla/TimeStamp.h"
#include "mozilla/TouchEvents.h" #include "mozilla/TouchEvents.h"
#include "mozilla/dom/SimpleGestureEventBinding.h" #include "mozilla/dom/SimpleGestureEventBinding.h"
@ -141,12 +140,8 @@ nsEventStatus SwipeTracker::ProcessEvent(
// success here and the user does not lift their fingers and then decreases // success here and the user does not lift their fingers and then decreases
// the total swipe so that we go below the success threshold the opacity would // the total swipe so that we go below the success threshold the opacity would
// also decrease in that case but that seems okay. // also decrease in that case but that seems okay.
// We don't want above tweak if we move the UI along with the opacity change
// since it forces the UI element jump to the last position and jump back to
// the original position if the navigation didn't happen.
double eventAmount = mGestureAmount; double eventAmount = mGestureAmount;
if (computedSwipeSuccess && if (computedSwipeSuccess) {
StaticPrefs::browser_swipe_navigation_icon_move_distance() == 0) {
eventAmount = kSwipeSuccessThreshold; eventAmount = kSwipeSuccessThreshold;
if (mGestureAmount < 0.f) { if (mGestureAmount < 0.f) {
eventAmount = -eventAmount; eventAmount = -eventAmount;

Просмотреть файл

@ -302,20 +302,6 @@ add_task(async () => {
let opacity = gHistorySwipeAnimation._prevBox.style.opacity; let opacity = gHistorySwipeAnimation._prevBox.style.opacity;
ok(0.98 < opacity && opacity < 0.99, "opacity of prevbox is not quite 1"); ok(0.98 < opacity && opacity < 0.99, "opacity of prevbox is not quite 1");
const translateDistance = Services.prefs.getIntPref(
"browser.swipe.navigation-icon-move-distance",
0
);
if (translateDistance != 0) {
isnot(
window
.getComputedStyle(gHistorySwipeAnimation._prevBox)
.getPropertyValue("translate"),
"none",
"translate of prevbox is not `none` during gestures"
);
}
await panLeftToRightEnd(tab.linkedBrowser, 100, 100, 0.9); await panLeftToRightEnd(tab.linkedBrowser, 100, 100, 0.9);
// NOTE: We only get a wheel event for the beginPhase, rest of events have // NOTE: We only get a wheel event for the beginPhase, rest of events have
@ -350,18 +336,6 @@ add_task(async () => {
opacity = gHistorySwipeAnimation._prevBox.style.opacity; opacity = gHistorySwipeAnimation._prevBox.style.opacity;
ok(opacity == 0, "element.style opacity of prevbox 0"); ok(opacity == 0, "element.style opacity of prevbox 0");
if (translateDistance != 0) {
// We don't have a transition for translate property so that we still have
// some amount of translate.
isnot(
window
.getComputedStyle(gHistorySwipeAnimation._prevBox)
.getPropertyValue("translate"),
"none",
"translate of prevbox is not `none` during the opacity transition"
);
}
// Make sure the gesture triggered going back to the previous page. // Make sure the gesture triggered going back to the previous page.
await Promise.all([startLoadingPromise, stoppedLoadingPromise]); await Promise.all([startLoadingPromise, stoppedLoadingPromise]);