Bug 213618 - [iOS] Event region briefly missing editable element after typing second character in question field on discussions.apple.com
Summary: [iOS] Event region briefly missing editable element after typing second chara...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Daniel Bates
URL: https://discussions.apple.com
Keywords: InRadar, PlatformOnly
Depends on:
Blocks:
 
Reported: 2020-06-25 13:57 PDT by Daniel Bates
Modified: 2020-06-25 15:41 PDT (History)
12 users (show)

See Also:


Attachments
Test case (239 bytes, text/html)
2020-06-25 13:59 PDT, Daniel Bates
no flags Details
Test case (shows it affects touch-action region too!) (385 bytes, text/html)
2020-06-25 13:59 PDT, Daniel Bates
no flags Details
Patch (8.36 KB, patch)
2020-06-25 14:23 PDT, Daniel Bates
no flags Details | Formatted Diff | Diff
To land (8.55 KB, patch)
2020-06-25 15:40 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 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.