Bug 138786 - Whitespace action menus should focus the HitTestResult and create an insertion point
Summary: Whitespace action menus should focus the HitTestResult and create an insertio...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-16 17:06 PST by Beth Dakin
Modified: 2014-11-17 12:10 PST (History)
3 users (show)

See Also:


Attachments
Patch (9.95 KB, patch)
2014-11-16 17:10 PST, Beth Dakin
thorton: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Beth Dakin 2014-11-16 17:06:08 PST
Whitespace action menus should focus the HitTestResult and create an insertion point

rdar://problem/18944893
Comment 1 Beth Dakin 2014-11-16 17:10:43 PST
Created attachment 241685 [details]
Patch
Comment 2 Tim Horton 2014-11-16 17:28:40 PST
Comment on attachment 241685 [details]
Patch

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

> Source/WebKit/mac/WebView/WebActionMenuController.mm:176
> +    frame->page()->focusController().setFocusedElement(element, element->document().frame());
> +    VisiblePosition position = renderer->positionForPoint(_hitTestResult.localPoint(), nullptr);
> +    element->document().frame()->selection().setSelection(position);

There's a bunch of things that might need null checks here? (but I don't know).
Comment 3 Beth Dakin 2014-11-17 12:10:11 PST
(In reply to comment #2)
> Comment on attachment 241685 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=241685&action=review
> 
> > Source/WebKit/mac/WebView/WebActionMenuController.mm:176
> > +    frame->page()->focusController().setFocusedElement(element, element->document().frame());
> > +    VisiblePosition position = renderer->positionForPoint(_hitTestResult.localPoint(), nullptr);
> > +    element->document().frame()->selection().setSelection(position);
> 
> There's a bunch of things that might need null checks here? (but I don't
> know).

I fixed this up. Thank you! http://trac.webkit.org/changeset/176220