Bug 99021 - [EFL][WK2] Add support for JavaScript popup boxes to MiniBrowser
Summary: [EFL][WK2] Add support for JavaScript popup boxes to MiniBrowser
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: Chris Dumez
URL:
Keywords:
: 96616 (view as bug list)
Depends on: 98748
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-11 04:17 PDT by Chris Dumez
Modified: 2012-10-11 21:48 PDT (History)
7 users (show)

See Also:


Attachments
Patch (8.35 KB, patch)
2012-10-11 04:51 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2012-10-11 04:17:08 PDT
MiniBrowser does not currently support JavaScript alert / confirm / prompt popups.
Comment 1 Chris Dumez 2012-10-11 04:51:57 PDT
Created attachment 168194 [details]
Patch
Comment 2 Byungwoo Lee 2012-10-11 05:10:06 PDT
Comment on attachment 168194 [details]
Patch

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

There is a same bug (bug 96616)

> Tools/MiniBrowser/efl/main.c:430
> +    ecore_main_loop_begin();

Is it ok to use the nested run loop?
As I know, EFL recommends not to use the nested run loop.
Comment 3 Chris Dumez 2012-10-11 05:13:45 PDT
(In reply to comment #2)
> (From update of attachment 168194 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=168194&action=review
> 
> There is a same bug (bug 96616)

Sorry, I did not notice.

> > Tools/MiniBrowser/efl/main.c:430
> > +    ecore_main_loop_begin();
> 
> Is it ok to use the nested run loop?
> As I know, EFL recommends not to use the nested run loop.

Well, it works. I've tested everything with:
http://www.w3schools.com/js/js_popup.asp

FYI, we already use this for the Web Inspector:
Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp-    // Because it can't complete loading inspector.html before loading testURL.
Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp-    Evas_Object* inspectorView = ewk_view_web_inspector_view_get(mainView());
Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp-    if (inspectorView)
Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp:        ecore_main_loop_begin();
Comment 4 Chris Dumez 2012-10-11 05:27:16 PDT
(In reply to comment #2)
> (From update of attachment 168194 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=168194&action=review
> 
> There is a same bug (bug 96616)
> 
> > Tools/MiniBrowser/efl/main.c:430
> > +    ecore_main_loop_begin();
> 
> Is it ok to use the nested run loop?
> As I know, EFL recommends not to use the nested run loop.

I believe that this case is special. Those JS dialogs are meant to suspend the JS execution until the dialog is closed and this is exactly what my call to ecore_main_loop_begin() does.

I personally don't know of any other way to achieve this. Waiting for a condition to become true and calling ecore_main_loop_iterate() is not an acceptable solution here.
Comment 5 Byungwoo Lee 2012-10-11 05:43:21 PDT
(In reply to comment #4)
> (In reply to comment #2)
> > (From update of attachment 168194 [details] [details])
> > View in context: https://bugs.webkit.org/attachment.cgi?id=168194&action=review
> > 
> > There is a same bug (bug 96616)
> > 
> > > Tools/MiniBrowser/efl/main.c:430
> > > +    ecore_main_loop_begin();
> > 
> > Is it ok to use the nested run loop?
> > As I know, EFL recommends not to use the nested run loop.
> 
> I believe that this case is special. Those JS dialogs are meant to suspend the JS execution until the dialog is closed and this is exactly what my call to ecore_main_loop_begin() does.
> 
> I personally don't know of any other way to achieve this. Waiting for a condition to become true and calling ecore_main_loop_iterate() is not an acceptable solution here.

Yes, ecore_main_loop_iterate() will make busy loop, so it is not acceptable.
So as you told, ecore_main_loop_begin() might be a solution.

But I'm worrying about some side effect with the nested main loop. (especially related with some timing issue related with timer or pipe)

Can you guarantee that there will be no issues?
Comment 6 Chris Dumez 2012-10-11 06:01:48 PDT
(In reply to comment #5)
> (In reply to comment #4)
> > (In reply to comment #2)
> > > (From update of attachment 168194 [details] [details] [details])
> > > View in context: https://bugs.webkit.org/attachment.cgi?id=168194&action=review
> > > 
> > > There is a same bug (bug 96616)
> > > 
> > > > Tools/MiniBrowser/efl/main.c:430
> > > > +    ecore_main_loop_begin();
> > > 
> > > Is it ok to use the nested run loop?
> > > As I know, EFL recommends not to use the nested run loop.
> > 
> > I believe that this case is special. Those JS dialogs are meant to suspend the JS execution until the dialog is closed and this is exactly what my call to ecore_main_loop_begin() does.
> > 
> > I personally don't know of any other way to achieve this. Waiting for a condition to become true and calling ecore_main_loop_iterate() is not an acceptable solution here.
> 
> Yes, ecore_main_loop_iterate() will make busy loop, so it is not acceptable.
> So as you told, ecore_main_loop_begin() might be a solution.
> 
> But I'm worrying about some side effect with the nested main loop. (especially related with some timing issue related with timer or pipe)
> 
> Can you guarantee that there will be no issues?

If this is the only way to do it, I don't think we have a choice.
All I can test is that my testing did not show any issue.

And as I said before, this is already used by Web Inspector code in DRT.
Comment 7 Byungwoo Lee 2012-10-11 07:24:50 PDT
(In reply to comment #6)
> (In reply to comment #5)
> > (In reply to comment #4)
> > > (In reply to comment #2)
> > > > (From update of attachment 168194 [details] [details] [details] [details])
> > > > View in context: https://bugs.webkit.org/attachment.cgi?id=168194&action=review
> > > > 
> > > > There is a same bug (bug 96616)
> > > > 
> > > > > Tools/MiniBrowser/efl/main.c:430
> > > > > +    ecore_main_loop_begin();
> > > > 
> > > > Is it ok to use the nested run loop?
> > > > As I know, EFL recommends not to use the nested run loop.
> > > 
> > > I believe that this case is special. Those JS dialogs are meant to suspend the JS execution until the dialog is closed and this is exactly what my call to ecore_main_loop_begin() does.
> > > 
> > > I personally don't know of any other way to achieve this. Waiting for a condition to become true and calling ecore_main_loop_iterate() is not an acceptable solution here.
> > 
> > Yes, ecore_main_loop_iterate() will make busy loop, so it is not acceptable.
> > So as you told, ecore_main_loop_begin() might be a solution.
> > 
> > But I'm worrying about some side effect with the nested main loop. (especially related with some timing issue related with timer or pipe)
> > 
> > Can you guarantee that there will be no issues?
> 
> If this is the only way to do it, I don't think we have a choice.
> All I can test is that my testing did not show any issue.
> 
> And as I said before, this is already used by Web Inspector code in DRT.

I made a bug for one issue about the nested loop and elm_popup. (bug 99067)

Actually, I have been preparing some patches or discussions about javascript popup on efl.

How about waiting to apply the javascript popup to mini browser until it is prepared?
Comment 8 Chris Dumez 2012-10-11 08:10:36 PDT
(In reply to comment #7)
> (In reply to comment #6)
> > (In reply to comment #5)
> > > (In reply to comment #4)
> > > > (In reply to comment #2)
> > > > > (From update of attachment 168194 [details] [details] [details] [details] [details])
> > > > > View in context: https://bugs.webkit.org/attachment.cgi?id=168194&action=review
> > > > > 
> > > > > There is a same bug (bug 96616)
> > > > > 
> > > > > > Tools/MiniBrowser/efl/main.c:430
> > > > > > +    ecore_main_loop_begin();
> > > > > 
> > > > > Is it ok to use the nested run loop?
> > > > > As I know, EFL recommends not to use the nested run loop.
> > > > 
> > > > I believe that this case is special. Those JS dialogs are meant to suspend the JS execution until the dialog is closed and this is exactly what my call to ecore_main_loop_begin() does.
> > > > 
> > > > I personally don't know of any other way to achieve this. Waiting for a condition to become true and calling ecore_main_loop_iterate() is not an acceptable solution here.
> > > 
> > > Yes, ecore_main_loop_iterate() will make busy loop, so it is not acceptable.
> > > So as you told, ecore_main_loop_begin() might be a solution.
> > > 
> > > But I'm worrying about some side effect with the nested main loop. (especially related with some timing issue related with timer or pipe)
> > > 
> > > Can you guarantee that there will be no issues?
> > 
> > If this is the only way to do it, I don't think we have a choice.
> > All I can test is that my testing did not show any issue.
> > 
> > And as I said before, this is already used by Web Inspector code in DRT.
> 
> I made a bug for one issue about the nested loop and elm_popup. (bug 99067)
> 
> Actually, I have been preparing some patches or discussions about javascript popup on efl.
> 
> How about waiting to apply the javascript popup to mini browser until it is prepared?

I need this patch landed as soon as possible as we have people waiting on it. Moreover the current patch works. You can always improve later if needed.

Please do not add dependencies to my bugs without discussing it first.
Comment 9 Kenneth Rohde Christiansen 2012-10-11 08:14:18 PDT
Comment on attachment 168194 [details]
Patch

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

> Tools/ChangeLog:3
> +        [EFL][WK2] Add support for Javascript popup boxes to MiniBrowser

JavaScript ?
Comment 10 WebKit Review Bot 2012-10-11 08:25:05 PDT
Comment on attachment 168194 [details]
Patch

Clearing flags on attachment: 168194

Committed r131064: <http://trac.webkit.org/changeset/131064>
Comment 11 WebKit Review Bot 2012-10-11 08:25:10 PDT
All reviewed patches have been landed.  Closing bug.
Comment 12 Byungwoo Lee 2012-10-11 14:55:40 PDT
> I need this patch landed as soon as possible as we have people waiting on it. Moreover the current patch works. You can always improve later if needed.

Actually, I heard and observed some problems(like pipe broken or some strange crash) about using the nested main loop with webkit on efl.

MiniBrowser source can be a reference code, so I thought that to share or discuss about the issue before landing will be better.

But as you told, I have not observed such an issue with this patch.

Anyway, this is already landed :)
(There might be some urgent issue on your side)

> Please do not add dependencies to my bugs without discussing it first.

I didn't consider that adding dependencies to some other one's bug can make him unpleasant. I'm sorry if you feel bad.
Comment 13 Byungwoo Lee 2012-10-11 21:48:59 PDT
*** Bug 96616 has been marked as a duplicate of this bug. ***