Update the visual look of a file input when privileged script sets its value.

Bug 387978, r+sr=sicking


git-svn-id: svn://10.0.0.236/trunk@229943 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bzbarsky%mit.edu
2007-07-14 04:46:09 +00:00
parent 1420b2bffc
commit 85b795adfa
2 changed files with 9 additions and 2 deletions

View File

@@ -332,13 +332,12 @@ nsFileControlFrame::MouseClick(nsIDOMEvent* aMouseEvent)
// and not fire onchange when it should.
PRBool oldState = mTextFrame->GetFireChangeEventState();
mTextFrame->SetFireChangeEventState(PR_TRUE);
mTextFrame->SetFormProperty(nsGkAtoms::value, unicodePath);
mTextFrame->SetFireChangeEventState(oldState);
nsCOMPtr<nsIFileControlElement> fileControl = do_QueryInterface(mContent);
if (fileControl) {
fileControl->SetFileName(unicodePath);
}
mTextFrame->SetFireChangeEventState(oldState);
// May need to fire an onchange here
mTextFrame->CheckFireOnChange();
return NS_OK;