Bug 221320 - Avoid frequent calls to HTMLFormControlElement::updateValidity() when constructing form control elements
Summary: Avoid frequent calls to HTMLFormControlElement::updateValidity() when constru...
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 22:06 PST by Simon Fraser (smfr)
Modified: 2021-02-03 20:10 PST (History)
11 users (show)

See Also:


Attachments
Patch (5.14 KB, patch)
2021-02-02 22:07 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 22:06:44 PST
Avoid frequent calls to HTMLFormControlElement::updateValidity() when constructing form control elements
Comment 1 Simon Fraser (smfr) 2021-02-02 22:07:25 PST
Created attachment 419107 [details]
Patch
Comment 2 Ryosuke Niwa 2021-02-03 15:05:24 PST
Comment on attachment 419107 [details]
Patch

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

> Source/WebCore/html/HTMLInputElement.cpp:826
> +    DelayedUpdateValidityScope delayedUpdateValidityScope(*this);
> +

I don't think it's possible for this function to get called recursively.
Why don't we just put a boolean like m_initializingParserSetAttributes instead?
Comment 3 Geoffrey Garen 2021-02-03 15:08:32 PST
Comment on attachment 419107 [details]
Patch

r=me
Comment 4 Simon Fraser (smfr) 2021-02-03 20:01:32 PST
I tried the boolean thing and it just feels uglier.
Comment 5 EWS 2021-02-03 20:09:31 PST
Committed r272354: <https://trac.webkit.org/changeset/272354>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 419107 [details].
Comment 6 Radar WebKit Bug Importer 2021-02-03 20:10:22 PST
<rdar://problem/73962613>