Bug 1616620 - maxlength shouldn't apply to <input type=number>. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D63474
This commit is contained in:
@@ -1869,7 +1869,7 @@ nsresult TextControlState::PrepareEditor(const nsAString* aValue) {
|
||||
}
|
||||
|
||||
// Set max text field length
|
||||
newTextEditor->SetMaxTextLength(GetMaxLength());
|
||||
newTextEditor->SetMaxTextLength(mTextCtrlElement->UsedMaxLength());
|
||||
|
||||
editorFlags = newTextEditor->Flags();
|
||||
|
||||
@@ -2482,17 +2482,6 @@ void TextControlState::UnbindFromFrame(nsTextControlFrame* aFrame) {
|
||||
}
|
||||
}
|
||||
|
||||
int32_t TextControlState::GetMaxLength() {
|
||||
if (NS_WARN_IF(!mTextCtrlElement)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
const nsAttrValue* attr =
|
||||
mTextCtrlElement->GetParsedAttr(nsGkAtoms::maxlength);
|
||||
return attr && attr->Type() == nsAttrValue::eInteger ? attr->GetIntegerValue()
|
||||
: -1;
|
||||
}
|
||||
|
||||
void TextControlState::GetValue(nsAString& aValue, bool aIgnoreWrap) const {
|
||||
// While SetValue() is being called and requesting to commit composition to
|
||||
// IME, GetValue() may be called for appending text or something. Then, we
|
||||
|
||||
Reference in New Issue
Block a user