Bug 64481

Summary: Implement WKPageCenterSelectionInVisibleArea
Product: WebKit Reporter: Ada Chan <adachan>
Component: WebKit2Assignee: Ada Chan <adachan>
Status: RESOLVED FIXED    
Severity: Normal CC: jeffm, sam
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch andersca: review+

Description Ada Chan 2011-07-13 13:45:05 PDT
This is the WebKit2 counterpart of WebView::centerSelectionInVisibleArea() in WebKit1.

Related to <rdar://problem/9732174>
Comment 1 Ada Chan 2011-07-13 14:28:45 PDT
Created attachment 100712 [details]
Patch
Comment 2 Jeff Miller 2011-07-13 15:51:18 PDT
Comment on attachment 100712 [details]
Patch

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

> Source/WebKit2/ChangeLog:9
> +        (WKPageCenterSelectionInVisibleArea):

You should add a description here, even it it's just to note that this function was added.
Comment 3 Ada Chan 2011-07-13 15:57:26 PDT
(In reply to comment #2)
> (From update of attachment 100712 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=100712&action=review
> 
> > Source/WebKit2/ChangeLog:9
> > +        (WKPageCenterSelectionInVisibleArea):
> 
> You should add a description here, even it it's just to note that this function was added.

OK, added this comment:
        (WKPageCenterSelectionInVisibleArea): Added.  Call WebPageProxy::centerSelectionInVisibleArea().
Comment 4 Anders Carlsson 2011-07-14 10:18:33 PDT
Comment on attachment 100712 [details]
Patch

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

> Source/WebKit2/WebProcess/WebPage/WebPage.cpp:1244
> +    if (!frameSelection)
> +        return;

Frame::selection can never return null, so you can just call coreFrame->selection()->revealSelection directly.
Comment 5 Ada Chan 2011-07-14 10:20:39 PDT
(In reply to comment #4)
> (From update of attachment 100712 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=100712&action=review
> 
> > Source/WebKit2/WebProcess/WebPage/WebPage.cpp:1244
> > +    if (!frameSelection)
> > +        return;
> 
> Frame::selection can never return null, so you can just call coreFrame->selection()->revealSelection directly.

OK, will do.  Thanks!
Comment 6 Ada Chan 2011-07-14 10:44:57 PDT
Fixed in http://trac.webkit.org/changeset/91012