Only update the select command for focused text inputs. Bug 394792, r=roc, sr=neil, a=roc

This commit is contained in:
bzbarsky@mit.edu 2007-09-14 15:33:40 -07:00
parent ee42650dde
commit 11b0a24baf

View File

@ -323,6 +323,17 @@ nsTextInputListener::NotifySelectionChanged(nsIDOMDocument* aDoc, nsISelection*
mSelectionWasCollapsed = collapsed;
if (!mFrame) {
return NS_OK;
}
nsCOMPtr<nsIContent> focusedContent;
mFrame->PresContext()->EventStateManager()->
GetFocusedContent(getter_AddRefs(focusedContent));
if (focusedContent != mFrame->GetContent()) {
return NS_OK;
}
return UpdateTextInputCommands(NS_LITERAL_STRING("select"));
}