Bug 103679 - [EFL][WK2] MiniBrowser should have a legacy mode
Summary: [EFL][WK2] MiniBrowser should have a legacy mode
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: Nobody
URL:
Keywords:
Depends on:
Blocks: 103860
  Show dependency treegraph
 
Reported: 2012-11-29 15:37 PST by Yael
Modified: 2012-12-02 23:27 PST (History)
5 users (show)

See Also:


Attachments
Patch (7.90 KB, patch)
2012-11-29 17:44 PST, Yael
no flags Details | Formatted Diff | Diff
Patch (4.11 KB, patch)
2012-11-30 07:13 PST, Yael
no flags Details | Formatted Diff | Diff
Patch (4.46 KB, patch)
2012-11-30 08:05 PST, Yael
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yael 2012-11-29 15:37:56 PST
It is very useful to start MiniBrowser in Legacy mode. e.g. to compare how a test looks in MiniBrowser to the pixel tests results.
Comment 1 Yael 2012-11-29 17:44:50 PST
Created attachment 176865 [details]
Patch

The new API name was suggested in https://bugs.webkit.org/show_bug.cgi?id=100674#c47
Comment 2 Kenneth Rohde Christiansen 2012-11-30 00:54:12 PST
Comment on attachment 176865 [details]
Patch

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

> Source/WebKit2/UIProcess/API/efl/ewk_context.cpp:213
> +void EwkContext::setViewBehavior(Ewk_View_Behavior behavior)
> +{
> +    m_behavior = behavior;
> +}
> +
> +Ewk_View_Behavior EwkContext::viewBehavior() const
> +{
> +    return m_behavior;
> +}

Do we really want this to be public api? You could also just use a hidden environment variable.

Every thing we expose has to be supported
Comment 3 Gyuyoung Kim 2012-11-30 01:02:59 PST
Comment on attachment 176865 [details]
Patch

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

>> Source/WebKit2/UIProcess/API/efl/ewk_context.cpp:213
>> +}
> 
> Do we really want this to be public api? You could also just use a hidden environment variable.
> 
> Every thing we expose has to be supported

I agree with Kenneth. We should avoid to add unneeded APIs.
Comment 4 Yael 2012-11-30 05:26:06 PST
(In reply to comment #2)
> (From update of attachment 176865 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=176865&action=review
> 
> > Source/WebKit2/UIProcess/API/efl/ewk_context.cpp:213
> > +void EwkContext::setViewBehavior(Ewk_View_Behavior behavior)
> > +{
> > +    m_behavior = behavior;
> > +}
> > +
> > +Ewk_View_Behavior EwkContext::viewBehavior() const
> > +{
> > +    return m_behavior;
> > +}
> 
> Do we really want this to be public api? You could also just use a hidden environment variable.
> 
> Every thing we expose has to be supported
From https://bugs.webkit.org/show_bug.cgi?id=100674#c47 I assumed that we do, but this can be done without a new API.
Comment 5 Yael 2012-11-30 07:13:51 PST
Created attachment 176962 [details]
Patch

Removed the new API.
Comment 6 Kenneth Rohde Christiansen 2012-11-30 07:47:41 PST
Comment on attachment 176962 [details]
Patch

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

> Source/WebKit2/ChangeLog:10
> +
> +        Allow calling WKViewCreate without creating a context first. A default context
> +        will be used.
> +

You should explain what that actually means. How is that related to the legacy mode.

> Tools/MiniBrowser/efl/main.c:1063
> -    window->ewk_view = ewk_view_smart_add(evas, smart, ewk_context_default_get());
> +    window->ewk_view = legacy_behavior_enabled ? (Evas_Object*)WKViewCreate(evas, 0, 0) : ewk_view_smart_add(evas, smart, ewk_context_default_get());

Why not make this more clean

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
   window->ewk_view = ewk_view_smart_add(evas, smart, ewk_context_default_get());
Comment 7 Yael 2012-11-30 07:49:05 PST
(In reply to comment #6)
> (From update of attachment 176962 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=176962&action=review
> 
> > Source/WebKit2/ChangeLog:10
> > +
> > +        Allow calling WKViewCreate without creating a context first. A default context
> > +        will be used.
> > +
> 
> You should explain what that actually means. How is that related to the legacy mode.
> 
> > Tools/MiniBrowser/efl/main.c:1063
> > -    window->ewk_view = ewk_view_smart_add(evas, smart, ewk_context_default_get());
> > +    window->ewk_view = legacy_behavior_enabled ? (Evas_Object*)WKViewCreate(evas, 0, 0) : ewk_view_smart_add(evas, smart, ewk_context_default_get());
> 
> Why not make this more clean
> 
> 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
>    window->ewk_view = ewk_view_smart_add(evas, smart, ewk_context_default_get());
Because people usually ask me to condense lines as much as possible :)
Comment 8 Kenneth Rohde Christiansen 2012-11-30 07:50:04 PST
> > 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
> >    window->ewk_view = ewk_view_smart_add(evas, smart, ewk_context_default_get());
> Because people usually ask me to condense lines as much as possible :)

We are doing something a bit out of the ordinary here, let's make that clear.
Comment 9 Kenneth Rohde Christiansen 2012-11-30 07:51:40 PST
Comment on attachment 176962 [details]
Patch

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

>> Tools/MiniBrowser/efl/main.c:1063
>> +    window->ewk_view = legacy_behavior_enabled ? (Evas_Object*)WKViewCreate(evas, 0, 0) : ewk_view_smart_add(evas, smart, ewk_context_default_get());
> 
> Why not make this more clean
> 
> 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
>    window->ewk_view = ewk_view_smart_add(evas, smart, ewk_context_default_get());

As you don't add the smart now, why create it?
Comment 10 Yael 2012-11-30 08:05:14 PST
Created attachment 176971 [details]
Patch

Address Kenneth's comments
Comment 11 WebKit Review Bot 2012-12-02 02:13:41 PST
Comment on attachment 176971 [details]
Patch

Clearing flags on attachment: 176971

Committed r136320: <http://trac.webkit.org/changeset/136320>
Comment 12 WebKit Review Bot 2012-12-02 02:13:46 PST
All reviewed patches have been landed.  Closing bug.