Bug 1722359 - Remove ui.showHideScrollbars. r=mstange

It probably did something more useful in the past, but right now it's
only used to avoid throttling some overflow-causing animations.

It returns 0 everywhere except on Android (for some reason?), but in any
case it doesn't seem this would need to be a LookAndFeel integer, it
could just be a regular pref that we turn on for tests.

However the tests pass with this patch locally, so for now I'm not
adding a pref to replace it.

Differential Revision: https://phabricator.services.mozilla.com/D120871
This commit is contained in:
Emilio Cobos Álvarez 2021-07-26 18:42:36 +00:00
parent 19ac12a39e
commit ebffc1928f
7 changed files with 2 additions and 23 deletions

View File

@ -1539,15 +1539,11 @@ bool KeyframeEffect::CanThrottleOverflowChangesInScrollable(
return true;
}
bool hasIntersectionObservers = doc->HasIntersectionObservers();
// If we know that the animation cannot cause overflow,
// we can just disable flushes for this animation.
// If we don't show scrollbars and have no intersection observers, we don't
// care about overflow.
if (LookAndFeel::GetInt(LookAndFeel::IntID::ShowHideScrollbars) == 0 &&
!hasIntersectionObservers) {
// If we have no intersection observers, we don't care about overflow.
if (!doc->HasIntersectionObservers()) {
return true;
}
@ -1555,12 +1551,6 @@ bool KeyframeEffect::CanThrottleOverflowChangesInScrollable(
return true;
}
// If we have any intersection observers, we unthrottle this transform
// animation periodically.
if (hasIntersectionObservers) {
return false;
}
// If the nearest scrollable ancestor has overflow:hidden,
// we don't care about overflow.
nsIScrollableFrame* scrollable =

View File

@ -247,9 +247,6 @@ promise_test(async t => {
// This is to test that we don't temporarily clear the flag when forcing
// an unthrottled sample.
promise_test(async t => {
// Needs scrollbars to cause overflow.
await SpecialPowers.pushPrefEnv({ set: [["ui.showHideScrollbars", 1]] })
var div = addDiv(t, { style: 'animation: rotate 100s' });
var animation = div.getAnimations()[0];

View File

@ -12,7 +12,6 @@ SpecialPowers.pushPrefEnv(
set: [
['layout.reflow.synthMouseMove', false],
['privacy.reduceTimerPrecision', false],
["ui.showHideScrollbars", 1],
],
},
function() {

View File

@ -56,7 +56,6 @@ pref("toolkit.zoomManager.zoomValues", ".2,.3,.5,.67,.8,.9,1,1.1,1.2,1.33,1.5,1.
pref("browser.viewport.defaultZoom", -1);
// Show/Hide scrollbars when active/inactive
pref("ui.showHideScrollbars", 1);
pref("ui.useOverlayScrollbars", 1);
pref("ui.scrollbarFadeBeginDelay", 450);
pref("ui.scrollbarFadeDuration", 0);

View File

@ -58,8 +58,6 @@ class LookAndFeel {
UseOverlayScrollbars,
// allow H and V overlay scrollbars to overlap?
AllowOverlayScrollbarsOverlap,
// show/hide scrollbars based on activity
ShowHideScrollbars,
// skip navigating to disabled menu item?
SkipNavigatingDisabledMenuItem,
// begin a drag if the mouse is moved further than the threshold while the

View File

@ -153,9 +153,6 @@ nsresult HeadlessLookAndFeel::NativeGetInt(IntID aID, int32_t& aResult) {
case IntID::AllowOverlayScrollbarsOverlap:
aResult = 0;
break;
case IntID::ShowHideScrollbars:
aResult = 0;
break;
case IntID::SkipNavigatingDisabledMenuItem:
aResult = 1;
break;

View File

@ -117,7 +117,6 @@ static const char sIntPrefs[][42] = {
"ui.menusCanOverlapOSBar",
"ui.useOverlayScrollbars",
"ui.allowOverlayScrollbarsOverlap",
"ui.showHideScrollbars",
"ui.skipNavigatingDisabledMenuItem",
"ui.dragThresholdX",
"ui.dragThresholdY",