Limit user agent versioning to an upper bound
authorbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Dec 2017 01:59:53 +0000 (01:59 +0000)
committerbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Dec 2017 01:59:53 +0000 (01:59 +0000)
commitfb65f0172df59da968e7f46544a90e224b538441
tree2845237e2901e69787f780e15dd0ddff1dc67580
parenta713225cb1a20cb8aecfc4806e0ce53d7db6378d
Limit user agent versioning to an upper bound
https://bugs.webkit.org/show_bug.cgi?id=180365
<rdar://problem/34550617>

Reviewed by Joseph Pecoraro.

Source/WebCore:

Freeze the version reported as User Agent to OS 10.13.4 (OS 11.3 on iOS) and WebKit 605.1.15
for User Agent purposes.

Test: fast/dom/navigator-userAgent-frozen.html

* page/cocoa/UserAgent.h:
* page/cocoa/UserAgent.mm:
(WebCore::versionPredatesFreeze): Helper function. Returns true for Version 10.13.3 or older.
(WebCore::systemMarketingVersionForUserAgentString):
(WebCore::userAgentBundleVersion):
(WebCore::userVisibleWebKitBundleVersionFromFullVersion): Deleted.
(WebCore::userAgentBundleVersionFromFullVersionString): Deleted.
* page/ios/UserAgentIOS.mm:
(WebCore::standardUserAgentWithApplicationName): Don't take the WebKit bundle version
as an argument, or pass it to the user agent string generator.
* page/mac/UserAgentMac.mm:
(WebCore::standardUserAgentWithApplicationName): Ditto.

Source/WebKit:

* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::standardUserAgent): Don't pass the WebKit bundle version when
creatin the User Agent string.
(WebKit::webKitBundleVersionString): Deleted.
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::standardUserAgent): Ditto.
(WebKit::webKitBundleVersionString): Deleted.

Source/WebKitLegacy/mac:

* WebView/WebView.mm:
(+[WebView _standardUserAgentWithApplicationName:]): Don't pass the WebKit bundle version when
creating the User Agent string.
(webKitBundleVersionString): Deleted.

LayoutTests:

* fast/dom/navigator-userAgent-frozen-expected.txt: Added.
* fast/dom/navigator-userAgent-frozen.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225562 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/dom/navigator-userAgent-frozen-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/navigator-userAgent-frozen.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/page/cocoa/UserAgent.h
Source/WebCore/page/cocoa/UserAgent.mm
Source/WebCore/page/ios/UserAgentIOS.mm
Source/WebCore/page/mac/UserAgentMac.mm
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm
Source/WebKit/UIProcess/mac/WebPageProxyMac.mm
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/WebView/WebView.mm