Bug 103342 - [EFL][WK2] Add ewk_settings APIs for text autosizing
Summary: [EFL][WK2] Add ewk_settings APIs for text autosizing
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: 99074
  Show dependency treegraph
 
Reported: 2012-11-26 18:15 PST by Jaehun Lim
Modified: 2012-12-09 15:53 PST (History)
5 users (show)

See Also:


Attachments
Patch (5.03 KB, patch)
2012-11-26 18:19 PST, Jaehun Lim
kenneth: review+
Details | Formatted Diff | Diff
Fixed patch (4.85 KB, patch)
2012-12-06 22:10 PST, Jaehun Lim
no flags Details | Formatted Diff | Diff
Fixed patch (4.84 KB, patch)
2012-12-06 22:15 PST, Jaehun Lim
no flags Details | Formatted Diff | Diff
Patch (5.13 KB, patch)
2012-12-06 23:50 PST, Jaehun Lim
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jaehun Lim 2012-11-26 18:15:54 PST
Add ewk_settings_text_autosizing_enabled_get / set() functions.
Comment 1 Jaehun Lim 2012-11-26 18:19:15 PST
Created attachment 176138 [details]
Patch
Comment 2 Gyuyoung Kim 2012-12-06 17:59:22 PST
Comment on attachment 176138 [details]
Patch

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

> Source/WebKit2/ChangeLog:9
> +        Text autosizing is disabled by default.

I think this API is not meaningless if text autosizing is disabled.

> Source/WebKit2/UIProcess/API/efl/ewk_settings.cpp:354
> +    EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);

I think we don't need to keep this line when disabling TEXT_AUTOSIZING

> Source/WebKit2/UIProcess/API/efl/ewk_settings.cpp:368
> +#if ENABLE(TEXT_AUTOSIZING)

ditto.

> Source/WebKit2/UIProcess/API/efl/ewk_settings.cpp:370
> +#else

Missing UNUSED_PARAM
Comment 3 Kenneth Rohde Christiansen 2012-12-06 18:02:29 PST
Comment on attachment 176138 [details]
Patch

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

>> Source/WebKit2/UIProcess/API/efl/ewk_settings.cpp:354
>> +    EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
> 
> I think we don't need to keep this line when disabling TEXT_AUTOSIZING

The line is correct and people could give a null pointer.

I say leave it
Comment 4 Gyuyoung Kim 2012-12-06 18:07:07 PST
(In reply to comment #3)
> (From update of attachment 176138 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=176138&action=review
> 
> >> Source/WebKit2/UIProcess/API/efl/ewk_settings.cpp:354
> >> +    EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
> > 
> > I think we don't need to keep this line when disabling TEXT_AUTOSIZING
> 
> The line is correct and people could give a null pointer.
> 
> I say leave it

Ok, I don't mind this. Jaehun, please fix I pointed out.
Comment 5 Gyuyoung Kim 2012-12-06 18:11:03 PST
(In reply to comment #2)
> (From update of attachment 176138 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=176138&action=review
> 
> > Source/WebKit2/ChangeLog:9
> > +        Text autosizing is disabled by default.
> 
> I think this API is not meaningless if text autosizing is disabled.

typo : not meaningless -> meaningless.

Kenneth, what do you think about this? Do you think this API can be landed without enabling TEXT_AUTOSIZING ?
Comment 6 Gyuyoung Kim 2012-12-06 18:18:47 PST
Comment on attachment 176138 [details]
Patch

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

>>>> Source/WebKit2/UIProcess/API/efl/ewk_settings.cpp:354
>>>> +    EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
>>> 
>>> I think we don't need to keep this line when disabling TEXT_AUTOSIZING
>> 
>> The line is correct and people could give a null pointer.
>> 
>> I say leave it
> 
> Ok, I don't mind this. Jaehun, please fix I pointed out.

I missed one thing. EFL port has used below line. To be compliant with existing implementation, I prefer to use below style. My first comment meant this. 

#if ENABLE(TEXT_AUTOSIZING)
   EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
   settings->preferences()->setTextAutosizingEnabled(enable);

   return true;
#else
   UNUSED_PARAM(enable);
   return false;
#endif
}

For example,

Eina_Bool ewk_settings_fullscreen_enabled_get(const Ewk_Settings* settings)
{
#if ENABLE(FULLSCREEN_API)
    EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
    return settings->preferences()->fullScreenEnabled();
#else
    return false;
#endif
}
Comment 7 Jaehun Lim 2012-12-06 22:10:34 PST
Created attachment 178160 [details]
Fixed patch

I fixed my patch according to Gyuyoung's comments.
Gyuyoung, Please review again.
Comment 8 Jaehun Lim 2012-12-06 22:15:31 PST
Created attachment 178162 [details]
Fixed patch

Fixed patch
Comment 9 Jaehun Lim 2012-12-06 23:50:29 PST
Created attachment 178167 [details]
Patch
Comment 10 Kenneth Rohde Christiansen 2012-12-07 02:36:11 PST
Comment on attachment 178167 [details]
Patch

Please enable text autosizing in the build system soon
Comment 11 WebKit Review Bot 2012-12-07 02:48:47 PST
Comment on attachment 178167 [details]
Patch

Clearing flags on attachment: 178167

Committed r136941: <http://trac.webkit.org/changeset/136941>
Comment 12 WebKit Review Bot 2012-12-07 02:48:52 PST
All reviewed patches have been landed.  Closing bug.
Comment 13 Jaehun Lim 2012-12-09 15:53:24 PST
(In reply to comment #10)
> (From update of attachment 178167 [details])
> Please enable text autosizing in the build system soon

I'll make another bug to enable TEXT_AUTOSIZING soon.

But there is one problem how to define "HACK_FORCE_TEXT_AUTOSIZING_ON_DESKTOP" in  http://trac.webkit.org/browser/trunk/Source/WebCore/page/Settings.cpp#L140.

I'll enable it after resolving https://bugs.webkit.org/show_bug.cgi?id=94371.