Bug 100066 - [WK2] Add APIs to get/set encoding detector
Summary: [WK2] Add APIs to get/set encoding detector
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit EFL (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 100931
  Show dependency treegraph
 
Reported: 2012-10-22 20:07 PDT by Yuni Jeong
Modified: 2012-11-01 02:25 PDT (History)
8 users (show)

See Also:


Attachments
Patch (6.67 KB, patch)
2012-10-22 22:06 PDT, Yuni Jeong
no flags Details | Formatted Diff | Diff
Patch (6.67 KB, patch)
2012-10-30 02:13 PDT, Yuni Jeong
no flags Details | Formatted Diff | Diff
Patch (6.74 KB, patch)
2012-10-31 23:37 PDT, Yuni Jeong
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yuni Jeong 2012-10-22 20:07:38 PDT
It is required for enabling encoding detector.
Comment 1 Yuni Jeong 2012-10-22 22:06:01 PDT
Created attachment 170062 [details]
Patch
Comment 2 Jinwoo Song 2012-10-25 09:00:41 PDT
Comment on attachment 170062 [details]
Patch

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

> Source/WebKit2/ChangeLog:3
> +        [EFL][WK2] Add APIs to get/set encoding detector

This patch not only adds ewk setting APIs but also adds WKPreference APIs.
So it is not proper to add [EFL] prefix to the title.

> Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_settings.cpp:165
> +    ASSERT_FALSE(ewk_setting_uses_encoding_detector_get(settings));

It would be better to add comments that the default setting value is 'false' to explain why ASSERT_FALSE() is used.
Comment 3 Kangil Han 2012-10-25 17:04:16 PDT
Comment on attachment 170062 [details]
Patch

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

> Source/WebKit2/UIProcess/API/C/WKPreferences.h:223
> +// Defaults to false.

IMHO, it depends on policy. So I would like to remove this comment.

>> Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_settings.cpp:165
>> +    ASSERT_FALSE(ewk_setting_uses_encoding_detector_get(settings));
> 
> It would be better to add comments that the default setting value is 'false' to explain why ASSERT_FALSE() is used.

IMHO, it depends on policy. So I would like to remove this line of test.
Comment 4 Jinwoo Song 2012-10-25 17:33:19 PDT
Comment on attachment 170062 [details]
Patch

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

>> Source/WebKit2/UIProcess/API/C/WKPreferences.h:223
>> +// Defaults to false.
> 
> IMHO, it depends on policy. So I would like to remove this comment.

There are default values for each setting member variables in Setting.cpp. I think its common to comment it.

>>> Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_settings.cpp:165
>>> +    ASSERT_FALSE(ewk_setting_uses_encoding_detector_get(settings));
>> 
>> It would be better to add comments that the default setting value is 'false' to explain why ASSERT_FALSE() is used.
> 
> IMHO, it depends on policy. So I would like to remove this line of test.

Ditto.
Comment 5 Kangil Han 2012-10-25 20:11:37 PDT
Comment on attachment 170062 [details]
Patch

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

>>> Source/WebKit2/UIProcess/API/C/WKPreferences.h:223
>>> +// Defaults to false.
>> 
>> IMHO, it depends on policy. So I would like to remove this comment.
> 
> There are default values for each setting member variables in Setting.cpp. I think its common to comment it.

If we set this setting value true on ewk initialization step, as an example, this function should return true.
It means it is port specific.

Then, caller might have confusion between this comment and actual result.
Actually, there was a discussion to enable encoding detector by default in efl port even though it hasn't been happened. :)
Comment 6 Chris Dumez 2012-10-25 21:46:40 PDT
(In reply to comment #4)
> (From update of attachment 170062 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=170062&action=review
> 
> >> Source/WebKit2/UIProcess/API/C/WKPreferences.h:223
> >> +// Defaults to false.
> > 
> > IMHO, it depends on policy. So I would like to remove this comment.
> 
> There are default values for each setting member variables in Setting.cpp. I think its common to comment it.

I agree with Jinwoo here. It is good (and common practice) to document the default value (even if ports can override it). Ports document their default values in their port-specific API anyway.
Comment 7 Ryuan Choi 2012-10-25 22:17:42 PDT
(In reply to comment #5)
> (From update of attachment 170062 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=170062&action=review
> 
> >>> Source/WebKit2/UIProcess/API/C/WKPreferences.h:223
> >>> +// Defaults to false.
> >> 
> >> IMHO, it depends on policy. So I would like to remove this comment.
> > 
> > There are default values for each setting member variables in Setting.cpp. I think its common to comment it.
> 
> If we set this setting value true on ewk initialization step, as an example, this function should return true.
> It means it is port specific.
> 
> Then, caller might have confusion between this comment and actual result.
> Actually, there was a discussion to enable encoding detector by default in efl port even though it hasn't been happened. :)

If someone changes default value, they should update doxygen also.

I supports jinwoo and chris.
Comment 8 Kangil Han 2012-10-25 23:14:06 PDT
Okay, we can update when policy would be changed. ;)
Comment 9 Yuni Jeong 2012-10-30 02:13:14 PDT
Created attachment 171403 [details]
Patch
Comment 10 Yuni Jeong 2012-10-30 02:18:46 PDT
As Jinwoo Song's comment,
I removed [EFL] prefix in the title and added comment that encoding detector is not used by default to unit test for ewk_setting_uses_encoding_detector.
Comment 11 Kangil Han 2012-10-30 04:32:13 PDT
Comment on attachment 171403 [details]
Patch

LGTM, thanks.
Comment 12 Mikhail Pozdnyakov 2012-10-30 04:34:11 PDT
Comment on attachment 171403 [details]
Patch

LGTM
Comment 13 Ryuan Choi 2012-10-30 05:14:30 PDT
LGTM.

I changed bug title to match with changelog.
Comment 14 Gyuyoung Kim 2012-10-30 05:33:16 PDT
Comment on attachment 171403 [details]
Patch

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

> Source/WebKit2/UIProcess/API/C/WKPreferences.cpp:947
> +void WKPreferencesSetUsesEncodingDetector(WKPreferencesRef preferencesRef, bool use)

To be consistent with existing APIs, it would be good if you use *enabled* or *flag* instead of *use*.

> Source/WebKit2/UIProcess/API/efl/ewk_settings.cpp:274
> +Eina_Bool ewk_setting_uses_encoding_detector_set(Ewk_Settings* settings, Eina_Bool use)

ditto. In this case, enable ?
Comment 15 Yuni Jeong 2012-10-31 23:37:07 PDT
Created attachment 171779 [details]
Patch
Comment 16 Yuni Jeong 2012-10-31 23:39:14 PDT
To be consistent with existing APIs, i changed "use" to "enable".
Comment 17 WebKit Review Bot 2012-11-01 00:26:20 PDT
Comment on attachment 171779 [details]
Patch

Clearing flags on attachment: 171779

Committed r133133: <http://trac.webkit.org/changeset/133133>
Comment 18 WebKit Review Bot 2012-11-01 00:26:25 PDT
All reviewed patches have been landed.  Closing bug.