Bug 528435 Drop NS_COMPOSITION_QUERY event r=roc, sr=neil

This commit is contained in:
Masayuki Nakano 2009-11-16 22:13:02 +09:00
Родитель 2e63db5b79
Коммит 7b634303be
13 изменённых файлов: 24 добавлений и 72 удалений

Просмотреть файл

@ -370,8 +370,7 @@ nsDOMUIEvent::GetIsChar(PRBool* aIsChar)
NS_METHOD nsDOMUIEvent::GetCompositionReply(nsTextEventReply** aReply)
{
if((mEvent->message == NS_COMPOSITION_START) ||
(mEvent->message == NS_COMPOSITION_QUERY))
if((mEvent->message == NS_COMPOSITION_START))
{
*aReply = &(static_cast<nsCompositionEvent*>(mEvent)->theReply);
return NS_OK;

Просмотреть файл

@ -211,9 +211,7 @@ static const EventDispatchData sCompositionEvents[] = {
{ NS_COMPOSITION_START,
HANDLER(&nsIDOMCompositionListener::HandleStartComposition) },
{ NS_COMPOSITION_END,
HANDLER(&nsIDOMCompositionListener::HandleEndComposition) },
{ NS_COMPOSITION_QUERY,
HANDLER(&nsIDOMCompositionListener::HandleQueryComposition) }
HANDLER(&nsIDOMCompositionListener::HandleEndComposition) }
};
static const EventDispatchData sTextEvents[] = {

Просмотреть файл

@ -44,10 +44,10 @@
/*
* Key pressed / released / typed listener interface.
*/
// {93A5A335-AA51-4d32-977D-3680B7722AD5}
// {47F158C0-C534-43a1-8415-8B17706E2FBC}
#define NS_IDOMCOMPOSITIONLISTENER_IID \
{ 0x93a5a335, 0xaa51, 0x4d32, \
{ 0x97, 0x7d, 0x36, 0x80, 0xb7, 0x72, 0x2a, 0xd5 } }
{ 0x47f158c0, 0xc534, 0x43a1, \
{ 0x84, 0x15, 0x8b, 0x17, 0x70, 0x6e, 0x2f, 0xbc } }
class nsIDOMCompositionListener : public nsIDOMEventListener {
@ -58,7 +58,6 @@ public:
NS_IMETHOD HandleStartComposition(nsIDOMEvent* aCompositionEvent) = 0;
NS_IMETHOD HandleEndComposition(nsIDOMEvent* aCompositionEvent) = 0;
NS_IMETHOD HandleQueryComposition(nsIDOMEvent* aCompositionEvent) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMCompositionListener,

Просмотреть файл

@ -48,7 +48,7 @@ struct nsTextEventReply;
[ptr] native nsTextEventReplyPtr(nsTextEventReply);
[scriptable, uuid(57032dcb-e8c7-4eb6-8ec6-a0f8e300809d)]
[scriptable, uuid(52032429-9337-4ecf-b56b-81875a9324bc)]
interface nsIEditorIMESupport : nsISupports
{
@ -73,12 +73,6 @@ interface nsIEditorIMESupport : nsISupports
void endComposition();
/**
* queryComposition() Get the composition position
*/
[noscript] void queryComposition(in nsTextEventReplyPtr aReply);
/**
* forceCompositionEnd() force the composition end
*/

Просмотреть файл

@ -1982,7 +1982,7 @@ nsEditor::StopPreservingSelection()
//
// The BeingComposition method is called from the Editor Composition event listeners.
//
NS_IMETHODIMP
nsresult
nsEditor::QueryComposition(nsTextEventReply* aReply)
{
nsresult result;

Просмотреть файл

@ -357,6 +357,8 @@ protected:
*/
PRBool GetDesiredSpellCheckState();
nsresult QueryComposition(nsTextEventReply* aReply);
public:
/** All editor operations which alter the doc should be prefaced

Просмотреть файл

@ -850,21 +850,6 @@ nsTextEditorCompositionListener::HandleStartComposition(nsIDOMEvent* aCompositio
return mEditor->BeginComposition(eventReply);
}
nsresult
nsTextEditorCompositionListener::HandleQueryComposition(nsIDOMEvent* aCompositionEvent)
{
#ifdef DEBUG_IME
printf("nsTextEditorCompositionListener::HandleQueryComposition\n");
#endif
nsCOMPtr<nsIPrivateCompositionEvent> pCompositionEvent = do_QueryInterface(aCompositionEvent);
if (!pCompositionEvent) return NS_ERROR_FAILURE;
nsTextEventReply* eventReply;
nsresult rv = pCompositionEvent->GetCompositionReply(&eventReply);
if (NS_FAILED(rv)) return rv;
return mEditor->QueryComposition(eventReply);
}
nsresult
nsTextEditorCompositionListener::HandleEndComposition(nsIDOMEvent* aCompositionEvent)

Просмотреть файл

@ -147,7 +147,6 @@ public:
NS_IMETHOD HandleEvent(nsIDOMEvent* aEvent);
NS_IMETHOD HandleStartComposition(nsIDOMEvent* aCompositionEvent);
NS_IMETHOD HandleEndComposition(nsIDOMEvent* aCompositionEvent);
NS_IMETHOD HandleQueryComposition(nsIDOMEvent* aCompositionEvent);
/*END implementations of textevent handler interface*/
protected:

Просмотреть файл

@ -781,16 +781,6 @@ nsFormFillController::HandleEndComposition(nsIDOMEvent* aCompositionEvent)
return NS_OK;
}
NS_IMETHODIMP
nsFormFillController::HandleQueryComposition(nsIDOMEvent* aCompositionEvent)
{
// Drop untrusted events from content
if (!IsEventTrusted(aCompositionEvent))
return NS_OK;
return NS_OK;
}
////////////////////////////////////////////////////////////////////////
//// nsIDOMFormListener

Просмотреть файл

@ -90,7 +90,6 @@ public:
// nsIDOMCompositionListener
NS_IMETHOD HandleStartComposition(nsIDOMEvent* aCompositionEvent);
NS_IMETHOD HandleEndComposition(nsIDOMEvent* aCompositionEvent);
NS_IMETHOD HandleQueryComposition(nsIDOMEvent* aCompositionEvent);
// nsIDOMFormListener
NS_IMETHOD Submit(nsIDOMEvent* aEvent);

Просмотреть файл

@ -307,7 +307,6 @@ class nsHashKey;
#define NS_COMPOSITION_EVENT_START 2200
#define NS_COMPOSITION_START (NS_COMPOSITION_EVENT_START)
#define NS_COMPOSITION_END (NS_COMPOSITION_EVENT_START + 1)
#define NS_COMPOSITION_QUERY (NS_COMPOSITION_EVENT_START + 2)
// text events
#define NS_TEXT_START 2400
@ -988,6 +987,8 @@ struct nsTextRange
typedef nsTextRange* nsTextRangeArray;
// XXX We should drop this struct because the results are provided by query
// content events now, so, this struct finished the role.
struct nsTextEventReply
{
nsTextEventReply()
@ -1012,7 +1013,7 @@ public:
}
nsString theText;
nsTextEventReply theReply;
nsTextEventReply theReply; // OBSOLETE
PRUint32 rangeCount;
// Note that the range array may not specify a caret position; in that
// case there will be no range of type NS_TEXTRANGE_CARETPOSITION in the
@ -1029,7 +1030,7 @@ public:
{
}
nsTextEventReply theReply;
nsTextEventReply theReply; // OBSOLETE
};
/* Mouse Scroll Events: Line Scrolling, Pixel Scrolling and Common Event Flows
@ -1382,8 +1383,7 @@ enum nsDragDropEventStatus {
#define NS_IS_IME_EVENT(evnt) \
(((evnt)->message == NS_TEXT_TEXT) || \
((evnt)->message == NS_COMPOSITION_START) || \
((evnt)->message == NS_COMPOSITION_END) || \
((evnt)->message == NS_COMPOSITION_QUERY))
((evnt)->message == NS_COMPOSITION_END))
#define NS_IS_ACTIVATION_EVENT(evnt) \
(((evnt)->message == NS_ACTIVATE) || \

Просмотреть файл

@ -173,6 +173,8 @@ void nsIMEBeOS::RunIME(uint32 *args, nsWindow *target, BView *fView)
break;
case B_INPUT_METHOD_LOCATION_REQUEST:
// XXX NS_COMPOSITION_QUERY was dropped, use content query content events to get the caret rect.
#if 0
if (fView && fView->LockLooper())
{
BPoint caret(imeCaret);
@ -191,13 +193,16 @@ void nsIMEBeOS::RunIME(uint32 *args, nsWindow *target, BView *fView)
imeMessenger.SendMessage(&reply);
fView->UnlockLooper();
}
#endif
break;
case B_INPUT_METHOD_STARTED:
imeTarget = target;
DispatchIME(NS_COMPOSITION_START);
// XXX NS_COMPOSITION_QUERY was dropped, use content query content events to get the caret rect.
#if 0
DispatchIME(NS_COMPOSITION_QUERY);
#endif
msg.FindMessenger("be:reply_to", &imeMessenger);
break;
@ -256,12 +261,15 @@ void nsIMEBeOS::DispatchIME(PRUint32 what)
DispatchWindowEvent(&compEvent);
imeState = what;
// XXX NS_COMPOSITION_QUERY was dropped, use content query content events to get the caret rect.
#if 0
if (what == NS_COMPOSITION_QUERY)
{
imeCaret.Set(compEvent.theReply.mCursorPosition.x,
compEvent.theReply.mCursorPosition.y);
imeHeight = compEvent.theReply.mCursorPosition.height+4;
}
#endif
}
PRBool nsIMEBeOS::DispatchWindowEvent(nsGUIEvent* event)

Просмотреть файл

@ -2470,28 +2470,7 @@ PRBool nsWindow::ProcessMessage( ULONG msg, MPARAM mp1, MPARAM mp2, MRESULT &rc)
case WM_QUERYCONVERTPOS:
{
PRECTL pCursorRect = (PRECTL)mp1;
nsCompositionEvent event(PR_TRUE, NS_COMPOSITION_QUERY, this);
nsIntPoint point;
point.x = 0;
point.y = 0;
InitEvent(event,&point);
DispatchWindowEvent(&event);
if ((event.theReply.mCursorPosition.x) ||
(event.theReply.mCursorPosition.y))
{
pCursorRect->xLeft = event.theReply.mCursorPosition.x + 1;
pCursorRect->xRight = pCursorRect->xLeft + event.theReply.mCursorPosition.width - 1;
pCursorRect->yTop = GetClientHeight() - event.theReply.mCursorPosition.y;
pCursorRect->yBottom = pCursorRect->yTop - event.theReply.mCursorPosition.height;
point.x = 0;
point.y = 0;
rc = (MRESULT)QCP_CONVERT;
}
else
rc = (MRESULT)QCP_NOCONVERT;
rc = (MRESULT)QCP_NOCONVERT;
result = PR_TRUE;
break;
}