mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 805357 part.2 Get rid of NS_SUCCESS_IME_NO_UPDATES since OnIMEFocusChange(false) is always called r=roc
This commit is contained in:
parent
683e1373fd
commit
e33e735f92
@ -60,8 +60,7 @@ public:
|
||||
|
||||
nsresult Init(nsIWidget* aWidget,
|
||||
nsPresContext* aPresContext,
|
||||
nsINode* aNode,
|
||||
bool aWantUpdates);
|
||||
nsINode* aNode);
|
||||
void Destroy(void);
|
||||
bool IsManaging(nsPresContext* aPresContext, nsIContent* aContent);
|
||||
|
||||
@ -675,15 +674,10 @@ nsTextStateManager::nsTextStateManager()
|
||||
nsresult
|
||||
nsTextStateManager::Init(nsIWidget* aWidget,
|
||||
nsPresContext* aPresContext,
|
||||
nsINode* aNode,
|
||||
bool aWantUpdates)
|
||||
nsINode* aNode)
|
||||
{
|
||||
mWidget = aWidget;
|
||||
MOZ_ASSERT(mWidget);
|
||||
if (!aWantUpdates) {
|
||||
mEditableNode = aNode;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsIPresShell* presShell = aPresContext->PresShell();
|
||||
|
||||
@ -1012,8 +1006,6 @@ nsIMEStateManager::CreateTextStateManager()
|
||||
return;
|
||||
NS_ENSURE_SUCCESS_VOID(rv);
|
||||
|
||||
bool wantUpdates = rv != NS_SUCCESS_IME_NO_UPDATES;
|
||||
|
||||
// OnIMEFocusChange may cause focus and sTextStateObserver to change
|
||||
// In that case return and keep the current sTextStateObserver
|
||||
NS_ENSURE_TRUE_VOID(!sTextStateObserver);
|
||||
@ -1021,8 +1013,7 @@ nsIMEStateManager::CreateTextStateManager()
|
||||
sTextStateObserver = new nsTextStateManager();
|
||||
NS_ENSURE_TRUE_VOID(sTextStateObserver);
|
||||
NS_ADDREF(sTextStateObserver);
|
||||
rv = sTextStateObserver->Init(widget, sPresContext,
|
||||
editableNode, wantUpdates);
|
||||
rv = sTextStateObserver->Init(widget, sPresContext, editableNode);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
return;
|
||||
}
|
||||
|
@ -525,7 +525,7 @@ TabParent::RecvNotifyIMEFocus(const bool& aFocus,
|
||||
nsresult rv = widget->OnIMEFocusChange(aFocus);
|
||||
|
||||
if (aFocus) {
|
||||
if (NS_SUCCEEDED(rv) && rv != NS_SUCCESS_IME_NO_UPDATES) {
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
*aPreference = widget->GetIMEUpdatePreference();
|
||||
} else {
|
||||
aPreference->mWantUpdates = false;
|
||||
|
@ -1494,10 +1494,7 @@ class nsIWidget : public nsISupports {
|
||||
* aFocus is false if node is giving up focus (blur)
|
||||
*
|
||||
* If this returns NS_ERROR_*, OnIMETextChange and OnIMESelectionChange
|
||||
* and OnIMEFocusChange(false) will be never called.
|
||||
*
|
||||
* If this returns NS_SUCCESS_IME_NO_UPDATES, OnIMEFocusChange(false)
|
||||
* will be called but OnIMETextChange and OnIMESelectionChange will NOT.
|
||||
* will be never called.
|
||||
*/
|
||||
NS_IMETHOD OnIMEFocusChange(bool aFocus) = 0;
|
||||
|
||||
|
@ -422,7 +422,7 @@ PuppetWidget::OnIMEFocusChange(bool aFocus)
|
||||
if (aFocus) {
|
||||
if (!mIMEPreference.mWantUpdates && !mIMEPreference.mWantHints)
|
||||
// call OnIMEFocusChange on blur but no other updates
|
||||
return NS_SUCCESS_IME_NO_UPDATES;
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
OnIMESelectionChange(); // Update selection
|
||||
} else {
|
||||
mIMELastBlurSeqno = chromeSeqno;
|
||||
|
@ -164,16 +164,6 @@
|
||||
#undef MODULE
|
||||
|
||||
|
||||
/* ======================================================================= */
|
||||
/* 4: NS_ERROR_MODULE_WIDGET */
|
||||
/* ======================================================================= */
|
||||
#define MODULE NS_ERROR_MODULE_WIDGET
|
||||
/* nsIWidget::OnIMEFocusChange should be called during blur, but other
|
||||
* OnIME*Change methods should not be called */
|
||||
ERROR(NS_SUCCESS_IME_NO_UPDATES, SUCCESS(1)),
|
||||
#undef MODULE
|
||||
|
||||
|
||||
/* ======================================================================= */
|
||||
/* 6: NS_ERROR_MODULE_NETWORK */
|
||||
/* ======================================================================= */
|
||||
|
Loading…
Reference in New Issue
Block a user