Bug 221318 - Avoid a virtual function call in HTMLInputElement::value()
Summary: Avoid a virtual function call in HTMLInputElement::value()
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Simon Fraser (smfr)
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-02-02 21:48 PST by Simon Fraser (smfr)
Modified: 2021-02-03 18:22 PST (History)
10 users (show)

See Also:


Attachments
Patch (2.25 KB, patch)
2021-02-02 21:49 PST, Simon Fraser (smfr)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2021-02-02 21:48:08 PST
Avoid a virtual function call in HTMLInputElement::value()
Comment 1 Simon Fraser (smfr) 2021-02-02 21:49:25 PST
Created attachment 419104 [details]
Patch
Comment 2 EWS 2021-02-02 23:08:49 PST
Committed r272298: <https://trac.webkit.org/changeset/272298>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 419104 [details].
Comment 3 Radar WebKit Bug Importer 2021-02-02 23:09:28 PST
<rdar://problem/73917640>
Comment 4 Darin Adler 2021-02-03 18:22:08 PST
Comment on attachment 419104 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=419104&action=review

> Source/WebCore/html/InputType.h:193
> +    bool canHaveTypeSpecificValue() const { return isFileUpload(); }

I know this already landed, but I’d instead suggest changing getTypeSpecificValue to do this optimization so callers don’t need to make a separate call. Make it non-virtual and have it call a virtual function. It’s not great that caller has to be careful to call in a certain way. Better if there’s no way to do it wrong.