+2016-03-16 Enrica Casucci <enrica@apple.com>
+
+ Recognize mailto and tel url as data detector links.
+ https://bugs.webkit.org/show_bug.cgi?id=155569
+ rdar://problem/24836185
+
+ Reviewed by Sam Weinig.
+
+ When we check if the element is a data detector link,
+ we should return true also for URLs with mailto: and tel: scheme.
+
+ * editing/cocoa/DataDetection.mm:
+ (WebCore::DataDetection::isDataDetectorLink):
+
2016-03-16 Zalan Bujtas <zalan@apple.com>
Subpixel rendering: Directly composited image layers need pixelsnapping.
bool DataDetection::isDataDetectorLink(Element* element)
{
- return element->getAttribute(dataDetectorsURLScheme) == "true";
+ // FIXME: We should be able to ask this from DataDetectorsCore when rdar://problem/25206062 is fixed.
+ if (!is<HTMLAnchorElement>(*element))
+ return false;
+
+ if (element->getAttribute(dataDetectorsURLScheme) == "true")
+ return true;
+ URL url = downcast<HTMLAnchorElement>(*element).href();
+ return url.protocolIs("mailto") || url.protocolIs("tel");
}
bool DataDetection::requiresExtendedContext(Element* element)
UNUSED_PARAM(element);
return false;
#else
- // FIXME: We should also compute the DDResultRef and check the result category.
+ // FIXME: We should be able to retrieve this information from DataDetectorsCore when rdar://problem/25169133 is fixed.
if (!is<HTMLAnchorElement>(*element))
return false;
if (element->getAttribute(dataDetectorsURLScheme) != "true")