Changeset 195300 in webkit


Ignore:
Timestamp:
Jan 19, 2016 11:34:20 AM (8 years ago)
Author:
enrica@apple.com
Message:

Add support for DataDetectors in WK (iOS).
https://bugs.webkit.org/show_bug.cgi?id=152989
rdar://problem/22855960

Reviewed by Tim Horton.

Source/JavaScriptCore:

Adding feature definition.

  • Configurations/FeatureDefines.xcconfig:

Source/WebCore:

This is the first step toward implementing Data Detectors support
in WK2. The patch adds a new memeber to the Settings object
to retrieve the type of detection desired. The DataDetection files
have been moved under cocoa, since they are no longer OS X specific.

  • Configurations/FeatureDefines.xcconfig:
  • Configurations/WebCore.xcconfig:
  • WebCore.xcodeproj/project.pbxproj:
  • editing/cocoa/DataDetection.h: Copied from Source/WebCore/editing/mac/DataDetection.h.
  • editing/cocoa/DataDetection.mm: Copied from Source/WebCore/editing/mac/DataDetection.mm.

(WebCore::detectItemAtPositionWithRange):
(WebCore::DataDetection::detectItemAroundHitTestResult):
(WebCore::DataDetection::detectContentInRange):

  • editing/mac/DataDetection.h: Removed.
  • editing/mac/DataDetection.mm: Removed.
  • loader/FrameLoader.cpp:

(WebCore::FrameLoader::checkLoadCompleteForThisFrame):

  • page/Settings.h:
  • page/Settings.in:
  • platform/spi/mac/DataDetectorsSPI.h:

Source/WebKit/mac:

Adding feature definition for data detection.

  • Configurations/FeatureDefines.xcconfig:

Source/WebKit2:

This is the first step toward implementing Data Detectors support
in WK2. The patch adds a new property to the configuration
object to indicate the type of detection desired and propagates
to the WebProcess.

  • Configurations/FeatureDefines.xcconfig:
  • Shared/WebPreferencesDefinitions.h:
  • UIProcess/API/Cocoa/WKWebView.mm:

(-[WKWebView initWithFrame:configuration:]):

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

(-[WKWebViewConfiguration copyWithZone:]):

  • WebKit2.xcodeproj/project.pbxproj:
  • WebProcess/WebPage/Cocoa/WebPageCocoa.mm: Added.

(WebKit::WebPage::fromWKDataDetectorTypes):

  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::updatePreferences):

  • WebProcess/WebPage/WebPage.h:

Source/WTF:

Adding feature definition for data detection.

  • wtf/FeatureDefines.h:
