Backout changeset 269ee0275709 (bug 688438) because of bug 688423

This commit is contained in:
Ehsan Akhgari 2011-10-25 22:32:11 -04:00
parent 441646faaa
commit 037b12b7d1
2 changed files with 2 additions and 18 deletions

View File

@ -1348,12 +1348,7 @@ PRUint32
nsIContent::GetDesiredIMEState()
{
if (!IsEditableInternal()) {
// Check for the special case where we're dealing with elements which don't
// have the editable flag set, but are readwrite (such as text controls).
if (!IsElement() ||
!AsElement()->State().HasState(NS_EVENT_STATE_MOZ_READWRITE)) {
return IME_STATUS_DISABLE;
}
return IME_STATUS_DISABLE;
}
// NOTE: The content for independent editors (e.g., input[type=text],
// textarea) must override this method, so, we don't need to worry about

View File

@ -646,24 +646,13 @@ nsTextStateManager::ContentRemoved(nsIDocument* aDocument,
new TextChangeEvent(mWidget, offset, offset + childOffset, offset));
}
static bool IsEditable(nsINode* node) {
if (node->IsEditable()) {
return true;
}
// |node| might be readwrite (for example, a text control)
if (node->IsElement() && node->AsElement()->State().HasState(NS_EVENT_STATE_MOZ_READWRITE)) {
return true;
}
return false;
}
static nsINode* GetRootEditableNode(nsPresContext* aPresContext,
nsIContent* aContent)
{
if (aContent) {
nsINode* root = nsnull;
nsINode* node = aContent;
while (node && IsEditable(node)) {
while (node && node->IsEditable()) {
root = node;
node = node->GetNodeParent();
}