mirror of
https://github.com/classilla/tenfourfox.git
synced 2024-05-28 20:41:33 +00:00
#432: M1390342
This commit is contained in:
parent
8a6fd1e659
commit
6aee6c06ab
|
@ -865,6 +865,7 @@ HTMLInputElement::HTMLInputElement(already_AddRefed<mozilla::dom::NodeInfo>& aNo
|
|||
, mNumberControlSpinnerSpinsUp(false)
|
||||
, mPickerRunning(false)
|
||||
, mSelectionCached(true)
|
||||
, mHasPatternAttribute(false)
|
||||
{
|
||||
// We are in a type=text so we now we currenty need a nsTextEditorState.
|
||||
mInputData.mState = new nsTextEditorState(this);
|
||||
|
@ -1150,6 +1151,10 @@ HTMLInputElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
|||
} else if (MaxLengthApplies() && aName == nsGkAtoms::maxlength) {
|
||||
UpdateTooLongValidityState();
|
||||
} else if (aName == nsGkAtoms::pattern) {
|
||||
// Although pattern attribute only applies to single line text controls,
|
||||
// we set this flag for all input types to save having to check the type
|
||||
// here.
|
||||
mHasPatternAttribute = !!aValue;
|
||||
UpdatePatternMismatchValidityState();
|
||||
} else if (aName == nsGkAtoms::multiple) {
|
||||
UpdateTypeMismatchValidityState();
|
||||
|
@ -6426,8 +6431,7 @@ HTMLInputElement::HasTypeMismatch() const
|
|||
bool
|
||||
HTMLInputElement::HasPatternMismatch() const
|
||||
{
|
||||
if (!DoesPatternApply() ||
|
||||
!HasAttr(kNameSpaceID_None, nsGkAtoms::pattern)) {
|
||||
if (!mHasPatternAttribute || !DoesPatternApply()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -282,6 +282,11 @@ public:
|
|||
return mSelectionProperties;
|
||||
}
|
||||
|
||||
bool HasPatternAttribute() const
|
||||
{
|
||||
return mHasPatternAttribute;
|
||||
}
|
||||
|
||||
// nsIConstraintValidation
|
||||
bool IsTooLong();
|
||||
bool IsValueMissing() const;
|
||||
|
@ -1357,6 +1362,7 @@ protected:
|
|||
bool mNumberControlSpinnerSpinsUp : 1;
|
||||
bool mPickerRunning : 1;
|
||||
bool mSelectionCached : 1;
|
||||
bool mHasPatternAttribute : 1;
|
||||
|
||||
private:
|
||||
static void MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
|
||||
|
|
Loading…
Reference in New Issue
Block a user