Changeset 200668 in webkit


Ignore:
Timestamp:
May 10, 2016, 8:37:30 PM (9 years ago)
Author:
weinig@apple.com
Message:

Only expose WKDataDetectorTypes and -[WKWebViewConfiguration dataDetectorTypes] on iOS
for now, since we don't have it fully implemented on Mac.

Reviewed by Tim Horton.

  • UIProcess/API/Cocoa/WKWebView.mm:

(fromWKDataDetectorTypes):
(-[WKWebView _initializeWithConfiguration:]):

  • UIProcess/API/Cocoa/WKWebViewConfiguration.h:
  • UIProcess/API/Cocoa/WKWebViewConfiguration.mm:

(-[WKWebViewConfiguration encodeWithCoder:]):
(-[WKWebViewConfiguration initWithCoder:]):
(-[WKWebViewConfiguration copyWithZone:]):

Location:
trunk/Source/WebKit2
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r200662 r200668  
     12016-05-10  Sam Weinig  <sam@webkit.org>
     2
     3        Only expose WKDataDetectorTypes and -[WKWebViewConfiguration dataDetectorTypes] on iOS
     4        for now, since we don't have it fully implemented on Mac.
     5
     6        Reviewed by Tim Horton.
     7
     8        * UIProcess/API/Cocoa/WKWebView.mm:
     9        (fromWKDataDetectorTypes):
     10        (-[WKWebView _initializeWithConfiguration:]):
     11        * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
     12        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
     13        (-[WKWebViewConfiguration encodeWithCoder:]):
     14        (-[WKWebViewConfiguration initWithCoder:]):
     15        (-[WKWebViewConfiguration copyWithZone:]):
     16
    1172016-05-10  Sam Weinig  <sam@webkit.org>
    218
  • trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm

    r200470 r200668  
    334334#endif
    335335
    336 #if ENABLE(DATA_DETECTION)
     336#if ENABLE(DATA_DETECTION) && PLATFORM(IOS)
    337337static WebCore::DataDetectorTypes fromWKDataDetectorTypes(uint64_t types)
    338338{
     
    472472#endif
    473473
    474 #if ENABLE(DATA_DETECTION)
     474#if ENABLE(DATA_DETECTION) && PLATFORM(IOS)
    475475    pageConfiguration->preferenceValues().set(WebKit::WebPreferencesKey::dataDetectorTypesKey(), WebKit::WebPreferencesStore::Value(static_cast<uint32_t>(fromWKDataDetectorTypes([_configuration dataDetectorTypes]))));
    476476#endif
  • trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.h

    r200330 r200668  
    5252} WK_ENUM_AVAILABLE_IOS(8_0);
    5353
    54 #else
    55 
    56 /*! @enum WKUserInterfaceDirectionPolicy
    57  @abstract The policy used to determine the directionality of user interface elements inside a web view.
    58  @constant WKUserInterfaceDirectionPolicyContent User interface directionality follows CSS / HTML / XHTML
    59  specifications.
    60  @constant WKUserInterfaceDirectionPolicySystem User interface directionality follows the view's
    61  userInterfaceLayoutDirection property
    62  @discussion When WKUserInterfaceDirectionPolicyContent is specified, the directionality of user interface
    63  elements is affected by the "dir" attribute or the "direction" CSS property. When
    64  WKUserInterfaceDirectionPolicySystem is specified, the directionaltiy of user interface elements is
    65  affected by the direction of the view.
    66 */
    67 typedef NS_ENUM(NSInteger, WKUserInterfaceDirectionPolicy) {
    68     WKUserInterfaceDirectionPolicyContent,
    69     WKUserInterfaceDirectionPolicySystem,
    70 } WK_ENUM_AVAILABLE(WK_MAC_TBA, NA);
    71 
    72 #endif
    73 
    7454/*! @enum WKDataDetectorTypes
    7555 @abstract The type of data detected.
     
    9272    WKDataDetectorTypeSpotlightSuggestion = 1 << 6,
    9373    WKDataDetectorTypeAll = NSUIntegerMax
    94 } WK_ENUM_AVAILABLE(WK_MAC_TBA, WK_IOS_TBA);
     74} WK_ENUM_AVAILABLE(NA, WK_IOS_TBA);
     75
     76#else
     77
     78/*! @enum WKUserInterfaceDirectionPolicy
     79 @abstract The policy used to determine the directionality of user interface elements inside a web view.
     80 @constant WKUserInterfaceDirectionPolicyContent User interface directionality follows CSS / HTML / XHTML
     81 specifications.
     82 @constant WKUserInterfaceDirectionPolicySystem User interface directionality follows the view's
     83 userInterfaceLayoutDirection property
     84 @discussion When WKUserInterfaceDirectionPolicyContent is specified, the directionality of user interface
     85 elements is affected by the "dir" attribute or the "direction" CSS property. When
     86 WKUserInterfaceDirectionPolicySystem is specified, the directionaltiy of user interface elements is
     87 affected by the direction of the view.
     88*/
     89typedef NS_ENUM(NSInteger, WKUserInterfaceDirectionPolicy) {
     90    WKUserInterfaceDirectionPolicyContent,
     91    WKUserInterfaceDirectionPolicySystem,
     92} WK_ENUM_AVAILABLE(WK_MAC_TBA, NA);
     93
     94#endif
    9595
    9696/*! A WKWebViewConfiguration object is a collection of properties with
     
    136136@property (nonatomic) BOOL allowsAirPlayForMediaPlayback WK_AVAILABLE(10_11, 9_0);
    137137
    138 /*! @abstract An enum value indicating the type of data detection desired.
    139  @discussion The default value is WKDataDetectorTypeNone.
    140  An example of how this property may affect the content loaded in the WKWebView is that content like
    141  'Visit apple.com on July 4th or call 1 800 555-5545' will be transformed to add links around 'apple.com', 'July 4th' and '1 800 555-5545'
    142  if the dataDetectorTypes property is set to WKDataDetectorTypePhoneNumber | WKDataDetectorTypeLink | WKDataDetectorTypeCalendarEvent.
    143 
    144  */
    145 @property (nonatomic) WKDataDetectorTypes dataDetectorTypes WK_AVAILABLE(WK_MAC_TBA, WK_IOS_TBA);
    146 
    147138#if TARGET_OS_IPHONE
    148139/*! @abstract A Boolean value indicating whether HTML5 videos play inline
     
    171162@property (nonatomic) BOOL allowsPictureInPictureMediaPlayback WK_AVAILABLE(NA, 9_0);
    172163
     164/*! @abstract An enum value indicating the type of data detection desired.
     165 @discussion The default value is WKDataDetectorTypeNone.
     166 An example of how this property may affect the content loaded in the WKWebView is that content like
     167 'Visit apple.com on July 4th or call 1 800 555-5545' will be transformed to add links around 'apple.com', 'July 4th' and '1 800 555-5545'
     168 if the dataDetectorTypes property is set to WKDataDetectorTypePhoneNumber | WKDataDetectorTypeLink | WKDataDetectorTypeCalendarEvent.
     169
     170 */
     171@property (nonatomic) WKDataDetectorTypes dataDetectorTypes WK_AVAILABLE(NA, WK_IOS_TBA);
     172
    173173#else
    174174
  • trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.mm

    r200330 r200668  
    199199    [coder encodeObject:self.applicationNameForUserAgent forKey:@"applicationNameForUserAgent"];
    200200    [coder encodeBool:self.allowsAirPlayForMediaPlayback forKey:@"allowsAirPlayForMediaPlayback"];
     201
     202#if PLATFORM(IOS)
    201203    [coder encodeInteger:self.dataDetectorTypes forKey:@"dataDetectorTypes"];
    202 
    203 #if PLATFORM(IOS)
    204204    [coder encodeBool:self.allowsInlineMediaPlayback forKey:@"allowsInlineMediaPlayback"];
    205205    [coder encodeBool:self.requiresUserActionForMediaPlayback forKey:@"requiresUserActionForMediaPlayback"];
     
    224224    self.applicationNameForUserAgent = [coder decodeObjectForKey:@"applicationNameForUserAgent"];
    225225    self.allowsAirPlayForMediaPlayback = [coder decodeBoolForKey:@"allowsAirPlayForMediaPlayback"];
     226
     227#if PLATFORM(IOS)
    226228    self.dataDetectorTypes = [coder decodeIntegerForKey:@"dataDetectorTypes"];
    227 
    228 #if PLATFORM(IOS)
    229229    self.allowsInlineMediaPlayback = [coder decodeBoolForKey:@"allowsInlineMediaPlayback"];
    230230    self.requiresUserActionForMediaPlayback = [coder decodeBoolForKey:@"requiresUserActionForMediaPlayback"];
     
    288288    configuration->_imageControlsEnabled = self->_imageControlsEnabled;
    289289#endif
    290 #if ENABLE(DATA_DETECTION)
     290#if ENABLE(DATA_DETECTION) && PLATFORM(IOS)
    291291    configuration->_dataDetectorTypes = self->_dataDetectorTypes;
    292292#endif
Note: See TracChangeset for help on using the changeset viewer.