Title: [105224] trunk
Revision
105224
Author
[email protected]
Date
2012-01-17 18:03:30 -0800 (Tue, 17 Jan 2012)

Log Message

NULL ptr in WebCore::RenderSVGInlineText::localCaretRect
https://bugs.webkit.org/show_bug.cgi?id=75851

Patch by Stephen Chenney <[email protected]> on 2012-01-17
Reviewed by Ryosuke Niwa.

.:

Added a check for null box in localCaretRect, to match test in other
implementations. Adding a manual test because the crash is not
reproducible in DRT.

* ManualTests/svg-modify-deleted-selection.svg: Added.

Source/WebCore:

Added a check for null box in localCaretRect, to match test in other
implementations. Adding a manual test because the crash is not reproducible
in DRT.

Test: ManualTests/svg-modify-deleted-selection.svg

* rendering/svg/RenderSVGInlineText.cpp:
(WebCore::RenderSVGInlineText::localCaretRect):

Modified Paths

Added Paths

Diff

Modified: trunk/ChangeLog (105223 => 105224)


--- trunk/ChangeLog	2012-01-18 02:00:44 UTC (rev 105223)
+++ trunk/ChangeLog	2012-01-18 02:03:30 UTC (rev 105224)
@@ -1,3 +1,16 @@
+2012-01-17  Stephen Chenney  <[email protected]>
+
+        NULL ptr in WebCore::RenderSVGInlineText::localCaretRect
+        https://bugs.webkit.org/show_bug.cgi?id=75851
+
+        Reviewed by Ryosuke Niwa.
+
+        Added a check for null box in localCaretRect, to match test in other
+        implementations. Adding a manual test because the crash is not
+        reproducible in DRT.
+
+        * ManualTests/svg-modify-deleted-selection.svg: Added.
+
 2012-01-17  Raul Hudea  <[email protected]>
 
         Move tests out of WebCore/manual-tests to toplevel ManualTests.

Added: trunk/ManualTests/svg-modify-deleted-selection.svg (0 => 105224)


--- trunk/ManualTests/svg-modify-deleted-selection.svg	                        (rev 0)
+++ trunk/ManualTests/svg-modify-deleted-selection.svg	2012-01-18 02:03:30 UTC (rev 105224)
@@ -0,0 +1,16 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<style>
+  * {
+    border-top-style: inset
+  }
+</style>
+<script>
+  window._onclick_=function() {
+    getSelection().setBaseAndExtent(document,5,document,5);
+    getSelection().deleteFromDocument();
+    getSelection().modify('extend','backward','line');
+  }
+</script>
+<text y="50" fill="green" font-size="20">Test passes if no crash on mouse click. Text may be highlighted.</text>
+<text> 1 </text>
+</svg>

Modified: trunk/Source/WebCore/ChangeLog (105223 => 105224)


--- trunk/Source/WebCore/ChangeLog	2012-01-18 02:00:44 UTC (rev 105223)
+++ trunk/Source/WebCore/ChangeLog	2012-01-18 02:03:30 UTC (rev 105224)
@@ -1,3 +1,19 @@
+2012-01-17  Stephen Chenney  <[email protected]>
+
+        NULL ptr in WebCore::RenderSVGInlineText::localCaretRect
+        https://bugs.webkit.org/show_bug.cgi?id=75851
+
+        Reviewed by Ryosuke Niwa.
+
+        Added a check for null box in localCaretRect, to match test in other
+        implementations. Adding a manual test because the crash is not reproducible
+        in DRT.
+
+        Test: ManualTests/svg-modify-deleted-selection.svg
+
+        * rendering/svg/RenderSVGInlineText.cpp:
+        (WebCore::RenderSVGInlineText::localCaretRect):
+
 2012-01-17  Caio Marcelo de Oliveira Filho  <[email protected]>
 
         Uint8ClampedArray support

Modified: trunk/Source/WebCore/rendering/svg/RenderSVGInlineText.cpp (105223 => 105224)


--- trunk/Source/WebCore/rendering/svg/RenderSVGInlineText.cpp	2012-01-18 02:00:44 UTC (rev 105223)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGInlineText.cpp	2012-01-18 02:03:30 UTC (rev 105224)
@@ -138,7 +138,7 @@
 
 LayoutRect RenderSVGInlineText::localCaretRect(InlineBox* box, int caretOffset, LayoutUnit*)
 {
-    if (!box->isInlineTextBox())
+    if (!box || !box->isInlineTextBox())
         return LayoutRect();
 
     InlineTextBox* textBox = static_cast<InlineTextBox*>(box);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to