Bug 1934567 - add a CSS webcompat intervention to fix scrolling on www.port8.fi/bokning; r=denschub,webcompat-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D232277
This commit is contained in:
@@ -1228,6 +1228,20 @@ const AVAILABLE_INJECTIONS = [
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "1934567",
|
||||
platform: "android",
|
||||
domain: "www.port8.fi",
|
||||
bug: "1934567",
|
||||
contentScripts: {
|
||||
matches: ["*://www.port8.fi/bokning/*"],
|
||||
css: [
|
||||
{
|
||||
file: "injections/css/bug1934567-www.port8.fi-scrolling-fix.css",
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
module.exports = AVAILABLE_INJECTIONS;
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
/* 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.port8.fi - The site sets Firefox-specific CSS which
|
||||
* breaks scrolling on mobile. This intervention undoes it.
|
||||
*/
|
||||
|
||||
@media (max-width: 959px) {
|
||||
html.firefox .row div[class*="col-lg-"].pos-bottom,
|
||||
html.firefox .row div[class*="col-lg-"].pos-middle {
|
||||
height: unset !important;
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
"manifest_version": 2,
|
||||
"name": "Web Compatibility Interventions",
|
||||
"description": "Urgent post-release fixes for web compatibility.",
|
||||
"version": "134.5.0",
|
||||
"version": "135.0.0",
|
||||
"browser_specific_settings": {
|
||||
"gecko": {
|
||||
"id": "webcompat@mozilla.org",
|
||||
|
||||
@@ -81,6 +81,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/bug1934567-www.port8.fi-scrolling-fix.css",
|
||||
]
|
||||
|
||||
FINAL_TARGET_FILES.features["webcompat@mozilla.org"]["injections"]["js"] += [
|
||||
|
||||
@@ -1228,6 +1228,20 @@ const AVAILABLE_INJECTIONS = [
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "1934567",
|
||||
platform: "android",
|
||||
domain: "www.port8.fi",
|
||||
bug: "1934567",
|
||||
contentScripts: {
|
||||
matches: ["*://www.port8.fi/bokning/*"],
|
||||
css: [
|
||||
{
|
||||
file: "injections/css/bug1934567-www.port8.fi-scrolling-fix.css",
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
module.exports = AVAILABLE_INJECTIONS;
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
/* 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.port8.fi - The site sets Firefox-specific CSS which
|
||||
* breaks scrolling on mobile. This intervention undoes it.
|
||||
*/
|
||||
|
||||
@media (max-width: 959px) {
|
||||
html.firefox .row div[class*="col-lg-"].pos-bottom,
|
||||
html.firefox .row div[class*="col-lg-"].pos-middle {
|
||||
height: unset !important;
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
"manifest_version": 2,
|
||||
"name": "Web Compatibility Interventions",
|
||||
"description": "Urgent post-release fixes for web compatibility.",
|
||||
"version": "134.5.0",
|
||||
"version": "135.0.0",
|
||||
"browser_specific_settings": {
|
||||
"gecko": {
|
||||
"id": "webcompat@mozilla.org",
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
import asyncio
|
||||
|
||||
import pytest
|
||||
|
||||
URL = "https://www.port8.fi/bokning/"
|
||||
|
||||
|
||||
async def check_if_scrolling_works(client):
|
||||
await client.navigate(URL)
|
||||
body = client.await_css("body")
|
||||
expected_pos = client.execute_script("return window.scrollY")
|
||||
client.apz_scroll(body, dy=100000)
|
||||
await asyncio.sleep(0.2)
|
||||
final_pos = client.execute_script("return window.scrollY")
|
||||
return expected_pos != final_pos
|
||||
|
||||
|
||||
@pytest.mark.only_platforms("android")
|
||||
@pytest.mark.asyncio
|
||||
@pytest.mark.with_interventions
|
||||
async def test_enabled(client, in_headless_mode):
|
||||
assert await check_if_scrolling_works(client)
|
||||
|
||||
|
||||
@pytest.mark.only_platforms("android")
|
||||
@pytest.mark.asyncio
|
||||
@pytest.mark.without_interventions
|
||||
async def test_disabled(client, in_headless_mode):
|
||||
assert not await check_if_scrolling_works(client)
|
||||
Reference in New Issue
Block a user