Bug 213618

Summary: [iOS] Event region briefly missing editable element after typing second character in question field on discussions.apple.com
Product: WebKit Reporter: Daniel Bates <dbates>
Component: Layout and RenderingAssignee: Daniel Bates <dbates>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, changseok, esprehn+autocc, ews-watchlist, fred.wang, glenn, koivisto, kondapallykalyan, pdr, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar, PlatformOnly
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   
URL: https://discussions.apple.com
See Also: https://bugs.webkit.org/show_bug.cgi?id=213564
Attachments:
Description Flags
Test case
none
Test case (shows it affects touch-action region too!)
none
Patch
none
To land none

Description Daniel Bates 2020-06-25 13:57:56 PDT
This is visually observable with the editable regions debug overlay enabled: defaults key WebKitDebugVisibleDebugOverlayRegions has bit 3 enabled.

Steps to reproduce:

1. Visit <https://discussions.apple.com>.
2. Type 'f' into the question field

Notice the field has purple overlay, which indicates that it's in the editable region.

3. Type 'f'.

Then the overlay briefly vanishes until search results come back.
Comment 1 Daniel Bates 2020-06-25 13:59:03 PDT
Created attachment 402807 [details]
Test case
Comment 2 Daniel Bates 2020-06-25 13:59:22 PDT
This also affects touch-action!
Comment 3 Daniel Bates 2020-06-25 13:59:41 PDT
Created attachment 402808 [details]
Test case (shows it affects touch-action region too!)
Comment 4 Daniel Bates 2020-06-25 14:01:35 PDT
How do I use ^^^ tests?

Easiest way is to just ensure WebKitDebugVisibleDebugOverlayRegions has TouchActionRegion and EditableElementRegion set. Here's the enum for reference:

[[

enum DebugOverlayRegionFlags {
    NonFastScrollableRegion = 1 << 0,
    WheelEventHandlerRegion = 1 << 1,
    TouchActionRegion = 1 << 2,
    EditableElementRegion = 1 << 3,
};

]]
<https://trac.webkit.org/browser/trunk/Source/WebCore/page/SettingsBase.h?rev=263316#L65>
Comment 5 Daniel Bates 2020-06-25 14:02:54 PDT
<rdar://problem/62656131>
Comment 6 Daniel Bates 2020-06-25 14:09:28 PDT
Note that bug #213564 will mitigate *this* bug (on https://discussions.apple.com), but that's only because the repro steps require focusing the search field. The root cause of this bug is that the event region is not updated for the foreground layer (if it exists) and could be triggered just like in the attached test case (0 interaction required!)
Comment 7 Daniel Bates 2020-06-25 14:23:18 PDT
Created attachment 402810 [details]
Patch
Comment 8 Daniel Bates 2020-06-25 15:38:24 PDT
Oops forgot to include the updated expected results for iOS...
Comment 9 Daniel Bates 2020-06-25 15:40:26 PDT
Created attachment 402820 [details]
To land
Comment 10 Daniel Bates 2020-06-25 15:41:27 PDT
Comment on attachment 402820 [details]
To land

Clearing flags on attachment: 402820

Committed r263538: <https://trac.webkit.org/changeset/263538>
Comment 11 Daniel Bates 2020-06-25 15:41:30 PDT
All reviewed patches have been landed.  Closing bug.