Bug 105846 - [WK2][EFL] Add guard around NativeWebTouchEvent
Summary: [WK2][EFL] Add guard around NativeWebTouchEvent
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-28 21:05 PST by Seokju Kwon
Modified: 2017-03-11 10:39 PST (History)
8 users (show)

See Also:


Attachments
Patch (1.16 KB, patch)
2012-12-28 21:11 PST, Seokju Kwon
no flags Details | Formatted Diff | Diff
Patch (1.65 KB, patch)
2013-01-08 15:30 PST, Seokju Kwon
no flags Details | Formatted Diff | Diff
Patch (1.65 KB, patch)
2013-01-08 15:37 PST, Seokju Kwon
no flags Details | Formatted Diff | Diff
Patch (1.18 KB, patch)
2013-01-09 01:46 PST, Seokju Kwon
no flags Details | Formatted Diff | Diff
Patch (1.46 KB, patch)
2013-01-09 22:26 PST, Seokju Kwon
no flags Details | Formatted Diff | Diff
Patch (1.46 KB, patch)
2013-01-09 22:36 PST, Seokju Kwon
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Seokju Kwon 2012-12-28 21:05:22 PST
Build breaks when TOUCH_EVENTS is disabled.
Source/WebKit2/Shared/NativeWebTouchEvent.h:41:50: error: expected class-name before ‘{’ token
Comment 1 Seokju Kwon 2012-12-28 21:11:40 PST
Created attachment 180913 [details]
Patch
Comment 2 Benjamin Poulain 2013-01-07 12:05:16 PST
Comment on attachment 180913 [details]
Patch

With a few exceptions, the feature #ifdef should be on the #include side, not in the header.

Why is this case different?
Comment 3 Seokju Kwon 2013-01-07 15:42:03 PST
(In reply to comment #2)
> (From update of attachment 180913 [details])
> With a few exceptions, the feature #ifdef should be on the #include side, not in the header.
> 
> Why is this case different?

NativeWebTouchEvent was derived from WebTouchEvent. But it is around ENABLE(TOUCH_EVENTS) in header file (WebEvent.h).
It seems that build breaks when TOUCH_EVENTS is disabled.
Comment 4 Benjamin Poulain 2013-01-07 16:33:56 PST
(In reply to comment #3)
> (In reply to comment #2)
> > (From update of attachment 180913 [details] [details])
> > With a few exceptions, the feature #ifdef should be on the #include side, not in the header.
> > 
> > Why is this case different?
> 
> NativeWebTouchEvent was derived from WebTouchEvent. But it is around ENABLE(TOUCH_EVENTS) in header file (WebEvent.h).
> It seems that build breaks when TOUCH_EVENTS is disabled.

I understand that. But why #ifdef the header instead of in the code where the header is included?
Comment 5 Seokju Kwon 2013-01-07 18:35:59 PST
(In reply to comment #4)
> (In reply to comment #3)
> > (In reply to comment #2)
> > > (From update of attachment 180913 [details] [details] [details])
> > > With a few exceptions, the feature #ifdef should be on the #include side, not in the header.
> > > 
> > > Why is this case different?
> > 
> > NativeWebTouchEvent was derived from WebTouchEvent. But it is around ENABLE(TOUCH_EVENTS) in header file (WebEvent.h).
> > It seems that build breaks when TOUCH_EVENTS is disabled.
> 
> I understand that. But why #ifdef the header instead of in the code where the header is included?

Sorry, I was confused. I will upload a new patch.
Comment 6 Seokju Kwon 2013-01-08 15:30:37 PST
Created attachment 181787 [details]
Patch
Comment 7 Seokju Kwon 2013-01-08 15:37:44 PST
Created attachment 181790 [details]
Patch
Comment 8 Benjamin Poulain 2013-01-08 15:52:24 PST
Comment on attachment 181790 [details]
Patch

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

> Source/WebKit2/ChangeLog:8
> +        Add TOUCH_EVENTS guard.

Please add a sentence to say this fixes EFL build without TOUCH_EVENTS.

> Source/WebKit2/Shared/qt/NativeWebTouchEventQt.cpp:29
> +#if ENABLE(TOUCH_EVENTS)
>  #include "NativeWebTouchEvent.h"
> +#endif

This is not correct for Qt.

For performance reason, Qt exclude such files through the project file. In this case, NativeWebTouchEventQt.cpp is excluded from Target.pri if TOUCH_EVENTS is not defined.
Comment 9 Gyuyoung Kim 2013-01-08 21:29:48 PST
Comment on attachment 181790 [details]
Patch

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

> Source/WebKit2/ChangeLog:3
> +        Add guard around NativeWebTouchEvent

It would be good if you add [WK2][EFL][QT] prefix.
Comment 10 Seokju Kwon 2013-01-09 01:46:14 PST
Created attachment 181876 [details]
Patch
Comment 11 Gyuyoung Kim 2013-01-09 02:45:04 PST
Comment on attachment 181876 [details]
Patch

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

> Source/WebKit2/Shared/efl/NativeWebTouchEventEfl.cpp:27
> +#if ENABLE(TOUCH_EVENTS)

NativeWebTouchEventEfl.cpp already uses this guard. I think this build break occurs because NativeWebTouchEvent.h doesn't use the guard. I think it would be good to add this guard to NativeWebTouchEvent.h.
Comment 12 Benjamin Poulain 2013-01-09 09:39:00 PST
Comment on attachment 181876 [details]
Patch

(In reply to comment #11)
> (From update of attachment 181876 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=181876&action=review
> 
> > Source/WebKit2/Shared/efl/NativeWebTouchEventEfl.cpp:27
> > +#if ENABLE(TOUCH_EVENTS)
> 
> NativeWebTouchEventEfl.cpp already uses this guard. 

You can just move that guard up under the #include of config.h.

> I think this build break occurs because NativeWebTouchEvent.h doesn't use the guard. I think it would be good to add this guard to NativeWebTouchEvent.h.

See my previous comments.
Comment 13 Gyuyoung Kim 2013-01-09 22:05:16 PST
(In reply to comment #12)
> (From update of attachment 181876 [details])
> (In reply to comment #11)
> > (From update of attachment 181876 [details] [details])
> > View in context: https://bugs.webkit.org/attachment.cgi?id=181876&action=review
> > 
> > > Source/WebKit2/Shared/efl/NativeWebTouchEventEfl.cpp:27
> > > +#if ENABLE(TOUCH_EVENTS)
> > 
> > NativeWebTouchEventEfl.cpp already uses this guard. 
> 
> You can just move that guard up under the #include of config.h.

Seokju, please do that. Then, I will set cq+.

> > I think this build break occurs because NativeWebTouchEvent.h doesn't use the guard. I think it would be good to add this guard to NativeWebTouchEvent.h.
> 
> See my previous comments.

>> With a few exceptions, the feature #ifdef should be on the #include side, not in the header.

I have no strong opinion on this, but it seems to me #ifdef has been using in header in many places. For example, Modules sub-directories. But, I don't wanna object your opinion.
Comment 14 Seokju Kwon 2013-01-09 22:25:55 PST
(In reply to comment #13)
> (In reply to comment #12)
> > (From update of attachment 181876 [details] [details])
> > (In reply to comment #11)
> > > (From update of attachment 181876 [details] [details] [details])
> > > View in context: https://bugs.webkit.org/attachment.cgi?id=181876&action=review
> > > 
> > > > Source/WebKit2/Shared/efl/NativeWebTouchEventEfl.cpp:27
> > > > +#if ENABLE(TOUCH_EVENTS)
> > > 
> > > NativeWebTouchEventEfl.cpp already uses this guard. 
> > 
> > You can just move that guard up under the #include of config.h.
> 
> Seokju, please do that. Then, I will set cq+.
> 
> > > I think this build break occurs because NativeWebTouchEvent.h doesn't use the guard. I think it would be good to add this guard to NativeWebTouchEvent.h.
> > 
> > See my previous comments.
> 
> >> With a few exceptions, the feature #ifdef should be on the #include side, not in the header.
> 
> I have no strong opinion on this, but it seems to me #ifdef has been using in header in many places. For example, Modules sub-directories. But, I don't wanna object your opinion.

Ok, Thanks.
Comment 15 Seokju Kwon 2013-01-09 22:26:38 PST
Created attachment 182066 [details]
Patch
Comment 16 Gyuyoung Kim 2013-01-09 22:29:20 PST
Comment on attachment 182066 [details]
Patch

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

> Source/WebKit2/Shared/efl/NativeWebTouchEventEfl.cpp:26
>  #include "config.h"

I prefer to add a new line below config.h, if possible.
Comment 17 Seokju Kwon 2013-01-09 22:36:08 PST
Created attachment 182068 [details]
Patch
Comment 18 Benjamin Poulain 2013-01-09 22:48:25 PST
> >> With a few exceptions, the feature #ifdef should be on the #include side, not in the header.
> 
> I have no strong opinion on this, but it seems to me #ifdef has been using in header in many places. For example, Modules sub-directories. But, I don't wanna object your opinion.

You are right, I am thinking of touch events header in particular. If I am not mistaken, those use the style I mentioned above (right?).

For me the difference ties into a feature in development, and optional features like touch events.

(In reply to comment #16)
> > Source/WebKit2/Shared/efl/NativeWebTouchEventEfl.cpp:26
> >  #include "config.h"
> 
> I prefer to add a new line below config.h, if possible.

+1 :)
Comment 19 WebKit Review Bot 2013-01-09 23:08:40 PST
Comment on attachment 182068 [details]
Patch

Clearing flags on attachment: 182068

Committed r139287: <http://trac.webkit.org/changeset/139287>
Comment 20 WebKit Review Bot 2013-01-09 23:08:45 PST
All reviewed patches have been landed.  Closing bug.
Comment 21 Gyuyoung Kim 2013-01-09 23:17:24 PST
(In reply to comment #18)
> > >> With a few exceptions, the feature #ifdef should be on the #include side, not in the header.
> > 
> > I have no strong opinion on this, but it seems to me #ifdef has been using in header in many places. For example, Modules sub-directories. But, I don't wanna object your opinion.
> 
> You are right, I am thinking of touch events header in particular. If I am not mistaken, those use the style I mentioned above (right?).
> 
> For me the difference ties into a feature in development, and optional features like touch events.

It looks there is no rule for this. However, I prefer to tie .h and .cpp together with #ifdef guard personally if there is #ifdef guard for those files. I think it will prevent unexpected build break on other ports. But, I'm not sure if this should become one of coding style.
Comment 22 Michael Catanzaro 2017-03-11 10:39:18 PST
Closing this bug because the EFL port has been removed from trunk.

If you feel this bug applies to a different upstream WebKit port and was closed in error, please either update the title and reopen the bug, or leave a comment to request this.