Title: [130991] trunk/Source/WebKit/blackberry
Revision
130991
Author
mifen...@rim.com
Date
2012-10-10 18:40:29 -0700 (Wed, 10 Oct 2012)

Log Message

[BlackBerry] Fix crash for detached node when validating selection change.
https://bugs.webkit.org/show_bug.cgi?id=98926

Reviewed by Rob Buis.

PR 220628.

Guard against detached nodes when generating selection rect.

* WebKitSupport/DOMSupport.cpp:
(BlackBerry::WebKit::DOMSupport::visibleTextQuads):

Modified Paths

Diff

Modified: trunk/Source/WebKit/blackberry/ChangeLog (130990 => 130991)


--- trunk/Source/WebKit/blackberry/ChangeLog	2012-10-11 01:25:33 UTC (rev 130990)
+++ trunk/Source/WebKit/blackberry/ChangeLog	2012-10-11 01:40:29 UTC (rev 130991)
@@ -1,5 +1,19 @@
 2012-10-10  Mike Fenton  <mifen...@rim.com>
 
+        [BlackBerry] Fix crash for detached node when validating selection change.
+        https://bugs.webkit.org/show_bug.cgi?id=98926
+
+        Reviewed by Rob Buis.
+
+        PR 220628.
+
+        Guard against detached nodes when generating selection rect.
+
+        * WebKitSupport/DOMSupport.cpp:
+        (BlackBerry::WebKit::DOMSupport::visibleTextQuads):
+
+2012-10-10  Mike Fenton  <mifen...@rim.com>
+
         [BlackBerry] Adjust spell checking location to update after the cursor position is set.
         https://bugs.webkit.org/show_bug.cgi?id=98904
 

Modified: trunk/Source/WebKit/blackberry/WebKitSupport/DOMSupport.cpp (130990 => 130991)


--- trunk/Source/WebKit/blackberry/WebKitSupport/DOMSupport.cpp	2012-10-11 01:25:33 UTC (rev 130990)
+++ trunk/Source/WebKit/blackberry/WebKitSupport/DOMSupport.cpp	2012-10-11 01:40:29 UTC (rev 130991)
@@ -54,8 +54,12 @@
 {
     if (!selection.isRange())
         return;
-    ASSERT(selection.firstRange());
 
+    // Make sure that both start and end have valid nodes associated otherwise
+    // this can crash. See PR 220628.
+    if (!selection.start().anchorNode() || !selection.end().anchorNode())
+        return;
+
     visibleTextQuads(*(selection.firstRange()), quads, true /* useSelectionHeight */);
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to