Title: [96411] trunk/Tools
Revision
96411
Author
[email protected]
Date
2011-09-30 11:44:46 -0700 (Fri, 30 Sep 2011)

Log Message

[EFL] Support and keep track of extra windows (views).
https://bugs.webkit.org/show_bug.cgi?id=68454

Patch by Raphael Kubo da Costa <[email protected]> on 2011-09-30
Reviewed by Antonio Gomes.

So far, window.open and related _javascript_ code would not work, as
DRTView did not implementation
Ewk_View_Smart_Class::window_{open,close}. The default implementation
in ewk just returns the current window/view, which broke any
layouttest which relied on window.open.

We now properly create and remove these new views. Unfortunately, the
current way ewk works (and due to the fact that we cannot pass class
methods as function pointers to the EFL functions), DRTView needs to
know that DRTChrome exists and call `browser' directly in some points.

* DumpRenderTree/efl/DumpRenderTreeView.cpp:
(onWindowCreate):
(onWindowCloseDelayed):
(onWindowClose):
(drtViewTiledAdd):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (96410 => 96411)


--- trunk/Tools/ChangeLog	2011-09-30 18:28:13 UTC (rev 96410)
+++ trunk/Tools/ChangeLog	2011-09-30 18:44:46 UTC (rev 96411)
@@ -1,3 +1,27 @@
+2011-09-30  Raphael Kubo da Costa  <[email protected]>
+
+        [EFL] Support and keep track of extra windows (views).
+        https://bugs.webkit.org/show_bug.cgi?id=68454
+
+        Reviewed by Antonio Gomes.
+
+        So far, window.open and related _javascript_ code would not work, as
+        DRTView did not implementation
+        Ewk_View_Smart_Class::window_{open,close}. The default implementation
+        in ewk just returns the current window/view, which broke any
+        layouttest which relied on window.open.
+
+        We now properly create and remove these new views. Unfortunately, the
+        current way ewk works (and due to the fact that we cannot pass class
+        methods as function pointers to the EFL functions), DRTView needs to
+        know that DRTChrome exists and call `browser' directly in some points.
+
+        * DumpRenderTree/efl/DumpRenderTreeView.cpp:
+        (onWindowCreate):
+        (onWindowCloseDelayed):
+        (onWindowClose):
+        (drtViewTiledAdd):
+
 2011-09-30  Qi Zhang  <[email protected]>
 
         WebKitTestRunner needs layoutTestController.setAppCacheMaximumSize

Modified: trunk/Tools/DumpRenderTree/efl/DumpRenderTreeView.cpp (96410 => 96411)


--- trunk/Tools/DumpRenderTree/efl/DumpRenderTreeView.cpp	2011-09-30 18:28:13 UTC (rev 96410)
+++ trunk/Tools/DumpRenderTree/efl/DumpRenderTreeView.cpp	2011-09-30 18:44:46 UTC (rev 96411)
@@ -26,7 +26,11 @@
 #include "config.h"
 #include "DumpRenderTreeView.h"
 
+#include "DumpRenderTree.h"
+#include "DumpRenderTreeChrome.h"
+#include "LayoutTestController.h"
 #include <EWebKit.h>
+#include <Ecore.h>
 #include <Eina.h>
 #include <Evas.h>
 #include <cstdio>
@@ -58,6 +62,24 @@
     return EINA_TRUE;
 }
 
+static Evas_Object* onWindowCreate(Ewk_View_Smart_Data*, Eina_Bool, const Ewk_Window_Features*)
+{
+    return gLayoutTestController->canOpenWindows() ? browser->createNewWindow() : 0;
+}
+
+static Eina_Bool onWindowCloseDelayed(void* data)
+{
+    Evas_Object* view = static_cast<Evas_Object*>(data);
+    browser->removeWindow(view);
+    return EINA_FALSE;
+}
+
+static void onWindowClose(Ewk_View_Smart_Data* smartData)
+{
+    Evas_Object* view = smartData->self;
+    ecore_idler_add(onWindowCloseDelayed, view);
+}
+
 Evas_Object* drtViewTiledAdd(Evas* evas)
 {
     static Ewk_View_Smart_Class api = EWK_VIEW_SMART_CLASS_INIT_NAME_VERSION("DRT_View_Tiled");
@@ -72,6 +94,8 @@
     api.run_javascript_alert = onJavaScriptAlert;
     api.run_javascript_confirm = onJavaScriptConfirm;
     api.run_javascript_prompt = onJavaScriptPrompt;
+    api.window_create = onWindowCreate;
+    api.window_close = onWindowClose;
 
     return evas_object_smart_add(evas, evas_smart_class_new(&api.sc));
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to