Bug 1390342 - Skip pattern matching in HasPatternMismatch() if @pattern is not set. r=ehsan
We use a bitfield in HTMLInputElement to cache whether the input element has the @pattern set, and skip pattern mathching in HasPatternMismatch() if the attribute is not set.
This commit is contained in:
@@ -339,6 +339,11 @@ public:
|
||||
return mSelectionProperties;
|
||||
}
|
||||
|
||||
bool HasPatternAttribute() const
|
||||
{
|
||||
return mHasPatternAttribute;
|
||||
}
|
||||
|
||||
// nsIConstraintValidation
|
||||
bool IsTooLong();
|
||||
bool IsTooShort();
|
||||
@@ -1667,6 +1672,7 @@ protected:
|
||||
bool mPickerRunning : 1;
|
||||
bool mSelectionCached : 1;
|
||||
bool mIsPreviewEnabled : 1;
|
||||
bool mHasPatternAttribute : 1;
|
||||
|
||||
private:
|
||||
static void MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
|
||||
|
||||
Reference in New Issue
Block a user