commit 5ab09e910fda83b3d4fa203d08ac9655d895d2ec
parent 4c89c9aef8cb29151f0d21c294a894c8df24bbd5
Author: Thomas Wisniewski <twisniewski@mozilla.com>
Date: Thu, 16 Oct 2025 16:12:17 +0000
Bug 1994142 - add a desktop-only CSS intervention for virtual-cards.exnode.ru; r=webcompat-reviewers,ksenia
Differential Revision: https://phabricator.services.mozilla.com/D268795
Diffstat:
3 files changed, 67 insertions(+), 0 deletions(-)
diff --git a/browser/extensions/webcompat/data/interventions.json b/browser/extensions/webcompat/data/interventions.json
@@ -5408,5 +5408,22 @@
}
}
]
+ },
+ "1994142": {
+ "label": "virtual-cards.exnode.ru",
+ "bugs": {
+ "1994142": {
+ "issue": "broken-layout",
+ "matches": ["*://virtual-cards.exnode.ru/*"]
+ }
+ },
+ "interventions": [
+ {
+ "platforms": ["desktop"],
+ "content_scripts": {
+ "css": ["1994142-virtual-cards.exnode.ru-fix-table-layout.css"]
+ }
+ }
+ ]
}
}
diff --git a/browser/extensions/webcompat/injections/css/1994142-virtual-cards.exnode.ru-fix-table-layout.css b/browser/extensions/webcompat/injections/css/1994142-virtual-cards.exnode.ru-fix-table-layout.css
@@ -0,0 +1,12 @@
+/* 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/. */
+
+/**
+ * virtual-cards.exnode.ru - text in table cells is visually broken
+ * Bug #1994142 - https://bugzilla.mozilla.org/show_bug.cgi?id=1994142
+ * WebCompat issue #182769 - https://webcompat.com/issues/182769
+ */
+.flexbe-table__row--first .flexbe-table__cell {
+ min-width: 0 !important;
+}
diff --git a/testing/webcompat/interventions/tests/test_1994142_virtual-cards_exnode_ru.py b/testing/webcompat/interventions/tests/test_1994142_virtual-cards_exnode_ru.py
@@ -0,0 +1,38 @@
+import pytest
+
+URL = "https://virtual-cards.exnode.ru/"
+
+CELLS_CSS = ".flexbe-table__td:nth-child(2)"
+
+
+async def table_text_properly_rendered(client):
+ await client.navigate(URL)
+ cells = client.await_css(CELLS_CSS, is_displayed=True, all=True)
+ # the text of cells is taller than it is wide when they are rendered incorrectly.
+ return client.execute_script(
+ """
+ const [cells] = arguments;
+ for (const cell of arguments[0]) {
+ const box = cell.getBoundingClientRect();
+ if (box.height > box.width) {
+ return false;
+ }
+ }
+ return true;
+ """,
+ cells,
+ )
+
+
+@pytest.mark.skip_platforms("android")
+@pytest.mark.asyncio
+@pytest.mark.with_interventions
+async def test_enabled(client):
+ assert await table_text_properly_rendered(client)
+
+
+@pytest.mark.skip_platforms("android")
+@pytest.mark.asyncio
+@pytest.mark.without_interventions
+async def test_disabled(client):
+ assert not await table_text_properly_rendered(client)