Changeset 214697 in webkit
- Timestamp:
- Mar 31, 2017, 4:33:24 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r214694 r214697 1 2017-03-31 Andy Estes <aestes@apple.com> 2 3 REGRESSION (r202472): Data Detection overwrites existing links in detected ranges 4 https://bugs.webkit.org/show_bug.cgi?id=170365 5 <rdar://problem/29205721> 6 7 Reviewed by Tim Horton. 8 9 r202472 changed the node traversal in searchForLinkRemovingExistingDDLinks() to only 10 consider nodes that are descendants of startNode, but we need to traverse all nodes between 11 startNode and endNode to find existing non-DD links. 12 13 As a result, we'd add a Data Detector link to the following snippet and make the original 14 links un-clickable: 15 16 <a href='#'>tomorrow</a> <a href='#'>night</a> 17 18 Fix this by not specifying a stayWithin node when calling NodeTraversal::next(). The loop 19 will terminate when we reach endNode. 20 21 Updated WebKit2.DataDetectionReferenceDate API test. 22 23 * editing/cocoa/DataDetection.mm: 24 (WebCore::searchForLinkRemovingExistingDDLinks): 25 1 26 2017-03-31 Eric Carlson <eric.carlson@apple.com> 2 27 -
trunk/Source/WebCore/editing/cocoa/DataDetection.mm
r213355 r214697 275 275 { 276 276 didModifyDOM = false; 277 for (Node* node = &startNode; node; node = NodeTraversal::next(*node , &startNode)) {277 for (Node* node = &startNode; node; node = NodeTraversal::next(*node)) { 278 278 if (is<HTMLAnchorElement>(*node)) { 279 279 auto& anchor = downcast<HTMLAnchorElement>(*node); -
trunk/Tools/ChangeLog
r214683 r214697 1 2017-03-31 Andy Estes <aestes@apple.com> 2 3 REGRESSION (r202472): Data Detection overwrites existing links in detected ranges 4 https://bugs.webkit.org/show_bug.cgi?id=170365 5 <rdar://problem/29205721> 6 7 Reviewed by Tim Horton. 8 9 * TestWebKitAPI/Tests/WebKit2Cocoa/DataDetection.mm: 10 (expectLinkCount): Changed to only query links with the x-apple-data-detectors attribute. 11 (TEST): Re-enabled the test, which now passes. 12 1 13 2017-03-31 Tim Horton <timothy_horton@apple.com> 2 14 -
trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/DataDetection.mm
r205976 r214697 61 61 [webView _test_waitForDidFinishNavigation]; 62 62 63 [webView evaluateJavaScript:@"document. getElementsByTagName('a').length" completionHandler:^(id value, NSError *error) {63 [webView evaluateJavaScript:@"document.querySelectorAll('a[x-apple-data-detectors=true]').length" completionHandler:^(id value, NSError *error) { 64 64 EXPECT_EQ(linkCount, [value unsignedIntValue]); 65 65 ranScript = true; … … 70 70 } 71 71 72 TEST(WebKit2, D ISABLED_DataDetectionReferenceDate)72 TEST(WebKit2, DataDetectionReferenceDate) 73 73 { 74 74 RetainPtr<WKWebViewConfiguration> configuration = adoptNS([[WKWebViewConfiguration alloc] init]); … … 82 82 expectLinkCount(webView.get(), @"tomorrow at 6PM", 1); 83 83 expectLinkCount(webView.get(), @"yesterday at 6PM", 0); 84 expectLinkCount(webView.get(), @"<a href='about:blank'>tomorrow at 6PM</a>", 0); 85 expectLinkCount(webView.get(), @"<a href='about:blank'>tomorrow</a> at <a href='about:blank'>6PM</a>", 0); 86 84 87 85 88 NSTimeInterval week = 60 * 60 * 24 * 7;
Note:
See TracChangeset
for help on using the changeset viewer.