Bug 221320

Summary: Avoid frequent calls to HTMLFormControlElement::updateValidity() when constructing form control elements
Product: WebKit Reporter: Simon Fraser (smfr) <simon.fraser>
Component: FormsAssignee: Simon Fraser (smfr) <simon.fraser>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, changseok, esprehn+autocc, ews-watchlist, ggaren, gyuyoung.kim, mifenton, rniwa, simon.fraser, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

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>