Changeset 53294 in webkit


Ignore:
Timestamp:
Jan 14, 2010 3:08:46 PM (14 years ago)
Author:
kov@webkit.org
Message:

Reviewed by Oliver Hunter.

[GTK] couple fixes for signal emissions, and property notifications
https://bugs.webkit.org/show_bug.cgi?id=33428

Do not emit signals and property notifications for error
pages. The notifications are not really useful for anything, you
can get them back by overriding the error pages, and it avoids a
number of hacks.

  • WebCoreSupport/FrameLoaderClientGtk.cpp: (WebKit::FrameLoaderClient::FrameLoaderClient): (WebKit::FrameLoaderClient::dispatchDidFinishLoad): (WebKit::FrameLoaderClient::dispatchDidReceiveIcon): (WebKit::FrameLoaderClient::dispatchDidStartProvisionalLoad): (WebKit::FrameLoaderClient::dispatchDidReceiveTitle): (WebKit::FrameLoaderClient::dispatchDidCommitLoad): (WebKit::FrameLoaderClient::dispatchDidFirstVisuallyNonEmptyLayout): (WebKit::FrameLoaderClient::dispatchDidFailLoad):
  • WebCoreSupport/FrameLoaderClientGtk.h:
  • tests/testloading.c: (load_error_status_changed_cb): (test_loading_error):
Location:
trunk/WebKit/gtk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit/gtk/ChangeLog

    r53264 r53294  
     12010-01-14  Gustavo Noronha Silva  <gns@gnome.org>
     2
     3        Reviewed by Oliver Hunter.
     4
     5        [GTK] couple fixes for signal emissions, and property notifications
     6        https://bugs.webkit.org/show_bug.cgi?id=33428
     7
     8        Do not emit signals and property notifications for error
     9        pages. The notifications are not really useful for anything, you
     10        can get them back by overriding the error pages, and it avoids a
     11        number of hacks.
     12
     13        * WebCoreSupport/FrameLoaderClientGtk.cpp:
     14        (WebKit::FrameLoaderClient::FrameLoaderClient):
     15        (WebKit::FrameLoaderClient::dispatchDidFinishLoad):
     16        (WebKit::FrameLoaderClient::dispatchDidReceiveIcon):
     17        (WebKit::FrameLoaderClient::dispatchDidStartProvisionalLoad):
     18        (WebKit::FrameLoaderClient::dispatchDidReceiveTitle):
     19        (WebKit::FrameLoaderClient::dispatchDidCommitLoad):
     20        (WebKit::FrameLoaderClient::dispatchDidFirstVisuallyNonEmptyLayout):
     21        (WebKit::FrameLoaderClient::dispatchDidFailLoad):
     22        * WebCoreSupport/FrameLoaderClientGtk.h:
     23        * tests/testloading.c:
     24        (load_error_status_changed_cb):
     25        (test_loading_error):
     26
    1272010-01-14  Martin Robinson  <martin.james.robinson@gmail.com>
    228
     
    3864        (webkit_web_view_query_tooltip): Added
    3965
    40 2010-01-12  Gustavo Noronha Silva  <gns@gnome.org>
     662010-01-09  Gustavo Noronha Silva  <gns@gnome.org>
    4167
    4268        Reviewed by Xan Lopez.
  • trunk/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp

    r53138 r53294  
    7878    : m_frame(frame)
    7979    , m_policyDecision(0)
     80    , m_loadingErrorPage(false)
    8081    , m_pluginView(0)
    8182    , m_hasSentResponseToPlugin(false)
     
    569570void FrameLoaderClient::dispatchDidFinishLoad()
    570571{
     572    if (m_loadingErrorPage) {
     573        m_loadingErrorPage = false;
     574        return;
     575    }
     576
    571577    loadDone(m_frame, true);
    572578}
     
    704710void FrameLoaderClient::dispatchDidReceiveIcon()
    705711{
     712    if (m_loadingErrorPage)
     713        return;
     714
    706715    WebKitWebView* webView = getViewFromFrame(m_frame);
    707716
     
    716725void FrameLoaderClient::dispatchDidStartProvisionalLoad()
    717726{
     727    if (m_loadingErrorPage)
     728        return;
     729
    718730    notifyStatus(m_frame, WEBKIT_LOAD_PROVISIONAL);
    719731}
     
    721733void FrameLoaderClient::dispatchDidReceiveTitle(const String& title)
    722734{
     735    if (m_loadingErrorPage)
     736        return;
     737
    723738    WebKitWebFramePrivate* priv = m_frame->priv;
    724739    g_free(priv->title);
     
    737752void FrameLoaderClient::dispatchDidCommitLoad()
    738753{
     754    if (m_loadingErrorPage)
     755        return;
     756
    739757    /* Update the URI once first data has been received.
    740758     * This means the URI is valid and successfully identify the page that's going to be loaded.
     
    777795void FrameLoaderClient::dispatchDidFirstVisuallyNonEmptyLayout()
    778796{
     797    if (m_loadingErrorPage)
     798        return;
     799
    779800    notifyStatus(m_frame, WEBKIT_LOAD_FIRST_VISUALLY_NON_EMPTY_LAYOUT);
    780801}
     
    938959void FrameLoaderClient::dispatchDidFailLoad(const ResourceError& error)
    939960{
     961    if (m_loadingErrorPage)
     962        return;
     963
    940964    notifyStatus(m_frame, WEBKIT_LOAD_FAILED);
    941965
     
    956980        return;
    957981    }
     982
     983    m_loadingErrorPage = true;
    958984
    959985    String content;
  • trunk/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h

    r51644 r53294  
    185185        WebKitWebPolicyDecision* m_policyDecision;
    186186
     187        bool m_loadingErrorPage;
     188
    187189        // Plugin view to redirect data to
    188190        WebCore::PluginView* m_pluginView;
  • trunk/WebKit/gtk/tests/testloading.c

    r53138 r53294  
    172172    switch(status) {
    173173    case WEBKIT_LOAD_PROVISIONAL:
    174         /* We are going to go through here twice, so don't assert
    175          * anything */
     174        g_assert(!fixture->has_been_provisional);
    176175        fixture->has_been_provisional = TRUE;
    177176        break;
     
    184183        g_assert(fixture->has_been_load_error);
    185184        g_assert(fixture->has_been_failed);
    186         /* We are checking that only one FINISHED is received in the
    187            whole cycle, so assert it's FALSE */
    188185        g_assert(!fixture->has_been_finished);
    189186        fixture->has_been_finished = TRUE;
     
    222219
    223220    g_main_loop_run(fixture->loop);
     221
     222    g_assert(fixture->has_been_provisional);
     223    g_assert(fixture->has_been_committed);
     224    g_assert(fixture->has_been_load_error);
     225    g_assert(fixture->has_been_failed);
     226    g_assert(fixture->has_been_finished);
    224227}
    225228
  • trunk/WebKit/gtk/webkit/webkitwebview.cpp

    r53256 r53294  
    24282428    *
    24292429    * Connect to "notify::load-status" to monitor loading.
     2430    *
     2431    * Some versions of WebKitGTK+ emitted this signal for the default
     2432    * error page, while loading it. This behavior was considered bad,
     2433    * because it was essentially exposing an implementation
     2434    * detail. From 1.1.19 onwards this signal is no longer emitted for
     2435    * the default error pages, but keep in mind that if you override
     2436    * the error pages by using webkit_web_frame_load_alternate_string()
     2437    * the signals will be emitted.
    24302438    *
    24312439    * Since: 1.1.7
Note: See TracChangeset for help on using the changeset viewer.