Ignore:
Timestamp:
Aug 19, 2007 2:40:39 PM (17 years ago)
Author:
mjs
Message:

LayoutTests:

Reviewed by Darin.

  • update for fix to <rdar://problem/5198272> REGRESSION: PLT 1.5% slower due to r21367 (change to start frames with empty documents)


No longer expect windowScriptObject delegate method in frames that never
use script.

  • http/tests/loading/bad-scheme-subframe-expected.txt:
  • http/tests/loading/bad-server-subframe-expected.txt:
  • http/tests/loading/empty-subframe-expected.txt:
  • http/tests/loading/slow-parsing-subframe-expected.txt:

WebCore:

Reviewed by Darin.

  • fixed <rdar://problem/5198272> REGRESSION: PLT 1.5% slower due to r21367 (change to start frames with empty documents)


There were three main cuases of extra time due to creating the initial empty document:


1) Creating an extra WebHTMLView and swapping it for a new one for each frame created.
2) Parsing the minimal markup for the initial document's contents.
3) Clearing the Window object an extra time and dispatching the corresponding delegate method.


The WebCore part of the fixes addresses 2 and 3.


  • loader/FrameLoader.cpp: (WebCore::FrameLoader::init): Don't parse "<html><body>" for the initial empty document; it turns out not to be needed. (WebCore::FrameLoader::dispatchWindowObjectAvailable): Don't dispatch the delegate if we haven't created a ScriptInterpreter yet.
  • bindings/js/kjs_proxy.cpp: (WebCore::KJSProxy::initScriptIfNeeded): Dispatch the window object delegate when we first create the interpreter, since that is now done lazily.
  • loader/FrameLoader.h: (WebCore::FrameLoader::committingFirstRealLoad): Helper for WebKit to know when to reuse a WebHTMLView.

WebKit:

Reviewed by Darin.


  • fixed <rdar://problem/5198272> REGRESSION: PLT 1.5% slower due to r21367 (change to start frames with empty documents)

There were three main cuases of extra time due to creating the initial empty document:


1) Creating an extra WebHTMLView and swapping it for a new one for each frame created.
2) Parsing the minimal markup for the initial document's contents.
3) Clearing the Window object an extra time and dispatching the corresponding delegate method.


The WebKit part of the fixes addresses 1.

  • WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::makeDocumentView): When switching from the initial empty document to the first real document, reuse the WebHTMLView.


It might actually be a significant performance improvement to always
reuse the WebHTMLView, but that is a much riskier change and not
needed to fix the regression right now.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/loader/FrameLoader.cpp

    r25142 r25151  
    266266    m_provisionalDocumentLoader->setResponse(ResourceResponse(KURL(), "text/html", 0, String(), String()));
    267267    m_provisionalDocumentLoader->finishedLoading();
    268     begin();
    269     write("<html><body>");
     268    begin(KURL(), false);
    270269    end();
    271270    m_frame->document()->cancelParsing();
     
    44144413{
    44154414    if (Settings* settings = m_frame->settings())
    4416         if (settings->isJavaScriptEnabled()) {
     4415        if (settings->isJavaScriptEnabled() && m_frame->scriptProxy()->haveInterpreter()) {
    44174416            m_client->windowObjectCleared();
    44184417            if (Page* page = m_frame->page())
Note: See TracChangeset for help on using the changeset viewer.