Bug 48685

Summary: Notify UI process about focused frame
Product: WebKit Reporter: Alexey Proskuryakov <ap>
Component: WebKit2Assignee: Alexey Proskuryakov <ap>
Status: RESOLVED FIXED    
Severity: Normal CC: juha.savolainen
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
proposed patch darin: review+

Alexey Proskuryakov
Reported 2010-10-29 14:56:52 PDT
Some UI operations work with focused frames.
Attachments
proposed patch (33.96 KB, patch)
2010-10-29 15:26 PDT, Alexey Proskuryakov
darin: review+
Alexey Proskuryakov
Comment 1 2010-10-29 15:26:21 PDT
Created attachment 72406 [details] proposed patch Some notes of interest: 1. I don't know why exactly there are separate setFocusedNode() and setFocusedFrame() methods on FocusController. Just matching that in client, even though it seems that one could calculate focused frame from focused node. 2. FocusController's notion of "focused" is different from WebView's. For example, -[WebView _focusedFrame] would return null when keyboard focus is in page find banner in Safari, but FocusController simply remembers the last focused subframe, and also has an isActive() method. I don't know what makes more sense, so I just exposed FocusController's notion. This might be a mistake. 3. Ultimately, this WKPageGetFocusedFrame() is going to be used as a replacement for -[WebView selectedFrame]. As documented (and implemented), selectedFrame @discussion Returns the frame that contains the first responder, if any. Otherwise returns the frame that contains a non-zero-length selection, if any. Returns nil if no frame meets these criteria. WKPageGetFocusedFrame() is different in a single case: 1. Click in a frame. 2. Click on address bar, or press Cmd+F. WKPageGetFocusedFrame will return that last click frame, but selectedFrame will return null. There is no visual indication for focused frame, so it was strange that we recognized it in some situations, but not in others.
Darin Adler
Comment 2 2010-11-03 10:35:56 PDT
Comment on attachment 72406 [details] proposed patch View in context: https://bugs.webkit.org/attachment.cgi?id=72406&action=review > WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp:117 > + WebFrame* webFrame = static_cast<WebFrameLoaderClient*>(frame->loader()->client())->webFrame(); Extra space after = sign on this line.
Alexey Proskuryakov
Comment 3 2010-11-08 10:24:50 PST
> Extra space after = sign on this line. This was copied from elsewhere in this file. Fixed all instances. Committed <http://trac.webkit.org/changeset/71541>.
Alexey Proskuryakov
Comment 4 2010-12-23 10:18:03 PST
*** Bug 46165 has been marked as a duplicate of this bug. ***
Note You need to log in before you can comment on or make changes to this bug.