mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-20 16:55:40 +00:00
Bug 1571544 - Convert the two layout.framevisibility.amountscrollbeforeupdate* prefs to static prefs. r=njn
Converts layout.framevisibility.amountscrollbeforeupdatevertical and layout.framevisibility.amountscrollbeforeupdatehorizontal to static prefs. Differential Revision: https://phabricator.services.mozilla.com/D40718 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
24117f02d3
commit
5855268c8e
@ -2807,12 +2807,20 @@ void ScrollFrameHelper::ScrollToImpl(nsPoint aPt, const nsRect& aRange,
|
|||||||
nsPoint dist(std::abs(pt.x - mLastUpdateFramesPos.x),
|
nsPoint dist(std::abs(pt.x - mLastUpdateFramesPos.x),
|
||||||
std::abs(pt.y - mLastUpdateFramesPos.y));
|
std::abs(pt.y - mLastUpdateFramesPos.y));
|
||||||
nsSize visualViewportSize = GetVisualViewportSize();
|
nsSize visualViewportSize = GetVisualViewportSize();
|
||||||
nscoord horzAllowance =
|
nscoord horzAllowance = std::max(
|
||||||
std::max(visualViewportSize.width / std::max(sHorzScrollFraction, 1),
|
visualViewportSize.width /
|
||||||
AppUnitsPerCSSPixel());
|
std::max(
|
||||||
nscoord vertAllowance =
|
StaticPrefs::
|
||||||
std::max(visualViewportSize.height / std::max(sVertScrollFraction, 1),
|
layout_framevisibility_amountscrollbeforeupdatehorizontal(),
|
||||||
AppUnitsPerCSSPixel());
|
1),
|
||||||
|
AppUnitsPerCSSPixel());
|
||||||
|
nscoord vertAllowance = std::max(
|
||||||
|
visualViewportSize.height /
|
||||||
|
std::max(
|
||||||
|
StaticPrefs::
|
||||||
|
layout_framevisibility_amountscrollbeforeupdatevertical(),
|
||||||
|
1),
|
||||||
|
AppUnitsPerCSSPixel());
|
||||||
if (dist.x >= horzAllowance || dist.y >= vertAllowance) {
|
if (dist.x >= horzAllowance || dist.y >= vertAllowance) {
|
||||||
needFrameVisibilityUpdate = true;
|
needFrameVisibilityUpdate = true;
|
||||||
}
|
}
|
||||||
@ -3245,10 +3253,6 @@ bool ScrollFrameHelper::sFrameVisPrefsCached = false;
|
|||||||
uint32_t ScrollFrameHelper::sHorzExpandScrollPort = 0;
|
uint32_t ScrollFrameHelper::sHorzExpandScrollPort = 0;
|
||||||
/* static */
|
/* static */
|
||||||
uint32_t ScrollFrameHelper::sVertExpandScrollPort = 1;
|
uint32_t ScrollFrameHelper::sVertExpandScrollPort = 1;
|
||||||
/* static */
|
|
||||||
int32_t ScrollFrameHelper::sHorzScrollFraction = 2;
|
|
||||||
/* static */
|
|
||||||
int32_t ScrollFrameHelper::sVertScrollFraction = 2;
|
|
||||||
|
|
||||||
/* static */
|
/* static */
|
||||||
void ScrollFrameHelper::EnsureFrameVisPrefsCached() {
|
void ScrollFrameHelper::EnsureFrameVisPrefsCached() {
|
||||||
@ -3259,14 +3263,6 @@ void ScrollFrameHelper::EnsureFrameVisPrefsCached() {
|
|||||||
Preferences::AddUintVarCache(&sVertExpandScrollPort,
|
Preferences::AddUintVarCache(&sVertExpandScrollPort,
|
||||||
"layout.framevisibility.numscrollportheights",
|
"layout.framevisibility.numscrollportheights",
|
||||||
1);
|
1);
|
||||||
|
|
||||||
Preferences::AddIntVarCache(
|
|
||||||
&sHorzScrollFraction,
|
|
||||||
"layout.framevisibility.amountscrollbeforeupdatehorizontal", 2);
|
|
||||||
Preferences::AddIntVarCache(
|
|
||||||
&sVertScrollFraction,
|
|
||||||
"layout.framevisibility.amountscrollbeforeupdatevertical", 2);
|
|
||||||
|
|
||||||
sFrameVisPrefsCached = true;
|
sFrameVisPrefsCached = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -753,10 +753,6 @@ class ScrollFrameHelper : public nsIReflowCallback {
|
|||||||
// visibility.
|
// visibility.
|
||||||
static uint32_t sHorzExpandScrollPort;
|
static uint32_t sHorzExpandScrollPort;
|
||||||
static uint32_t sVertExpandScrollPort;
|
static uint32_t sVertExpandScrollPort;
|
||||||
// The fraction of the scrollport we allow to scroll by before we schedule
|
|
||||||
// an update of frame visibility.
|
|
||||||
static int32_t sHorzScrollFraction;
|
|
||||||
static int32_t sVertScrollFraction;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace mozilla
|
} // namespace mozilla
|
||||||
|
@ -4584,6 +4584,20 @@
|
|||||||
value: @IS_EARLY_BETA_OR_EARLIER@
|
value: @IS_EARLY_BETA_OR_EARLIER@
|
||||||
mirror: always
|
mirror: always
|
||||||
|
|
||||||
|
# The fraction of the scrollport we allow to horizontally scroll by before we
|
||||||
|
# schedule an update of frame visibility.
|
||||||
|
- name: layout.framevisibility.amountscrollbeforeupdatehorizontal
|
||||||
|
type: int32_t
|
||||||
|
value: 2
|
||||||
|
mirror: always
|
||||||
|
|
||||||
|
# The fraction of the scrollport we allow to vertically scroll by before we
|
||||||
|
# schedule an update of frame visibility.
|
||||||
|
- name: layout.framevisibility.amountscrollbeforeupdatevertical
|
||||||
|
type: int32_t
|
||||||
|
value: 2
|
||||||
|
mirror: always
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
# Prefs starting with "media."
|
# Prefs starting with "media."
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user