tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit c1eefb7447bebccfc633ef111390c6e2aa88d4e8
parent 55d0c9428ed35bc533838aa15b1a5dcac712ed77
Author: Thomas Wisniewski <twisniewski@mozilla.com>
Date:   Wed, 22 Oct 2025 14:47:04 +0000

Bug 1994571 - add a CSS webcompat intervention for chick-fil-a.com; r=webcompat-reviewers,ksenia

Differential Revision: https://phabricator.services.mozilla.com/D269471

Diffstat:
Mbrowser/extensions/webcompat/data/interventions.json | 17+++++++++++++++++
Abrowser/extensions/webcompat/injections/css/1994571-chick-fil-a.com-fix-icon-heights.css | 15+++++++++++++++
Mbrowser/extensions/webcompat/manifest.json | 2+-
Atesting/webcompat/interventions/tests/test_1994571_chick-fil-a_com.py | 45+++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 78 insertions(+), 1 deletion(-)

diff --git a/browser/extensions/webcompat/data/interventions.json b/browser/extensions/webcompat/data/interventions.json @@ -5657,5 +5657,22 @@ } } ] + }, + "1994571": { + "label": "chick-fil-a.com", + "bugs": { + "1994571": { + "issue": "broken-images", + "matches": ["*://www.chick-fil-a.com/*"] + } + }, + "interventions": [ + { + "platforms": ["desktop"], + "content_scripts": { + "css": ["1994571-chick-fil-a.com-fix-icon-heights.css"] + } + } + ] } } diff --git a/browser/extensions/webcompat/injections/css/1994571-chick-fil-a.com-fix-icon-heights.css b/browser/extensions/webcompat/injections/css/1994571-chick-fil-a.com-fix-icon-heights.css @@ -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/. */ + +/** + * chick-fil-a.com - red-colored icons are vertically stretched + * Bug #1994571 - https://bugzilla.mozilla.org/show_bug.cgi?id=1994571 + * + * The site's height:100% on the icons is causing them to stretch on + * Firefox. We can work around it here. + */ +.classic-callout img { + height: auto; + max-height: 100%; +} diff --git a/browser/extensions/webcompat/manifest.json b/browser/extensions/webcompat/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 2, "name": "Web Compatibility Interventions", "description": "Urgent post-release fixes for web compatibility.", - "version": "146.3.0", + "version": "146.4.0", "browser_specific_settings": { "gecko": { "id": "webcompat@mozilla.org", diff --git a/testing/webcompat/interventions/tests/test_1994571_chick-fil-a_com.py b/testing/webcompat/interventions/tests/test_1994571_chick-fil-a_com.py @@ -0,0 +1,45 @@ +import pytest + +URL = "https://www.chick-fil-a.com/careers" +ICONS_CSS = ".classic-callout img" + + +async def are_icons_stretched(client): + await client.navigate(URL, wait="none") + client.await_css(ICONS_CSS, is_displayed=True) + return client.execute_script( + """ + const icon_imgs = document.querySelectorAll(arguments[0]); + for (const img of icon_imgs) { + const box = img.getBoundingClientRect(); + const actual_ratio = box.height / box.width; + const expected_ratio = img.naturalHeight / img.naturalWidth; + if (!isNaN(expected_ratio) && parseInt(actual_ratio * 10) !== parseInt(expected_ratio * 10)) { + return true; + } + } + return false; + """, + ICONS_CSS, + ) + + +@pytest.mark.skip_platforms("android") +@pytest.mark.asyncio +@pytest.mark.with_interventions +async def test_enabled(client): + assert not await are_icons_stretched(client) + + +@pytest.mark.skip_platforms("android") +@pytest.mark.asyncio +@pytest.mark.without_interventions +async def test_disabled(client): + assert await are_icons_stretched(client) + + +@pytest.mark.only_platforms("android") +@pytest.mark.asyncio +@pytest.mark.without_interventions +async def test_works_on_android(client): + assert not await are_icons_stretched(client)