Bug 195749 - REGRESSION (r242801): [iOS] preventDefault() on touchstart in a subframe does not prevent focusing the subframe
Summary: REGRESSION (r242801): [iOS] preventDefault() on touchstart in a subframe does...
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Wenson Hsieh
Keywords: InRadar
Depends on:
Reported: 2019-03-14 10:16 PDT by Wenson Hsieh
Modified: 2019-06-24 12:32 PDT (History)
7 users (show)

See Also:

Patch (12.17 KB, patch)
2019-03-14 13:06 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 2019-03-14 10:16:01 PDT
This began after r242801, but it's really due to an existing (long-standing) bug wherein position information requests will change the focused frame:

InteractionInformationAtPosition WebPage::positionInformation(const InteractionInformationRequest& request)

    if (!elementIsLinkOrImage) {
        HitTestResult result = m_page->mainFrame().eventHandler().hitTestResultAtPoint(request.point, HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::DisallowUserAgentShadowContent | HitTestRequest::AllowChildFrameContent);
        hitNode = result.innerNode();
        // Hit test could return HTMLHtmlElement that has no renderer, if the body is smaller than the document.
        if (hitNode && hitNode->renderer()) {
            RenderObject* renderer = hitNode->renderer();
                                      This line in particular

            info.bounds = renderer->absoluteBoundingBoxRect(true);
            // We don't want to select blocks that are larger than 97% of the visible area of the document.

Comment 1 Wenson Hsieh 2019-03-14 10:17:11 PDT
(In reply to Wenson Hsieh from comment #0)
> m_page->focusController().setFocusedFrame(result.innerNodeFrame());
>                                       ^^^^^^^^^^^^^^^
>                                       This line in particular

...it was added to fix <https://bugs.webkit.org/show_bug.cgi?id=128264>.
Comment 2 Radar WebKit Bug Importer 2019-03-14 10:50:28 PDT
Comment 3 Wenson Hsieh 2019-03-14 13:06:13 PDT
Created attachment 364677 [details]
Comment 4 Wenson Hsieh 2019-03-14 13:08:13 PDT
This will bring back <rdar://problem/48020610>, but I have a different plan to make that work.
Comment 5 WebKit Commit Bot 2019-03-14 15:07:13 PDT
Comment on attachment 364677 [details]

Clearing flags on attachment: 364677

Committed r242968: <https://trac.webkit.org/changeset/242968>
Comment 6 WebKit Commit Bot 2019-03-14 15:07:15 PDT
All reviewed patches have been landed.  Closing bug.