[Webkit-unassigned] [Bug 202214] Update API availability for autoplay event

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jan 6 07:24:53 PST 2020


https://bugs.webkit.org/show_bug.cgi?id=202214

--- Comment #14 from Luming Yin <luming_yin at apple.com> ---
(In reply to Wenson Hsieh from comment #12)
> Comment on attachment 379869 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=379869&action=review
> 
> > Source/WebCore/page/Quirks.cpp:-109
> > -    auto host = m_document->topDocument().url().host();
> > -    return equalLettersIgnoringASCIICase(host, "netflix.com") || host.endsWithIgnoringASCIICase(".netflix.com");
> 
> Just to double check — would we not need this quirk on iOS anymore because
> it will be handled by Safari?
Oops, I just double checked, and we do in fact still need this quirk on iOS. I've Added the quirk back.

> 
> > Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:848
> > +void WebPage::simulateTap(const IntPoint& point, OptionSet<WebEvent::Modifier> modifiers)
> > +{
> > +    FloatPoint adjustedPoint;
> > +    Node* nodeRespondingToClick = m_page->mainFrame().nodeRespondingToClickEvents(point, adjustedPoint);
> > +    if (nodeRespondingToClick)
> > +        handleSyntheticClick(*nodeRespondingToClick, adjustedPoint, modifiers);
> > +}
> 
> Hm…I think we generally try to avoid deep testing hooks like this if we can,
> and mostly limit interaction-related testing hooks such as this to the UI
> process (commonly, WKContentViewInteraction and WKWebView).
> 
> That said, I recall that this was difficult in API tests due to how there
> are `lastLayerTreeTransactionId` checks throughout WebPageIOS that fail due
> to `lastLayerTreeTransactionId ` being 0. If that’s the case, could we
> additionally synthesize touch events by calling into
> -_webTouchEventsRecognized: (or add a simple hook to do so) before sending
> the click? I think that /might/ be slightly cleaner than adding a different
> testing codepath in the web process for simulating clicks.

This is indeed the case! Generating synthetic taps in the UI process is difficult due to various `lastLayerTreeTransactionId` checks. I also tried to use _WKTouchEventGenerator to generate touches, but when running the headless WebKit API tests, [UIApplication sharedApplication] returns nil, so there’s no way to get the associated contextID, meaning this also isn't a valid option.

I've updated the patch to synthesize touch events by calling into -_webTouchEventsRecognized: before sending the click.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20200106/5b8475de/attachment.htm>


More information about the webkit-unassigned mailing list