Bug 64481 - Implement WKPageCenterSelectionInVisibleArea
Summary: Implement WKPageCenterSelectionInVisibleArea
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Ada Chan
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-13 13:45 PDT by Ada Chan
Modified: 2011-07-14 10:44 PDT (History)
2 users (show)

See Also:


Attachments
Patch (5.67 KB, patch)
2011-07-13 14:28 PDT, Ada Chan
andersca: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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