Bug 103860 - [WK2][EFL] Add ewk API for creating a view with legacy behavior
Summary: [WK2][EFL] Add ewk API for creating a view with legacy behavior
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit EFL (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: KyungTae Kim
URL:
Keywords:
Depends on: 103679
Blocks:
  Show dependency treegraph
 
Reported: 2012-12-02 23:27 PST by KyungTae Kim
Modified: 2012-12-06 01:47 PST (History)
8 users (show)

See Also:


Attachments
Patch (4.33 KB, patch)
2012-12-02 23:37 PST, KyungTae Kim
kenneth: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description KyungTae Kim 2012-12-02 23:27:05 PST
The EFL WebKit2 MiniBrowser uses WK2 API for creating a view with legacy behavior (bug 103679).

But, it seems not a good way because it's the only WK2 API that is used by the MiniBrowser, 
and it needs a type conversion between incompatible types that makes the below build warning:
 
Tools/MiniBrowser/efl/main.c:1064:28: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]

How about add a ewk API for creating a view with legacy behavior?
Comment 1 KyungTae Kim 2012-12-02 23:37:00 PST
Created attachment 177192 [details]
Patch
Comment 3 KyungTae Kim 2012-12-03 21:23:02 PST
(In reply to comment #2)
> Please see https://bugs.webkit.org/show_bug.cgi?id=103679#c2 and https://bugs.webkit.org/show_bug.cgi?id=103679#c3.

I agree with the comments. The 'setViewBehavior' and 'viewBehavior' should not to be APIs.

What I suggest is a API for just what you want - creating a view with legacy behavior.
(not 'setViewBehavior' for already created view)

You need that functionality but there was no ewk_ API for that, so that API is necessary API I think.

I think the alternative implementation would be the view creating API with behavior like below:

enum Ewk_View_Behavior {
    EWK_VIEW_BEHAVIOR_DEFAULT,
    EWK_VEIW_BEHAVIOR_LEGACY
};
 ewk_view_smart_add_with_behavior(evas, smart, ewk_context_default_get(), EWK_VEIW_BEHAVIOR_LEGACY);
Comment 4 Gyuyoung Kim 2012-12-03 22:12:41 PST
(In reply to comment #3)
> (In reply to comment #2)
> > Please see https://bugs.webkit.org/show_bug.cgi?id=103679#c2 and https://bugs.webkit.org/show_bug.cgi?id=103679#c3.
> 
> I agree with the comments. The 'setViewBehavior' and 'viewBehavior' should not to be APIs.
> 
> What I suggest is a API for just what you want - creating a view with legacy behavior.
> (not 'setViewBehavior' for already created view)
> 
> You need that functionality but there was no ewk_ API for that, so that API is necessary API I think.
> 
> I think the alternative implementation would be the view creating API with behavior like below:
> 
> enum Ewk_View_Behavior {
>     EWK_VIEW_BEHAVIOR_DEFAULT,
>     EWK_VEIW_BEHAVIOR_LEGACY
> };
>  ewk_view_smart_add_with_behavior(evas, smart, ewk_context_default_get(), EWK_VEIW_BEHAVIOR_LEGACY);

I don't agree to change API by MiniBrowser needs. Do you think this will be needed by real application(e.g. browser) ?  Kenneth, what do you think ?
Comment 5 KyungTae Kim 2012-12-03 23:58:53 PST
(In reply to comment #4)
> I don't agree to change API by MiniBrowser needs. Do you think this will be needed by real application(e.g. browser) ?  Kenneth, what do you think ?

I think this will be needed when we make a PC Browser with legacy behavior.
Comment 6 Mikhail Pozdnyakov 2012-12-04 00:31:46 PST
Think "legacy" means that it's not supposed to be used any more :) Don't think we should expose it.
Comment 7 Ryuan Choi 2012-12-05 18:10:13 PST
(In reply to comment #6)
> Think "legacy" means that it's not supposed to be used any more :) Don't think we should expose it.

By the way, exposing WK is also bad.

We didn't expose it to application side.
Comment 8 KyungTae Kim 2012-12-05 21:17:35 PST
(In reply to comment #6)
> Think "legacy" means that it's not supposed to be used any more :) Don't think we should expose it.

If the  "legacy" is "not supposed to be used", the WKViewCreate also need to do "default behavior" by default, not "legacy behavior".
Anyway, the "legacy behavior" is needed for Minibrowser now, and may be needed for other applications that don't want to use the backing store.
Comment 9 Kenneth Rohde Christiansen 2012-12-06 01:17:39 PST
(In reply to comment #8)
> (In reply to comment #6)
> > Think "legacy" means that it's not supposed to be used any more :) Don't think we should expose it.
> 
> If the  "legacy" is "not supposed to be used", the WKViewCreate also need to do "default behavior" by default, not "legacy behavior".
> Anyway, the "legacy behavior" is needed for Minibrowser now, and may be needed for other applications that don't want to use the backing store.

If you don't want a proper browser featuring high performance features commonly known as HTML5 today, you can always use a WebKit snapshot from 2008 or earlier.

Joke aside, I mean we cannot and don't want to support all kind of configurations and especially not ones that means sacrificing the platform. Even browsers like Chrome today uses a backing store by default. Get over it. There should not be any "may be used". We don't care about "may", we need to focus on what we "do need".
Comment 10 Kenneth Rohde Christiansen 2012-12-06 01:20:09 PST
Comment on attachment 177192 [details]
Patch

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

> Source/WebKit2/UIProcess/API/efl/ewk_view.h:342
>  EAPI Evas_Object *ewk_view_smart_add(Evas *e, Evas_Smart *smart, Ewk_Context *context);
> +EAPI Evas_Object *ewk_view_smart_add_with_legacy_behavior(Evas *e, Evas_Smart *smart, Ewk_Context *context);

We decided to not expose these things publically.

> Tools/MiniBrowser/efl/main.c:1062
> -    if (legacy_behavior_enabled) {
> -        // Use raw WK2 api to create a view using legacy mode.
> -        window->ewk_view = (Evas_Object*)WKViewCreate(evas, 0, 0);
> -    } else {
> -        Evas_Smart *smart = evas_smart_class_new(&ewkViewClass->sc);
> +

MiniBrowser is a development tool. There is no problem using some internal API for the sake of being able to improve debugging some cases.

The API is internal, it will not be documented, and even if people find it and use it, we have no guarantees it will stay there or not change behavior. That is fine.
Comment 11 KyungTae Kim 2012-12-06 01:47:56 PST
(In reply to comment #10)
> MiniBrowser is a development tool. There is no problem using some internal API for the sake of being able to improve debugging some cases.
> The API is internal, it will not be documented, and even if people find it and use it, we have no guarantees it will stay there or not change behavior. That is fine.

OK. I understood your point. I'll close this bug.
Then, I think the below warning need to be fixed in another way : 
Tools/MiniBrowser/efl/main.c:1064:28: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]