Bug 109794 - [WK2][EFL] Eliminate access to WK2 C++ internals from ewk_view functions
Summary: [WK2][EFL] Eliminate access to WK2 C++ internals from ewk_view functions
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit EFL (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-14 01:34 PST by Mikhail Pozdnyakov
Modified: 2013-02-19 08:49 PST (History)
7 users (show)

See Also:


Attachments
patch (12.42 KB, patch)
2013-02-14 01:58 PST, Mikhail Pozdnyakov
no flags Details | Formatted Diff | Diff
patch (11.69 KB, patch)
2013-02-14 02:02 PST, Mikhail Pozdnyakov
no flags Details | Formatted Diff | Diff
patch v2 (11.41 KB, patch)
2013-02-14 04:35 PST, Mikhail Pozdnyakov
no flags Details | Formatted Diff | Diff
patch v3 (11.32 KB, patch)
2013-02-18 05:02 PST, Mikhail Pozdnyakov
eflews.bot: commit-queue-
Details | Formatted Diff | Diff
patch v4 (11.29 KB, patch)
2013-02-18 05:21 PST, Mikhail Pozdnyakov
no flags 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-14 01:34:00 PST
SSIA.
Comment 1 Mikhail Pozdnyakov 2013-02-14 01:58:56 PST
Created attachment 188291 [details]
patch
Comment 2 Mikhail Pozdnyakov 2013-02-14 02:02:40 PST
Created attachment 188293 [details]
patch

Removed extra line and pending space
Comment 3 Chris Dumez 2013-02-14 03:16:07 PST
Comment on attachment 188293 [details]
patch

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

> Source/WebKit2/UIProcess/API/C/efl/WKView.cpp:113
> +    return toImpl(viewRef)->requestExitFullScreen();

return statement in void function.

> Source/WebKit2/UIProcess/API/C/efl/WKView.cpp:116
> +    return 0;

Ditto.

> Source/WebKit2/UIProcess/API/efl/EwkView.cpp:746
> +void EwkView::feedTouchEvent(Ewk_Touch_Event_Type type, const Eina_List* points, const Evas_Modifier* modifiers)

Feels like this may be a WebView method, except for the argument types.

> Source/WebKit2/UIProcess/API/efl/EwkView.cpp:748
> +    page()->handleTouchEvent(NativeWebTouchEvent(type, points, modifiers, transformFromScene(), transformToScreen(), ecore_time_get()));

Page proxy should really not be used in EwkView, which is why I think this should be on WebView side.

> Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:446
> +    toImpl(impl->wkPage())->setPaginationMode(static_cast<WebCore::Pagination::Mode>(mode));

WKPageSetPaginationMode() ?

> Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:455
> +    return static_cast<Ewk_Pagination_Mode>(toImpl(impl->wkPage())->paginationMode());

WKPageGetPaginationMode() ?

> Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:-472
> -    return false;

We should keep returning false if FULLSCREEN_API is disabled.
Comment 4 Kenneth Rohde Christiansen 2013-02-14 03:32:01 PST
Comment on attachment 188293 [details]
patch

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

> Source/WebKit2/ChangeLog:24
> +            Added feedTouchEvent() method so that: at fisrt ewk_view_feed_touch_event()

first*

> Source/WebKit2/UIProcess/API/C/efl/WKView.cpp:108
> +
> +bool WKViewGetMainFrameInViewSourceMode(WKViewRef viewRef)
> +{
> +    return toImpl(viewRef)->mainFrameInViewSourceMode();
> +}

Does "mainframe" add any value here? 

WKViewSetShowAsSource?

> Source/WebKit2/UIProcess/API/C/efl/WKView.cpp:111
> +
> +void WKViewRequestExitFullScreen(WKViewRef viewRef)
> +{

How does this integrate with the WK C api for fullscreen?
Comment 5 Mikhail Pozdnyakov 2013-02-14 03:53:25 PST
Comment on attachment 188293 [details]
patch

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

>> Source/WebKit2/UIProcess/API/C/efl/WKView.cpp:113
>> +    return toImpl(viewRef)->requestExitFullScreen();
> 
> return statement in void function.

oops. my bad :/

>> Source/WebKit2/UIProcess/API/efl/EwkView.cpp:746
>> +void EwkView::feedTouchEvent(Ewk_Touch_Event_Type type, const Eina_List* points, const Evas_Modifier* modifiers)
> 
> Feels like this may be a WebView method, except for the argument types.

yeah, but this has to be solved further, together with the rest event handling.

>> Source/WebKit2/UIProcess/API/efl/EwkView.cpp:748
>> +    page()->handleTouchEvent(NativeWebTouchEvent(type, points, modifiers, transformFromScene(), transformToScreen(), ecore_time_get()));
> 
> Page proxy should really not be used in EwkView, which is why I think this should be on WebView side.

We do not have C API for event objects so far..

>> Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:446
>> +    toImpl(impl->wkPage())->setPaginationMode(static_cast<WebCore::Pagination::Mode>(mode));
> 
> WKPageSetPaginationMode() ?

I did not dare to use this as this function as WKPageSetPaginationMode is from WKPagePrivate, there is probably a reason for not exposing it.

>> Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:455
>> +    return static_cast<Ewk_Pagination_Mode>(toImpl(impl->wkPage())->paginationMode());
> 
> WKPageGetPaginationMode() ?

ditto.

>> Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:-472
>> -    return false;
> 
> We should keep returning false if FULLSCREEN_API is disabled.

yeah.
Comment 6 Mikhail Pozdnyakov 2013-02-14 03:58:06 PST
> > Source/WebKit2/UIProcess/API/C/efl/WKView.cpp:108
> > +
> > +bool WKViewGetMainFrameInViewSourceMode(WKViewRef viewRef)
> > +{
> > +    return toImpl(viewRef)->mainFrameInViewSourceMode();
> > +}
> 
> Does "mainframe" add any value here? 
> 
> WKViewSetShowAsSource?
could be WKViewGetShowsAsSource, to be consistent with WKViewGetDrawsBackground and so on.
Comment 7 Mikhail Pozdnyakov 2013-02-14 04:17:28 PST
> 
> > Source/WebKit2/UIProcess/API/C/efl/WKView.cpp:111
> > +
> > +void WKViewRequestExitFullScreen(WKViewRef viewRef)
> > +{
> 
> How does this integrate with the WK C api for fullscreen?
Do we have C api for fullscreen? I can see only WKFullScreenClientGtk, however RequestExitFullScreen seems to be rather functionality of view I guess.
Comment 8 Mikhail Pozdnyakov 2013-02-14 04:35:16 PST
Created attachment 188319 [details]
patch v2

Took comments from Chris and Kenneth into consideration.
Comment 9 Kenneth Rohde Christiansen 2013-02-15 06:34:05 PST
Comment on attachment 188319 [details]
patch v2

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

Looks fine

> Source/WebKit2/UIProcess/API/C/efl/WKView.cpp:111
> +
> +void WKViewRequestExitFullScreen(WKViewRef viewRef)
> +{

when does the UA/browser request to exit the fullscreen? How is this supposed to work?

> Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:445
> +    // FIXME: move to exported C WKPage API when it appears.

appears?

> Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:517
> +    WKPageGetContentsAsMHTMLData(impl->wkPage(), false, context, ewkViewPageContentsCallback);

Content* no?
Comment 10 Chris Dumez 2013-02-15 06:36:02 PST
Comment on attachment 188319 [details]
patch v2

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

>> Source/WebKit2/UIProcess/API/C/efl/WKView.cpp:111
>> +{
> 
> when does the UA/browser request to exit the fullscreen? How is this supposed to work?

When the content requested full screen mode via full screen API, and we switch to full screen. If the user press "ESC" key, the browser will request to exit fullscreen using this API. You can test in our MiniBrowser.
Comment 11 Kenneth Rohde Christiansen 2013-02-15 06:37:07 PST
(In reply to comment #10)
> (From update of attachment 188319 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=188319&action=review
> 
> >> Source/WebKit2/UIProcess/API/C/efl/WKView.cpp:111
> >> +{
> > 
> > when does the UA/browser request to exit the fullscreen? How is this supposed to work?
> 
> When the content requested full screen mode via full screen API, and we switch to full screen. If the user press "ESC" key, the browser will request to exit fullscreen using this API. You can test in our MiniBrowser.

As it is a request can the content actually ignore this and not exit? or is this just so that JS etc can act on exiting?
Comment 12 Chris Dumez 2013-02-15 06:45:25 PST
Comment on attachment 188319 [details]
patch v2

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

>>>> Source/WebKit2/UIProcess/API/C/efl/WKView.cpp:111
>>>> +{
>>> 
>>> when does the UA/browser request to exit the fullscreen? How is this supposed to work?
>> 
>> When the content requested full screen mode via full screen API, and we switch to full screen. If the user press "ESC" key, the browser will request to exit fullscreen using this API. You can test in our MiniBrowser.
> 
> As it is a request can the content actually ignore this and not exit? or is this just so that JS etc can act on exiting?

To my knowledge, this is so that doc.fullscreenEnabled is updated and so that a fullscreenchange event is fired. CSS style may also change depending on fullscreen state. It is not technically a request, we should probably call it "WKViewExitFullScreen()".
Comment 13 Mikhail Pozdnyakov 2013-02-18 05:02:15 PST
Created attachment 188855 [details]
patch v3

WKViewRequestExitFullScreen -> WKViewExitFullScreen
Comment 14 EFL EWS Bot 2013-02-18 05:09:07 PST
Comment on attachment 188855 [details]
patch v3

Attachment 188855 [details] did not pass efl-ews (efl):
Output: http://queues.webkit.org/results/16613156
Comment 15 Mikhail Pozdnyakov 2013-02-18 05:21:26 PST
Created attachment 188858 [details]
patch v4

rebased
Comment 16 Kenneth Rohde Christiansen 2013-02-18 05:29:17 PST
Comment on attachment 188858 [details]
patch v4

LGTM
Comment 17 WebKit Review Bot 2013-02-19 08:49:49 PST
Comment on attachment 188858 [details]
patch v4

Clearing flags on attachment: 188858

Committed r143339: <http://trac.webkit.org/changeset/143339>
Comment 18 WebKit Review Bot 2013-02-19 08:49:54 PST
All reviewed patches have been landed.  Closing bug.