Bug 138786

Summary: Whitespace action menus should focus the HitTestResult and create an insertion point
Product: WebKit Reporter: Beth Dakin <bdakin>
Component: WebKit2Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: andersca, bdakin, thorton
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch thorton: review+

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