commit f915cbc4fd0c1bb9b8780d6aeb78b5f2048c7f08
parent 8f792ca8efcfd947505ade3738f1c75237e835db
Author: Thomas Wisniewski <twisniewski@mozilla.com>
Date: Tue, 25 Nov 2025 16:52:46 +0000
Bug 1978572 - add a CSS webcompat intervention for store.renishaw.com to fix product sliders; r=denschub,webcompat-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D273920
Diffstat:
3 files changed, 85 insertions(+), 0 deletions(-)
diff --git a/browser/extensions/webcompat/data/interventions.json b/browser/extensions/webcompat/data/interventions.json
@@ -5258,6 +5258,23 @@
}
]
},
+ "1978572": {
+ "label": "store.renishaw.com",
+ "bugs": {
+ "1978572": {
+ "issue": "broken-interactive-elements",
+ "matches": ["*://store.renishaw.com/*"]
+ }
+ },
+ "interventions": [
+ {
+ "platforms": ["all"],
+ "content_scripts": {
+ "css": ["bug1978572-store.renishaw.com-fix-range-sliders.css"]
+ }
+ }
+ ]
+ },
"1934908": {
"label": "www.cbsnews.com",
"bugs": {
diff --git a/browser/extensions/webcompat/injections/css/bug1978572-store.renishaw.com-fix-range-sliders.css b/browser/extensions/webcompat/injections/css/bug1978572-store.renishaw.com-fix-range-sliders.css
@@ -0,0 +1,18 @@
+/* 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/. */
+
+/**
+ * store.renishaw.com - fix product dual-sliders
+ * Bug #1978572 - https://bugzilla.mozilla.org/show_bug.cgi?id=1978572
+ * WebCompat issue #168051 - https://webcompat.com/issues/168051
+ */
+input[type="range"].range-selector,
+input[type="range"].range-selector + div,
+input[type="range"].range-selector::-moz-range-track,
+input[type="range"].range-selector::-moz-range-progress {
+ pointer-events: none;
+}
+input[type="range"].range-selector::-moz-range-thumb {
+ pointer-events: all;
+}
diff --git a/testing/webcompat/interventions/tests/test_1978572_store_renishaw_com.py b/testing/webcompat/interventions/tests/test_1978572_store_renishaw_com.py
@@ -0,0 +1,50 @@
+import asyncio
+
+import pytest
+
+URL = "https://store.renishaw.com/en-GB/category/styli-renishaw-straight?Thread=%3AM2&TipMaterial=%3ARuby"
+POPUPS_CSS = "#onetrust-consent-sdk, [data-testid=toast]"
+MOBILE_FILTERS_CSS = "[data-testid=plp-filters-open-modal-button]"
+LEFT_SLIDER_CSS = "details.bg-primary #undefined-min"
+
+
+async def does_left_slider_work(client):
+ await client.navigate(URL)
+ client.hide_elements(POPUPS_CSS)
+ client.await_css(MOBILE_FILTERS_CSS, is_displayed=True).click()
+ slider = client.await_css(LEFT_SLIDER_CSS, is_displayed=True)
+ await asyncio.sleep(0.5)
+
+ # Unfortunately, on desktop range thumbs do not react to any attempts to
+ # drag them with WebDriver. However they do on Android, which is enough
+ # for us to be able to test them.
+
+ def slider_value():
+ return client.execute_script("return arguments[0].value", slider)
+
+ orig_value = slider_value()
+
+ coords = client.get_element_screen_position(slider)
+ coords = [coords[0] + 4, coords[1] + 4]
+ await client.apz_down(coords=coords)
+ for i in range(25):
+ await asyncio.sleep(0.01)
+ coords[0] += 5
+ await client.apz_move(coords=coords)
+ return orig_value != slider_value()
+
+
+@pytest.mark.only_platforms("android")
+@pytest.mark.actual_platform_required
+@pytest.mark.asyncio
+@pytest.mark.with_interventions
+async def test_enabled(client):
+ assert await does_left_slider_work(client)
+
+
+@pytest.mark.only_platforms("android")
+@pytest.mark.actual_platform_required
+@pytest.mark.asyncio
+@pytest.mark.without_interventions
+async def test_disabled(client):
+ assert not await does_left_slider_work(client)