Bug 110877 - [WK2][EFL] Encapsulate view states set-up within WebView
Summary: [WK2][EFL] Encapsulate view states set-up within WebView
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit API (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Mikhail Pozdnyakov
URL:
Keywords:
Depends on:
Blocks: 107657 107662
  Show dependency treegraph
 
Reported: 2013-02-26 06:05 PST by Mikhail Pozdnyakov
Modified: 2013-04-05 01:18 PDT (History)
8 users (show)

See Also:


Attachments
patch (8.54 KB, patch)
2013-02-26 06:19 PST, Mikhail Pozdnyakov
no flags Details | Formatted Diff | Diff
patch v2 (8.52 KB, patch)
2013-03-13 07:37 PDT, Mikhail Pozdnyakov
benjamin: review-
Details | Formatted Diff | Diff
patch v3 (8.73 KB, patch)
2013-04-03 14:02 PDT, Mikhail Pozdnyakov
benjamin: review+
webkit.review.bot: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mikhail Pozdnyakov 2013-02-26 06:05:41 PST
SSIA. Outcome:
1) Reduces usage of EwkView inside WebView class.
2) Reduces direct usage of WebPageProxy inside EwkView class.
Comment 1 Mikhail Pozdnyakov 2013-02-26 06:19:08 PST
Created attachment 190270 [details]
patch
Comment 2 Kenneth Rohde Christiansen 2013-02-26 06:37:41 PST
Comment on attachment 190270 [details]
patch

