Title: [198986] trunk/Source/WebCore
Revision
198986
Author
[email protected]
Date
2016-04-03 11:56:30 -0700 (Sun, 03 Apr 2016)

Log Message

REGRESSION (r198653, r198864): http/tests/contentdispositionattachmentsandbox/referer-header-stripped*.html tests crashing due to unavailable SPI
<http://webkit.org/b/156145>

Reviewed by Tim Horton.

Covered by existing tests under GuardMalloc:

    http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-always.html
    http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-default.html
    http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-never.html
    http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-no-referrer-when-downgrade.html
    http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-no-referrer.html
    http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-origin.html
    http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-unsafe-url.html
    http/tests/contentdispositionattachmentsandbox/referer-header-stripped.html

* editing/cocoa/DataDetection.mm:
(WebCore::DataDetection::isDataDetectorLink):
(WebCore::DataDetection::shouldCancelDefaultAction):
- Restore iOS 9.x code.
(WebCore::DataDetection::detectContentInRange):
- Guard new SPI with version macros.

* platform/cocoa/DataDetectorsCoreSoftLink.h:
* platform/cocoa/DataDetectorsCoreSoftLink.mm:
- Guard new SPI with version macros.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (198985 => 198986)


--- trunk/Source/WebCore/ChangeLog	2016-04-03 16:50:59 UTC (rev 198985)
+++ trunk/Source/WebCore/ChangeLog	2016-04-03 18:56:30 UTC (rev 198986)
@@ -1,3 +1,32 @@
+2016-04-03  David Kilzer  <[email protected]>
+
+        REGRESSION (r198653, r198864): http/tests/contentdispositionattachmentsandbox/referer-header-stripped*.html tests crashing due to unavailable SPI
+        <http://webkit.org/b/156145>
+
+        Reviewed by Tim Horton.
+
+        Covered by existing tests under GuardMalloc:
+
+            http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-always.html
+            http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-default.html
+            http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-never.html
+            http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-no-referrer-when-downgrade.html
+            http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-no-referrer.html
+            http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-origin.html
+            http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-unsafe-url.html
+            http/tests/contentdispositionattachmentsandbox/referer-header-stripped.html
+
+        * editing/cocoa/DataDetection.mm:
+        (WebCore::DataDetection::isDataDetectorLink):
+        (WebCore::DataDetection::shouldCancelDefaultAction):
+        - Restore iOS 9.x code.
+        (WebCore::DataDetection::detectContentInRange):
+        - Guard new SPI with version macros.
+
+        * platform/cocoa/DataDetectorsCoreSoftLink.h:
+        * platform/cocoa/DataDetectorsCoreSoftLink.mm:
+        - Guard new SPI with version macros.
+
 2016-04-03  Carlos Garcia Campos  <[email protected]>
 
         Replace all RenderTheme::popupInternalPadding methods with a single one returning a LengthBox

Modified: trunk/Source/WebCore/editing/cocoa/DataDetection.mm (198985 => 198986)


--- trunk/Source/WebCore/editing/cocoa/DataDetection.mm	2016-04-03 16:50:59 UTC (rev 198985)
+++ trunk/Source/WebCore/editing/cocoa/DataDetection.mm	2016-04-03 18:56:30 UTC (rev 198986)
@@ -156,8 +156,15 @@
 {
     if (!is<HTMLAnchorElement>(element))
         return false;
-    
+
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 100000
     return [softLink_DataDetectorsCore_DDURLTapAndHoldSchemes() containsObject:(NSString *)downcast<HTMLAnchorElement>(element).href().protocol().convertToASCIILowercase()];
+#else
+    if (equalIgnoringASCIICase(element.fastGetAttribute(x_apple_data_detectorsAttr), "true"))
+        return true;
+    URL url = ""
+    return url.protocolIs("mailto") || url.protocolIs("tel");
+#endif
 }
 
 bool DataDetection::requiresExtendedContext(Element& element)
@@ -172,6 +179,7 @@
 
 bool DataDetection::shouldCancelDefaultAction(Element& element)
 {
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 100000
     if (!isDataDetectorLink(element))
         return false;
     
@@ -193,6 +201,16 @@
         result = (DDResultRef)[results objectAtIndex:resultIndices[i].toInt()];
     }
     return softLink_DataDetectorsCore_DDShouldImmediatelyShowActionSheetForResult(result);
+#else
+    if (!is<HTMLAnchorElement>(element))
+        return false;
+    if (!equalIgnoringASCIICase(element.fastGetAttribute(x_apple_data_detectorsAttr), "true"))
+        return false;
+    String type = element.getAttribute(x_apple_data_detectors_typeAttr).convertToASCIILowercase();
+    if (type == "misc" || type == "calendar-event" || type == "telephone")
+        return true;
+    return false;
+#endif
 }
 
 static BOOL resultIsURL(DDResultRef result)
