tor-browser

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

commit 959cf1a54bfd8f05692f90a3cd7e1ff6f7722611
parent c51c942660865435e250efffb9160dc5867d142e
Author: Ted Campbell <tcampbell@mozilla.com>
Date:   Wed, 10 Dec 2025 22:13:00 +0000

Bug 2005126 - Support S24 when sanitizing render strings. r=jnicol

My Samsung S24 has extra parens in the render string, so extend the
sanitizer regex to cover this as well.

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

Diffstat:
Mdom/canvas/SanitizeRenderer.cpp | 2+-
Mdom/canvas/gtest/TestSanitizeRenderer.cpp | 9+++++++++
2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/dom/canvas/SanitizeRenderer.cpp b/dom/canvas/SanitizeRenderer.cpp @@ -300,7 +300,7 @@ std::string SanitizeRenderer(const std::string& raw_renderer) { "ANGLE [(]([^,]*), ([^,]*)( Direct3D[^,]*), .*[)]"); // e.g. "ANGLE (Samsung Xclipse 940) on Vulkan 1.3.264" static const std::regex kReAngleVulkan( - "ANGLE [(](.*)[)]( on Vulkan) [0-9\\.]*"); + "ANGLE [(]+(.*)[)]( on Vulkan) [0-9\\.]*[)]*"); if (std::regex_match(raw_renderer, m, kReAngleDirect3D)) { const auto& vendor = m.str(1); diff --git a/dom/canvas/gtest/TestSanitizeRenderer.cpp b/dom/canvas/gtest/TestSanitizeRenderer.cpp @@ -197,6 +197,15 @@ TEST(SanitizeRenderer, TestAngleSamsungVulkan) EXPECT_EQ(sanitized, expectation); } +TEST(SanitizeRenderer, TestAngleSamsungVulkanAlt) +{ + const std::string renderer("ANGLE ((Samsung Xclipse 940) on Vulkan 1.3.279)"); + const std::string expectation( + "ANGLE (Samsung Xclipse 920) on Vulkan, or similar"); + const auto sanitized = mozilla::webgl::SanitizeRenderer(renderer); + EXPECT_EQ(sanitized, expectation); +} + TEST(SanitizeRenderer, TestLinuxK600) { const std::string renderer("NVE7");