Title: [210795] trunk/Source/WebCore
Revision
210795
Author
an...@apple.com
Date
2017-01-16 19:47:43 -0800 (Mon, 16 Jan 2017)

Log Message

CrashTracer: com.apple.WebKit.WebContent at _javascript_Core: WTF::StringImpl::containsOnlyWhitespace
https://bugs.webkit.org/show_bug.cgi?id=167106
<rdar://problem/24457632>

Reviewed by Tim Horton.

Speculative fix.

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

    Test before casting to Text.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (210794 => 210795)


--- trunk/Source/WebCore/ChangeLog	2017-01-17 03:42:20 UTC (rev 210794)
+++ trunk/Source/WebCore/ChangeLog	2017-01-17 03:47:43 UTC (rev 210795)
@@ -1,3 +1,18 @@
+2017-01-16  Antti Koivisto  <an...@apple.com>
+
+        CrashTracer: com.apple.WebKit.WebContent at _javascript_Core: WTF::StringImpl::containsOnlyWhitespace
+        https://bugs.webkit.org/show_bug.cgi?id=167106
+        <rdar://problem/24457632>
+
+        Reviewed by Tim Horton.
+
+        Speculative fix.
+
+        * editing/cocoa/DataDetection.mm:
+        (WebCore::DataDetection::detectContentInRange):
+
+            Test before casting to Text.
+
 2017-01-16  Javier Fernandez  <jfernan...@igalia.com>
 
         [css-grid] Implementing baseline positioning for grid containers

Modified: trunk/Source/WebCore/editing/cocoa/DataDetection.mm (210794 => 210795)


--- trunk/Source/WebCore/editing/cocoa/DataDetection.mm	2017-01-17 03:42:20 UTC (rev 210794)
+++ trunk/Source/WebCore/editing/cocoa/DataDetection.mm	2017-01-17 03:47:43 UTC (rev 210795)
@@ -577,7 +577,8 @@
             auto* parentNode = range->startContainer().parentNode();
             if (!parentNode)
                 continue;
-
+            if (!is<Text>(range->startContainer()))
+                continue;
             auto& currentTextNode = downcast<Text>(range->startContainer());
             Document& document = currentTextNode.document();
             String textNodeData;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to