2009-06-15 Xan Lopez <xlopez@igalia.com>
authorxan@webkit.org <xan@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 15 Jun 2009 14:17:15 +0000 (14:17 +0000)
committerxan@webkit.org <xan@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 15 Jun 2009 14:17:15 +0000 (14:17 +0000)
        Reviewed by Holger Freyther.

        https://bugs.webkit.org/show_bug.cgi?id=25895
        [Gtk] Segfault when deleting the last/only character in an entry if a11y is enabled

        Use computeOffsetInContainerNode instead of the inline
        offsetInContainerNode to return the caret offset, since the former
        can handle all types of anchoring. Otherwise we'll hit an ASSERT
        in some situations in debug builds, and crash.

        * editing/gtk/SelectionControllerGtk.cpp:
        (WebCore::SelectionController::notifyAccessibilityForSelectionChange):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@44683 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/editing/gtk/SelectionControllerGtk.cpp

index dded28d43b2704a9abbee66059dc9488da07df16..eeb7a01eaa58e64610b484df559cf09bf42adbd2 100644 (file)
@@ -1,3 +1,18 @@
+2009-06-15  Xan Lopez  <xlopez@igalia.com>
+
+        Reviewed by Holger Freyther.
+
+        https://bugs.webkit.org/show_bug.cgi?id=25895
+        [Gtk] Segfault when deleting the last/only character in an entry if a11y is enabled
+
+        Use computeOffsetInContainerNode instead of the inline
+        offsetInContainerNode to return the caret offset, since the former
+        can handle all types of anchoring. Otherwise we'll hit an ASSERT
+        in some situations in debug builds, and crash.
+
+        * editing/gtk/SelectionControllerGtk.cpp:
+        (WebCore::SelectionController::notifyAccessibilityForSelectionChange):
+
 2009-06-15  Joe Ligman  <joseph.ligman@nokia.com>
 
         Reviewed by Simon Hausmann.
index 52fbbab53925aa370eedafef11e2036310d59cd3..c21c45a54d88e980e3c484908143d581ec1bc0b0 100644 (file)
@@ -34,7 +34,7 @@ void SelectionController::notifyAccessibilityForSelectionChange()
         AccessibilityObject* accessibilityObject = m_frame->document()->axObjectCache()->getOrCreate(focusedNode);
         AtkObject* wrapper = accessibilityObject->wrapper();
         if (ATK_IS_TEXT(wrapper)) {
-            g_signal_emit_by_name(wrapper, "text-caret-moved", m_sel.start().offsetInContainerNode());
+            g_signal_emit_by_name(wrapper, "text-caret-moved", m_sel.start().computeOffsetInContainerNode());
 
             if (m_sel.isRange())
                 g_signal_emit_by_name(wrapper, "text-selection-changed");