Location:
trunk/Source
Files:
1 added
23 edited
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r195298 r195300  
     12016-01-19  Enrica Casucci  <enrica@apple.com>
     2
     3        Add support for DataDetectors in WK (iOS).
     4        https://bugs.webkit.org/show_bug.cgi?id=152989
     5        rdar://problem/22855960
     6
     7        Reviewed by Tim Horton.
     8
     9        Adding feature definition.
     10
     11        * Configurations/FeatureDefines.xcconfig:
     12
    1132016-01-17  Filip Pizlo  <fpizlo@apple.com>
    214
  • trunk/Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig

    r194921 r195300  
    112112
    113113ENABLE_IOS_TEXT_AUTOSIZING[sdk=iphone*] = ENABLE_IOS_TEXT_AUTOSIZING;
     114ENABLE_DATA_DETECTION = ENABLE_DATA_DETECTION;
    114115
    115116ENABLE_IOS_TOUCH_EVENTS[sdk=iphone*] = $(ENABLE_IOS_TOUCH_EVENTS_ios_WITH_INTERNAL_SDK_$(USE_INTERNAL_SDK));
  • trunk/Source/WTF/ChangeLog

    r195298 r195300  
     12016-01-19  Enrica Casucci  <enrica@apple.com>
     2
     3        Add support for DataDetectors in WK (iOS).
     4        https://bugs.webkit.org/show_bug.cgi?id=152989
     5        rdar://problem/22855960
     6
     7        Reviewed by Tim Horton.
     8
     9        Adding feature definition for data detection.
     10
     11        * wtf/FeatureDefines.h:
     12
    1132016-01-17  Filip Pizlo  <fpizlo@apple.com>
    214
  • trunk/Source/WTF/wtf/FeatureDefines.h

    r194921 r195300  
    273273#endif /* PLATFORM(MAC) */
    274274
     275#if PLATFORM(COCOA)
     276
     277#if !defined(ENABLE_DATA_DETECTION)
     278#define ENABLE_DATA_DETECTION 1
     279#endif
     280
     281#endif /* PLATFORM(COCOA) */
     282
    275283/* --------- Apple Windows port --------- */
    276284#if PLATFORM(WIN) && !PLATFORM(WIN_CAIRO)
  • trunk/Source/WebCore/ChangeLog

    r195294 r195300  
     12016-01-19  Enrica Casucci  <enrica@apple.com>
     2
     3        Add support for DataDetectors in WK (iOS).
     4        https://bugs.webkit.org/show_bug.cgi?id=152989
     5        rdar://problem/22855960
     6
     7        Reviewed by Tim Horton.
     8
     9        This is the first step toward implementing Data Detectors support
     10        in WK2. The patch adds a new memeber to the Settings object
     11        to retrieve the type of detection desired. The DataDetection files
     12        have been moved under cocoa, since they are no longer OS X specific.
     13
     14        * Configurations/FeatureDefines.xcconfig:
     15        * Configurations/WebCore.xcconfig:
     16        * WebCore.xcodeproj/project.pbxproj:
     17        * editing/cocoa/DataDetection.h: Copied from Source/WebCore/editing/mac/DataDetection.h.
     18        * editing/cocoa/DataDetection.mm: Copied from Source/WebCore/editing/mac/DataDetection.mm.
     19        (WebCore::detectItemAtPositionWithRange):
     20        (WebCore::DataDetection::detectItemAroundHitTestResult):
     21        (WebCore::DataDetection::detectContentInRange):
     22        * editing/mac/DataDetection.h: Removed.
     23        * editing/mac/DataDetection.mm: Removed.
     24        * loader/FrameLoader.cpp:
     25        (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
     26        * page/Settings.h:
     27        * page/Settings.in:
     28        * platform/spi/mac/DataDetectorsSPI.h:
     29
    1302016-01-19  Chris Dumez  <cdumez@apple.com>
    231
  • trunk/Source/WebCore/Configurations/FeatureDefines.xcconfig

    r194921 r195300  
    112112
    113113ENABLE_IOS_TEXT_AUTOSIZING[sdk=iphone*] = ENABLE_IOS_TEXT_AUTOSIZING;
     114ENABLE_DATA_DETECTION = ENABLE_DATA_DETECTION;
    114115
    115116ENABLE_IOS_TOUCH_EVENTS[sdk=iphone*] = $(ENABLE_IOS_TOUCH_EVENTS_ios_WITH_INTERNAL_SDK_$(USE_INTERNAL_SDK));
  • trunk/Source/WebCore/Configurations/WebCore.xcconfig

    r194821 r195300  
    5151OTHER_LDFLAGS = $(inherited) $(OTHER_LDFLAGS_PLATFORM);
    5252OTHER_LDFLAGS_BASE = -lsqlite3 -lobjc -lANGLE;
    53 OTHER_LDFLAGS_BASE_ios = $(OTHER_LDFLAGS_BASE) -framework CFNetwork -framework CoreGraphics -framework CoreText -framework Foundation -framework GraphicsServices -framework ImageIO -framework OpenGLES -lMobileGestalt;
     53OTHER_LDFLAGS_BASE_ios = $(OTHER_LDFLAGS_BASE) -framework CFNetwork -framework CoreGraphics -framework CoreText -framework Foundation -framework GraphicsServices -framework ImageIO -framework OpenGLES -lMobileGestalt -framework DataDetectorsCore;
    5454OTHER_LDFLAGS_PLATFORM[sdk=iphoneos*] = $(OTHER_LDFLAGS_BASE_ios) -framework IOSurface;
    5555OTHER_LDFLAGS_PLATFORM[sdk=iphonesimulator*] = $(OTHER_LDFLAGS_BASE_ios);
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r195087 r195300  
    11381138                2D5036681BCDDDC400E20BB3 /* GestureEvents.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D5036671BCDDDC400E20BB3 /* GestureEvents.cpp */; };
    11391139                2D5646B01B8F8493003C4994 /* DictionaryPopupInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D5646AF1B8F8493003C4994 /* DictionaryPopupInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
    1140                 2D58D8551A15F65F00A5F726 /* DataDetection.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D58D8531A15F65F00A5F726 /* DataDetection.h */; settings = {ATTRIBUTES = (Private, ); }; };
    1141                 2D58D8561A15F65F00A5F726 /* DataDetection.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D58D8541A15F65F00A5F726 /* DataDetection.mm */; };
    11421140                2D59F1BF1A0044C6001F3D29 /* DataDetectorsSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D59F1BE1A0044C6001F3D29 /* DataDetectorsSPI.h */; settings = {ATTRIBUTES = (Private, ); }; };
    11431141                2D5A592F152525230036EE51 /* ImageOrientation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8748D7412CC3F89001FBA41 /* ImageOrientation.cpp */; };
     
    58835881                C5137CF211A58378004ADB99 /* JSDOMStringList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C5137CF011A58378004ADB99 /* JSDOMStringList.cpp */; };
    58845882                C5137CF311A58378004ADB99 /* JSDOMStringList.h in Headers */ = {isa = PBXBuildFile; fileRef = C5137CF111A58378004ADB99 /* JSDOMStringList.h */; };
     5883                C5227DF11C3C6DF100F5ED54 /* DataDetection.h in Headers */ = {isa = PBXBuildFile; fileRef = C5227DEF1C3C6DD700F5ED54 /* DataDetection.h */; settings = {ATTRIBUTES = (Private, ); }; };
     5884                C5227DF21C3C6DF900F5ED54 /* DataDetection.mm in Sources */ = {isa = PBXBuildFile; fileRef = C5227DF01C3C6DD700F5ED54 /* DataDetection.mm */; };
    58855885                C5278B0C17F212EA003A2998 /* PlatformPasteboardIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = C5278B0B17F212EA003A2998 /* PlatformPasteboardIOS.mm */; };
    58865886                C544274B11A57E7A0063A749 /* DOMStringList.h in Headers */ = {isa = PBXBuildFile; fileRef = C544274911A57E7A0063A749 /* DOMStringList.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    85138513                2D5036671BCDDDC400E20BB3 /* GestureEvents.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GestureEvents.cpp; sourceTree = "<group>"; };
    85148514                2D5646AF1B8F8493003C4994 /* DictionaryPopupInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DictionaryPopupInfo.h; sourceTree = "<group>"; };
    8515                 2D58D8531A15F65F00A5F726 /* DataDetection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DataDetection.h; sourceTree = "<group>"; };
    8516                 2D58D8541A15F65F00A5F726 /* DataDetection.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DataDetection.mm; sourceTree = "<group>"; };
    85178515                2D59F1BE1A0044C6001F3D29 /* DataDetectorsSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DataDetectorsSPI.h; sourceTree = "<group>"; };
    85188516                2D5BC42516F882BE007048D0 /* SecurityPolicyViolationEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SecurityPolicyViolationEvent.h; sourceTree = "<group>"; };
     
    1371213710                C5137CF011A58378004ADB99 /* JSDOMStringList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMStringList.cpp; sourceTree = "<group>"; };
    1371313711                C5137CF111A58378004ADB99 /* JSDOMStringList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMStringList.h; sourceTree = "<group>"; };
     13712                C5227DEF1C3C6DD700F5ED54 /* DataDetection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DataDetection.h; sourceTree = "<group>"; };
     13713                C5227DF01C3C6DD700F5ED54 /* DataDetection.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DataDetection.mm; sourceTree = "<group>"; };
    1371413714                C5278B0B17F212EA003A2998 /* PlatformPasteboardIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PlatformPasteboardIOS.mm; sourceTree = "<group>"; };
    1371513715                C544274911A57E7A0063A749 /* DOMStringList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMStringList.h; sourceTree = "<group>"; };
     
    1788217882                        isa = PBXGroup;
    1788317883                        children = (
     17884                                C5227DEF1C3C6DD700F5ED54 /* DataDetection.h */,
     17885                                C5227DF01C3C6DD700F5ED54 /* DataDetection.mm */,
    1788417886                                9B55EEEA1B3F3FEF005342BC /* EditorCocoa.h */,
    1788517887                                9B55EEE81B3E8898005342BC /* EditorCocoa.mm */,
     
    2318623188                                CE7B2DAF1586ABAD0098B3FA /* AlternativeTextUIController.h */,
    2318723189                                CE7B2DB01586ABAD0098B3FA /* AlternativeTextUIController.mm */,
    23188                                 2D58D8531A15F65F00A5F726 /* DataDetection.h */,
    23189                                 2D58D8541A15F65F00A5F726 /* DataDetection.mm */,
    2319023190                                937FF3D41A1012D6008EBA31 /* DictionaryLookup.h */,
    2319123191                                937FF3D61A10131B008EBA31 /* DictionaryLookup.mm */,
     
    2506325063                                97BC6A321505F081001B74AC /* DatabaseTracker.h in Headers */,
    2506425064                                BE23480D18A9871400E4B6E8 /* DataCue.h in Headers */,
    25065                                 2D58D8551A15F65F00A5F726 /* DataDetection.h in Headers */,
    2506625065                                935E2B4E1AFF06CA00976F9F /* DataDetectorsCoreSPI.h in Headers */,
    2506725066                                2D59F1BF1A0044C6001F3D29 /* DataDetectorsSPI.h in Headers */,
     
    2603526034                                B27535760B053814002CE64F /* IntSizeHash.h in Headers */,
    2603626035                                CE12524D1A1A77DE00864480 /* IOPMLibSPI.h in Headers */,
     26036                                C5227DF11C3C6DF100F5ED54 /* DataDetection.h in Headers */,
    2603726037                                44DEF6431A6FF92700D45EEC /* IOReturnSPI.h in Headers */,
    2603826038                                2D0B4AAB18DA1CCD00434DE1 /* IOSurface.h in Headers */,
     
    2874128741                                580371611A66F00A00BAF519 /* ClipRect.cpp in Sources */,
    2874228742                                CDEA76351460B71A008B31F1 /* Clock.cpp in Sources */,
     28743                                C5227DF21C3C6DF900F5ED54 /* DataDetection.mm in Sources */,
    2874328744                                CDEA76341460B56F008B31F1 /* ClockGeneric.cpp in Sources */,
    2874428745                                9BD8A95A18BEFC7600987E9A /* CollectionIndexCache.cpp in Sources */,
     
    2891928920                                97BC6A311505F081001B74AC /* DatabaseTracker.cpp in Sources */,
    2892028921                                BE23480C18A9870B00E4B6E8 /* DataCue.cpp in Sources */,
    28921                                 2D58D8561A15F65F00A5F726 /* DataDetection.mm in Sources */,
    2892228922                                BC64641D11D7F416006455B0 /* DatasetDOMStringMap.cpp in Sources */,
    2892328923                                A784941B0B5FE507001E237A /* DataTransfer.cpp in Sources */,
  • trunk/Source/WebCore/editing/cocoa/DataDetection.h

    r194591 r195300  
    2727#define DataDetection_h
    2828
    29 #if PLATFORM(MAC)
    30 
    3129#import <wtf/RefPtr.h>
    3230#import <wtf/RetainPtr.h>
     
    4038class Range;
    4139
     40enum DataDetectorTypes {
     41    DataDetectorTypeNone = 0,
     42    DataDetectorTypePhoneNumber = 1 << 0,
     43    DataDetectorTypeLink = 1 << 1,
     44    DataDetectorTypeAddress = 1 << 2,
     45    DataDetectorTypeCalendarEvent = 1 << 3,
     46    DataDetectorTypeAll = ULONG_MAX
     47};
     48
    4249class DataDetection {
    4350public:
     51#if PLATFORM(MAC)
    4452    WEBCORE_EXPORT static RetainPtr<DDActionContext> detectItemAroundHitTestResult(const HitTestResult&, FloatRect& detectedDataBoundingBox, RefPtr<Range>& detectedDataRange);
     53#endif
     54    WEBCORE_EXPORT static void detectContentInRange(RefPtr<Range>& contextRange, DataDetectorTypes);
    4555};
    4656
    4757} // namespace WebCore
    4858
    49 #endif // PLATFORM(MAC)
    50 
    5159#endif // DataDetection_h
  • trunk/Source/WebCore/editing/cocoa/DataDetection.mm

    r194591 r195300  
    2727#import "DataDetection.h"
    2828
    29 #if PLATFORM(MAC)
    30 
     29#import "Attr.h"
     30#import "CSSStyleDeclaration.h"
    3131#import "DataDetectorsSPI.h"
    3232#import "FrameView.h"
     33#import "HTMLAnchorElement.h"
    3334#import "HTMLTextFormControlElement.h"
    3435#import "HitTestResult.h"
    3536#import "Node.h"
     37#import "NodeList.h"
     38#import "NodeTraversal.h"
    3639#import "Range.h"
    3740#import "RenderObject.h"
     41#import "Text.h"
    3842#import "TextIterator.h"
    3943#import "VisiblePosition.h"
     
    4246
    4347namespace WebCore {
     48
     49#if PLATFORM(MAC)
    4450
    4551static RetainPtr<DDActionContext> detectItemAtPositionWithRange(VisiblePosition position, RefPtr<Range> contextRange, FloatRect& detectedDataBoundingBox, RefPtr<Range>& detectedDataRange)
     
    132138    return detectItemAtPositionWithRange(position, contextRange, detectedDataBoundingBox, detectedDataRange);
    133139}
     140#endif // PLATFORM(MAC)
     141
     142void DataDetection::detectContentInRange(RefPtr<Range>&, DataDetectorTypes)
     143{
     144}
    134145
    135146} // namespace WebCore
    136 
    137 #endif // PLATFORM(MAC)
  • trunk/Source/WebCore/loader/FrameLoader.cpp

    r194888 r195300  
    126126#endif
    127127
     128#if ENABLE(DATA_DETECTION)
     129#include "DataDetection.h"
     130#endif
     131
    128132#if PLATFORM(IOS)
    129133#include "DocumentType.h"
     
    22782282                m_client.dispatchDidFinishLoad();
    22792283                loadingEvent = AXObjectCache::AXLoadingFinished;
     2284#if ENABLE(DATA_DETECTION)
     2285                if (m_frame.settings().dataDetectorTypes() != DataDetectorTypeNone) {
     2286                    RefPtr<Range> documentRange = makeRange(firstPositionInNode(m_frame.document()->documentElement()), lastPositionInNode(m_frame.document()->documentElement()));
     2287                    DataDetection::detectContentInRange(documentRange, m_frame.settings().dataDetectorTypes());
     2288                }
     2289#endif
    22802290            }
    22812291
  • trunk/Source/WebCore/page/Settings.h

    r194000 r195300  
    4343#include <wtf/text/AtomicStringHash.h>
    4444
     45#if ENABLE(DATA_DETECTION)
     46#include "DataDetection.h"
     47#endif
     48
    4549namespace WebCore {
    4650
  • trunk/Source/WebCore/page/Settings.in

    r194683 r195300  
    229229
    230230useImageDocumentForSubframePDF initial=false
     231dataDetectorTypes type=DataDetectorTypes, initial=DataDetectorTypeNone, conditional=DATA_DETECTION
    231232
    232233# Allow SourceBuffers to store up to 304MB each, enough for approximately five minutes
  • trunk/Source/WebCore/platform/spi/mac/DataDetectorsSPI.h

    r190102 r195300  
    2626#import <wtf/Platform.h>
    2727
    28 #if PLATFORM(MAC)
    2928
    3029#import <WebCore/DataDetectorsCoreSPI.h>
    3130#import <WebCore/SoftLinking.h>
     31
     32#if PLATFORM(MAC)
    3233
    3334#if USE(APPLE_INTERNAL_SDK)
  • trunk/Source/WebKit/mac/ChangeLog

    r195180 r195300  
     12016-01-19  Enrica Casucci  <enrica@apple.com>
     2
     3        Add support for DataDetectors in WK (iOS).
     4        https://bugs.webkit.org/show_bug.cgi?id=152989
     5        rdar://problem/22855960
     6
     7        Reviewed by Tim Horton.
     8
     9        Adding feature definition for data detection.
     10
     11        * Configurations/FeatureDefines.xcconfig:
     12
    1132016-01-16  Myles C. Maxfield  <mmaxfield@apple.com>
    214
  • trunk/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig

    r194921 r195300  
    112112
    113113ENABLE_IOS_TEXT_AUTOSIZING[sdk=iphone*] = ENABLE_IOS_TEXT_AUTOSIZING;
     114ENABLE_DATA_DETECTION = ENABLE_DATA_DETECTION;
    114115
    115116ENABLE_IOS_TOUCH_EVENTS[sdk=iphone*] = $(ENABLE_IOS_TOUCH_EVENTS_ios_WITH_INTERNAL_SDK_$(USE_INTERNAL_SDK));
  • trunk/Source/WebKit2/ChangeLog

    r195295 r195300  
     12016-01-19  Enrica Casucci  <enrica@apple.com>
     2
     3        Add support for DataDetectors in WK (iOS).
     4        https://bugs.webkit.org/show_bug.cgi?id=152989
     5        rdar://problem/22855960
     6
     7        Reviewed by Tim Horton.
     8
     9        This is the first step toward implementing Data Detectors support
     10        in WK2. The patch adds a new property to the configuration
     11        object to indicate the type of detection desired and propagates
     12        to the WebProcess.
     13
     14        * Configurations/FeatureDefines.xcconfig:
     15        * Shared/WebPreferencesDefinitions.h:
     16        * UIProcess/API/Cocoa/WKWebView.mm:
     17        (-[WKWebView initWithFrame:configuration:]):
     18        * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
     19        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
     20        (-[WKWebViewConfiguration copyWithZone:]):
     21        * WebKit2.xcodeproj/project.pbxproj:
     22        * WebProcess/WebPage/Cocoa/WebPageCocoa.mm: Added.
     23        (WebKit::WebPage::fromWKDataDetectorTypes):
     24        * WebProcess/WebPage/WebPage.cpp:
     25        (WebKit::WebPage::updatePreferences):
     26        * WebProcess/WebPage/WebPage.h:
     27
    1282016-01-19  Commit Queue  <commit-queue@webkit.org>
    229
  • trunk/Source/WebKit2/Configurations/FeatureDefines.xcconfig

    r194921 r195300  
    112112
    113113ENABLE_IOS_TEXT_AUTOSIZING[sdk=iphone*] = ENABLE_IOS_TEXT_AUTOSIZING;
     114ENABLE_DATA_DETECTION = ENABLE_DATA_DETECTION;
    114115
    115116ENABLE_IOS_TOUCH_EVENTS[sdk=iphone*] = $(ENABLE_IOS_TOUCH_EVENTS_ios_WITH_INTERNAL_SDK_$(USE_INTERNAL_SDK));
  • trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h

    r194683 r195300  
    240240    macro(StorageBlockingPolicy, storageBlockingPolicy, UInt32, uint32_t, WebCore::SecurityOrigin::BlockThirdPartyStorage) \
    241241    macro(JavaScriptRuntimeFlags, javaScriptRuntimeFlags, UInt32, uint32_t, 0) \
     242    macro(DataDetectorTypes, dataDetectorTypes, UInt32, uint32_t, 0) \
    242243    \
    243244
  • trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm

    r194750 r195300  
    383383    pageConfiguration->preferenceValues().set(WebKit::WebPreferencesKey::invisibleAutoplayNotPermittedKey(), WebKit::WebPreferencesStore::Value(!![_configuration _invisibleAutoplayNotPermitted]));
    384384    pageConfiguration->preferenceValues().set(WebKit::WebPreferencesKey::mediaDataLoadsAutomaticallyKey(), WebKit::WebPreferencesStore::Value(!![_configuration _mediaDataLoadsAutomatically]));
     385#endif
     386#if ENABLE(DATA_DETECTION)
     387    pageConfiguration->preferenceValues().set(WebKit::WebPreferencesKey::dataDetectorTypesKey(), WebKit::WebPreferencesStore::Value(static_cast<uint32_t>([_configuration dataDetectorTypes])));
    385388#endif
    386389#if ENABLE(WIRELESS_PLAYBACK_TARGET)
  • trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.h

    r191228 r195300  
    5252#endif
    5353
     54/*! @enum WKDataDetectorTypes
     55 @abstract The type of detection desired.
     56 @constant WKDataDetectorTypeNone No detection is performed.
     57 @constant WKDataDetectorTypePhoneNumber Phone numbers are detected and turned into links.
     58 @constant WKDataDetectorTypeLink URLs in text are detected and turned into links.
     59 @constant WKDataDetectorTypeAddress Addresses are detected and turned into links.
     60 @constant WKDataDetectorTypeCalendarEvent Dates and times that are in the future are detected and turned into links.
     61 @constant WKDataDetectorTypeAll All of the above data types are turned into links when detected. Choosing this value will
     62 automatically include any new detection type that is added.
     63 */
     64typedef NS_OPTIONS(NSUInteger, WKDataDetectorTypes) {
     65    WKDataDetectorTypeNone = 0,
     66    WKDataDetectorTypePhoneNumber = 1 << 0,
     67    WKDataDetectorTypeLink = 1 << 1,
     68    WKDataDetectorTypeAddress = 1 << 2,
     69    WKDataDetectorTypeCalendarEvent = 1 << 3,
     70    WKDataDetectorTypeAll = NSUIntegerMax
     71} WK_ENUM_AVAILABLE(WK_MAC_TBA, WK_IOS_TBA);
     72
    5473/*! A WKWebViewConfiguration object is a collection of properties with
    5574 which to initialize a web view.
     
    93112 */
    94113@property (nonatomic) BOOL allowsAirPlayForMediaPlayback WK_AVAILABLE(10_11, 9_0);
     114
     115/*! @abstract An enum value indicating the type of data detection desired.
     116 @discussion The default value is WKDataDetectorTypeNone.
     117 An example of how this property may affect the content loaded in the WKWebView is that content like
     118 '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'
     119 if the dataDetectorTypes property is set to WKDataDetectorTypePhoneNumber | WKDataDetectorTypeLink | WKDataDetectorTypeCalendarEvent.
     120
     121 */
     122@property (nonatomic) WKDataDetectorTypes dataDetectorTypes WK_AVAILABLE(WK_MAC_TBA, WK_IOS_TBA);
    95123
    96124#if TARGET_OS_IPHONE
  • trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.mm

    r194496 r195300  
    199199    configuration->_imageControlsEnabled = self->_imageControlsEnabled;
    200200#endif
     201#if ENABLE(DATA_DETECTION)
     202    configuration->_dataDetectorTypes = self->_dataDetectorTypes;
     203#endif
    201204#if ENABLE(WIRELESS_TARGET_PLAYBACK)
    202205    configuration->_allowsAirPlayForMediaPlayback = self->_allowsAirPlayForMediaPlayback;
  • trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj

    r194902 r195300  
    16901690                C54256B918BEC18C00DE4179 /* WKFormPopover.mm in Sources */ = {isa = PBXBuildFile; fileRef = C54256B318BEC18B00DE4179 /* WKFormPopover.mm */; };
    16911691                C54256BA18BEC18C00DE4179 /* WKFormSelectControl.h in Headers */ = {isa = PBXBuildFile; fileRef = C54256B418BEC18C00DE4179 /* WKFormSelectControl.h */; };
     1692                C554A3131C49C36400A388FE /* WebPageCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = C554A3111C49BCCB00A388FE /* WebPageCocoa.mm */; };
    16921693                C55CB5B718C269CF00CA81E1 /* WKFormSelectPopover.mm in Sources */ = {isa = PBXBuildFile; fileRef = C57193BA18C149D0002D0F12 /* WKFormSelectPopover.mm */; };
    16931694                C55CB5B818C2A5D600CA81E1 /* WKFormSelectPicker.mm in Sources */ = {isa = PBXBuildFile; fileRef = C57193B918C149D0002D0F12 /* WKFormSelectPicker.mm */; };
     
    39333934                C54256B318BEC18B00DE4179 /* WKFormPopover.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WKFormPopover.mm; path = ios/forms/WKFormPopover.mm; sourceTree = "<group>"; };
    39343935                C54256B418BEC18C00DE4179 /* WKFormSelectControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WKFormSelectControl.h; path = ios/forms/WKFormSelectControl.h; sourceTree = "<group>"; };
     3936                C554A3111C49BCCB00A388FE /* WebPageCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebPageCocoa.mm; sourceTree = "<group>"; };
    39353937                C554FFA212E4E8EA002F22C0 /* WebDragClientMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebDragClientMac.mm; sourceTree = "<group>"; };
    39363938                C57193B918C149D0002D0F12 /* WKFormSelectPicker.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WKFormSelectPicker.mm; path = ios/forms/WKFormSelectPicker.mm; sourceTree = "<group>"; };
     
    50895091                                2D29ECCE192F2C2E00984B78 /* RemoteLayerTreeDisplayRefreshMonitor.h */,
    50905092                                2D29ECCF192F2C2E00984B78 /* RemoteLayerTreeDisplayRefreshMonitor.mm */,
     5093                                C554A3111C49BCCB00A388FE /* WebPageCocoa.mm */,
    50915094                        );
    50925095                        path = Cocoa;
     
    93939396                                C5E1AFEC16B21012006CC1F2 /* APIWebArchive.mm in Sources */,
    93949397                                C5E1AFEE16B21025006CC1F2 /* APIWebArchiveResource.mm in Sources */,
     9398                                C554A3131C49C36400A388FE /* WebPageCocoa.mm in Sources */,
    93959399                                1A4832C71A9BC13C008B4DFE /* APIWebsiteDataRecord.cpp in Sources */,
    93969400                                1A3635A91A3144A300ED6197 /* APIWebsiteDataStore.cpp in Sources */,
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp

    r194683 r195300  
    220220#endif
    221221
     222#if ENABLE(DATA_DETECTION)
     223#include <WebCore/DataDetection.h>
     224#endif
     225
    222226#if ENABLE(VIDEO) && USE(GSTREAMER)
    223227#include <WebCore/MediaPlayerRequestInstallMissingPluginsCallback.h>
     
    29362940#endif
    29372941
     2942#if ENABLE(DATA_DETECTION)
     2943    settings.setDataDetectorTypes(fromWKDataDetectorTypes(store.getUInt32ValueForKey(WebPreferencesKey::dataDetectorTypesKey())));
     2944#endif
    29382945#if ENABLE(GAMEPAD)
    29392946    RuntimeEnabledFeatures::sharedFeatures().setGamepadsEnabled(store.getBoolValueForKey(WebPreferencesKey::gamepadsEnabledKey()));
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h

    r195078 r195300  
    9292#endif
    9393
     94#if ENABLE(DATA_DETECTION)
     95#include <WebCore/DataDetection.h>
     96#endif
     97
    9498#if ENABLE(IOS_TOUCH_EVENTS)
    9599#include <WebKitAdditions/PlatformTouchEventIOS.h>
     
    10631067    void drawPagesToPDFFromPDFDocument(CGContextRef, PDFDocument *, const PrintInfo&, uint32_t first, uint32_t count);
    10641068#endif
     1069#if ENABLE(DATA_DETECTION)
     1070    WebCore::DataDetectorTypes fromWKDataDetectorTypes(uint32_t types);
     1071#endif
    10651072
    10661073    void setMainFrameIsScrollable(bool);
Note: See TracChangeset for help on using the changeset viewer.