New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stop marking isInvalidInputType() as friend to InputType subclasses #12975
Stop marking isInvalidInputType() as friend to InputType subclasses #12975
Conversation
EWS run on current version of this PR (hash 6eaf9f9) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great. If any of this is a hot code path we might want to make this not be so many separate virtual functions.
This is hot code and yes, many of them are virtual. However, the idea behind the isInvalidInputType() templated function is that it always calls those functions on derived classes of InputType. As a result, it should allow the compiler to skip the vtable and call the most derived implementation right away. That said, there are still separate function calls so there might still be some win here. |
https://bugs.webkit.org/show_bug.cgi?id=255731 Reviewed by Darin Adler. Stop marking isInvalidInputType() as friend to InputType subclasses. We just need to make a few validation function public (which they are already in the base class). This allows us to move isInvalidInputType() to InputType.cpp, since this is the only place it is used. * Source/WebCore/html/BaseDateAndTimeInputType.h: * Source/WebCore/html/ButtonInputType.h: * Source/WebCore/html/CheckboxInputType.h: * Source/WebCore/html/ColorInputType.h: * Source/WebCore/html/DateInputType.h: * Source/WebCore/html/DateTimeLocalInputType.h: * Source/WebCore/html/EmailInputType.h: * Source/WebCore/html/FileInputType.h: * Source/WebCore/html/HiddenInputType.h: * Source/WebCore/html/ImageInputType.h: * Source/WebCore/html/InputType.cpp: (WebCore::isInvalidInputType): (WebCore::InputType::typeMismatchFor const): Deleted. (WebCore::InputType::typeMismatch const): Deleted. (WebCore::InputType::valueMissing const): Deleted. (WebCore::InputType::hasBadInput const): Deleted. (WebCore::InputType::patternMismatch const): Deleted. * Source/WebCore/html/InputType.h: (WebCore::InputType::typeMismatchFor const): (WebCore::InputType::valueMissing const): (WebCore::InputType::hasBadInput const): (WebCore::InputType::patternMismatch const): (WebCore::InputType::typeMismatch const): (WebCore::isInvalidInputType): Deleted. * Source/WebCore/html/MonthInputType.h: * Source/WebCore/html/NumberInputType.h: * Source/WebCore/html/PasswordInputType.h: * Source/WebCore/html/RadioInputType.h: * Source/WebCore/html/RangeInputType.h: * Source/WebCore/html/ResetInputType.h: * Source/WebCore/html/SearchInputType.h: * Source/WebCore/html/SubmitInputType.h: * Source/WebCore/html/TelephoneInputType.h: * Source/WebCore/html/TextInputType.h: * Source/WebCore/html/TimeInputType.h: * Source/WebCore/html/URLInputType.h: * Source/WebCore/html/WeekInputType.h: Canonical link: https://commits.webkit.org/263179@main
6eaf9f9
to
5b1d7c2
Compare
Committed 263179@main (5b1d7c2): https://commits.webkit.org/263179@main Reviewed commits have been landed. Closing PR #12975 and removing active labels. |
5b1d7c2
6eaf9f9
π§ͺ gtk-wk2π§ͺ mac-AS-debug-wk2