Reviewed by Brady.
Make document.open count as committing a document load, so that -[WebFrame dataSource:] won't
return nil in that case.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::didExplicitOpen):
WebKitTools:
Reviewed by Brady.
Assert that a web frame that's loading a resource always has either a data source or
a provisional data source.
* DumpRenderTree/mac/ResourceLoadDelegate.mm:
(-[ResourceLoadDelegate webView:identifierForInitialRequest:fromDataSource:]):
LayoutTests:
Reviewed by Brady.
Add test that calls window.open and then immediately writes into the document
of the newly opened window.
* http/tests/misc/resources/compass.jpg: Added.
* http/tests/misc/window-open-then-write-expected.txt: Added.
* http/tests/misc/window-open-then-write.html: Added.
* platform/win/Skipped:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@28723
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2007-12-14 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Brady.
+
+ Add test that calls window.open and then immediately writes into the document
+ of the newly opened window.
+
+ * http/tests/misc/resources/compass.jpg: Added.
+ * http/tests/misc/window-open-then-write-expected.txt: Added.
+ * http/tests/misc/window-open-then-write.html: Added.
+ * platform/win/Skipped:
+
2007-12-14 David Smith <catfish.man@gmail.com>
Reviewed by Mitz.
--- /dev/null
+This tests that calling window.open() with a URL and then writing to the window using document.write still causes the WebFrame in question to have a correct WebDataSource.
+SUCCESS! Did not assert!
--- /dev/null
+<html>
+<script>
+if (window.layoutTestController) {
+ layoutTestController.waitUntilDone();
+ layoutTestController.setCanOpenWindows();
+ layoutTestController.dumpAsText();
+}
+
+function runTest() {
+ var w = window.open('test.html');
+ w.document.write('<img src="resources/compass.jpg" onload="if (window.layoutTestController) setTimeout(\'layoutTestController.notifyDone()\', 100);">');
+ w.document.close();
+}
+</script>
+<body onload="runTest();">
+<div>This tests that calling window.open() with a URL and then writing to the window using document.write still causes the WebFrame in question to have a correct WebDataSource.</div>
+<div>SUCCESS! Did not assert!</div>
+</body>
+</html>
fast/history/history_reload.html
http/tests/navigation/new-window-redirect-history.html
http/tests/navigation/target-frame-from-window.html
+http/tests/misc/window-open-then-write.html
#http/tests/security/dataURL/xss-DENIED-from-data-url-in-foreign-domain-window-open.html [This test is currently disabled]
http/tests/security/dataURL/xss-DENIED-from-javascript-url-window-open.html
#http/tests/security/dataURL/xss-DENIED-to-data-url-in-foreign-domain-window-open.html [This test is currently disabled]
+2007-12-14 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Brady.
+
+ Make document.open count as committing a document load, so that -[WebFrame dataSource:] won't
+ return nil in that case.
+
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::didExplicitOpen):
+
2007-12-14 David Smith <catfish.man@gmail.com>
Reviewed by Mitz.
m_isComplete = false;
m_didCallImplicitClose = false;
+ // Calling document.open counts as committing the first real document load.
+ m_committedFirstRealDocumentLoad = true;
+
// Prevent window.open(url) -- eg window.open("about:blank") -- from blowing away results
// from a subsequent window.document.open / window.document.write call.
// Cancelling redirection here works for all cases because document.open
+2007-12-14 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Brady.
+
+ Assert that a web frame that's loading a resource always has either a data source or
+ a provisional data source.
+
+ * DumpRenderTree/mac/ResourceLoadDelegate.mm:
+ (-[ResourceLoadDelegate webView:identifierForInitialRequest:fromDataSource:]):
+
2007-12-14 Darin Adler <darin@apple.com>
- fix mistake causing nearly all tests to fail on Windows
#import "DumpRenderTree.h"
#import "LayoutTestController.h"
#import <WebKit/WebKit.h>
+#import <wtf/Assertions.h>
@interface NSURL (DRTExtras)
- (NSString *)_drt_descriptionSuitableForTestResult;
- webView: (WebView *)wv identifierForInitialRequest: (NSURLRequest *)request fromDataSource: (WebDataSource *)dataSource
{
+ ASSERT([[dataSource webFrame] dataSource] || [[dataSource webFrame] provisionalDataSource]);
+
if (!done && layoutTestController->dumpResourceLoadCallbacks())
return [[request URL] _drt_descriptionSuitableForTestResult];