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.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@25151
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2007-08-18 Maciej Stachowiak <mjs@apple.com>
+
+ 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:
+
2007-08-19 Mitz Pettel <mitz@webkit.org>
Reviewed by Adam Roben.
main frame - willCloseFrame
main frame - didCommitLoadForFrame
main frame - didClearWindowObjectForFrame
-frame "f1" - didClearWindowObjectForFrame
main frame - didFinishDocumentLoadForFrame
main frame - didFinishLoadForFrame
This is a test of load callbacks. It is only useful inside the regression test tool.
main frame - willCloseFrame
main frame - didCommitLoadForFrame
main frame - didClearWindowObjectForFrame
-frame "f1" - didClearWindowObjectForFrame
frame "f1" - didStartProvisionalLoadForFrame
main frame - didFinishDocumentLoadForFrame
main frame - didHandleOnloadEventsForFrame
main frame - willCloseFrame
main frame - didCommitLoadForFrame
main frame - didClearWindowObjectForFrame
-frame "f1" - didClearWindowObjectForFrame
frame "f1" - didStartProvisionalLoadForFrame
frame "f1" - willCloseFrame
frame "f1" - didCommitLoadForFrame
-frame "f1" - didClearWindowObjectForFrame
frame "f1" - didHandleOnloadEventsForFrame
frame "f1" - didFinishDocumentLoadForFrame
frame "f1" - didFinishLoadForFrame
main frame - willCloseFrame
main frame - didCommitLoadForFrame
main frame - didClearWindowObjectForFrame
-frame "f1" - didClearWindowObjectForFrame
frame "f1" - didStartProvisionalLoadForFrame
main frame - didFinishDocumentLoadForFrame
frame "f1" - willCloseFrame
+2007-08-18 Maciej Stachowiak <mjs@apple.com>
+
+ 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.
+
2007-08-19 Mitz Pettel <mitz@webkit.org>
Reviewed by Adam Roben.
// If we find "Mozilla" but not "(compatible, ...)" we are a real Netscape
if (userAgent.find("Mozilla") >= 0 && userAgent.find("compatible") == -1)
m_script->setCompatMode(Interpreter::NetscapeCompat);
+
+ m_frame->loader()->dispatchWindowObjectAvailable();
}
}
setState(FrameStateProvisional);
m_provisionalDocumentLoader->setResponse(ResourceResponse(KURL(), "text/html", 0, String(), String()));
m_provisionalDocumentLoader->finishedLoading();
- begin();
- write("<html><body>");
+ begin(KURL(), false);
end();
m_frame->document()->cancelParsing();
m_creatingInitialEmptyDocument = false;
void FrameLoader::dispatchWindowObjectAvailable()
{
if (Settings* settings = m_frame->settings())
- if (settings->isJavaScriptEnabled()) {
+ if (settings->isJavaScriptEnabled() && m_frame->scriptProxy()->haveInterpreter()) {
m_client->windowObjectCleared();
if (Page* page = m_frame->page())
if (InspectorController* inspector = page->parentInspectorController())
bool useLowBandwidthDisplay() const { return m_useLowBandwidthDisplay; }
#endif
- private:
+ bool committingFirstRealLoad() const { return !m_creatingInitialEmptyDocument && !m_committedFirstRealDocumentLoad; }
+
+ private:
PassRefPtr<HistoryItem> createHistoryItem(bool useOriginal);
PassRefPtr<HistoryItem> createHistoryItemTree(Frame* targetFrame, bool clipAtTarget);
+2007-08-18 Maciej Stachowiak <mjs@apple.com>
+
+ 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.
+
2007-08-17 Maciej Stachowiak <mjs@apple.com>
Reviewed by Darin.
WebFrameView *v = m_webFrame->_private->webFrameView;
WebDataSource *ds = [m_webFrame.get() _dataSource];
+ bool canSkipCreation = [m_webFrame.get() _frameLoader]->committingFirstRealLoad() && [[WebFrameView class] _viewClassForMIMEType:[[ds response] MIMEType]] == [WebHTMLView class];
+ if (canSkipCreation) {
+ [[v documentView] setDataSource:ds];
+ return;
+ }
+
NSView <WebDocumentView> *documentView = [v _makeDocumentViewForDataSource:ds];
if (!documentView)
return;