Refactor HTMLInputElement: Move Move typeMismatch(), valueMissing(), isRequiredFormControl(), and recalcWillValidate()
Created attachment 70221 [details] Patch
Comment on attachment 70221 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=70221&action=review This looks better and better. I am very happy with this design. > WebCore/html/HTMLInputElement.cpp:2020 > + return m_inputType->supportsValidation() && HTMLFormControlElementWithState::recalcWillValidate(); OMG, This is so much easier to understand. > WebCore/html/NumberInputType.h:48 > + virtual bool typeMismatchForCandidate(const String&) const; > + virtual bool typeMismatchForCurrentValue() const; I wonder if out of these two, there's just one virtual function, typeMismatchFor(const String&), and HTMLInputType::typeMismatch() just calls it?
Thank you for reviewing a large patch. > > WebCore/html/NumberInputType.h:48 > > + virtual bool typeMismatchForCandidate(const String&) const; > > + virtual bool typeMismatchForCurrentValue() const; > > I wonder if out of these two, there's just one virtual function, typeMismatchFor(const String&), and HTMLInputType::typeMismatch() just calls it? Shorten the names sounds good. I change them to typeMismatchFor(const String&) and typeMismatch(). Unfortunately typeMismatchFor(HTMLInputElement::value()) and typeMismatch() have different behaviors in some types.
Landed as r69445.