commit 813b75b82462b89abc58dbc251c2b553fb8282d1
parent 7d589adb41574ddc83eef54a982c53aff8c52175
Author: Thomas Wisniewski <twisniewski@mozilla.com>
Date: Wed, 8 Oct 2025 22:50:23 +0000
Bug 1974686 - add a CSS webcompat intervention for www.hermes.admin.ch; r=webcompat-reviewers,ksenia
Differential Revision: https://phabricator.services.mozilla.com/D268016
Diffstat:
3 files changed, 70 insertions(+), 0 deletions(-)
diff --git a/browser/extensions/webcompat/data/interventions.json b/browser/extensions/webcompat/data/interventions.json
@@ -5243,6 +5243,25 @@
}
]
},
+ "1974686": {
+ "label": "hermes.admin.ch",
+ "bugs": {
+ "1974686": {
+ "issue": "broken-layout",
+ "matches": [
+ "*://www.hermes.admin.ch/de/projektmanagement/szenarien/it-entwicklung/szenariouebersicht.html*"
+ ]
+ }
+ },
+ "interventions": [
+ {
+ "platforms": ["all"],
+ "content_scripts": {
+ "css": ["bug1974686-hermes_admin_ch.css"]
+ }
+ }
+ ]
+ },
"1976402": {
"label": "dieseldispatch.com",
"bugs": {
diff --git a/browser/extensions/webcompat/injections/css/bug1974686-hermes_admin_ch.css b/browser/extensions/webcompat/injections/css/bug1974686-hermes_admin_ch.css
@@ -0,0 +1,17 @@
+/* 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/. */
+
+/**
+ * hermes.admin.ch - table cells overlap
+ * Bug #1974686 - https://bugzilla.mozilla.org/show_bug.cgi?id=1974686
+ *
+ * The page sets a 1px height on its table cells, which has interop issues.
+ * We can unset that and adjust their other CSS to improve the situation.
+ */
+.hermespjm-projektuebersicht-row {
+ height: unset;
+}
+.hermespjm-projektuebersicht-cell-verantwortlicher {
+ position: static;
+}
diff --git a/testing/webcompat/interventions/tests/test_1974686_hermes_admin_ch.py b/testing/webcompat/interventions/tests/test_1974686_hermes_admin_ch.py
@@ -0,0 +1,34 @@
+import pytest
+
+URL = "https://www.hermes.admin.ch/de/projektmanagement/szenarien/it-entwicklung/szenariouebersicht.html"
+
+CELLS_CSS = ".hermespjm-projektuebersicht-cell"
+
+
+async def are_table_cells_collapsed(client):
+ await client.navigate(URL, wait="none")
+ client.await_css(CELLS_CSS, is_displayed=True)
+ return client.execute_script(
+ """
+ const cells = document.querySelectorAll(arguments[0]);
+ for (const cell of cells) {
+ if (cell.clientHeight < cell.scrollHeight) {
+ return true;
+ }
+ }
+ return false;
+ """,
+ CELLS_CSS,
+ )
+
+
+@pytest.mark.asyncio
+@pytest.mark.with_interventions
+async def test_enabled(client):
+ assert not await are_table_cells_collapsed(client)
+
+
+@pytest.mark.asyncio
+@pytest.mark.without_interventions
+async def test_disabled(client):
+ assert await are_table_cells_collapsed(client)