Bug 218004

Summary: [iOS] Prevent presentation of input peripherals when focusing form controls with a validation message
Product: WebKit Reporter: Aditya Keerthi <akeerthi>
Component: FormsAssignee: Aditya Keerthi <akeerthi>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, changseok, christian.burtchen, esprehn+autocc, ews-watchlist, gyuyoung.kim, mifenton, thorton, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: iPhone / iPad   
OS: Unspecified   
Attachments:
Description Flags
Patch
wenson_hsieh: review+
Patch for landing none

Description Aditya Keerthi 2020-10-20 16:48:28 PDT
...
Comment 1 Aditya Keerthi 2020-10-20 16:48:50 PDT
<rdar://problem/70507678>
Comment 2 Aditya Keerthi 2020-10-20 16:52:01 PDT
Created attachment 411939 [details]
Patch
Comment 3 Wenson Hsieh 2020-10-21 15:02:33 PDT
Comment on attachment 411939 [details]
Patch

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

> Source/WebCore/html/HTMLFormControlElement.cpp:537
> +    m_willShowValidationMessage = true;

Is it possible for this to be called twice in the same runloop? If so, we should consider making this a counter and incrementing/decrementing it instead (and then `HTMLFormControlElement::willShowValidationMessage` would return true if the count is nonzero).
Comment 4 Aditya Keerthi 2020-10-21 19:59:21 PDT
Created attachment 412063 [details]
Patch for landing
Comment 5 Aditya Keerthi 2020-10-21 20:02:46 PDT
(In reply to Wenson Hsieh from comment #3)
> Comment on attachment 411939 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=411939&action=review
> 
> > Source/WebCore/html/HTMLFormControlElement.cpp:537
> > +    m_willShowValidationMessage = true;
> 
> Is it possible for this to be called twice in the same runloop? If so, we
> should consider making this a counter and incrementing/decrementing it
> instead (and then `HTMLFormControlElement::willShowValidationMessage` would
> return true if the count is nonzero).

Discussed this offline. Since the flag only needs to be true around the call to focus(), I moved the reset outside of the asynchronous call to `updateVisibleValidationMessage`, and renamed the flag to m_isFocusingWithValidationMessage.
Comment 6 EWS 2020-10-22 08:55:59 PDT
Committed r268866: <https://trac.webkit.org/changeset/268866>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 412063 [details].
Comment 7 Simon Fraser (smfr) 2021-01-20 11:39:01 PST
*** Bug 220593 has been marked as a duplicate of this bug. ***