LGTM, but are you sure the initial state is correct? any way to test it? Focus issues are hard to debug, so we better be certain
Comment 3 Mikhail Pozdnyakov 2013-03-13 07:35:24 PDT
(In reply to comment #2)
> (From update of attachment 190270 [details])
> LGTM, but are you sure the initial state is correct? any way to test it? Focus issues are hard to debug, so we better be certain

Initial states are set by evas callbacks while evas object creation, so the values will be certain anyway. However think, both isFocused and isVisible are better to be set to 'false' initially indeed.
Comment 4 Mikhail Pozdnyakov 2013-03-13 07:37:42 PDT
Created attachment 192920 [details]
patch v2

Changed initial values.
Comment 5 Kenneth Rohde Christiansen 2013-03-20 04:47:19 PDT
Ping owner review/sign off.
Comment 6 Benjamin Poulain 2013-03-25 13:59:56 PDT
Comment on attachment 192920 [details]
patch v2

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

> Source/WebKit2/UIProcess/API/C/efl/WKView.cpp:66
> +void WKViewSetFocused(WKViewRef viewRef, bool flag)

Not a fan of "flag" for the argument name.

> Source/WebKit2/UIProcess/API/C/efl/WKView.cpp:76
> +void WKViewSetVisible(WKViewRef viewRef, bool flag)

Ditto.

SetIsVisible maybe?

> Source/WebKit2/UIProcess/efl/WebView.cpp:95
> +void WebView::setFocused(bool focused)
> +{
> +    if (m_focused == focused)
> +        return;
> +
> +    m_focused = focused;
> +    m_page->viewStateDidChange(WebPageProxy::ViewIsFocused | WebPageProxy::ViewWindowIsActive);
> +}

setFocused(false) call viewStateDidChange(WebPageProxy::ViewIsFocused)???

> Source/WebKit2/UIProcess/efl/WebView.cpp:104
> +void WebView::setVisible(bool visible)
> +{
> +    if (m_visible == visible)
> +        return;
> +
> +    m_visible = visible;
> +    m_page->viewStateDidChange(WebPageProxy::ViewIsVisible);
> +}

You duplicate states between WebPageProxy and WebView. This is a really bad idea.

> Source/WebKit2/UIProcess/efl/WebView.cpp:305
>  bool WebView::isViewFocused()
>  {
> -    return m_ewkView->isFocused();
> +    return isFocused();
>  }
>  
>  bool WebView::isViewVisible()
>  {
> -    return m_ewkView->isVisible();
> +    return isVisible();
>  }

Why don't you get rid of those APIs?
Comment 7 Mikhail Pozdnyakov 2013-03-26 01:54:19 PDT
(In reply to comment #6)
> (From update of attachment 192920 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=192920&action=review
> 
> > Source/WebKit2/UIProcess/API/C/efl/WKView.cpp:66
> > +void WKViewSetFocused(WKViewRef viewRef, bool flag)
> 
> Not a fan of "flag" for the argument name.
> 
> > Source/WebKit2/UIProcess/API/C/efl/WKView.cpp:76
> > +void WKViewSetVisible(WKViewRef viewRef, bool flag)
> 
> Ditto.
> 
> SetIsVisible maybe?

agree, SetIsVisible is better.
> 
> > Source/WebKit2/UIProcess/efl/WebView.cpp:95
> > +void WebView::setFocused(bool focused)
> > +{
> > +    if (m_focused == focused)
> > +        return;
> > +
> > +    m_focused = focused;
> > +    m_page->viewStateDidChange(WebPageProxy::ViewIsFocused | WebPageProxy::ViewWindowIsActive);
> > +}
> 
> setFocused(false) call viewStateDidChange(WebPageProxy::ViewIsFocused)???
right, this code is in page proxy is invoked:

    if (flags & ViewIsFocused)     m_process->send(Messages::WebPage::SetFocused(m_pageClient->isViewFocused()), m_pageID);

so it just makes page proxy to query state from page client (web view itself).

> 
> > Source/WebKit2/UIProcess/efl/WebView.cpp:104
> > +void WebView::setVisible(bool visible)
> > +{
> > +    if (m_visible == visible)
> > +        return;
> > +
> > +    m_visible = visible;
> > +    m_page->viewStateDidChange(WebPageProxy::ViewIsVisible);
> > +}
> 
> You duplicate states between WebPageProxy and WebView. This is a really bad idea.

there is no duplication, as page client is supposed to hold the state.

> 
> > Source/WebKit2/UIProcess/efl/WebView.cpp:305
> >  bool WebView::isViewFocused()
> >  {
> > -    return m_ewkView->isFocused();
> > +    return isFocused();
> >  }
> >  
> >  bool WebView::isViewVisible()
> >  {
> > -    return m_ewkView->isVisible();
> > +    return isVisible();
> >  }
> 
> Why don't you get rid of those APIs?
mm.. isViewVisible and isViewFocused are mandatory things to have for page client.
Comment 8 Mikhail Pozdnyakov 2013-04-03 14:02:58 PDT
Created attachment 196406 [details]
patch v3

Changed API setter function names.
Comment 9 WebKit Review Bot 2013-04-04 14:14:48 PDT
Comment on attachment 196406 [details]
patch v3

Rejecting attachment 196406 [details] from commit-queue.

Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=webkit-commit-queue.appspot.com', '--bot-id=gce-cq-03', 'apply-attachment', '--no-update', '--non-interactive', 196406, '--port=chromium-xvfb']" exit_code: 2 cwd: /mnt/git/webkit-commit-queue

Last 500 characters of output:
ebView.cpp
Hunk #2 succeeded at 104 with fuzz 1 (offset 7 lines).
Hunk #3 succeeded at 321 (offset 13 lines).
patching file Source/WebKit2/UIProcess/efl/WebView.h
Hunk #1 succeeded at 60 with fuzz 2 (offset 3 lines).
Hunk #2 FAILED at 186.
1 out of 2 hunks FAILED -- saving rejects to file Source/WebKit2/UIProcess/efl/WebView.h.rej

Failed to run "[u'/mnt/git/webkit-commit-queue/Tools/Scripts/svn-apply', '--force', '--reviewer', 'Benjamin Poulain']" exit_code: 1 cwd: /mnt/git/webkit-commit-queue

Full output: http://webkit-commit-queue.appspot.com/results/17460137
Comment 10 Mikhail Pozdnyakov 2013-04-05 01:18:58 PDT
Committed r147723: <http://trac.webkit.org/changeset/147723>