Changeset 96411 in webkit


Ignore:
Timestamp:
Sep 30, 2011 11:44:46 AM (13 years ago)
Author:
commit-queue@webkit.org
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 <kubo@profusion.mobi> 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):

Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r96405 r96411  
     12011-09-30  Raphael Kubo da Costa  <kubo@profusion.mobi>
     2
     3        [EFL] Support and keep track of extra windows (views).
     4        https://bugs.webkit.org/show_bug.cgi?id=68454
     5
     6        Reviewed by Antonio Gomes.
     7
     8        So far, window.open and related JavaScript code would not work, as
     9        DRTView did not implementation
     10        Ewk_View_Smart_Class::window_{open,close}. The default implementation
     11        in ewk just returns the current window/view, which broke any
     12        layouttest which relied on window.open.
     13
     14        We now properly create and remove these new views. Unfortunately, the
     15        current way ewk works (and due to the fact that we cannot pass class
     16        methods as function pointers to the EFL functions), DRTView needs to
     17        know that DRTChrome exists and call `browser' directly in some points.
     18
     19        * DumpRenderTree/efl/DumpRenderTreeView.cpp:
     20        (onWindowCreate):
     21        (onWindowCloseDelayed):
     22        (onWindowClose):
     23        (drtViewTiledAdd):
     24
    1252011-09-30  Qi Zhang  <qi.2.zhang@nokia.com>
    226
  • trunk/Tools/DumpRenderTree/efl/DumpRenderTreeView.cpp

    r89821 r96411  
    2727#include "DumpRenderTreeView.h"
    2828
     29#include "DumpRenderTree.h"
     30#include "DumpRenderTreeChrome.h"
     31#include "LayoutTestController.h"
    2932#include <EWebKit.h>
     33#include <Ecore.h>
    3034#include <Eina.h>
    3135#include <Evas.h>
     
    5963}
    6064
     65static Evas_Object* onWindowCreate(Ewk_View_Smart_Data*, Eina_Bool, const Ewk_Window_Features*)
     66{
     67    return gLayoutTestController->canOpenWindows() ? browser->createNewWindow() : 0;
     68}
     69
     70static Eina_Bool onWindowCloseDelayed(void* data)
     71{
     72    Evas_Object* view = static_cast<Evas_Object*>(data);
     73    browser->removeWindow(view);
     74    return EINA_FALSE;
     75}
     76
     77static void onWindowClose(Ewk_View_Smart_Data* smartData)
     78{
     79    Evas_Object* view = smartData->self;
     80    ecore_idler_add(onWindowCloseDelayed, view);
     81}
     82
    6183Evas_Object* drtViewTiledAdd(Evas* evas)
    6284{
     
    7395    api.run_javascript_confirm = onJavaScriptConfirm;
    7496    api.run_javascript_prompt = onJavaScriptPrompt;
     97    api.window_create = onWindowCreate;
     98    api.window_close = onWindowClose;
    7599
    76100    return evas_object_smart_add(evas, evas_smart_class_new(&api.sc));
Note: See TracChangeset for help on using the changeset viewer.