Bug 226655 - [iOS] Meaningful click heuristic should account for media state changes
Summary: [iOS] Meaningful click heuristic should account for media state changes
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Wenson Hsieh
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-06-04 12:26 PDT by Wenson Hsieh
Modified: 2021-06-04 17:57 PDT (History)
11 users (show)

See Also:


Attachments
Patch (12.36 KB, patch)
2021-06-04 13:16 PDT, Wenson Hsieh
no flags Details | Formatted Diff | Diff
Patch (13.50 KB, patch)
2021-06-04 13:36 PDT, Wenson Hsieh
no flags Details | Formatted Diff | Diff
Patch (12.59 KB, patch)
2021-06-04 14:23 PDT, Wenson Hsieh
no flags Details | Formatted Diff | Diff
Renaming (12.63 KB, patch)
2021-06-04 14:55 PDT, Wenson Hsieh
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Wenson Hsieh 2021-06-04 12:26:14 PDT
rdar://78330664
Comment 1 Wenson Hsieh 2021-06-04 13:16:24 PDT Comment hidden (obsolete)
Comment 2 Wenson Hsieh 2021-06-04 13:36:49 PDT
Created attachment 430607 [details]
Patch
Comment 3 Tim Horton 2021-06-04 14:02:43 PDT
Comment on attachment 430607 [details]
Patch

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

> Source/WebKit/WebProcess/WebPage/WebPage.h:2195
>      bool m_didHandleOrPreventMouseDownOrMouseUpEventDuringSyntheticClick { false };
> +    bool m_didChangePlayingMediaStateDuringSyntheticClick { false };

How many of these are we going to end up with? Is it actually important that we keep track of /why/? 
Should we just "m_currentSyntheticClickMayBeMeaningful { true }" and then falsy it in all the callbacks? Then you don't need m_isCompletingSyntheticClick or separate bits for each thing.
Comment 4 Wenson Hsieh 2021-06-04 14:05:40 PDT
(In reply to Tim Horton from comment #3)
> Comment on attachment 430607 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=430607&action=review
> 
> > Source/WebKit/WebProcess/WebPage/WebPage.h:2195
> >      bool m_didHandleOrPreventMouseDownOrMouseUpEventDuringSyntheticClick { false };
> > +    bool m_didChangePlayingMediaStateDuringSyntheticClick { false };
> 
> How many of these are we going to end up with? Is it actually important that
> we keep track of /why/? 
> Should we just "m_currentSyntheticClickMayBeMeaningful { true }" and then
> falsy it in all the callbacks? Then you don't need
> m_isCompletingSyntheticClick or separate bits for each thing.

That's a good point — I'll change it to `m_currentSyntheticClickMayBeMeaningful` instead, in the way you described.

(As an aside, if we accumulate one or two more of these call sites in the future, we'll also probably want this to also turn it into an OptionSet).
Comment 5 Wenson Hsieh 2021-06-04 14:23:47 PDT
Created attachment 430611 [details]
Patch
Comment 6 Devin Rousso 2021-06-04 14:39:00 PDT
Comment on attachment 430611 [details]
Patch

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

r=me as well :)

> Source/WebKit/WebProcess/WebPage/WebPage.h:2193
> +    bool m_currentSyntheticClickMayBeNonMeaningful { true };

NIT: How about `m_currentSyntheticClickMayNotBeMeaningful`? 😅
Comment 7 Wenson Hsieh 2021-06-04 14:50:10 PDT
(In reply to Devin Rousso from comment #6)
> Comment on attachment 430611 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=430611&action=review
> 
> r=me as well :)
> 
> > Source/WebKit/WebProcess/WebPage/WebPage.h:2193
> > +    bool m_currentSyntheticClickMayBeNonMeaningful { true };
> 
> NIT: How about `m_currentSyntheticClickMayNotBeMeaningful`? 😅

Sure — I don't have a preference for either one, so I'll change it to `m_currentSyntheticClickMayNotBeMeaningful`.
Comment 8 Wenson Hsieh 2021-06-04 14:55:29 PDT
Created attachment 430616 [details]
Renaming
Comment 9 EWS 2021-06-04 17:57:50 PDT
Committed r278515 (238514@main): <https://commits.webkit.org/238514@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 430616 [details].