Changeset 198864 in webkit
- Timestamp:
- Mar 30, 2016 4:09:41 PM (8 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r198859 r198864 1 2016-03-30 Enrica Casucci <enrica@apple.com> 2 3 Add a style for Data Detectors links. 4 https://bugs.webkit.org/show_bug.cgi?id=155996 5 rdar://problem/25343514 6 7 Reviewed by Sam Weinig. 8 9 Based on indication from the data detection engine, 10 we style some of the links differently. 11 12 * editing/cocoa/DataDetection.mm: 13 (WebCore::DataDetection::detectContentInRange): 14 * platform/cocoa/DataDetectorsCoreSoftLink.h: 15 * platform/cocoa/DataDetectorsCoreSoftLink.mm: 16 1 17 2016-03-30 Myles C. Maxfield <mmaxfield@apple.com> 2 18 -
trunk/Source/WebCore/editing/cocoa/DataDetection.mm
r198684 r198864 50 50 #endif 51 51 52 const char *dataDetectorsURLScheme = "x-apple-data-detectors"; 53 const char *dataDetectorsAttributeTypeKey = "x-apple-data-detectors-type"; 54 const char *dataDetectorsAttributeResultKey = "x-apple-data-detectors-result"; 52 const char* dataDetectorsURLScheme = "x-apple-data-detectors"; 53 const char* dataDetectorsAttributeTypeKey = "x-apple-data-detectors-type"; 54 const char* dataDetectorsAttributeResultKey = "x-apple-data-detectors-result"; 55 const char* dataDetectorsLinkStyle = "-webkit-text-decoration-color:rgb(199, 199, 204); color:initial;"; 55 56 56 57 namespace WebCore { … … 576 577 577 578 lastModifiedQueryOffset = queryRange.end; 579 BOOL shouldUseLightLinks = softLink_DataDetectorsCore_DDShouldUseLightLinksForResult(coreResult, [indexPaths[resultIndex] length] > 1); 578 580 579 581 for (auto& range : resultRanges) { … … 606 608 anchorElement->setHref(correspondingURL); 607 609 anchorElement->setDir("ltr"); 608 RefPtr<Attr> color = downcast<Element>(parentNode)->getAttributeNode("color"); 609 if (color) 610 anchorElement->setAttribute(HTMLNames::styleAttr, color->style()->cssText()); 611 610 if (shouldUseLightLinks) 611 anchorElement->setAttribute(HTMLNames::styleAttr, dataDetectorsLinkStyle); 612 else { 613 RefPtr<Attr> color = downcast<Element>(parentNode)->getAttributeNode("color"); 614 if (color) 615 anchorElement->setAttribute(HTMLNames::styleAttr, color->style()->cssText()); 616 } 612 617 anchorElement->Node::appendChild(newNode, ASSERT_NO_EXCEPTION); 613 618 parentNode->insertBefore(anchorElement, ¤tTextNode, ASSERT_NO_EXCEPTION); -
trunk/Source/WebCore/platform/cocoa/DataDetectorsCoreSoftLink.h
r198653 r198864 52 52 SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, DataDetectorsCore, DDShouldImmediatelyShowActionSheetForURL, BOOL, (NSURL *url), (url)) 53 53 SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, DataDetectorsCore, DDShouldImmediatelyShowActionSheetForResult, BOOL, (DDResultRef result), (result)) 54 SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, DataDetectorsCore, DDShouldUseLightLinksForResult, BOOL, (DDResultRef result, BOOL extractedFromSignature), (result, extractedFromSignature)) 54 55 SOFT_LINK_POINTER_FOR_HEADER(WebCore, DataDetectorsCore, DDBinderHttpURLKey, CFStringRef) 55 56 SOFT_LINK_POINTER_FOR_HEADER(WebCore, DataDetectorsCore, DDBinderWebURLKey, CFStringRef) -
trunk/Source/WebCore/platform/cocoa/DataDetectorsCoreSoftLink.mm
r198653 r198864 51 51 SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, DataDetectorsCore, DDShouldImmediatelyShowActionSheetForURL, BOOL, (NSURL *url), (url)) 52 52 SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, DataDetectorsCore, DDShouldImmediatelyShowActionSheetForResult, BOOL, (DDResultRef result), (result)) 53 SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, DataDetectorsCore, DDShouldUseLightLinksForResult, BOOL, (DDResultRef result, BOOL extractedFromSignature), (result, extractedFromSignature)) 53 54 SOFT_LINK_POINTER_FOR_SOURCE(WebCore, DataDetectorsCore, DDBinderHttpURLKey, CFStringRef) 54 55 SOFT_LINK_POINTER_FOR_SOURCE(WebCore, DataDetectorsCore, DDBinderWebURLKey, CFStringRef)
Note: See TracChangeset
for help on using the changeset viewer.