Changeset 25151 in webkit


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.

Location:
trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r25150 r25151  
     12007-08-18  Maciej Stachowiak  <mjs@apple.com>
     2
     3        Reviewed by Darin.
     4
     5        - update for fix to <rdar://problem/5198272> REGRESSION: PLT 1.5% slower due to r21367 (change to start frames with empty documents)
     6       
     7        No longer expect windowScriptObject delegate method in frames that never
     8        use script.
     9
     10        * http/tests/loading/bad-scheme-subframe-expected.txt:
     11        * http/tests/loading/bad-server-subframe-expected.txt:
     12        * http/tests/loading/empty-subframe-expected.txt:
     13        * http/tests/loading/slow-parsing-subframe-expected.txt:
     14
    1152007-08-19  Mitz Pettel  <mitz@webkit.org>
    216
  • trunk/LayoutTests/http/tests/loading/bad-scheme-subframe-expected.txt

    r23723 r25151  
    33main frame - didCommitLoadForFrame
    44main frame - didClearWindowObjectForFrame
    5 frame "f1" - didClearWindowObjectForFrame
    65main frame - didFinishDocumentLoadForFrame
    76main frame - didFinishLoadForFrame
  • trunk/LayoutTests/http/tests/loading/bad-server-subframe-expected.txt

    r23723 r25151  
    44main frame - didCommitLoadForFrame
    55main frame - didClearWindowObjectForFrame
    6 frame "f1" - didClearWindowObjectForFrame
    76frame "f1" - didStartProvisionalLoadForFrame
    87main frame - didFinishDocumentLoadForFrame
  • trunk/LayoutTests/http/tests/loading/empty-subframe-expected.txt

    r23723 r25151  
    33main frame - didCommitLoadForFrame
    44main frame - didClearWindowObjectForFrame
    5 frame "f1" - didClearWindowObjectForFrame
    65frame "f1" - didStartProvisionalLoadForFrame
    76frame "f1" - willCloseFrame
    87frame "f1" - didCommitLoadForFrame
    9 frame "f1" - didClearWindowObjectForFrame
    108frame "f1" - didHandleOnloadEventsForFrame
    119frame "f1" - didFinishDocumentLoadForFrame
  • trunk/LayoutTests/http/tests/loading/slow-parsing-subframe-expected.txt

    r24798 r25151  
    44main frame - didCommitLoadForFrame
    55main frame - didClearWindowObjectForFrame
    6 frame "f1" - didClearWindowObjectForFrame
    76frame "f1" - didStartProvisionalLoadForFrame
    87main frame - didFinishDocumentLoadForFrame
  • trunk/WebCore/ChangeLog

    r25150 r25151  
     12007-08-18  Maciej Stachowiak  <mjs@apple.com>
     2
     3        Reviewed by Darin.
     4
     5        - fixed <rdar://problem/5198272> REGRESSION: PLT 1.5% slower due to r21367 (change to start frames with empty documents)
     6       
     7        There were three main cuases of extra time due to creating the initial empty document:
     8       
     9        1) Creating an extra WebHTMLView and swapping it for a new one for each frame created.
     10        2) Parsing the minimal markup for the initial document's contents.
     11        3) Clearing the Window object an extra time and dispatching the corresponding delegate method.
     12       
     13        The WebCore part of the fixes addresses 2 and 3.
     14       
     15        * loader/FrameLoader.cpp:
     16        (WebCore::FrameLoader::init): Don't parse "<html><body>" for the initial
     17        empty document; it turns out not to be needed.
     18        (WebCore::FrameLoader::dispatchWindowObjectAvailable): Don't
     19        dispatch the delegate if we haven't created a ScriptInterpreter yet.
     20        * bindings/js/kjs_proxy.cpp:
     21        (WebCore::KJSProxy::initScriptIfNeeded): Dispatch the window object
     22        delegate when we first create the interpreter, since that is now done
     23        lazily.
     24        * loader/FrameLoader.h:
     25        (WebCore::FrameLoader::committingFirstRealLoad): Helper for WebKit
     26        to know when to reuse a WebHTMLView.
     27
    1282007-08-19  Mitz Pettel  <mitz@webkit.org>
    229
  • trunk/WebCore/bindings/js/kjs_proxy.cpp

    r24495 r25151  
    162162    if (userAgent.find("Mozilla") >= 0 && userAgent.find("compatible") == -1)
    163163      m_script->setCompatMode(Interpreter::NetscapeCompat);
     164
     165  m_frame->loader()->dispatchWindowObjectAvailable();
    164166}
    165167
  • 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())
  • trunk/WebCore/loader/FrameLoader.h

    r24798 r25151  
    435435#endif
    436436
    437     private:       
     437        bool committingFirstRealLoad() const { return !m_creatingInitialEmptyDocument && !m_committedFirstRealDocumentLoad; }
     438
     439    private:
    438440        PassRefPtr<HistoryItem> createHistoryItem(bool useOriginal);
    439441        PassRefPtr<HistoryItem> createHistoryItemTree(Frame* targetFrame, bool clipAtTarget);
  • trunk/WebKit/ChangeLog

    r25142 r25151  
     12007-08-18  Maciej Stachowiak  <mjs@apple.com>
     2
     3        Reviewed by Darin.
     4       
     5        - fixed <rdar://problem/5198272> REGRESSION: PLT 1.5% slower due to r21367 (change to start frames with empty documents)
     6
     7        There were three main cuases of extra time due to creating the initial empty document:
     8       
     9        1) Creating an extra WebHTMLView and swapping it for a new one for each frame created.
     10        2) Parsing the minimal markup for the initial document's contents.
     11        3) Clearing the Window object an extra time and dispatching the corresponding delegate method.
     12       
     13        The WebKit part of the fixes addresses 1.
     14
     15        * WebCoreSupport/WebFrameLoaderClient.mm:
     16        (WebFrameLoaderClient::makeDocumentView): When switching from the initial
     17        empty document to the first real document, reuse the WebHTMLView.
     18       
     19        It might actually be a significant performance improvement to always
     20        reuse the WebHTMLView, but that is a much riskier change and not
     21        needed to fix the regression right now.
     22
    1232007-08-17  Maciej Stachowiak  <mjs@apple.com>
    224
  • trunk/WebKit/WebCoreSupport/WebFrameLoaderClient.mm

    r25137 r25151  
    156156    WebDataSource *ds = [m_webFrame.get() _dataSource];
    157157
     158    bool canSkipCreation = [m_webFrame.get() _frameLoader]->committingFirstRealLoad() && [[WebFrameView class] _viewClassForMIMEType:[[ds response] MIMEType]] == [WebHTMLView class];
     159    if (canSkipCreation) {
     160        [[v documentView] setDataSource:ds];
     161        return;
     162    }
     163
    158164    NSView <WebDocumentView> *documentView = [v _makeDocumentViewForDataSource:ds];
    159165    if (!documentView)
Note: See TracChangeset for help on using the changeset viewer.