зеркало из https://github.com/mozilla/gecko-dev.git
Bug 451123. Make sure to not call SetValueInternal on file inputs. r+sr=sicking
This commit is contained in:
Родитель
d8f5af72d4
Коммит
280f377f6d
|
@ -0,0 +1,7 @@
|
|||
<html>
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
<input type="file" type="file">
|
||||
</body>
|
||||
</html>
|
|
@ -4,4 +4,4 @@ load 338649-1.xhtml
|
|||
load 339501-1.xhtml
|
||||
load 339501-2.xhtml
|
||||
load 423371-1.html
|
||||
|
||||
load 451123-1.html
|
||||
|
|
|
@ -1997,23 +1997,25 @@ nsHTMLInputElement::ParseAttribute(PRInt32 aNamespaceID,
|
|||
newType = NS_FORM_INPUT_TEXT;
|
||||
}
|
||||
|
||||
// Make sure to do the check for newType being NS_FORM_INPUT_FILE and the
|
||||
// corresponding SetValueInternal() call _before_ we set mType. That way
|
||||
// the logic in SetValueInternal() will work right (that logic makes
|
||||
// assumptions about our frame based on mType, but we won't have had time
|
||||
// to recreate frames yet -- that happens later in the SetAttr()
|
||||
// process).
|
||||
if (newType == NS_FORM_INPUT_FILE) {
|
||||
// These calls aren't strictly needed any more since we'll never
|
||||
// confuse values and filenames. However they're there for backwards
|
||||
// compat.
|
||||
SetFileName(EmptyString());
|
||||
SetValueInternal(EmptyString(), nsnull, PR_FALSE);
|
||||
} else if (mType == NS_FORM_INPUT_FILE) {
|
||||
SetFileName(EmptyString());
|
||||
}
|
||||
if (newType != mType) {
|
||||
// Make sure to do the check for newType being NS_FORM_INPUT_FILE and
|
||||
// the corresponding SetValueInternal() call _before_ we set mType.
|
||||
// That way the logic in SetValueInternal() will work right (that logic
|
||||
// makes assumptions about our frame based on mType, but we won't have
|
||||
// had time to recreate frames yet -- that happens later in the
|
||||
// SetAttr() process).
|
||||
if (newType == NS_FORM_INPUT_FILE) {
|
||||
// These calls aren't strictly needed any more since we'll never
|
||||
// confuse values and filenames. However they're there for backwards
|
||||
// compat.
|
||||
SetFileName(EmptyString());
|
||||
SetValueInternal(EmptyString(), nsnull, PR_FALSE);
|
||||
} else if (mType == NS_FORM_INPUT_FILE) {
|
||||
SetFileName(EmptyString());
|
||||
}
|
||||
|
||||
mType = newType;
|
||||
mType = newType;
|
||||
}
|
||||
|
||||
return success;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче