Title: [198650] trunk/Source/WebCore
Revision
198650
Author
[email protected]
Date
2016-03-24 16:09:18 -0700 (Thu, 24 Mar 2016)

Log Message

DataDetection creates links that are longer than the actual result.
https://bugs.webkit.org/show_bug.cgi?id=155850
rdar://problem/25280740

Reviewed by Anders Carlsson.

When a data detection result is composed of multiple fragments,
the range for the last fragment should take into account the end
offset of the query range structure, since there could be additional
content in that range that is not part of the result.

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

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (198649 => 198650)


--- trunk/Source/WebCore/ChangeLog	2016-03-24 23:01:45 UTC (rev 198649)
+++ trunk/Source/WebCore/ChangeLog	2016-03-24 23:09:18 UTC (rev 198650)
@@ -1,3 +1,19 @@
+2016-03-24  Enrica Casucci  <[email protected]>
+
+        DataDetection creates links that are longer than the actual result.
+        https://bugs.webkit.org/show_bug.cgi?id=155850
+        rdar://problem/25280740
+
+        Reviewed by Anders Carlsson.
+
+        When a data detection result is composed of multiple fragments,
+        the range for the last fragment should take into account the end
+        offset of the query range structure, since there could be additional
+        content in that range that is not part of the result.
+
+        * editing/cocoa/DataDetection.mm:
+        (WebCore::DataDetection::detectContentInRange):
+
 2016-03-24  Commit Queue  <[email protected]>
 
         Unreviewed, rolling out r198627.

Modified: trunk/Source/WebCore/editing/cocoa/DataDetection.mm (198649 => 198650)


--- trunk/Source/WebCore/editing/cocoa/DataDetection.mm	2016-03-24 23:01:45 UTC (rev 198649)
+++ trunk/Source/WebCore/editing/cocoa/DataDetection.mm	2016-03-24 23:09:18 UTC (rev 198650)
@@ -516,7 +516,10 @@
                 iteratorCount++;
             }
             currentRange = iterator.range();
-            fragmentRanges.append(currentRange);
+            if (fragmentIndex == queryRange.end.queryIndex)
+                fragmentRanges.append(Range::create(currentRange->ownerDocument(), &currentRange->startContainer(), currentRange->startOffset(), &currentRange->endContainer(), currentRange->startOffset() + queryRange.end.offset));
+            else
+                fragmentRanges.append(currentRange);
         }
         allResultRanges.append(fragmentRanges);
     }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to