[GTK] ATK text-caret-moved and text-selection-changed events not being emitted
authormario@webkit.org <mario@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 22 Jan 2012 19:29:04 +0000 (19:29 +0000)
committermario@webkit.org <mario@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 22 Jan 2012 19:29:04 +0000 (19:29 +0000)
commitd048f7632d4ad428fc5815f429dc6136de6f6ca6
tree8a2557209b4b984d2c0afd2ddafa7d865db86d32
parentaca1c092c0b45437d11aa28e8fc82f874670bf2b
[GTK] ATK text-caret-moved and text-selection-changed events not being emitted
https://bugs.webkit.org/show_bug.cgi?id=76069

Reviewed by Martin Robinson.

Source/WebCore:

Fix bug introduced with patch for Bug 72830.

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::isDescendantOfObject): New function,
to check if an accessibility object is a descendant of other object.
(WebCore::AccessibilityObject::isAncestorOfObject): New function,
to check if an accessibility object is an ancestor of other object.
* accessibility/AccessibilityObject.h:

* accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
(webkit_accessible_text_get_caret_offset): Make sure to pass the
right reference object to objectFocusedAndCaretOffsetUnignored.
(objectFocusedAndCaretOffsetUnignored): Use positionBeforeNode
instead of firstPositionInNode for calculating the begining of the
range used to calculate the offsets. Ensure that the reference
object is never a descendant of the actual object being returned.

* editing/gtk/FrameSelectionGtk.cpp:
(WebCore::FrameSelection::notifyAccessibilityForSelectionChange):
Pass the right accessibility object associated with the current
selection to objectFocusedAndCaretOffsetUnignored.

Source/WebKit/gtk:

Update caret browsing related unit tests to check emissions of
'text-caret-moved' and 'text-selection-changed' signals.

* tests/testatk.c:
(textCaretMovedCallback): New callback for 'text-caret-moved'.
(testWebkitAtkCaretOffsets): Check emissions of 'text-caret-moved'.
(textSelectionChangedCallback): New callback for 'text-selection-changed'.
(testWebkitAtkTextSelections): Check emissions of 'text-selection-changed'.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@105590 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityObject.cpp
Source/WebCore/accessibility/AccessibilityObject.h
Source/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp
Source/WebCore/editing/gtk/FrameSelectionGtk.cpp
Source/WebKit/gtk/ChangeLog
Source/WebKit/gtk/tests/testatk.c