Bug 197746 - [iOS] Lazily request keyboard on first hardware keydown when a non-editable element is focused
Summary: [iOS] Lazily request keyboard on first hardware keydown when a non-editable e...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: WebKit Local Build
Hardware: iPhone / iPad iOS 12
: P2 Normal
Assignee: Daniel Bates
URL:
Keywords: InRadar, PlatformOnly
Depends on:
Blocks: 190571
  Show dependency treegraph
 
Reported: 2019-05-09 11:27 PDT by Daniel Bates
Modified: 2019-05-09 13:18 PDT (History)
7 users (show)

See Also:


Attachments
Patch (3.89 KB, patch)
2019-05-09 12:26 PDT, Daniel Bates
no flags Details | Formatted Diff | Diff
Patch (4.07 KB, patch)
2019-05-09 12:32 PDT, Daniel Bates
no flags Details | Formatted Diff | Diff
To Land (4.11 KB, patch)
2019-05-09 13:18 PDT, Daniel Bates
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Bates 2019-05-09 11:27:24 PDT
In bug #197745 we made keyboard instantiation lazy: we always create one if a hardware keyboard is attached OR a content editable element is focused. We can be even lazier! Specifically the first disjunct can be even lazier. So, I think we only need to create a keyboard if any of the following are satisfied:

a. a non-editable element is focused AND we receive *one* hardware keydown event.
   ii. Take care to reset this on hardware keyboard availability changes. Side note, we could even reduce memory footprint here by tearing down the keyboard here when switching from attached to detached ONLY in the non-editable element case.
b. an editable element is focused (obvious, right?)
Comment 1 Radar WebKit Bug Importer 2019-05-09 11:42:50 PDT
<rdar://problem/50630406>
Comment 2 Daniel Bates 2019-05-09 12:26:39 PDT
Created attachment 369511 [details]
Patch
Comment 3 Daniel Bates 2019-05-09 12:27:30 PDT
Comment on attachment 369511 [details]
Patch

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

> Source/WebKit/ChangeLog:10
> +        Be even lazier. We only need to create a keyboard if an editable element is focused or on
> +        the first hardware keydown when a non-editable element is focused.

Note that we already do the former. This patch is about the latter.
Comment 4 Daniel Bates 2019-05-09 12:32:34 PDT
Created attachment 369512 [details]
Patch
Comment 5 Build Bot 2019-05-09 12:33:42 PDT
Attachment 369512 [details] did not pass style-queue:


ERROR: Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:1673:  Line contains only semicolon. If this should be an empty statement, use { } instead.  [whitespace/semicolon] [5]
Total errors found: 1 in 3 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 6 Brent Fulgham 2019-05-09 12:38:32 PDT
Comment on attachment 369512 [details]
Patch

r=me
Comment 7 Daniel Bates 2019-05-09 13:18:06 PDT
Created attachment 369519 [details]
To Land
Comment 8 Daniel Bates 2019-05-09 13:18:48 PDT
Comment on attachment 369519 [details]
To Land

Clearing flags on attachment: 369519

Committed r245154: <https://trac.webkit.org/changeset/245154>
Comment 9 Daniel Bates 2019-05-09 13:18:49 PDT
All reviewed patches have been landed.  Closing bug.