Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: bf4754390235b77cec6b3423764529a29eb4a252
https://github.com/WebKit/WebKit/commit/bf4754390235b77cec6b3423764529a29eb4a252
Author: Chris Dumez <[email protected]>
Date: 2026-06-29 (Mon, 29 Jun 2026)
Changed paths:
M Source/WebCore/WebCore.xcodeproj/project.pbxproj
M Source/WebCore/page/UserAgentStringParser.cpp
M Source/WebCore/page/UserAgentStringParser.h
M Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
A Tools/TestWebKitAPI/Tests/WebCore/UserAgentStringParser.cpp
Log Message:
-----------
UserAgentStringParser stores the Safari product version into the wrong field
https://bugs.webkit.org/show_bug.cgi?id=318084
Reviewed by Anne van Kesteren.
When the user-agent parser encountered the "Safari" product token, it assigned
the
parsed version to BrowsersSeen::firefoxVersion instead of
BrowsersSeen::safariVersion.
The safariVersion member was therefore never written, and was read back as the
empty
string when the result was determined to be Safari, so navigator.userAgentData
reported
Safari with an empty browser version. As a secondary effect, a user-agent
string listing
both Firefox and Safari products had its real Firefox version clobbered by the
Safari
product version.
Test: Tools/TestWebKitAPI/Tests/WebCore/UserAgentStringParser.cpp
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/page/UserAgentStringParser.cpp:
(WebCore::UserAgentStringParser::populateUserAgentData):
* Source/WebCore/page/UserAgentStringParser.h:
* Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* Tools/TestWebKitAPI/Tests/WebCore/UserAgentStringParser.cpp: Added.
(TestWebKitAPI::parse):
(TestWebKitAPI::TEST_F(UserAgentStringParserTest,
SafariBrowserVersionIsReported)):
(TestWebKitAPI::TEST_F(UserAgentStringParserTest,
FirefoxVersionNotClobberedByTrailingSafariToken)):
(TestWebKitAPI::TEST_F(UserAgentStringParserTest,
ChromeBrowserVersionIsReported)):
Canonical link: https://commits.webkit.org/315999@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications