diff --git a/mozilla/layout/forms/nsFileControlFrame.cpp b/mozilla/layout/forms/nsFileControlFrame.cpp index 83289aa1032..63ac2e972cd 100644 --- a/mozilla/layout/forms/nsFileControlFrame.cpp +++ b/mozilla/layout/forms/nsFileControlFrame.cpp @@ -317,6 +317,9 @@ nsFileControlFrame::MouseClick(nsIDOMEvent* aMouseEvent) } } + // Tell our textframe to remember the currently focused value + mTextFrame->InitFocusedValue(); + // Open dialog PRInt16 mode; result = filePicker->Show(&mode); @@ -338,6 +341,8 @@ nsFileControlFrame::MouseClick(nsIDOMEvent* aMouseEvent) result = localFile->GetPath(unicodePath); if (!unicodePath.IsEmpty()) { mTextFrame->SetProperty(mPresContext, nsHTMLAtoms::value, unicodePath); + // May need to fire an onchange here + mTextFrame->CheckFireOnChange(); return NS_OK; } } diff --git a/mozilla/layout/html/forms/src/nsFileControlFrame.cpp b/mozilla/layout/html/forms/src/nsFileControlFrame.cpp index 83289aa1032..63ac2e972cd 100644 --- a/mozilla/layout/html/forms/src/nsFileControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsFileControlFrame.cpp @@ -317,6 +317,9 @@ nsFileControlFrame::MouseClick(nsIDOMEvent* aMouseEvent) } } + // Tell our textframe to remember the currently focused value + mTextFrame->InitFocusedValue(); + // Open dialog PRInt16 mode; result = filePicker->Show(&mode); @@ -338,6 +341,8 @@ nsFileControlFrame::MouseClick(nsIDOMEvent* aMouseEvent) result = localFile->GetPath(unicodePath); if (!unicodePath.IsEmpty()) { mTextFrame->SetProperty(mPresContext, nsHTMLAtoms::value, unicodePath); + // May need to fire an onchange here + mTextFrame->CheckFireOnChange(); return NS_OK; } }