[Gtk] Regression: text-inserted events lack text inserted and current line
authormario@webkit.org <mario@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 29 Nov 2011 11:04:43 +0000 (11:04 +0000)
committermario@webkit.org <mario@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 29 Nov 2011 11:04:43 +0000 (11:04 +0000)
commit23e25125121475950497750a90c410692273e93c
tree3800929410e4298f7529105b5ff362c164bbb877
parentae4795b402b59d69f34a257f328f6d0aacdc23cc
[Gtk] Regression: text-inserted events lack text inserted and current line
https://bugs.webkit.org/show_bug.cgi?id=72830

Reviewed by Chris Fleizach.

Source/WebCore:

Replace the emission of the old (and now deprecated) AtkObject's
'text-changed:insert' and 'text-changed:remove' signals with the
new 'text-insert' and 'text-remove' ones, which are better and
less fragile since they emit the modified text too, along with the
typical 'offset' and 'count' values associated to the change.

Also, change the signature of the nodeTextChangeNotification() and
nodeTextChangePlatformNotification() to allow specifying the text
being modified from the place we better know about it, that is,
the text editing commands.

* accessibility/gtk/AXObjectCacheAtk.cpp:
(WebCore::emitTextChanged): Emit 'text-insert' and 'text-remove',
instead of the old and now deprecated 'text-changed' signal.
(WebCore::AXObjectCache::nodeTextChangePlatformNotification):
Update this function to receive a String with the text being
modified, instead of just the number of characters.

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::nodeTextChangeNotification): Update this
function to receive a String with the text being modified.
* accessibility/AXObjectCache.h:
(WebCore::AXObjectCache::nodeTextChangeNotification): Ditto.
(WebCore::AXObjectCache::nodeTextChangePlatformNotification): Ditto.

Adapt the text editing commants to pass the whole text string
being modified, instead of just its number of characters.

* editing/AppendNodeCommand.cpp:
(WebCore::sendAXTextChangedIgnoringLineBreaks): Adapt to the new
signature of nodeTextChangeNotification(), so pass the whole text.
* editing/DeleteFromTextNodeCommand.cpp:
(WebCore::DeleteFromTextNodeCommand::doApply): Ditto.
(WebCore::DeleteFromTextNodeCommand::doUnapply): Ditto.
* editing/InsertIntoTextNodeCommand.cpp:
(WebCore::InsertIntoTextNodeCommand::doApply): Ditto.
(WebCore::InsertIntoTextNodeCommand::doUnapply): Ditto.
* editing/InsertNodeBeforeCommand.cpp:
(WebCore::InsertNodeBeforeCommand::doApply): Ditto.
(WebCore::InsertNodeBeforeCommand::doUnapply): Ditto.

Update mac, win and chromium's specific parts of AXObjectCache to
match the new signature for nodeTextChangePlatformNotification(),
which won't affect their behaviour as they were not implementing
that method anyway.

* accessibility/chromium/AXObjectCacheChromium.cpp:
(WebCore::AXObjectCache::nodeTextChangePlatformNotification):
* accessibility/mac/AXObjectCacheMac.mm:
(WebCore::AXObjectCache::nodeTextChangePlatformNotification):
* accessibility/win/AXObjectCacheWin.cpp:
(WebCore::AXObjectCache::nodeTextChangePlatformNotification):

Source/WebKit/gtk:

Updated unit test to handle the new 'text-insert' and
'text-remove' signals, instead of the 'text-changed' one.

* tests/testatk.c:
(textChangedCb): Update a global variable with the result of the
text change, so we can check its value later.
(testWebkitAtkTextChangedNotifications): Connect to the
'text-insert' and 'text-remove' signals and check, in a way more
carefully way than it was done before, that the signals are being
properly emitted, and that the information attached to them is the
right one for each case (insert/remove, offset, count and text).

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@101349 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AXObjectCache.cpp
Source/WebCore/accessibility/AXObjectCache.h
Source/WebCore/accessibility/chromium/AXObjectCacheChromium.cpp
Source/WebCore/accessibility/gtk/AXObjectCacheAtk.cpp
Source/WebCore/accessibility/mac/AXObjectCacheMac.mm
Source/WebCore/accessibility/win/AXObjectCacheWin.cpp
Source/WebCore/editing/AppendNodeCommand.cpp
Source/WebCore/editing/DeleteFromTextNodeCommand.cpp
Source/WebCore/editing/InsertIntoTextNodeCommand.cpp
Source/WebCore/editing/InsertNodeBeforeCommand.cpp
Source/WebKit/gtk/ChangeLog
Source/WebKit/gtk/tests/testatk.c