Bug 1829327 - Use scrollbar-width style instead of ui.scrollbarFadeBeginDelay to hide overlay scrollbars. r=botond,geckoview-reviewers,owlish

Differential Revision: https://phabricator.services.mozilla.com/D176745
This commit is contained in:
Hiroyuki Ikezoe 2023-05-16 01:09:00 +00:00
Родитель 37d3ef8995
Коммит 11a4d97a7b
1 изменённых файлов: 12 добавлений и 32 удалений

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

@ -585,14 +585,6 @@ class DynamicToolbarTest : BaseSessionTest() {
@WithDisplay(height = SCREEN_HEIGHT, width = SCREEN_WIDTH)
@Test
fun zoomedOverflowHidden() {
// Set ui.scrollbarFadeBeginDelay value to 0 to hide the overlayed scrollbars
// immediately.
sessionRule.setPrefsUntilTestEnd(
mapOf(
"ui.scrollbarFadeBeginDelay" to 0
)
)
val reference = getComparisonScreenshot(SCREEN_WIDTH, SCREEN_HEIGHT)
val dynamicToolbarMaxHeight = SCREEN_HEIGHT / 2
@ -607,6 +599,9 @@ class DynamicToolbarTest : BaseSessionTest() {
// Change the body background color to match the reference image's background color.
mainSession.evaluateJS("document.body.style.background = 'rgb(0, 128, 0)'")
// Hide the vertical scrollbar.
mainSession.evaluateJS("document.documentElement.style.scrollbarWidth = 'none'")
// Zoom in the content so that the content's visual viewport can be scrollable.
mainSession.setResolutionAndScaleTo(10.0f)
@ -623,14 +618,6 @@ class DynamicToolbarTest : BaseSessionTest() {
@WithDisplay(height = SCREEN_HEIGHT, width = SCREEN_WIDTH)
@Test
fun zoomedPositionFixedRoot() {
// Set ui.scrollbarFadeBeginDelay value to 0 to hide the overlayed scrollbars
// immediately.
sessionRule.setPrefsUntilTestEnd(
mapOf(
"ui.scrollbarFadeBeginDelay" to 0
)
)
val reference = getComparisonScreenshot(SCREEN_WIDTH, SCREEN_HEIGHT)
val dynamicToolbarMaxHeight = SCREEN_HEIGHT / 2
@ -650,6 +637,9 @@ class DynamicToolbarTest : BaseSessionTest() {
mainSession.evaluateJS("document.body.style.overflow = 'scroll'")
mainSession.evaluateJS("document.documentElement.style.position = 'fixed'")
// Hide the vertical scrollbar.
mainSession.evaluateJS("document.documentElement.style.scrollbarWidth = 'none'")
// Zoom in the content so that the content's visual viewport can be scrollable.
mainSession.setResolutionAndScaleTo(10.0f)
@ -666,14 +656,6 @@ class DynamicToolbarTest : BaseSessionTest() {
@WithDisplay(height = SCREEN_HEIGHT, width = SCREEN_WIDTH)
@Test
fun backgroundImageFixed() {
// Set ui.scrollbarFadeBeginDelay value to 0 to hide the overlayed scrollbars
// immediately.
sessionRule.setPrefsUntilTestEnd(
mapOf(
"ui.scrollbarFadeBeginDelay" to 0
)
)
val reference = getComparisonScreenshot(SCREEN_WIDTH, SCREEN_HEIGHT)
val dynamicToolbarMaxHeight = SCREEN_HEIGHT / 2
@ -692,6 +674,9 @@ class DynamicToolbarTest : BaseSessionTest() {
// Make the root element scrollable.
mainSession.evaluateJS("document.documentElement.style.height = '100vh'")
// Hide the vertical scrollbar.
mainSession.evaluateJS("document.documentElement.style.scrollbarWidth = 'none'")
mainSession.flushApzRepaints()
// Simulate the dynamic toolbar being hidden by the scroll
@ -707,14 +692,6 @@ class DynamicToolbarTest : BaseSessionTest() {
@WithDisplay(height = SCREEN_HEIGHT, width = SCREEN_WIDTH)
@Test
fun backgroundAttachmentFixed() {
// Set ui.scrollbarFadeBeginDelay value to 0 to hide the overlayed scrollbars
// immediately.
sessionRule.setPrefsUntilTestEnd(
mapOf(
"ui.scrollbarFadeBeginDelay" to 0
)
)
val reference = getComparisonScreenshot(SCREEN_WIDTH, SCREEN_HEIGHT)
val dynamicToolbarMaxHeight = SCREEN_HEIGHT / 2
@ -733,6 +710,9 @@ class DynamicToolbarTest : BaseSessionTest() {
// Make the root element scrollable.
mainSession.evaluateJS("document.documentElement.style.height = '100vh'")
// Hide the vertical scrollbar.
mainSession.evaluateJS("document.documentElement.style.scrollbarWidth = 'none'")
mainSession.flushApzRepaints()
// Simulate the dynamic toolbar being hidden by the scroll