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...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Wenson Hsieh
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-03-14 10:16 PDT by Wenson Hsieh
Modified: 2019-03-14 15:07 PDT (History)
7 users (show)

See Also:


Attachments
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();
            m_page->focusController().setFocusedFrame(result.innerNodeFrame());
                                      ^^^^^^^^^^^^^^^
                                      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
<rdar://problem/48892367>
Comment 3 Wenson Hsieh 2019-03-14 13:06:13 PDT
Created attachment 364677 [details]
Patch
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]
Patch

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.