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.