@@ -580,7 +598,11 @@
         }
         
         lastModifiedQueryOffset = queryRange.end;
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 100000
         BOOL shouldUseLightLinks = softLink_DataDetectorsCore_DDShouldUseLightLinksForResult(coreResult, [indexPaths[resultIndex] length] > 1);
+#else
+        BOOL shouldUseLightLinks = NO;
+#endif
 
         for (auto& range : resultRanges) {
             Node* parentNode = range->startContainer().parentNode();

Modified: trunk/Source/WebCore/platform/cocoa/DataDetectorsCoreSoftLink.h (198985 => 198986)


--- trunk/Source/WebCore/platform/cocoa/DataDetectorsCoreSoftLink.h	2016-04-03 16:50:59 UTC (rev 198985)
+++ trunk/Source/WebCore/platform/cocoa/DataDetectorsCoreSoftLink.h	2016-04-03 18:56:30 UTC (rev 198986)
@@ -48,10 +48,12 @@
 SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, DataDetectorsCore, DDResultGetSubResults, CFArrayRef, (DDResultRef result), (result))
 SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, DataDetectorsCore, DDResultGetQueryRangeForURLification, DDQueryRange, (DDResultRef result), (result))
 SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, DataDetectorsCore, DDURLStringForResult, NSString *, (DDResultRef currentResult, NSString * resultIdentifier, DDURLifierPhoneNumberDetectionTypes includingTelGroups, NSDate * referenceDate, NSTimeZone * referenceTimeZone), (currentResult, resultIdentifier, includingTelGroups, referenceDate, referenceTimeZone))
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 100000
 SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, DataDetectorsCore, DDURLTapAndHoldSchemes, NSArray *, (), ())
 SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, DataDetectorsCore, DDShouldImmediatelyShowActionSheetForURL, BOOL, (NSURL *url), (url))
 SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, DataDetectorsCore, DDShouldImmediatelyShowActionSheetForResult, BOOL, (DDResultRef result), (result))
 SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, DataDetectorsCore, DDShouldUseLightLinksForResult, BOOL, (DDResultRef result, BOOL extractedFromSignature), (result, extractedFromSignature))
+#endif
 SOFT_LINK_POINTER_FOR_HEADER(WebCore, DataDetectorsCore, DDBinderHttpURLKey, CFStringRef)
 SOFT_LINK_POINTER_FOR_HEADER(WebCore, DataDetectorsCore, DDBinderWebURLKey, CFStringRef)
 SOFT_LINK_POINTER_FOR_HEADER(WebCore, DataDetectorsCore, DDBinderMailURLKey, CFStringRef)

Modified: trunk/Source/WebCore/platform/cocoa/DataDetectorsCoreSoftLink.mm (198985 => 198986)


--- trunk/Source/WebCore/platform/cocoa/DataDetectorsCoreSoftLink.mm	2016-04-03 16:50:59 UTC (rev 198985)
+++ trunk/Source/WebCore/platform/cocoa/DataDetectorsCoreSoftLink.mm	2016-04-03 18:56:30 UTC (rev 198986)
@@ -47,10 +47,12 @@
 SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, DataDetectorsCore, DDResultGetSubResults, CFArrayRef, (DDResultRef result), (result))
 SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, DataDetectorsCore, DDResultGetQueryRangeForURLification, DDQueryRange, (DDResultRef result), (result))
 SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, DataDetectorsCore, DDURLStringForResult, NSString *, (DDResultRef currentResult, NSString * resultIdentifier, DDURLifierPhoneNumberDetectionTypes includingTelGroups, NSDate * referenceDate, NSTimeZone * referenceTimeZone), (currentResult, resultIdentifier, includingTelGroups, referenceDate, referenceTimeZone))
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 100000
 SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, DataDetectorsCore, DDURLTapAndHoldSchemes, NSArray *, (), ())
 SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, DataDetectorsCore, DDShouldImmediatelyShowActionSheetForURL, BOOL, (NSURL *url), (url))
 SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, DataDetectorsCore, DDShouldImmediatelyShowActionSheetForResult, BOOL, (DDResultRef result), (result))
 SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, DataDetectorsCore, DDShouldUseLightLinksForResult, BOOL, (DDResultRef result, BOOL extractedFromSignature), (result, extractedFromSignature))
+#endif
 SOFT_LINK_POINTER_FOR_SOURCE(WebCore, DataDetectorsCore, DDBinderHttpURLKey, CFStringRef)
 SOFT_LINK_POINTER_FOR_SOURCE(WebCore, DataDetectorsCore, DDBinderWebURLKey, CFStringRef)
 SOFT_LINK_POINTER_FOR_SOURCE(WebCore, DataDetectorsCore, DDBinderMailURLKey, CFStringRef)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to