Bug 1366250, don't flush layout when calling element.focus() on already focused element. Ensure layout is flushed after changing input.type, r=ehsan
This commit is contained in:
@@ -4925,6 +4925,14 @@ HTMLInputElement::HandleTypeChange(uint8_t aNewType, bool aNotify)
|
||||
uint8_t oldType = mType;
|
||||
MOZ_ASSERT(oldType != aNewType);
|
||||
|
||||
nsFocusManager* fm = nsFocusManager::GetFocusManager();
|
||||
if (fm) {
|
||||
// Input element can represent very different kinds of UIs, and we may
|
||||
// need to flush styling even when focusing the already focused input
|
||||
// element.
|
||||
fm->NeedsFlushBeforeEventHandling(this);
|
||||
}
|
||||
|
||||
if (aNewType == NS_FORM_INPUT_FILE || oldType == NS_FORM_INPUT_FILE) {
|
||||
if (aNewType == NS_FORM_INPUT_FILE) {
|
||||
mFileData.reset(new FileData());
|
||||
|
||||
Reference in New Issue
Block a user