Changeset 77596 in webkit


Ignore:
Timestamp:
Feb 3, 2011 9:03:08 PM (13 years ago)
Author:
joone.hur@collabora.co.uk
Message:

2011-02-03 Joone Hur <joone.hur@collabora.co.uk>

Reviewed by Martin Robinson.

[Gtk] No need to set text encoding in the provisional phase
https://bugs.webkit.org/show_bug.cgi?id=53487

According to changeset 67253, setEncoding could be called multiple times from
committedLoad, finishedLoading, dispatchDidFailLoading, and setMainDocumentError
in FrameLoaderClient. To fix this, the relevant code was removed from
FrameLoaderClient and moved to DocumentLoader::commitData. However, that
code was not removed from FrameLoaderClient::finishedLoading in WebKitGtk+.

Due to this reason, after loading a html document, other ports initialize the
text encoding from FrameLoaderClient::finishedLoading, but WebKitGtk+ sets
the same encoding again, even tries to set encoding in the provisional phase.
This causes unnecessary encoding setting.

  • WebCoreSupport/FrameLoaderClientGtk.cpp: (WebKit::FrameLoaderClient::FrameLoaderClient): Set m_hasRepresentation to false. (WebKit::FrameLoaderClient::makeRepresentation): Set m_hasRepresentation to true. (WebKit::FrameLoaderClient::revertToProvisionalState): Set m_hasRepresentation to true. (WebKit::FrameLoaderClient::finishedLoading): Skip the encoding setting when m_hasRepresentation is false.
  • WebCoreSupport/FrameLoaderClientGtk.h: Added m_hasRepresentation.
Location:
trunk/Source/WebKit/gtk
Files:
3 edited

Legend:

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

    r77414 r77596  
     12011-02-03  Joone Hur  <joone.hur@collabora.co.uk>
     2
     3        Reviewed by Martin Robinson.
     4
     5        [Gtk] No need to set text encoding in the provisional phase
     6        https://bugs.webkit.org/show_bug.cgi?id=53487
     7
     8        According to changeset 67253, setEncoding could be called multiple times from
     9        committedLoad, finishedLoading, dispatchDidFailLoading, and setMainDocumentError
     10        in FrameLoaderClient. To fix this, the relevant code was removed from
     11        FrameLoaderClient and moved to DocumentLoader::commitData. However, that
     12        code was not removed from FrameLoaderClient::finishedLoading in WebKitGtk+.
     13
     14        Due to this reason, after loading a html document, other ports initialize the
     15        text encoding from FrameLoaderClient::finishedLoading, but WebKitGtk+ sets
     16        the same encoding again, even tries to set encoding in the provisional phase.
     17        This causes unnecessary encoding setting.
     18
     19        * WebCoreSupport/FrameLoaderClientGtk.cpp:
     20        (WebKit::FrameLoaderClient::FrameLoaderClient): Set m_hasRepresentation to false.
     21        (WebKit::FrameLoaderClient::makeRepresentation): Set m_hasRepresentation to true.
     22        (WebKit::FrameLoaderClient::revertToProvisionalState): Set m_hasRepresentation to true.
     23        (WebKit::FrameLoaderClient::finishedLoading): Skip the encoding setting when
     24        m_hasRepresentation is false.
     25        * WebCoreSupport/FrameLoaderClientGtk.h: Added m_hasRepresentation.
     26
    1272011-02-02  Alejandro G. Castro  <alex@igalia.com>
    228
  • trunk/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp

    r76872 r77596  
    9898    , m_loadingErrorPage(false)
    9999    , m_pluginView(0)
     100    , m_hasRepresentation(false)
    100101    , m_hasSentResponseToPlugin(false)
    101102{
     
    781782void FrameLoaderClient::makeRepresentation(WebCore::DocumentLoader*)
    782783{
    783     notImplemented();
     784    m_hasRepresentation = true;
    784785}
    785786
     
    981982void FrameLoaderClient::revertToProvisionalState(WebCore::DocumentLoader*)
    982983{
    983     notImplemented();
     984    m_hasRepresentation = true;
    984985}
    985986
     
    10291030{
    10301031    if (!m_pluginView) {
    1031         FrameLoader* loader = documentLoader->frameLoader();
    1032         loader->writer()->setEncoding(m_response.textEncodingName(), false);
     1032        // This is necessary to create an empty document,
     1033        // but it has to be skipped in the provisional phase.
     1034        if (m_hasRepresentation)
     1035            documentLoader->frameLoader()->writer()->setEncoding("", false);
    10331036    } else {
    10341037        m_pluginView->didFinishLoading();
  • trunk/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h

    r74571 r77596  
    202202        WebCore::PluginView* m_pluginView;
    203203        bool m_hasSentResponseToPlugin;
     204
     205        bool m_hasRepresentation;
    204206    };
    205207
Note: See TracChangeset for help on using the changeset viewer.