mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
bug 1172523 - fire useful text change events for proxies r=lsocks
This commit is contained in:
parent
27dc768d13
commit
077c66681a
@ -1462,6 +1462,15 @@ MaiAtkObject::FireStateChangeEvent(uint64_t aState, bool aEnabled)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
a11y::ProxyTextChangeEvent(ProxyAccessible* aTarget, const nsString& aStr,
|
||||||
|
int32_t aStart, uint32_t aLen, bool aIsInsert,
|
||||||
|
bool aFromUser)
|
||||||
|
{
|
||||||
|
MaiAtkObject* atkObj = MAI_ATK_OBJECT(GetWrapperFor(aTarget));
|
||||||
|
atkObj->FireTextChangeEvent(aStr, aStart, aLen, aIsInsert, aFromUser);
|
||||||
|
}
|
||||||
|
|
||||||
#define OLD_TEXT_INSERTED "text_changed::insert"
|
#define OLD_TEXT_INSERTED "text_changed::insert"
|
||||||
#define OLD_TEXT_REMOVED "text_changed::delete"
|
#define OLD_TEXT_REMOVED "text_changed::delete"
|
||||||
static const char* oldTextChangeStrings[2][2] = {
|
static const char* oldTextChangeStrings[2][2] = {
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
class nsString;
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
namespace a11y {
|
namespace a11y {
|
||||||
|
|
||||||
@ -70,6 +72,9 @@ void ProxyEvent(ProxyAccessible* aTarget, uint32_t aEventType);
|
|||||||
void ProxyStateChangeEvent(ProxyAccessible* aTarget, uint64_t aState,
|
void ProxyStateChangeEvent(ProxyAccessible* aTarget, uint64_t aState,
|
||||||
bool aEnabled);
|
bool aEnabled);
|
||||||
void ProxyCaretMoveEvent(ProxyAccessible* aTarget, int32_t aOffset);
|
void ProxyCaretMoveEvent(ProxyAccessible* aTarget, int32_t aOffset);
|
||||||
|
void ProxyTextChangeEvent(ProxyAccessible* aTarget, const nsString& aStr,
|
||||||
|
int32_t aStart, uint32_t aLen, bool aIsInsert,
|
||||||
|
bool aFromUser);
|
||||||
} // namespace a11y
|
} // namespace a11y
|
||||||
} // namespace mozilla
|
} // namespace mozilla
|
||||||
|
|
||||||
|
@ -865,6 +865,16 @@ Accessible::HandleAccEvent(AccEvent* aEvent)
|
|||||||
ipcDoc->SendEvent(id, event->GetCaretOffset());
|
ipcDoc->SendEvent(id, event->GetCaretOffset());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case nsIAccessibleEvent::EVENT_TEXT_INSERTED:
|
||||||
|
case nsIAccessibleEvent::EVENT_TEXT_REMOVED: {
|
||||||
|
AccTextChangeEvent* event = downcast_accEvent(aEvent);
|
||||||
|
ipcDoc->SendTextChangeEvent(id, event->ModifiedText(),
|
||||||
|
event->GetStartOffset(),
|
||||||
|
event->GetLength(),
|
||||||
|
event->IsTextInserted(),
|
||||||
|
event->IsFromUserInput());
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
ipcDoc->SendEvent(id, aEvent->GetEventType());
|
ipcDoc->SendEvent(id, aEvent->GetEventType());
|
||||||
}
|
}
|
||||||
|
@ -151,6 +151,23 @@ DocAccessibleParent::RecvCaretMoveEvent(const uint64_t& aID, const int32_t& aOff
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
DocAccessibleParent::RecvTextChangeEvent(const uint64_t& aID,
|
||||||
|
const nsString& aStr,
|
||||||
|
const int32_t& aStart,
|
||||||
|
const uint32_t& aLen,
|
||||||
|
const bool& aIsInsert,
|
||||||
|
const bool& aFromUser)
|
||||||
|
{
|
||||||
|
ProxyAccessible* target = GetAccessible(aID);
|
||||||
|
if (!target)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
ProxyTextChangeEvent(target, aStr, aStart, aLen, aIsInsert, aFromUser);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
DocAccessibleParent::RecvBindChildDoc(PDocAccessibleParent* aChildDoc, const uint64_t& aID)
|
DocAccessibleParent::RecvBindChildDoc(PDocAccessibleParent* aChildDoc, const uint64_t& aID)
|
||||||
{
|
{
|
||||||
|
@ -51,6 +51,11 @@ public:
|
|||||||
virtual bool RecvCaretMoveEvent(const uint64_t& aID, const int32_t& aOffset)
|
virtual bool RecvCaretMoveEvent(const uint64_t& aID, const int32_t& aOffset)
|
||||||
override final;
|
override final;
|
||||||
|
|
||||||
|
virtual bool RecvTextChangeEvent(const uint64_t& aID, const nsString& aStr,
|
||||||
|
const int32_t& aStart, const uint32_t& aLen,
|
||||||
|
const bool& aIsInsert,
|
||||||
|
const bool& aFromUser) override;
|
||||||
|
|
||||||
virtual bool RecvBindChildDoc(PDocAccessibleParent* aChildDoc, const uint64_t& aID) override;
|
virtual bool RecvBindChildDoc(PDocAccessibleParent* aChildDoc, const uint64_t& aID) override;
|
||||||
void Unbind()
|
void Unbind()
|
||||||
{
|
{
|
||||||
|
@ -59,6 +59,8 @@ parent:
|
|||||||
HideEvent(uint64_t aRootID);
|
HideEvent(uint64_t aRootID);
|
||||||
StateChangeEvent(uint64_t aID, uint64_t aState, bool aEnabled);
|
StateChangeEvent(uint64_t aID, uint64_t aState, bool aEnabled);
|
||||||
CaretMoveEvent(uint64_t aID, int32_t aOffset);
|
CaretMoveEvent(uint64_t aID, int32_t aOffset);
|
||||||
|
TextChangeEvent(uint64_t aID, nsString aStr, int32_t aStart, uint32_t aLen,
|
||||||
|
bool aIsInsert, bool aFromUser);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Tell the parent document to bind the existing document as a new child
|
* Tell the parent document to bind the existing document as a new child
|
||||||
|
@ -83,6 +83,11 @@ ProxyCaretMoveEvent(ProxyAccessible* aTarget, int32_t aOffset)
|
|||||||
[wrapper selectedTextDidChange];
|
[wrapper selectedTextDidChange];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ProxyTextChangeEvent(ProxyAccessible*, const nsString&, int32_t, uint32_t,
|
||||||
|
bool, bool)
|
||||||
|
{
|
||||||
|
}
|
||||||
} // namespace a11y
|
} // namespace a11y
|
||||||
} // namespace mozilla
|
} // namespace mozilla
|
||||||
|
|
||||||
|
@ -43,3 +43,9 @@ void
|
|||||||
a11y::ProxyCaretMoveEvent(ProxyAccessible* aTarget, int32_t aOffset)
|
a11y::ProxyCaretMoveEvent(ProxyAccessible* aTarget, int32_t aOffset)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
a11y::ProxyTextChangeEvent(ProxyAccessible*, const nsString&, int32_t, uint32_t,
|
||||||
|
bool, bool)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
@ -68,3 +68,9 @@ void
|
|||||||
a11y::ProxyCaretMoveEvent(ProxyAccessible* aTarget, int32_t aOffset)
|
a11y::ProxyCaretMoveEvent(ProxyAccessible* aTarget, int32_t aOffset)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
a11y::ProxyTextChangeEvent(ProxyAccessible*, const nsString&, int32_t, uint32_t,
|
||||||
|
bool, bool)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user