Changeset 160412 in webkit


Ignore:
Timestamp:
Dec 10, 2013 11:25:45 PM (10 years ago)
Author:
mrowe@apple.com
Message:

<http://webkit.org/b/125556> WebKit doesn't deal with longer bundle versions correctly
<rdar://problem/15634192>

Reviewed by Dan Bernstein.

Source/WebKit/mac:

  • WebView/WebView.mm:

(createUserVisibleWebKitVersionString): Strip as many leading digits as is necessary to
bring the major component of the version down to 3 digits.

Source/WebKit2:

  • UIProcess/mac/WebPageProxyMac.mm:

(WebKit::userVisibleWebKitVersionString): Strip as many leading digits as is necessary to
bring the major component of the version down to 3 digits.

Location:
trunk/Source
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/mac/ChangeLog

    r160326 r160412  
     12013-12-10  Mark Rowe  <mrowe@apple.com>
     2
     3        <http://webkit.org/b/125556> WebKit doesn't deal with longer bundle versions correctly
     4        <rdar://problem/15634192>
     5
     6        Reviewed by Dan Bernstein.
     7
     8        * WebView/WebView.mm:
     9        (createUserVisibleWebKitVersionString): Strip as many leading digits as is necessary to
     10        bring the major component of the version down to 3 digits.
     11
    1122013-12-09  Sam Weinig  <sam@webkit.org>
    213
  • trunk/Source/WebKit/mac/WebView/WebView.mm

    r160261 r160412  
    595595static NSString *createUserVisibleWebKitVersionString()
    596596{
    597     // If the version is 4 digits long or longer, then the first digit represents
    598     // the version of the OS. Our user agent string should not include this first digit,
    599     // so strip it off and report the rest as the version. <rdar://problem/4997547>
     597    // If the version is longer than 3 digits then the leading digits represent the version of the OS. Our user agent
     598    // string should not include the leading digits, so strip them off and report the rest as the version. <rdar://problem/4997547>
    600599    NSString *fullVersion = [[NSBundle bundleForClass:[WebView class]] objectForInfoDictionaryKey:(NSString *)kCFBundleVersionKey];
    601600    NSRange nonDigitRange = [fullVersion rangeOfCharacterFromSet:[[NSCharacterSet decimalDigitCharacterSet] invertedSet]];
    602     if (nonDigitRange.location == NSNotFound && [fullVersion length] >= 4)
    603         return [[fullVersion substringFromIndex:1] copy];
    604     if (nonDigitRange.location != NSNotFound && nonDigitRange.location >= 4)
    605         return [[fullVersion substringFromIndex:1] copy];
     601    if (nonDigitRange.location == NSNotFound && fullVersion.length > 3)
     602        return [[fullVersion substringFromIndex:fullVersion.length - 3] copy];
     603    if (nonDigitRange.location != NSNotFound && nonDigitRange.location > 3)
     604        return [[fullVersion substringFromIndex:nonDigitRange.location - 3] copy];
    606605    return [fullVersion copy];
    607606}
  • trunk/Source/WebKit2/ChangeLog

    r160409 r160412  
     12013-12-10  Mark Rowe  <mrowe@apple.com>
     2
     3        <http://webkit.org/b/125556> WebKit doesn't deal with longer bundle versions correctly
     4        <rdar://problem/15634192>
     5
     6        Reviewed by Dan Bernstein.
     7
     8        * UIProcess/mac/WebPageProxyMac.mm:
     9        (WebKit::userVisibleWebKitVersionString): Strip as many leading digits as is necessary to
     10        bring the major component of the version down to 3 digits.
     11
    1122013-12-10  Ryuan Choi  <ryuan.choi@samsung.com>
    213
  • trunk/Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm

    r159903 r160412  
    9393static String userVisibleWebKitVersionString()
    9494{
    95     // If the version is 4 digits long or longer, then the first digit represents
    96     // the version of the OS. Our user agent string should not include this first digit,
    97     // so strip it off and report the rest as the version. <rdar://problem/4997547>
     95    // If the version is longer than 3 digits then the leading digits represent the version of the OS. Our user agent
     96    // string should not include the leading digits, so strip them off and report the rest as the version. <rdar://problem/4997547>
    9897    NSString *fullVersion = [[NSBundle bundleForClass:NSClassFromString(@"WKView")] objectForInfoDictionaryKey:(NSString *)kCFBundleVersionKey];
    9998    NSRange nonDigitRange = [fullVersion rangeOfCharacterFromSet:[[NSCharacterSet decimalDigitCharacterSet] invertedSet]];
    100     if (nonDigitRange.location == NSNotFound && [fullVersion length] >= 4)
    101         return [fullVersion substringFromIndex:1];
    102     if (nonDigitRange.location != NSNotFound && nonDigitRange.location >= 4)
    103         return [fullVersion substringFromIndex:1];
     99    if (nonDigitRange.location == NSNotFound && fullVersion.length > 3)
     100        return [fullVersion substringFromIndex:fullVersion.length - 3];
     101    if (nonDigitRange.location != NSNotFound && nonDigitRange.location > 3)
     102        return [fullVersion substringFromIndex:nonDigitRange.location - 3];
    104103    return fullVersion;
    105104}
Note: See TracChangeset for help on using the changeset viewer.