diff --git a/mozilla/layout/html/forms/src/nsGfxTextControlFrame.cpp b/mozilla/layout/html/forms/src/nsGfxTextControlFrame.cpp
index afe1e5485d7..08f011290d1 100644
--- a/mozilla/layout/html/forms/src/nsGfxTextControlFrame.cpp
+++ b/mozilla/layout/html/forms/src/nsGfxTextControlFrame.cpp
@@ -910,20 +910,12 @@ void nsGfxTextControlFrame::SetTextControlFrameState(const nsString& aValue)
}
if (PR_FALSE==currentValue.Equals(aValue)) // this is necessary to avoid infinite recursion
{
- nsCOMPtrselection;
- result = mEditor->GetSelection(getter_AddRefs(selection));
- if (NS_FAILED(result)) return;
- if (!selection) return;
-
nsCOMPtrdomDoc;
result = mEditor->GetDocument(getter_AddRefs(domDoc));
if (NS_FAILED(result)) return;
if (!domDoc) return;
- nsCOMPtr bodyNode;
- nsAutoString bodyTag = "body";
- result = GetFirstNodeOfType(bodyTag, domDoc, getter_AddRefs(bodyNode));
- SelectAllTextContent(bodyNode, selection);
+ result = mEditor->SelectAll();
nsCOMPtr htmlEditor = do_QueryInterface(mEditor);
if (!htmlEditor) return;
@@ -2381,7 +2373,7 @@ nsGfxTextControlFrame::InitializeTextControl(nsIPresShell *aPresShell, nsIDOMDoc
result = GetFirstNodeOfType(bodyTag, aDoc, getter_AddRefs(bodyNode));
if (NS_SUCCEEDED(result) && bodyNode)
{
- result = SelectAllTextContent(bodyNode, selection);
+ result = mEditor->SelectAll();
if (NS_SUCCEEDED(result))
{
if (0!=value.Length())