<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[195317] trunk/Source</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/195317">195317</a></dd>
<dt>Author</dt> <dd>enrica@apple.com</dd>
<dt>Date</dt> <dd>2016-01-19 14:58:59 -0800 (Tue, 19 Jan 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>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 for data detection.
* 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:
(fromWKDataDetectorTypes):
(-[WKWebView initWithFrame:configuration:]):
* UIProcess/API/Cocoa/WKWebViewConfiguration.h:
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration copyWithZone:]):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
Source/WTF:
Adding feature definition for data detection.
* wtf/FeatureDefines.h:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreConfigurationsFeatureDefinesxcconfig">trunk/Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig</a></li>
<li><a href="#trunkSourceWTFChangeLog">trunk/Source/WTF/ChangeLog</a></li>
<li><a href="#trunkSourceWTFwtfFeatureDefinesh">trunk/Source/WTF/wtf/FeatureDefines.h</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreConfigurationsFeatureDefinesxcconfig">trunk/Source/WebCore/Configurations/FeatureDefines.xcconfig</a></li>
<li><a href="#trunkSourceWebCoreConfigurationsWebCorexcconfig">trunk/Source/WebCore/Configurations/WebCore.xcconfig</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoreloaderFrameLoadercpp">trunk/Source/WebCore/loader/FrameLoader.cpp</a></li>
<li><a href="#trunkSourceWebCorepageSettingsh">trunk/Source/WebCore/page/Settings.h</a></li>
<li><a href="#trunkSourceWebCorepageSettingsin">trunk/Source/WebCore/page/Settings.in</a></li>
<li><a href="#trunkSourceWebCoreplatformspimacDataDetectorsSPIh">trunk/Source/WebCore/platform/spi/mac/DataDetectorsSPI.h</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacConfigurationsFeatureDefinesxcconfig">trunk/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2ConfigurationsFeatureDefinesxcconfig">trunk/Source/WebKit2/Configurations/FeatureDefines.xcconfig</a></li>
<li><a href="#trunkSourceWebKit2SharedWebPreferencesDefinitionsh">trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKWebViewmm">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKWebViewConfigurationh">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKWebViewConfigurationmm">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPagecpp">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreeditingcocoaDataDetectionh">trunk/Source/WebCore/editing/cocoa/DataDetection.h</a></li>
<li><a href="#trunkSourceWebCoreeditingcocoaDataDetectionmm">trunk/Source/WebCore/editing/cocoa/DataDetection.mm</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreeditingmacDataDetectionh">trunk/Source/WebCore/editing/mac/DataDetection.h</a></li>
<li><a href="#trunkSourceWebCoreeditingmacDataDetectionmm">trunk/Source/WebCore/editing/mac/DataDetection.mm</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (195316 => 195317)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2016-01-19 22:37:02 UTC (rev 195316)
+++ trunk/Source/JavaScriptCore/ChangeLog        2016-01-19 22:58:59 UTC (rev 195317)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2016-01-19 Enrica Casucci <enrica@apple.com>
+
+ Add support for DataDetectors in WK (iOS).
+ https://bugs.webkit.org/show_bug.cgi?id=152989
+ rdar://problem/22855960
+
+ Reviewed by Tim Horton.
+
+ Adding feature definition for data detection.
+
+ * Configurations/FeatureDefines.xcconfig:
+
</ins><span class="cx"> 2016-01-19 Per Arne Vollan <peavo@outlook.com>
</span><span class="cx">
</span><span class="cx"> [B3][Win64] Compile and warning fixes.
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreConfigurationsFeatureDefinesxcconfig"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig (195316 => 195317)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig        2016-01-19 22:37:02 UTC (rev 195316)
+++ trunk/Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig        2016-01-19 22:58:59 UTC (rev 195317)
</span><span class="lines">@@ -111,6 +111,7 @@
</span><span class="cx"> ENABLE_MAC_GESTURE_EVENTS_macosx_WITH_INTERNAL_SDK_YES = ENABLE_MAC_GESTURE_EVENTS;
</span><span class="cx">
</span><span class="cx"> ENABLE_IOS_TEXT_AUTOSIZING[sdk=iphone*] = ENABLE_IOS_TEXT_AUTOSIZING;
</span><ins>+ENABLE_DATA_DETECTION = ENABLE_DATA_DETECTION;
</ins><span class="cx">
</span><span class="cx"> ENABLE_IOS_TOUCH_EVENTS[sdk=iphone*] = $(ENABLE_IOS_TOUCH_EVENTS_ios_WITH_INTERNAL_SDK_$(USE_INTERNAL_SDK));
</span><span class="cx"> ENABLE_IOS_TOUCH_EVENTS_ios_WITH_INTERNAL_SDK_YES = ENABLE_IOS_TOUCH_EVENTS;
</span></span></pre></div>
<a id="trunkSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/ChangeLog (195316 => 195317)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/ChangeLog        2016-01-19 22:37:02 UTC (rev 195316)
+++ trunk/Source/WTF/ChangeLog        2016-01-19 22:58:59 UTC (rev 195317)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2016-01-19 Enrica Casucci <enrica@apple.com>
+
+ Add support for DataDetectors in WK (iOS).
+ https://bugs.webkit.org/show_bug.cgi?id=152989
+ rdar://problem/22855960
+
+ Reviewed by Tim Horton.
+
+ Adding feature definition for data detection.
+
+ * wtf/FeatureDefines.h:
+
</ins><span class="cx"> 2016-01-19 Commit Queue <commit-queue@webkit.org>
</span><span class="cx">
</span><span class="cx"> Unreviewed, rolling out r195300.
</span></span></pre></div>
<a id="trunkSourceWTFwtfFeatureDefinesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/FeatureDefines.h (195316 => 195317)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/FeatureDefines.h        2016-01-19 22:37:02 UTC (rev 195316)
+++ trunk/Source/WTF/wtf/FeatureDefines.h        2016-01-19 22:58:59 UTC (rev 195317)
</span><span class="lines">@@ -272,6 +272,14 @@
</span><span class="cx">
</span><span class="cx"> #endif /* PLATFORM(MAC) */
</span><span class="cx">
</span><ins>+#if PLATFORM(COCOA)
+
+#if !defined(ENABLE_DATA_DETECTION)
+#define ENABLE_DATA_DETECTION 1
+#endif
+
+#endif /* PLATFORM(COCOA) */
+
</ins><span class="cx"> /* --------- Apple Windows port --------- */
</span><span class="cx"> #if PLATFORM(WIN) && !PLATFORM(WIN_CAIRO)
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (195316 => 195317)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-01-19 22:37:02 UTC (rev 195316)
+++ trunk/Source/WebCore/ChangeLog        2016-01-19 22:58:59 UTC (rev 195317)
</span><span class="lines">@@ -1,3 +1,32 @@
</span><ins>+2016-01-19 Enrica Casucci <enrica@apple.com>
+
+ Add support for DataDetectors in WK (iOS).
+ https://bugs.webkit.org/show_bug.cgi?id=152989
+ rdar://problem/22855960
+
+ Reviewed by Tim Horton.
+
+ 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:
+
</ins><span class="cx"> 2016-01-19 Nikos Andronikos <nikos.andronikos-webkit@cisra.canon.com.au>
</span><span class="cx">
</span><span class="cx"> SVG 2 requires a mechanism for restricting enum values exposed through the DOM
</span><span class="lines">@@ -99,6 +128,7 @@
</span><span class="cx"> (WebCore::matchesFutureCuePseudoClass):
</span><span class="cx"> (WebCore::matchesPastCuePseudoClass):
</span><span class="cx">
</span><ins>+>>>>>>> .r195316
</ins><span class="cx"> 2016-01-19 Chris Dumez <cdumez@apple.com>
</span><span class="cx">
</span><span class="cx"> Unreviewed, rolling out r195179.
</span></span></pre></div>
<a id="trunkSourceWebCoreConfigurationsFeatureDefinesxcconfig"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Configurations/FeatureDefines.xcconfig (195316 => 195317)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Configurations/FeatureDefines.xcconfig        2016-01-19 22:37:02 UTC (rev 195316)
+++ trunk/Source/WebCore/Configurations/FeatureDefines.xcconfig        2016-01-19 22:58:59 UTC (rev 195317)
</span><span class="lines">@@ -111,6 +111,7 @@
</span><span class="cx"> ENABLE_MAC_GESTURE_EVENTS_macosx_WITH_INTERNAL_SDK_YES = ENABLE_MAC_GESTURE_EVENTS;
</span><span class="cx">
</span><span class="cx"> ENABLE_IOS_TEXT_AUTOSIZING[sdk=iphone*] = ENABLE_IOS_TEXT_AUTOSIZING;
</span><ins>+ENABLE_DATA_DETECTION = ENABLE_DATA_DETECTION;
</ins><span class="cx">
</span><span class="cx"> ENABLE_IOS_TOUCH_EVENTS[sdk=iphone*] = $(ENABLE_IOS_TOUCH_EVENTS_ios_WITH_INTERNAL_SDK_$(USE_INTERNAL_SDK));
</span><span class="cx"> ENABLE_IOS_TOUCH_EVENTS_ios_WITH_INTERNAL_SDK_YES = ENABLE_IOS_TOUCH_EVENTS;
</span></span></pre></div>
<a id="trunkSourceWebCoreConfigurationsWebCorexcconfig"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Configurations/WebCore.xcconfig (195316 => 195317)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Configurations/WebCore.xcconfig        2016-01-19 22:37:02 UTC (rev 195316)
+++ trunk/Source/WebCore/Configurations/WebCore.xcconfig        2016-01-19 22:58:59 UTC (rev 195317)
</span><span class="lines">@@ -50,7 +50,7 @@
</span><span class="cx"> UNEXPORTED_SYMBOLS_FILE = Configurations/WebCore.unexp;
</span><span class="cx"> OTHER_LDFLAGS = $(inherited) $(OTHER_LDFLAGS_PLATFORM);
</span><span class="cx"> OTHER_LDFLAGS_BASE = -lsqlite3 -lobjc -lANGLE;
</span><del>-OTHER_LDFLAGS_BASE_ios = $(OTHER_LDFLAGS_BASE) -framework CFNetwork -framework CoreGraphics -framework CoreText -framework Foundation -framework GraphicsServices -framework ImageIO -framework OpenGLES -lMobileGestalt;
</del><ins>+OTHER_LDFLAGS_BASE_ios = $(OTHER_LDFLAGS_BASE) -framework CFNetwork -framework CoreGraphics -framework CoreText -framework Foundation -framework GraphicsServices -framework ImageIO -framework OpenGLES -lMobileGestalt -framework DataDetectorsCore;
</ins><span class="cx"> OTHER_LDFLAGS_PLATFORM[sdk=iphoneos*] = $(OTHER_LDFLAGS_BASE_ios) -framework IOSurface;
</span><span class="cx"> OTHER_LDFLAGS_PLATFORM[sdk=iphonesimulator*] = $(OTHER_LDFLAGS_BASE_ios);
</span><span class="cx"> OTHER_LDFLAGS_PLATFORM[sdk=macosx*] = $(OTHER_LDFLAGS_BASE) -sub_library libobjc -umbrella WebKit -allowable_client WebCoreTestSupport -allowable_client WebKit2 -allowable_client WebKitLegacy -framework ApplicationServices -framework AudioUnit -framework Carbon -framework Cocoa -framework DataDetectorsCore -framework IOSurface -framework OpenGL;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (195316 => 195317)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-01-19 22:37:02 UTC (rev 195316)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-01-19 22:58:59 UTC (rev 195317)
</span><span class="lines">@@ -1137,8 +1137,6 @@
</span><span class="cx">                 2D5002FC1B56D7990020AAF7 /* PathUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D5002FA1B56D7990020AAF7 /* PathUtilities.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 2D5036681BCDDDC400E20BB3 /* GestureEvents.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D5036671BCDDDC400E20BB3 /* GestureEvents.cpp */; };
</span><span class="cx">                 2D5646B01B8F8493003C4994 /* DictionaryPopupInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D5646AF1B8F8493003C4994 /* DictionaryPopupInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><del>-                2D58D8551A15F65F00A5F726 /* DataDetection.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D58D8531A15F65F00A5F726 /* DataDetection.h */; settings = {ATTRIBUTES = (Private, ); }; };
-                2D58D8561A15F65F00A5F726 /* DataDetection.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D58D8541A15F65F00A5F726 /* DataDetection.mm */; };
</del><span class="cx">                 2D59F1BF1A0044C6001F3D29 /* DataDetectorsSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D59F1BE1A0044C6001F3D29 /* DataDetectorsSPI.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 2D5A592F152525230036EE51 /* ImageOrientation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8748D7412CC3F89001FBA41 /* ImageOrientation.cpp */; };
</span><span class="cx">                 2D5A5931152525D00036EE51 /* ImageOrientation.h in Headers */ = {isa = PBXBuildFile; fileRef = A8748D6612CC3763001FBA41 /* ImageOrientation.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -5882,6 +5880,8 @@
</span><span class="cx">                 C50D0E830FF4272900AC2644 /* StorageNamespace.h in Headers */ = {isa = PBXBuildFile; fileRef = C50D0E810FF4272900AC2644 /* StorageNamespace.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 C5137CF211A58378004ADB99 /* JSDOMStringList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C5137CF011A58378004ADB99 /* JSDOMStringList.cpp */; };
</span><span class="cx">                 C5137CF311A58378004ADB99 /* JSDOMStringList.h in Headers */ = {isa = PBXBuildFile; fileRef = C5137CF111A58378004ADB99 /* JSDOMStringList.h */; };
</span><ins>+                C5227DF11C3C6DF100F5ED54 /* DataDetection.h in Headers */ = {isa = PBXBuildFile; fileRef = C5227DEF1C3C6DD700F5ED54 /* DataDetection.h */; settings = {ATTRIBUTES = (Private, ); }; };
+                C5227DF21C3C6DF900F5ED54 /* DataDetection.mm in Sources */ = {isa = PBXBuildFile; fileRef = C5227DF01C3C6DD700F5ED54 /* DataDetection.mm */; };
</ins><span class="cx">                 C5278B0C17F212EA003A2998 /* PlatformPasteboardIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = C5278B0B17F212EA003A2998 /* PlatformPasteboardIOS.mm */; };
</span><span class="cx">                 C544274B11A57E7A0063A749 /* DOMStringList.h in Headers */ = {isa = PBXBuildFile; fileRef = C544274911A57E7A0063A749 /* DOMStringList.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 C55610F111A704EB00B82D27 /* DOMStringList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C55610F011A704EB00B82D27 /* DOMStringList.cpp */; };
</span><span class="lines">@@ -8514,8 +8514,6 @@
</span><span class="cx">                 2D5002FA1B56D7990020AAF7 /* PathUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PathUtilities.h; sourceTree = "<group>"; };
</span><span class="cx">                 2D5036671BCDDDC400E20BB3 /* GestureEvents.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GestureEvents.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 2D5646AF1B8F8493003C4994 /* DictionaryPopupInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DictionaryPopupInfo.h; sourceTree = "<group>"; };
</span><del>-                2D58D8531A15F65F00A5F726 /* DataDetection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DataDetection.h; sourceTree = "<group>"; };
-                2D58D8541A15F65F00A5F726 /* DataDetection.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DataDetection.mm; sourceTree = "<group>"; };
</del><span class="cx">                 2D59F1BE1A0044C6001F3D29 /* DataDetectorsSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DataDetectorsSPI.h; sourceTree = "<group>"; };
</span><span class="cx">                 2D5BC42516F882BE007048D0 /* SecurityPolicyViolationEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SecurityPolicyViolationEvent.h; sourceTree = "<group>"; };
</span><span class="cx">                 2D5BC42616F882BE007048D0 /* SecurityPolicyViolationEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SecurityPolicyViolationEvent.idl; sourceTree = "<group>"; };
</span><span class="lines">@@ -13713,6 +13711,8 @@
</span><span class="cx">                 C50D0E810FF4272900AC2644 /* StorageNamespace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StorageNamespace.h; sourceTree = "<group>"; };
</span><span class="cx">                 C5137CF011A58378004ADB99 /* JSDOMStringList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMStringList.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 C5137CF111A58378004ADB99 /* JSDOMStringList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMStringList.h; sourceTree = "<group>"; };
</span><ins>+                C5227DEF1C3C6DD700F5ED54 /* DataDetection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DataDetection.h; sourceTree = "<group>"; };
+                C5227DF01C3C6DD700F5ED54 /* DataDetection.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DataDetection.mm; sourceTree = "<group>"; };
</ins><span class="cx">                 C5278B0B17F212EA003A2998 /* PlatformPasteboardIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PlatformPasteboardIOS.mm; sourceTree = "<group>"; };
</span><span class="cx">                 C544274911A57E7A0063A749 /* DOMStringList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMStringList.h; sourceTree = "<group>"; };
</span><span class="cx">                 C544274A11A57E7A0063A749 /* DOMStringList.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DOMStringList.idl; sourceTree = "<group>"; };
</span><span class="lines">@@ -17885,6 +17885,8 @@
</span><span class="cx">                 7C3E510718DF8F1200C112F7 /* cocoa */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                C5227DEF1C3C6DD700F5ED54 /* DataDetection.h */,
+                                C5227DF01C3C6DD700F5ED54 /* DataDetection.mm */,
</ins><span class="cx">                                 9B55EEEA1B3F3FEF005342BC /* EditorCocoa.h */,
</span><span class="cx">                                 9B55EEE81B3E8898005342BC /* EditorCocoa.mm */,
</span><span class="cx">                                 7C3E510818DF8F3500C112F7 /* HTMLConverter.h */,
</span><span class="lines">@@ -23191,8 +23193,6 @@
</span><span class="cx">                         children = (
</span><span class="cx">                                 CE7B2DAF1586ABAD0098B3FA /* AlternativeTextUIController.h */,
</span><span class="cx">                                 CE7B2DB01586ABAD0098B3FA /* AlternativeTextUIController.mm */,
</span><del>-                                2D58D8531A15F65F00A5F726 /* DataDetection.h */,
-                                2D58D8541A15F65F00A5F726 /* DataDetection.mm */,
</del><span class="cx">                                 937FF3D41A1012D6008EBA31 /* DictionaryLookup.h */,
</span><span class="cx">                                 937FF3D61A10131B008EBA31 /* DictionaryLookup.mm */,
</span><span class="cx">                                 ED501DC50B249F2900AE18D9 /* EditorMac.mm */,
</span><span class="lines">@@ -25068,7 +25068,6 @@
</span><span class="cx">                                 97BC6A301505F081001B74AC /* DatabaseThread.h in Headers */,
</span><span class="cx">                                 97BC6A321505F081001B74AC /* DatabaseTracker.h in Headers */,
</span><span class="cx">                                 BE23480D18A9871400E4B6E8 /* DataCue.h in Headers */,
</span><del>-                                2D58D8551A15F65F00A5F726 /* DataDetection.h in Headers */,
</del><span class="cx">                                 935E2B4E1AFF06CA00976F9F /* DataDetectorsCoreSPI.h in Headers */,
</span><span class="cx">                                 2D59F1BF1A0044C6001F3D29 /* DataDetectorsSPI.h in Headers */,
</span><span class="cx">                                 BC22746F0E83664500E7F975 /* DataRef.h in Headers */,
</span><span class="lines">@@ -26040,6 +26039,7 @@
</span><span class="cx">                                 B27535750B053814002CE64F /* IntSize.h in Headers */,
</span><span class="cx">                                 B27535760B053814002CE64F /* IntSizeHash.h in Headers */,
</span><span class="cx">                                 CE12524D1A1A77DE00864480 /* IOPMLibSPI.h in Headers */,
</span><ins>+                                C5227DF11C3C6DF100F5ED54 /* DataDetection.h in Headers */,
</ins><span class="cx">                                 44DEF6431A6FF92700D45EEC /* IOReturnSPI.h in Headers */,
</span><span class="cx">                                 2D0B4AAB18DA1CCD00434DE1 /* IOSurface.h in Headers */,
</span><span class="cx">                                 1C21E57D183ED1FF001C289D /* IOSurfacePool.h in Headers */,
</span><span class="lines">@@ -28747,6 +28747,7 @@
</span><span class="cx">                                 85031B3F0A44EFC700F992E0 /* ClipboardEvent.cpp in Sources */,
</span><span class="cx">                                 580371611A66F00A00BAF519 /* ClipRect.cpp in Sources */,
</span><span class="cx">                                 CDEA76351460B71A008B31F1 /* Clock.cpp in Sources */,
</span><ins>+                                C5227DF21C3C6DF900F5ED54 /* DataDetection.mm in Sources */,
</ins><span class="cx">                                 CDEA76341460B56F008B31F1 /* ClockGeneric.cpp in Sources */,
</span><span class="cx">                                 9BD8A95A18BEFC7600987E9A /* CollectionIndexCache.cpp in Sources */,
</span><span class="cx">                                 B27535660B053814002CE64F /* Color.cpp in Sources */,
</span><span class="lines">@@ -28926,7 +28927,6 @@
</span><span class="cx">                                 97BC6A2F1505F081001B74AC /* DatabaseThread.cpp in Sources */,
</span><span class="cx">                                 97BC6A311505F081001B74AC /* DatabaseTracker.cpp in Sources */,
</span><span class="cx">                                 BE23480C18A9870B00E4B6E8 /* DataCue.cpp in Sources */,
</span><del>-                                2D58D8561A15F65F00A5F726 /* DataDetection.mm in Sources */,
</del><span class="cx">                                 BC64641D11D7F416006455B0 /* DatasetDOMStringMap.cpp in Sources */,
</span><span class="cx">                                 A784941B0B5FE507001E237A /* DataTransfer.cpp in Sources */,
</span><span class="cx">                                 93F19AFF08245E59001E9ABC /* DataTransferMac.mm in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingcocoaDataDetectionhfromrev195310trunkSourceWebCoreeditingmacDataDetectionh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/editing/cocoa/DataDetection.h (from rev 195310, trunk/Source/WebCore/editing/mac/DataDetection.h) (0 => 195317)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/cocoa/DataDetection.h         (rev 0)
+++ trunk/Source/WebCore/editing/cocoa/DataDetection.h        2016-01-19 22:58:59 UTC (rev 195317)
</span><span class="lines">@@ -0,0 +1,61 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef DataDetection_h
+#define DataDetection_h
+
+#import <wtf/RefPtr.h>
+#import <wtf/RetainPtr.h>
+
+OBJC_CLASS DDActionContext;
+
+namespace WebCore {
+
+class FloatRect;
+class HitTestResult;
+class Range;
+
+enum DataDetectorTypes {
+ DataDetectorTypeNone = 0,
+ DataDetectorTypePhoneNumber = 1 << 0,
+ DataDetectorTypeLink = 1 << 1,
+ DataDetectorTypeAddress = 1 << 2,
+ DataDetectorTypeCalendarEvent = 1 << 3,
+ DataDetectorTypeTrackingNumber = 1 << 4, // Not individually selectable with the API
+ DataDetectorTypeFlight = 1 << 5, // Not individually selectable with the API
+ DataDetectorTypeAll = ULONG_MAX
+};
+
+class DataDetection {
+public:
+#if PLATFORM(MAC)
+ WEBCORE_EXPORT static RetainPtr<DDActionContext> detectItemAroundHitTestResult(const HitTestResult&, FloatRect& detectedDataBoundingBox, RefPtr<Range>& detectedDataRange);
+#endif
+ WEBCORE_EXPORT static void detectContentInRange(RefPtr<Range>& contextRange, DataDetectorTypes);
+};
+
+} // namespace WebCore
+
+#endif // DataDetection_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreeditingcocoaDataDetectionmmfromrev195310trunkSourceWebCoreeditingmacDataDetectionmm"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/editing/cocoa/DataDetection.mm (from rev 195310, trunk/Source/WebCore/editing/mac/DataDetection.mm) (0 => 195317)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/cocoa/DataDetection.mm         (rev 0)
+++ trunk/Source/WebCore/editing/cocoa/DataDetection.mm        2016-01-19 22:58:59 UTC (rev 195317)
</span><span class="lines">@@ -0,0 +1,146 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple, Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+#import "DataDetection.h"
+
+#import "Attr.h"
+#import "CSSStyleDeclaration.h"
+#import "DataDetectorsSPI.h"
+#import "FrameView.h"
+#import "HTMLAnchorElement.h"
+#import "HTMLTextFormControlElement.h"
+#import "HitTestResult.h"
+#import "Node.h"
+#import "NodeList.h"
+#import "NodeTraversal.h"
+#import "Range.h"
+#import "RenderObject.h"
+#import "Text.h"
+#import "TextIterator.h"
+#import "VisiblePosition.h"
+#import "VisibleUnits.h"
+#import "htmlediting.h"
+
+namespace WebCore {
+
+#if PLATFORM(MAC)
+
+static RetainPtr<DDActionContext> detectItemAtPositionWithRange(VisiblePosition position, RefPtr<Range> contextRange, FloatRect& detectedDataBoundingBox, RefPtr<Range>& detectedDataRange)
+{
+ String fullPlainTextString = plainText(contextRange.get());
+ int hitLocation = TextIterator::rangeLength(makeRange(contextRange->startPosition(), position).get());
+
+ RetainPtr<DDScannerRef> scanner = adoptCF(DDScannerCreate(DDScannerTypeStandard, 0, nullptr));
+ RetainPtr<DDScanQueryRef> scanQuery = adoptCF(DDScanQueryCreateFromString(kCFAllocatorDefault, fullPlainTextString.createCFString().get(), CFRangeMake(0, fullPlainTextString.length())));
+
+ if (!DDScannerScanQuery(scanner.get(), scanQuery.get()))
+ return nullptr;
+
+ RetainPtr<CFArrayRef> results = adoptCF(DDScannerCopyResultsWithOptions(scanner.get(), DDScannerCopyResultsOptionsNoOverlap));
+
+ // Find the DDResultRef that intersects the hitTestResult's VisiblePosition.
+ DDResultRef mainResult = nullptr;
+ RefPtr<Range> mainResultRange;
+ CFIndex resultCount = CFArrayGetCount(results.get());
+ for (CFIndex i = 0; i < resultCount; i++) {
+ DDResultRef result = (DDResultRef)CFArrayGetValueAtIndex(results.get(), i);
+ CFRange resultRangeInContext = DDResultGetRange(result);
+ if (hitLocation >= resultRangeInContext.location && (hitLocation - resultRangeInContext.location) < resultRangeInContext.length) {
+ mainResult = result;
+ mainResultRange = TextIterator::subrange(contextRange.get(), resultRangeInContext.location, resultRangeInContext.length);
+ break;
+ }
+ }
+
+ if (!mainResult)
+ return nullptr;
+
+ RetainPtr<DDActionContext> actionContext = adoptNS([allocDDActionContextInstance() init]);
+ [actionContext setAllResults:@[ (id)mainResult ]];
+ [actionContext setMainResult:mainResult];
+
+ Vector<FloatQuad> quads;
+ mainResultRange->absoluteTextQuads(quads);
+ detectedDataBoundingBox = FloatRect();
+ FrameView* frameView = mainResultRange->ownerDocument().view();
+ for (const auto& quad : quads)
+ detectedDataBoundingBox.unite(frameView->contentsToWindow(quad.enclosingBoundingBox()));
+
+ detectedDataRange = mainResultRange;
+
+ return actionContext;
+}
+
+RetainPtr<DDActionContext> DataDetection::detectItemAroundHitTestResult(const HitTestResult& hitTestResult, FloatRect& detectedDataBoundingBox, RefPtr<Range>& detectedDataRange)
+{
+ if (!DataDetectorsLibrary())
+ return nullptr;
+
+ Node* node = hitTestResult.innerNonSharedNode();
+ if (!node)
+ return nullptr;
+ auto renderer = node->renderer();
+ if (!renderer)
+ return nullptr;
+
+ VisiblePosition position;
+ RefPtr<Range> contextRange;
+
+ if (!is<HTMLTextFormControlElement>(*node)) {
+ position = renderer->positionForPoint(hitTestResult.localPoint(), nullptr);
+ if (position.isNull())
+ position = firstPositionInOrBeforeNode(node);
+
+ contextRange = rangeExpandedAroundPositionByCharacters(position, 250);
+ if (!contextRange)
+ return nullptr;
+ } else {
+ Frame* frame = node->document().frame();
+ if (!frame)
+ return nullptr;
+
+ IntPoint framePoint = hitTestResult.roundedPointInInnerNodeFrame();
+ if (!frame->rangeForPoint(framePoint))
+ return nullptr;
+
+ VisiblePosition position = frame->visiblePositionForPoint(framePoint);
+ if (position.isNull())
+ return nullptr;
+
+ contextRange = enclosingTextUnitOfGranularity(position, LineGranularity, DirectionForward);
+ if (!contextRange)
+ return nullptr;
+ }
+
+ return detectItemAtPositionWithRange(position, contextRange, detectedDataBoundingBox, detectedDataRange);
+}
+#endif // PLATFORM(MAC)
+
+void DataDetection::detectContentInRange(RefPtr<Range>&, DataDetectorTypes)
+{
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCoreeditingmacDataDetectionh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/editing/mac/DataDetection.h (195316 => 195317)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/mac/DataDetection.h        2016-01-19 22:37:02 UTC (rev 195316)
+++ trunk/Source/WebCore/editing/mac/DataDetection.h        2016-01-19 22:58:59 UTC (rev 195317)
</span><span class="lines">@@ -1,51 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef DataDetection_h
-#define DataDetection_h
-
-#if PLATFORM(MAC)
-
-#import <wtf/RefPtr.h>
-#import <wtf/RetainPtr.h>
-
-OBJC_CLASS DDActionContext;
-
-namespace WebCore {
-
-class FloatRect;
-class HitTestResult;
-class Range;
-
-class DataDetection {
-public:
- WEBCORE_EXPORT static RetainPtr<DDActionContext> detectItemAroundHitTestResult(const HitTestResult&, FloatRect& detectedDataBoundingBox, RefPtr<Range>& detectedDataRange);
-};
-
-} // namespace WebCore
-
-#endif // PLATFORM(MAC)
-
-#endif // DataDetection_h
</del></span></pre></div>
<a id="trunkSourceWebCoreeditingmacDataDetectionmm"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/editing/mac/DataDetection.mm (195316 => 195317)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/mac/DataDetection.mm        2016-01-19 22:37:02 UTC (rev 195316)
+++ trunk/Source/WebCore/editing/mac/DataDetection.mm        2016-01-19 22:58:59 UTC (rev 195317)
</span><span class="lines">@@ -1,137 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 Apple, Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import "config.h"
-#import "DataDetection.h"
-
-#if PLATFORM(MAC)
-
-#import "DataDetectorsSPI.h"
-#import "FrameView.h"
-#import "HTMLTextFormControlElement.h"
-#import "HitTestResult.h"
-#import "Node.h"
-#import "Range.h"
-#import "RenderObject.h"
-#import "TextIterator.h"
-#import "VisiblePosition.h"
-#import "VisibleUnits.h"
-#import "htmlediting.h"
-
-namespace WebCore {
-
-static RetainPtr<DDActionContext> detectItemAtPositionWithRange(VisiblePosition position, RefPtr<Range> contextRange, FloatRect& detectedDataBoundingBox, RefPtr<Range>& detectedDataRange)
-{
- String fullPlainTextString = plainText(contextRange.get());
- int hitLocation = TextIterator::rangeLength(makeRange(contextRange->startPosition(), position).get());
-
- RetainPtr<DDScannerRef> scanner = adoptCF(DDScannerCreate(DDScannerTypeStandard, 0, nullptr));
- RetainPtr<DDScanQueryRef> scanQuery = adoptCF(DDScanQueryCreateFromString(kCFAllocatorDefault, fullPlainTextString.createCFString().get(), CFRangeMake(0, fullPlainTextString.length())));
-
- if (!DDScannerScanQuery(scanner.get(), scanQuery.get()))
- return nullptr;
-
- RetainPtr<CFArrayRef> results = adoptCF(DDScannerCopyResultsWithOptions(scanner.get(), DDScannerCopyResultsOptionsNoOverlap));
-
- // Find the DDResultRef that intersects the hitTestResult's VisiblePosition.
- DDResultRef mainResult = nullptr;
- RefPtr<Range> mainResultRange;
- CFIndex resultCount = CFArrayGetCount(results.get());
- for (CFIndex i = 0; i < resultCount; i++) {
- DDResultRef result = (DDResultRef)CFArrayGetValueAtIndex(results.get(), i);
- CFRange resultRangeInContext = DDResultGetRange(result);
- if (hitLocation >= resultRangeInContext.location && (hitLocation - resultRangeInContext.location) < resultRangeInContext.length) {
- mainResult = result;
- mainResultRange = TextIterator::subrange(contextRange.get(), resultRangeInContext.location, resultRangeInContext.length);
- break;
- }
- }
-
- if (!mainResult)
- return nullptr;
-
- RetainPtr<DDActionContext> actionContext = adoptNS([allocDDActionContextInstance() init]);
- [actionContext setAllResults:@[ (id)mainResult ]];
- [actionContext setMainResult:mainResult];
-
- Vector<FloatQuad> quads;
- mainResultRange->absoluteTextQuads(quads);
- detectedDataBoundingBox = FloatRect();
- FrameView* frameView = mainResultRange->ownerDocument().view();
- for (const auto& quad : quads)
- detectedDataBoundingBox.unite(frameView->contentsToWindow(quad.enclosingBoundingBox()));
-
- detectedDataRange = mainResultRange;
-
- return actionContext;
-}
-
-RetainPtr<DDActionContext> DataDetection::detectItemAroundHitTestResult(const HitTestResult& hitTestResult, FloatRect& detectedDataBoundingBox, RefPtr<Range>& detectedDataRange)
-{
- if (!DataDetectorsLibrary())
- return nullptr;
-
- Node* node = hitTestResult.innerNonSharedNode();
- if (!node)
- return nullptr;
- auto renderer = node->renderer();
- if (!renderer)
- return nullptr;
-
- VisiblePosition position;
- RefPtr<Range> contextRange;
-
- if (!is<HTMLTextFormControlElement>(*node)) {
- position = renderer->positionForPoint(hitTestResult.localPoint(), nullptr);
- if (position.isNull())
- position = firstPositionInOrBeforeNode(node);
-
- contextRange = rangeExpandedAroundPositionByCharacters(position, 250);
- if (!contextRange)
- return nullptr;
- } else {
- Frame* frame = node->document().frame();
- if (!frame)
- return nullptr;
-
- IntPoint framePoint = hitTestResult.roundedPointInInnerNodeFrame();
- if (!frame->rangeForPoint(framePoint))
- return nullptr;
-
- VisiblePosition position = frame->visiblePositionForPoint(framePoint);
- if (position.isNull())
- return nullptr;
-
- contextRange = enclosingTextUnitOfGranularity(position, LineGranularity, DirectionForward);
- if (!contextRange)
- return nullptr;
- }
-
- return detectItemAtPositionWithRange(position, contextRange, detectedDataBoundingBox, detectedDataRange);
-}
-
-} // namespace WebCore
-
-#endif // PLATFORM(MAC)
</del></span></pre></div>
<a id="trunkSourceWebCoreloaderFrameLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/FrameLoader.cpp (195316 => 195317)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/FrameLoader.cpp        2016-01-19 22:37:02 UTC (rev 195316)
+++ trunk/Source/WebCore/loader/FrameLoader.cpp        2016-01-19 22:58:59 UTC (rev 195317)
</span><span class="lines">@@ -125,6 +125,10 @@
</span><span class="cx"> #include "Archive.h"
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+#if ENABLE(DATA_DETECTION)
+#include "DataDetection.h"
+#endif
+
</ins><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> #include "DocumentType.h"
</span><span class="cx"> #include "MemoryPressureHandler.h"
</span><span class="lines">@@ -2277,6 +2281,12 @@
</span><span class="cx"> } else {
</span><span class="cx"> m_client.dispatchDidFinishLoad();
</span><span class="cx"> loadingEvent = AXObjectCache::AXLoadingFinished;
</span><ins>+#if ENABLE(DATA_DETECTION)
+ if (m_frame.settings().dataDetectorTypes() != DataDetectorTypeNone) {
+ RefPtr<Range> documentRange = makeRange(firstPositionInNode(m_frame.document()->documentElement()), lastPositionInNode(m_frame.document()->documentElement()));
+ DataDetection::detectContentInRange(documentRange, m_frame.settings().dataDetectorTypes());
+ }
+#endif
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Notify accessibility.
</span></span></pre></div>
<a id="trunkSourceWebCorepageSettingsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Settings.h (195316 => 195317)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Settings.h        2016-01-19 22:37:02 UTC (rev 195316)
+++ trunk/Source/WebCore/page/Settings.h        2016-01-19 22:58:59 UTC (rev 195317)
</span><span class="lines">@@ -42,6 +42,10 @@
</span><span class="cx"> #include <wtf/text/AtomicString.h>
</span><span class="cx"> #include <wtf/text/AtomicStringHash.h>
</span><span class="cx">
</span><ins>+#if ENABLE(DATA_DETECTION)
+#include "DataDetection.h"
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> class FontGenericFamilies;
</span></span></pre></div>
<a id="trunkSourceWebCorepageSettingsin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Settings.in (195316 => 195317)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Settings.in        2016-01-19 22:37:02 UTC (rev 195316)
+++ trunk/Source/WebCore/page/Settings.in        2016-01-19 22:58:59 UTC (rev 195317)
</span><span class="lines">@@ -228,6 +228,7 @@
</span><span class="cx"> temporaryTileCohortRetentionEnabled initial=true
</span><span class="cx">
</span><span class="cx"> useImageDocumentForSubframePDF initial=false
</span><ins>+dataDetectorTypes type=DataDetectorTypes, initial=DataDetectorTypeNone, conditional=DATA_DETECTION
</ins><span class="cx">
</span><span class="cx"> # Allow SourceBuffers to store up to 304MB each, enough for approximately five minutes
</span><span class="cx"> # of 1080p video and stereo audio.
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformspimacDataDetectorsSPIh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/spi/mac/DataDetectorsSPI.h (195316 => 195317)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/spi/mac/DataDetectorsSPI.h        2016-01-19 22:37:02 UTC (rev 195316)
+++ trunk/Source/WebCore/platform/spi/mac/DataDetectorsSPI.h        2016-01-19 22:58:59 UTC (rev 195317)
</span><span class="lines">@@ -25,11 +25,12 @@
</span><span class="cx">
</span><span class="cx"> #import <wtf/Platform.h>
</span><span class="cx">
</span><del>-#if PLATFORM(MAC)
</del><span class="cx">
</span><span class="cx"> #import <WebCore/DataDetectorsCoreSPI.h>
</span><span class="cx"> #import <WebCore/SoftLinking.h>
</span><span class="cx">
</span><ins>+#if PLATFORM(MAC)
+
</ins><span class="cx"> #if USE(APPLE_INTERNAL_SDK)
</span><span class="cx">
</span><span class="cx"> // Can't include DDAction.h because as of this writing it is a private header that includes a non-private header with an "" include.
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (195316 => 195317)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2016-01-19 22:37:02 UTC (rev 195316)
+++ trunk/Source/WebKit/mac/ChangeLog        2016-01-19 22:58:59 UTC (rev 195317)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2016-01-19 Enrica Casucci <enrica@apple.com>
+
+ Add support for DataDetectors in WK (iOS).
+ https://bugs.webkit.org/show_bug.cgi?id=152989
+ rdar://problem/22855960
+
+ Reviewed by Tim Horton.
+
+ Adding feature definition for data detection.
+
+ * Configurations/FeatureDefines.xcconfig:
+
</ins><span class="cx"> 2016-01-19 Commit Queue <commit-queue@webkit.org>
</span><span class="cx">
</span><span class="cx"> Unreviewed, rolling out r195300.
</span></span></pre></div>
<a id="trunkSourceWebKitmacConfigurationsFeatureDefinesxcconfig"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig (195316 => 195317)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig        2016-01-19 22:37:02 UTC (rev 195316)
+++ trunk/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig        2016-01-19 22:58:59 UTC (rev 195317)
</span><span class="lines">@@ -111,6 +111,7 @@
</span><span class="cx"> ENABLE_MAC_GESTURE_EVENTS_macosx_WITH_INTERNAL_SDK_YES = ENABLE_MAC_GESTURE_EVENTS;
</span><span class="cx">
</span><span class="cx"> ENABLE_IOS_TEXT_AUTOSIZING[sdk=iphone*] = ENABLE_IOS_TEXT_AUTOSIZING;
</span><ins>+ENABLE_DATA_DETECTION = ENABLE_DATA_DETECTION;
</ins><span class="cx">
</span><span class="cx"> ENABLE_IOS_TOUCH_EVENTS[sdk=iphone*] = $(ENABLE_IOS_TOUCH_EVENTS_ios_WITH_INTERNAL_SDK_$(USE_INTERNAL_SDK));
</span><span class="cx"> ENABLE_IOS_TOUCH_EVENTS_ios_WITH_INTERNAL_SDK_YES = ENABLE_IOS_TOUCH_EVENTS;
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (195316 => 195317)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-01-19 22:37:02 UTC (rev 195316)
+++ trunk/Source/WebKit2/ChangeLog        2016-01-19 22:58:59 UTC (rev 195317)
</span><span class="lines">@@ -1,3 +1,27 @@
</span><ins>+2016-01-19 Enrica Casucci <enrica@apple.com>
+
+ Add support for DataDetectors in WK (iOS).
+ https://bugs.webkit.org/show_bug.cgi?id=152989
+ rdar://problem/22855960
+
+ Reviewed by Tim Horton.
+
+ 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:
+ (fromWKDataDetectorTypes):
+ (-[WKWebView initWithFrame:configuration:]):
+ * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
+ * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
+ (-[WKWebViewConfiguration copyWithZone:]):
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::updatePreferences):
+
</ins><span class="cx"> 2016-01-19 Commit Queue <commit-queue@webkit.org>
</span><span class="cx">
</span><span class="cx"> Unreviewed, rolling out r195300.
</span></span></pre></div>
<a id="trunkSourceWebKit2ConfigurationsFeatureDefinesxcconfig"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Configurations/FeatureDefines.xcconfig (195316 => 195317)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Configurations/FeatureDefines.xcconfig        2016-01-19 22:37:02 UTC (rev 195316)
+++ trunk/Source/WebKit2/Configurations/FeatureDefines.xcconfig        2016-01-19 22:58:59 UTC (rev 195317)
</span><span class="lines">@@ -111,6 +111,7 @@
</span><span class="cx"> ENABLE_MAC_GESTURE_EVENTS_macosx_WITH_INTERNAL_SDK_YES = ENABLE_MAC_GESTURE_EVENTS;
</span><span class="cx">
</span><span class="cx"> ENABLE_IOS_TEXT_AUTOSIZING[sdk=iphone*] = ENABLE_IOS_TEXT_AUTOSIZING;
</span><ins>+ENABLE_DATA_DETECTION = ENABLE_DATA_DETECTION;
</ins><span class="cx">
</span><span class="cx"> ENABLE_IOS_TOUCH_EVENTS[sdk=iphone*] = $(ENABLE_IOS_TOUCH_EVENTS_ios_WITH_INTERNAL_SDK_$(USE_INTERNAL_SDK));
</span><span class="cx"> ENABLE_IOS_TOUCH_EVENTS_ios_WITH_INTERNAL_SDK_YES = ENABLE_IOS_TOUCH_EVENTS;
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebPreferencesDefinitionsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h (195316 => 195317)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h        2016-01-19 22:37:02 UTC (rev 195316)
+++ trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h        2016-01-19 22:58:59 UTC (rev 195317)
</span><span class="lines">@@ -239,6 +239,7 @@
</span><span class="cx"> macro(InspectorAttachmentSide, inspectorAttachmentSide, UInt32, uint32_t, 0) \
</span><span class="cx"> macro(StorageBlockingPolicy, storageBlockingPolicy, UInt32, uint32_t, WebCore::SecurityOrigin::BlockThirdPartyStorage) \
</span><span class="cx"> macro(JavaScriptRuntimeFlags, javaScriptRuntimeFlags, UInt32, uint32_t, 0) \
</span><ins>+ macro(DataDetectorTypes, dataDetectorTypes, UInt32, uint32_t, 0) \
</ins><span class="cx"> \
</span><span class="cx">
</span><span class="cx"> #define FOR_EACH_WEBKIT_DEBUG_BOOL_PREFERENCE(macro) \
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (195316 => 195317)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm        2016-01-19 22:37:02 UTC (rev 195316)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm        2016-01-19 22:58:59 UTC (rev 195317)
</span><span class="lines">@@ -314,6 +314,28 @@
</span><span class="cx">
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+#if ENABLE(DATA_DETECTION)
+static WebCore::DataDetectorTypes fromWKDataDetectorTypes(uint32_t types)
+{
+ if (static_cast<WKDataDetectorTypes>(types) == WKDataDetectorTypeNone)
+ return WebCore::DataDetectorTypeNone;
+ if (static_cast<WKDataDetectorTypes>(types) == WKDataDetectorTypeAll)
+ return WebCore::DataDetectorTypeAll;
+
+ uint32_t value = WebCore::DataDetectorTypeNone;
+ if (types & WKDataDetectorTypePhoneNumber)
+ value |= WebCore::DataDetectorTypePhoneNumber;
+ if (types & WKDataDetectorTypeLink)
+ value |= WebCore::DataDetectorTypeLink;
+ if (types & WKDataDetectorTypeAddress)
+ value |= WebCore::DataDetectorTypeAddress;
+ if (types & WKDataDetectorTypeCalendarEvent)
+ value |= WebCore::DataDetectorTypeCalendarEvent;
+
+ return static_cast<WebCore::DataDetectorTypes>(value);
+}
+#endif
+
</ins><span class="cx"> - (instancetype)initWithFrame:(CGRect)frame configuration:(WKWebViewConfiguration *)configuration
</span><span class="cx"> {
</span><span class="cx"> if (!(self = [super initWithFrame:frame]))
</span><span class="lines">@@ -383,6 +405,9 @@
</span><span class="cx"> pageConfiguration->preferenceValues().set(WebKit::WebPreferencesKey::invisibleAutoplayNotPermittedKey(), WebKit::WebPreferencesStore::Value(!![_configuration _invisibleAutoplayNotPermitted]));
</span><span class="cx"> pageConfiguration->preferenceValues().set(WebKit::WebPreferencesKey::mediaDataLoadsAutomaticallyKey(), WebKit::WebPreferencesStore::Value(!![_configuration _mediaDataLoadsAutomatically]));
</span><span class="cx"> #endif
</span><ins>+#if ENABLE(DATA_DETECTION)
+ pageConfiguration->preferenceValues().set(WebKit::WebPreferencesKey::dataDetectorTypesKey(), WebKit::WebPreferencesStore::Value(static_cast<uint32_t>(fromWKDataDetectorTypes([_configuration dataDetectorTypes]))));
+#endif
</ins><span class="cx"> #if ENABLE(WIRELESS_PLAYBACK_TARGET)
</span><span class="cx"> pageConfiguration->preferenceValues().set(WebKit::WebPreferencesKey::allowsAirPlayForMediaPlaybackKey(), WebKit::WebPreferencesStore::Value(!![_configuration allowsAirPlayForMediaPlayback]));
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKWebViewConfigurationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.h (195316 => 195317)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.h        2016-01-19 22:37:02 UTC (rev 195316)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.h        2016-01-19 22:58:59 UTC (rev 195317)
</span><span class="lines">@@ -51,6 +51,25 @@
</span><span class="cx"> } WK_ENUM_AVAILABLE_IOS(8_0);
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+/*! @enum WKDataDetectorTypes
+ @abstract The type of data detected.
+ @constant WKDataDetectorTypeNone No detection is performed.
+ @constant WKDataDetectorTypePhoneNumber Phone numbers are detected and turned into links.
+ @constant WKDataDetectorTypeLink URLs in text are detected and turned into links.
+ @constant WKDataDetectorTypeAddress Addresses are detected and turned into links.
+ @constant WKDataDetectorTypeCalendarEvent Dates and times that are in the future are detected and turned into links.
+ @constant WKDataDetectorTypeAll All of the above data types are turned into links when detected. Choosing this value will
+ automatically include any new detection type that is added.
+ */
+typedef NS_OPTIONS(NSUInteger, WKDataDetectorTypes) {
+ WKDataDetectorTypeNone = 0,
+ WKDataDetectorTypePhoneNumber = 1 << 0,
+ WKDataDetectorTypeLink = 1 << 1,
+ WKDataDetectorTypeAddress = 1 << 2,
+ WKDataDetectorTypeCalendarEvent = 1 << 3,
+ WKDataDetectorTypeAll = NSUIntegerMax
+} WK_ENUM_AVAILABLE(WK_MAC_TBA, WK_IOS_TBA);
+
</ins><span class="cx"> /*! A WKWebViewConfiguration object is a collection of properties with
</span><span class="cx"> which to initialize a web view.
</span><span class="cx"> @helps Contains properties used to configure a @link WKWebView @/link.
</span><span class="lines">@@ -93,6 +112,15 @@
</span><span class="cx"> */
</span><span class="cx"> @property (nonatomic) BOOL allowsAirPlayForMediaPlayback WK_AVAILABLE(10_11, 9_0);
</span><span class="cx">
</span><ins>+/*! @abstract An enum value indicating the type of data detection desired.
+ @discussion The default value is WKDataDetectorTypeNone.
+ An example of how this property may affect the content loaded in the WKWebView is that content like
+ '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'
+ if the dataDetectorTypes property is set to WKDataDetectorTypePhoneNumber | WKDataDetectorTypeLink | WKDataDetectorTypeCalendarEvent.
+
+ */
+@property (nonatomic) WKDataDetectorTypes dataDetectorTypes WK_AVAILABLE(WK_MAC_TBA, WK_IOS_TBA);
+
</ins><span class="cx"> #if TARGET_OS_IPHONE
</span><span class="cx"> /*! @abstract A Boolean value indicating whether HTML5 videos play inline
</span><span class="cx"> (YES) or use the native full-screen controller (NO).
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKWebViewConfigurationmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.mm (195316 => 195317)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.mm        2016-01-19 22:37:02 UTC (rev 195316)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.mm        2016-01-19 22:58:59 UTC (rev 195317)
</span><span class="lines">@@ -198,6 +198,9 @@
</span><span class="cx"> configuration->_serviceControlsEnabled = self->_serviceControlsEnabled;
</span><span class="cx"> configuration->_imageControlsEnabled = self->_imageControlsEnabled;
</span><span class="cx"> #endif
</span><ins>+#if ENABLE(DATA_DETECTION)
+ configuration->_dataDetectorTypes = self->_dataDetectorTypes;
+#endif
</ins><span class="cx"> #if ENABLE(WIRELESS_TARGET_PLAYBACK)
</span><span class="cx"> configuration->_allowsAirPlayForMediaPlayback = self->_allowsAirPlayForMediaPlayback;
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (195316 => 195317)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2016-01-19 22:37:02 UTC (rev 195316)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2016-01-19 22:58:59 UTC (rev 195317)
</span><span class="lines">@@ -219,6 +219,10 @@
</span><span class="cx"> #include "CoordinatedLayerTreeHostMessages.h"
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+#if ENABLE(DATA_DETECTION)
+#include <WebCore/DataDetection.h>
+#endif
+
</ins><span class="cx"> #if ENABLE(VIDEO) && USE(GSTREAMER)
</span><span class="cx"> #include <WebCore/MediaPlayerRequestInstallMissingPluginsCallback.h>
</span><span class="cx"> #endif
</span><span class="lines">@@ -2935,6 +2939,9 @@
</span><span class="cx"> settings.setUseImageDocumentForSubframePDF(true);
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+#if ENABLE(DATA_DETECTION)
+ settings.setDataDetectorTypes(static_cast<DataDetectorTypes>(store.getUInt32ValueForKey(WebPreferencesKey::dataDetectorTypesKey())));
+#endif
</ins><span class="cx"> #if ENABLE(GAMEPAD)
</span><span class="cx"> RuntimeEnabledFeatures::sharedFeatures().setGamepadsEnabled(store.getBoolValueForKey(WebPreferencesKey::gamepadsEnabledKey()));
</span><span class="cx"> #endif
</span></span></pre>
</div>
</div>
</body>
</html>