Changeset 93617 in webkit


Ignore:
Timestamp:
Aug 23, 2011 11:27:51 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

[EFL] Do not treat valid cases in ewk_frame_child_add() as failures.
https://bugs.webkit.org/show_bug.cgi?id=66692

Patch by Raphael Kubo da Costa <kubo@profusion.mobi> on 2011-08-23
Rubber-stamped by Kenneth Rohde Christiansen.

Frame::page() and FrameTree::parent() returning 0 were being considered
failure cases, however it is possible for them to return 0 when some
arbitrary JavaScript is run.

The function's return type has been changed to make it easier to convey
these cases to the caller (which is only ewk_view_frame_create).

This should make tests like
fast/dom/null-page-show-modal-dialog-crash.html stop outputting
erroneous messages to stderr.

  • ewk/ewk_frame.cpp:

(ewk_frame_child_add):

  • ewk/ewk_private.h:
Location:
trunk/Source/WebKit/efl
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/efl/ChangeLog

    r93611 r93617  
     12011-08-23  Raphael Kubo da Costa  <kubo@profusion.mobi>
     2
     3        [EFL] Do not treat valid cases in ewk_frame_child_add() as failures.
     4        https://bugs.webkit.org/show_bug.cgi?id=66692
     5
     6        Rubber-stamped by Kenneth Rohde Christiansen.
     7
     8        Frame::page() and FrameTree::parent() returning 0 were being considered
     9        failure cases, however it is possible for them to return 0 when some
     10        arbitrary JavaScript is run.
     11
     12        The function's return type has been changed to make it easier to convey
     13        these cases to the caller (which is only ewk_view_frame_create).
     14
     15        This should make tests like
     16        fast/dom/null-page-show-modal-dialog-crash.html stop outputting
     17        erroneous messages to stderr.
     18
     19        * ewk/ewk_frame.cpp:
     20        (ewk_frame_child_add):
     21        * ewk/ewk_private.h:
     22
    1232011-08-23  Leandro Pereira  <leandro@profusion.mobi>
    224
  • trunk/Source/WebKit/efl/ewk/ewk_frame.cpp

    r93410 r93617  
    11321132 * Adds child to the frame.
    11331133 */
    1134 Evas_Object *ewk_frame_child_add(Evas_Object *o, WTF::PassRefPtr<WebCore::Frame> child, const WTF::String &name, const WebCore::KURL &url, const WTF::String &referrer)
     1134Eina_Bool ewk_frame_child_add(Evas_Object *o, WTF::PassRefPtr<WebCore::Frame> child, const WTF::String &name, const WebCore::KURL &url, const WTF::String &referrer)
    11351135{
    11361136    EWK_FRAME_SD_GET_OR_RETURN(o, sd, 0);
     
    11421142    if (!frame) {
    11431143        ERR("Could not create ewk_frame object.");
    1144         return 0;
     1144        return EINA_FALSE;
    11451145    }
    11461146
     
    11541154    if (!ewk_frame_init(frame, sd->view, cf)) {
    11551155        evas_object_del(frame);
    1156         return 0;
     1156        return EINA_FALSE;
    11571157    }
    11581158    snprintf(buf, sizeof(buf), "EWK_Frame:child/%s", name.utf8().data());
     
    11611161    evas_object_show(frame);
    11621162
    1163     if (!cf->page())
    1164         goto died;
     1163    // The creation of the frame may have run arbitrary JavaScript that removed it from the page already.
     1164    if (!cf->page()) {
     1165        evas_object_del(frame);
     1166        return EINA_TRUE;
     1167    }
    11651168
    11661169    sd->frame->loader()->loadURLIntoChildFrame(url, referrer, cf);
    1167     if (!cf->tree()->parent())
    1168         goto died;
     1170
     1171    // The frame's onload handler may have removed it from the document.
     1172    // See fast/dom/null-page-show-modal-dialog-crash.html for an example.
     1173    if (!cf->tree()->parent()) {
     1174        evas_object_del(frame);
     1175        return EINA_TRUE;
     1176    }
    11691177
    11701178    // TODO: announce frame was created?
    1171     return frame;
    1172 
    1173 died:
    1174     CRITICAL("does this work: BEGIN");
    1175     ewk_frame_core_gone(frame); // CONFIRM
    1176     evas_object_del(frame); // CONFIRM
    1177     CRITICAL("does this work: END");
    1178     return 0;
     1179    return EINA_TRUE;
    11791180}
    11801181
  • trunk/Source/WebKit/efl/ewk/ewk_private.h

    r93602 r93617  
    158158Evas_Object *ewk_frame_add(Evas *e);
    159159Eina_Bool ewk_frame_init(Evas_Object *o, Evas_Object *view, WebCore::Frame *frame);
    160 Evas_Object *ewk_frame_child_add(Evas_Object *o, WTF::PassRefPtr<WebCore::Frame> child, const WTF::String &name, const WebCore::KURL &url, const WTF::String &referrer);
     160Eina_Bool ewk_frame_child_add(Evas_Object *o, WTF::PassRefPtr<WebCore::Frame> child, const WTF::String &name, const WebCore::KURL &url, const WTF::String &referrer);
    161161
    162162WebCore::Frame *ewk_frame_core_get(const Evas_Object *o);
Note: See TracChangeset for help on using the changeset viewer.