Title: [214722] trunk
Revision
214722
Author
a...@apple.com
Date
2017-04-01 18:56:34 -0700 (Sat, 01 Apr 2017)

Log Message

Rolling back <https://trac.webkit.org/r214697>, as it made WebKit2.DataDetectionReferenceDate time out.

Was REGRESSION (r202472): Data Detection overwrites existing links in detected ranges
https://bugs.webkit.org/show_bug.cgi?id=170365

Source/WebCore:

* editing/cocoa/DataDetection.mm:
(WebCore::searchForLinkRemovingExistingDDLinks):

Tools:

* TestWebKitAPI/Tests/WebKit2Cocoa/DataDetection.mm:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (214721 => 214722)


--- trunk/Source/WebCore/ChangeLog	2017-04-02 00:55:20 UTC (rev 214721)
+++ trunk/Source/WebCore/ChangeLog	2017-04-02 01:56:34 UTC (rev 214722)
@@ -1,3 +1,13 @@
+2017-04-01  Alexey Proskuryakov  <a...@apple.com>
+
+        Rolling back <https://trac.webkit.org/r214697>, as it made WebKit2.DataDetectionReferenceDate time out.
+
+        Was REGRESSION (r202472): Data Detection overwrites existing links in detected ranges
+        https://bugs.webkit.org/show_bug.cgi?id=170365
+
+        * editing/cocoa/DataDetection.mm:
+        (WebCore::searchForLinkRemovingExistingDDLinks):
+
 2017-04-01  Chris Dumez  <cdu...@apple.com>
 
         We should pause silent WebAudio rendering in background tabs

Modified: trunk/Source/WebCore/editing/cocoa/DataDetection.mm (214721 => 214722)


--- trunk/Source/WebCore/editing/cocoa/DataDetection.mm	2017-04-02 00:55:20 UTC (rev 214721)
+++ trunk/Source/WebCore/editing/cocoa/DataDetection.mm	2017-04-02 01:56:34 UTC (rev 214722)
@@ -274,7 +274,7 @@
 static bool searchForLinkRemovingExistingDDLinks(Node& startNode, Node& endNode, bool& didModifyDOM)
 {
     didModifyDOM = false;
-    for (Node* node = &startNode; node; node = NodeTraversal::next(*node)) {
+    for (Node* node = &startNode; node; node = NodeTraversal::next(*node, &startNode)) {
         if (is<HTMLAnchorElement>(*node)) {
             auto& anchor = downcast<HTMLAnchorElement>(*node);
             if (!equalIgnoringASCIICase(anchor.attributeWithoutSynchronization(x_apple_data_detectorsAttr), "true"))

Modified: trunk/Tools/ChangeLog (214721 => 214722)


--- trunk/Tools/ChangeLog	2017-04-02 00:55:20 UTC (rev 214721)
+++ trunk/Tools/ChangeLog	2017-04-02 01:56:34 UTC (rev 214722)
@@ -1,3 +1,12 @@
+2017-04-01  Alexey Proskuryakov  <a...@apple.com>
+
+        Rolling back <https://trac.webkit.org/r214697>, as it made WebKit2.DataDetectionReferenceDate time out.
+
+        Was REGRESSION (r202472): Data Detection overwrites existing links in detected ranges
+        https://bugs.webkit.org/show_bug.cgi?id=170365
+
+        * TestWebKitAPI/Tests/WebKit2Cocoa/DataDetection.mm:
+
 2017-04-01  Csaba Osztrogonác  <o...@webkit.org>
 
         Mac cmake buildfix after 214586.

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/DataDetection.mm (214721 => 214722)


--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/DataDetection.mm	2017-04-02 00:55:20 UTC (rev 214721)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/DataDetection.mm	2017-04-02 01:56:34 UTC (rev 214722)
@@ -60,7 +60,7 @@
     [webView loadHTMLString:HTMLString baseURL:nil];
     [webView _test_waitForDidFinishNavigation];
 
-    [webView evaluateJavaScript:@"document.querySelectorAll('a[x-apple-data-detectors=true]').length" completionHandler:^(id value, NSError *error) {
+    [webView evaluateJavaScript:@"document.getElementsByTagName('a').length" completionHandler:^(id value, NSError *error) {
         EXPECT_EQ(linkCount, [value unsignedIntValue]);
         ranScript = true;
     }];
@@ -69,7 +69,7 @@
     ranScript = false;
 }
 
-TEST(WebKit2, DataDetectionReferenceDate)
+TEST(WebKit2, DISABLED_DataDetectionReferenceDate)
 {
     RetainPtr<WKWebViewConfiguration> configuration = adoptNS([[WKWebViewConfiguration alloc] init]);
     [configuration setDataDetectorTypes:WKDataDetectorTypeCalendarEvent];
@@ -81,10 +81,7 @@
 
     expectLinkCount(webView.get(), @"tomorrow at 6PM", 1);
     expectLinkCount(webView.get(), @"yesterday at 6PM", 0);
-    expectLinkCount(webView.get(), @"<a href=''>tomorrow at 6PM</a>", 0);
-    expectLinkCount(webView.get(), @"<a href=''>tomorrow</a> at <a href=''>6PM</a>", 0);
 
-
     NSTimeInterval week = 60 * 60 * 24 * 7;
 
     [UIDelegate setReferenceDate:[NSDate dateWithTimeIntervalSinceNow:-week]];
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to