WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
128156
[EFL][WK2] Stop using COMPILE_ASSERT_MATCHING_ENUM macros in EFL WebKit2
https://bugs.webkit.org/show_bug.cgi?id=128156
Summary
[EFL][WK2] Stop using COMPILE_ASSERT_MATCHING_ENUM macros in EFL WebKit2
Jinwoo Song
Reported
2014-02-03 20:30:39 PST
SSIA.
Attachments
Patch
(23.50 KB, patch)
2014-02-03 20:33 PST
,
Jinwoo Song
no flags
Details
Formatted Diff
Diff
Patch
(23.14 KB, patch)
2014-02-03 23:31 PST
,
Jinwoo Song
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Jinwoo Song
Comment 1
2014-02-03 20:33:00 PST
Created
attachment 223067
[details]
Patch
Ryuan Choi
Comment 2
2014-02-03 20:46:56 PST
Comment on
attachment 223067
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=223067&action=review
Thanks. I commented bit.
> Source/WebKit2/UIProcess/API/efl/ewk_navigation_policy_decision_private.h:69 > + Ewk_Navigation_Type toEwkNavigationType(WKFrameNavigationType navigationType) const; > + Event_Mouse_Button toEventMouseButton(WKEventMouseButton mouseButton) const; > + Event_Modifier_Keys toEventModifierKeys(WKEventModifiers modifiers) const;
I am not sure why we should add these as methods? Can we make them as static inline function? At least, they can be static methods.
> Source/WebKit2/UIProcess/API/efl/ewk_private.h:29 > #include <wtf/Assertions.h>
Does we need to keep this?
> Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:399 > +inline WKFindOptions toWKFindOptions(Ewk_Find_Options options) > +{ > + unsigned wkFindOptions = 0; > + > + if (options & EWK_FIND_OPTIONS_CASE_INSENSITIVE) > + wkFindOptions |= kWKFindOptionsCaseInsensitive; > + if (options & EWK_FIND_OPTIONS_AT_WORD_STARTS) > + wkFindOptions |= kWKFindOptionsAtWordStarts; > + if (options & EWK_FIND_OPTIONS_TREAT_MEDIAL_CAPITAL_AS_WORD_START) > + wkFindOptions |= kWKFindOptionsTreatMedialCapitalAsWordStart; > + if (options & EWK_FIND_OPTIONS_BACKWARDS) > + wkFindOptions |= kWKFindOptionsBackwards; > + if (options & EWK_FIND_OPTIONS_WRAP_AROUND) > + wkFindOptions |= kWKFindOptionsWrapAround; > + if (options & EWK_FIND_OPTIONS_SHOW_OVERLAY) > + wkFindOptions |= kWKFindOptionsShowOverlay; > + if (options & EWK_FIND_OPTIONS_SHOW_FIND_INDICATOR) > + wkFindOptions |= kWKFindOptionsShowFindIndicator; > + if (options & EWK_FIND_OPTIONS_SHOW_HIGHLIGHT) > + wkFindOptions |= kWKFindOptionsShowHighlight; > + > + return static_cast<WKFindOptions>(wkFindOptions); > +}
I didn't check whether it is correct. but it looks changed the logic, right?
> Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:529 > + switch (mode) { > + case EWK_PAGINATION_MODE_INVALID: > + break;
Should we keep EWK_PAGINATION_MODE_INVALID if it is not in kWK's?
Ryuan Choi
Comment 3
2014-02-03 20:51:52 PST
Comment on
attachment 223067
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=223067&action=review
> Source/WebKit2/UIProcess/API/efl/ewk_context.cpp:215 > + return kWKCacheModelPrimaryWebBrowser; > + } > + ASSERT_NOT_REACHED(); > + > + return kWKCacheModelDocumentViewer; > +}
I don't know whether we have rules. But, you did it as two ways in a patch. any reason?
> Source/WebKit2/UIProcess/API/efl/ewk_popup_menu_item.cpp:47 > + default: > + ASSERT_NOT_REACHED(); > + return EWK_POPUP_MENU_ITEM; > + }
here
Anders Carlsson
Comment 4
2014-02-03 22:20:35 PST
Comment on
attachment 223067
[details]
Patch Patch looks good. Feel free to land as is, or address Ryan's comments.
Jinwoo Song
Comment 5
2014-02-03 23:24:37 PST
Comment on
attachment 223067
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=223067&action=review
>> Source/WebKit2/UIProcess/API/efl/ewk_context.cpp:215 >> +} > > I don't know whether we have rules. > > But, you did it as two ways in a patch. any reason?
As there is no concrete rules as I know, I added functions when there are more than three or four enum values.
>> Source/WebKit2/UIProcess/API/efl/ewk_navigation_policy_decision_private.h:69 >> + Event_Modifier_Keys toEventModifierKeys(WKEventModifiers modifiers) const; > > I am not sure why we should add these as methods? > > Can we make them as static inline function? > > At least, they can be static methods.
Exactly. I'll fix it.
>> Source/WebKit2/UIProcess/API/efl/ewk_popup_menu_item.cpp:47 >> + } > > here
I'll fix it.
>> Source/WebKit2/UIProcess/API/efl/ewk_private.h:29 >> #include <wtf/Assertions.h> > > Does we need to keep this?
No, I'll remove this line.
>> Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:399 >> +} > > I didn't check whether it is correct. but it looks changed the logic, right?
As several find options may be mixed, we have to do '|' operation. In previous code, static_cast converts the Ewk_Find_Options to WKFindOptions and in WKSahredAPICast, find options are mixed similarly like this.
>> Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:529 >> + break; > > Should we keep EWK_PAGINATION_MODE_INVALID if it is not in kWK's?
Because of [-Werror=switch] error, we have to keep this value in switch.
Jinwoo Song
Comment 6
2014-02-03 23:25:42 PST
(In reply to
comment #4
)
> (From update of
attachment 223067
[details]
) > Patch looks good. Feel free to land as is, or address Ryan's comments.
Thanks for review, Andersca! I'll land a patch with Ryuan's comment.
Jinwoo Song
Comment 7
2014-02-03 23:31:10 PST
Created
attachment 223075
[details]
Patch Patch for landing after applying Ryuan's comments.
Ryuan Choi
Comment 8
2014-02-03 23:35:51 PST
(In reply to
comment #7
)
> Created an attachment (id=223075) [details] > Patch > > Patch for landing after applying Ryuan's comments.
Looks fine to me. :)
WebKit Commit Bot
Comment 9
2014-02-04 00:15:27 PST
Comment on
attachment 223075
[details]
Patch Clearing flags on attachment: 223075 Committed
r163367
: <
http://trac.webkit.org/changeset/163367
>
WebKit Commit Bot
Comment 10
2014-02-04 00:15:30 PST
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug