Changeset 198986 in webkit


Ignore:
Timestamp:
Apr 3, 2016 11:56:30 AM (8 years ago)
Author:
ddkilzer@apple.com
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.
Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r198983 r198986  
     12016-04-03  David Kilzer  <ddkilzer@apple.com>
     2
     3        REGRESSION (r198653, r198864): http/tests/contentdispositionattachmentsandbox/referer-header-stripped*.html tests crashing due to unavailable SPI
     4        <http://webkit.org/b/156145>
     5
     6        Reviewed by Tim Horton.
     7
     8        Covered by existing tests under GuardMalloc:
     9
     10            http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-always.html
     11            http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-default.html
     12            http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-never.html
     13            http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-no-referrer-when-downgrade.html
     14            http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-no-referrer.html
     15            http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-origin.html
     16            http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-unsafe-url.html
     17            http/tests/contentdispositionattachmentsandbox/referer-header-stripped.html
     18
     19        * editing/cocoa/DataDetection.mm:
     20        (WebCore::DataDetection::isDataDetectorLink):
     21        (WebCore::DataDetection::shouldCancelDefaultAction):
     22        - Restore iOS 9.x code.
     23        (WebCore::DataDetection::detectContentInRange):
     24        - Guard new SPI with version macros.
     25
     26        * platform/cocoa/DataDetectorsCoreSoftLink.h:
     27        * platform/cocoa/DataDetectorsCoreSoftLink.mm:
     28        - Guard new SPI with version macros.
     29
    1302016-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>
    231
  • trunk/Source/WebCore/editing/cocoa/DataDetection.mm

    r198974 r198986  
    157157    if (!is<HTMLAnchorElement>(element))
    158158        return false;
    159    
     159
     160#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 100000
    160161    return [softLink_DataDetectorsCore_DDURLTapAndHoldSchemes() containsObject:(NSString *)downcast<HTMLAnchorElement>(element).href().protocol().convertToASCIILowercase()];
     162#else
     163    if (equalIgnoringASCIICase(element.fastGetAttribute(x_apple_data_detectorsAttr), "true"))
     164        return true;
     165    URL url = downcast<HTMLAnchorElement>(element).href();
     166    return url.protocolIs("mailto") || url.protocolIs("tel");
     167#endif
    161168}
    162169
     
    173180bool DataDetection::shouldCancelDefaultAction(Element& element)
    174181{
     182#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 100000
    175183    if (!isDataDetectorLink(element))
    176184        return false;
     
    194202    }
    195203    return softLink_DataDetectorsCore_DDShouldImmediatelyShowActionSheetForResult(result);
     204#else
     205    if (!is<HTMLAnchorElement>(element))
     206        return false;
     207    if (!equalIgnoringASCIICase(element.fastGetAttribute(x_apple_data_detectorsAttr), "true"))
     208        return false;
     209    String type = element.getAttribute(x_apple_data_detectors_typeAttr).convertToASCIILowercase();
     210    if (type == "misc" || type == "calendar-event" || type == "telephone")
     211        return true;
     212    return false;
     213#endif
    196214}
    197215
     
    581599       
    582600        lastModifiedQueryOffset = queryRange.end;
     601#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 100000
    583602        BOOL shouldUseLightLinks = softLink_DataDetectorsCore_DDShouldUseLightLinksForResult(coreResult, [indexPaths[resultIndex] length] > 1);
     603#else
     604        BOOL shouldUseLightLinks = NO;
     605#endif
    584606
    585607        for (auto& range : resultRanges) {
  • trunk/Source/WebCore/platform/cocoa/DataDetectorsCoreSoftLink.h

    r198864 r198986  
    4949SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, DataDetectorsCore, DDResultGetQueryRangeForURLification, DDQueryRange, (DDResultRef result), (result))
    5050SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, DataDetectorsCore, DDURLStringForResult, NSString *, (DDResultRef currentResult, NSString * resultIdentifier, DDURLifierPhoneNumberDetectionTypes includingTelGroups, NSDate * referenceDate, NSTimeZone * referenceTimeZone), (currentResult, resultIdentifier, includingTelGroups, referenceDate, referenceTimeZone))
     51#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 100000
    5152SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, DataDetectorsCore, DDURLTapAndHoldSchemes, NSArray *, (), ())
    5253SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, DataDetectorsCore, DDShouldImmediatelyShowActionSheetForURL, BOOL, (NSURL *url), (url))
    5354SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, DataDetectorsCore, DDShouldImmediatelyShowActionSheetForResult, BOOL, (DDResultRef result), (result))
    5455SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, DataDetectorsCore, DDShouldUseLightLinksForResult, BOOL, (DDResultRef result, BOOL extractedFromSignature), (result, extractedFromSignature))
     56#endif
    5557SOFT_LINK_POINTER_FOR_HEADER(WebCore, DataDetectorsCore, DDBinderHttpURLKey, CFStringRef)
    5658SOFT_LINK_POINTER_FOR_HEADER(WebCore, DataDetectorsCore, DDBinderWebURLKey, CFStringRef)
  • trunk/Source/WebCore/platform/cocoa/DataDetectorsCoreSoftLink.mm

    r198864 r198986  
    4848SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, DataDetectorsCore, DDResultGetQueryRangeForURLification, DDQueryRange, (DDResultRef result), (result))
    4949SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, DataDetectorsCore, DDURLStringForResult, NSString *, (DDResultRef currentResult, NSString * resultIdentifier, DDURLifierPhoneNumberDetectionTypes includingTelGroups, NSDate * referenceDate, NSTimeZone * referenceTimeZone), (currentResult, resultIdentifier, includingTelGroups, referenceDate, referenceTimeZone))
     50#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 100000
    5051SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, DataDetectorsCore, DDURLTapAndHoldSchemes, NSArray *, (), ())
    5152SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, DataDetectorsCore, DDShouldImmediatelyShowActionSheetForURL, BOOL, (NSURL *url), (url))
    5253SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, DataDetectorsCore, DDShouldImmediatelyShowActionSheetForResult, BOOL, (DDResultRef result), (result))
    5354SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, DataDetectorsCore, DDShouldUseLightLinksForResult, BOOL, (DDResultRef result, BOOL extractedFromSignature), (result, extractedFromSignature))
     55#endif
    5456SOFT_LINK_POINTER_FOR_SOURCE(WebCore, DataDetectorsCore, DDBinderHttpURLKey, CFStringRef)
    5557SOFT_LINK_POINTER_FOR_SOURCE(WebCore, DataDetectorsCore, DDBinderWebURLKey, CFStringRef)
Note: See TracChangeset for help on using the changeset viewer.