DescriptionRefactoring: Removing an extra boolean 'm_wasModifiedByUser' from
HTMLInputElement and HTMLTextAreaElement.
'm_wasModifiedByUser' was introduced so that element.validity.tooLong does not return true for values set via JavaScript irrespective of the size of the input value.
Thus this bool was set only for user initiated actions on text controls.
However, the parent class for both: HTMLTextFormControlElement, holds another boolean member 'm_lastChangeWasUserEdit' which too gets set only while performing user initiated editing actions on the form's text controls. [in the defaultEventHandler of textFormControlElement and only if the eventType is webkitEditableContentChanged.]
Thus, instead of maintaining the extra boolean 'm_wasModifiedByUser' in both the HTMLInputElement and the HTMLTextAreaElement classes, we can make use of their parent's 'm_wasModifiedByUser' which holds exactly the same information.
This can be verified by executing layout tests such as:
fast/forms/ValidityState-tooLong-textarea.html
fast/forms/ValidityState-tooLong-input.html
fast/forms/validationMessage.html
which were modified for verifying the validity of the form text controls. (tooLong etc.)
These pass even when using 'm_lastChangeWasUserEdit' instead of 'm_wasModifiedByUser'.
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=162794
Patch Set 1 #
Messages
Total messages: 16 (0 generated)
|