Bug 1925937 - add a CSS intervention to hide superfluous scrollbars on www.gazetasp.com.br; r=denschub,webcompat-reviewers

Differential Revision: https://phabricator.services.mozilla.com/D239447
This commit is contained in:
Thomas Wisniewski
2025-02-27 00:14:39 +00:00
parent 9b64d44bc6
commit 9e86d2d03b
4 changed files with 67 additions and 0 deletions

View File

@@ -2691,6 +2691,23 @@
}
]
},
"1925937": {
"label": "gazetasp.com.br",
"bugs": {
"1925937": {
"issue": "extra-scrollbars",
"matches": ["*://www.gazetasp.com.br/*"]
}
},
"interventions": [
{
"platforms": ["desktop"],
"content_scripts": {
"css": ["bug1925937-gazetasp.com.br-hide-extra-scrollbars.css"]
}
}
]
},
"1928216": {
"label": "voice.google.com",
"bugs": {

View File

@@ -0,0 +1,16 @@
/* 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/. */
/**
* www.gazetasp.com.br - scrollbars which should be hidden are not hidden
* Bug #1925937 - https://bugzilla.mozilla.org/show_bug.cgi?id=1925937
* WebCompat issue #142986 - https://github.com/webcompat/web-bugs/issues/142986
*
* They are using non-standard webkit-scrollbar CSS to hide scrollbars. We can use
* scrollbar-width instead to hide them.
*/
.busca,
.lista-categorias {
scrollbar-width: none;
}

View File

@@ -79,6 +79,7 @@ FINAL_TARGET_FILES.features["webcompat@mozilla.org"]["injections"]["css"] += [
"injections/css/bug1899937-plus.nhk.jp-hide-unsupported.css",
"injections/css/bug1901000-eyebuydirect.ca-fix-paypal-button.css",
"injections/css/bug1925508-developer-apple.com-transform-scale.css",
"injections/css/bug1925937-gazetasp.com.br-hide-extra-scrollbars.css",
"injections/css/bug1931538-buzzfeed.com-card-game-fix.css",
"injections/css/bug1934567-www.port8.fi-scrolling-fix.css",
"injections/css/bug1941530-climate.rutgers.edu-fix-broken-images.css",

View File

@@ -0,0 +1,33 @@
import pytest
URL = "https://www.gazetasp.com.br/"
CONTAINER_CSS = "#listaCategorias-1"
async def is_scrollbar_visible(client):
await client.navigate(URL)
container = client.await_css(CONTAINER_CSS)
return client.execute_script(
"""
const container = arguments[0];
return Math.round(container.getBoundingClientRect().height) != container.clientHeight;
""",
container,
)
@pytest.mark.skip_platforms("android")
@pytest.mark.need_visible_scrollbars
@pytest.mark.asyncio
@pytest.mark.with_interventions
async def test_enabled(client):
assert not await is_scrollbar_visible(client)
@pytest.mark.skip_platforms("android")
@pytest.mark.need_visible_scrollbars
@pytest.mark.asyncio
@pytest.mark.without_interventions
async def test_disabled(client):
assert await is_scrollbar_visible(client)