Reviewed by Maciej.
Adding tests for http://bugzilla.opendarwin.org/show_bug.cgi?id=8121
REGRESSION: 404s are not displayed
and http://bugzilla.opendarwin.org/show_bug.cgi?id=7739
REGRESSION: Assertion failure loading acid2 test in -[WebCoreFrameBridge installInFrame:]
In addition I tweaked the httpd conf file to allow us to exec perl CGI scripts.
* http/conf/httpd.conf:
* http/tests/misc/error404-expected.checksum: Added.
* http/tests/misc/error404-expected.png: Added.
* http/tests/misc/error404-expected.txt: Added.
* http/tests/misc/error404.pl: Added.
* http/tests/misc/iframe404-expected.checksum: Added.
* http/tests/misc/iframe404-expected.png: Added.
* http/tests/misc/iframe404-expected.txt: Added.
* http/tests/misc/iframe404.html: Added.
WebCore:
Reviewed by Maciej.
Support for fixing http://bugzilla.opendarwin.org/show_bug.cgi?id=8121
REGRESSION: 404s are not displayed
* bridge/mac/WebCoreFrameBridge.mm:
(-[WebCoreFrameBridge currentForm]): Nuke redundant nil check.
(-[WebCoreFrameBridge frameElement]): Tweak to not rely on our document, which
gives a correct result even at the start of our loading process.
* bindings/objc/DOM.mm:
(-[DOMDocument _ownerElement]): Nuke redundant nil check.
WebKit:
Reviewed by Maciej.
fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8121
REGRESSION: 404s are not displayed
* WebView/WebMainResourceLoader.m:
(-[WebMainResourceLoader continueAfterContentPolicy:response:]):
Only cancel failed loads for object elements, not for frames or a whole page.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@13650
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-04-02 Trey Matteson <trey@usa.net>
+
+ Reviewed by Maciej.
+
+ Adding tests for http://bugzilla.opendarwin.org/show_bug.cgi?id=8121
+ REGRESSION: 404s are not displayed
+ and http://bugzilla.opendarwin.org/show_bug.cgi?id=7739
+ REGRESSION: Assertion failure loading acid2 test in -[WebCoreFrameBridge installInFrame:]
+
+ In addition I tweaked the httpd conf file to allow us to exec perl CGI scripts.
+
+ * http/conf/httpd.conf:
+ * http/tests/misc/error404-expected.checksum: Added.
+ * http/tests/misc/error404-expected.png: Added.
+ * http/tests/misc/error404-expected.txt: Added.
+ * http/tests/misc/error404.pl: Added.
+ * http/tests/misc/iframe404-expected.checksum: Added.
+ * http/tests/misc/iframe404-expected.png: Added.
+ * http/tests/misc/iframe404-expected.txt: Added.
+ * http/tests/misc/iframe404.html: Added.
+
2006-04-02 Maciej Stachowiak <mjs@apple.com>
Reviewed by Hyatt.
#
# To use CGI scripts:
#
- AddHandler cgi-script .cgi
+ AddHandler cgi-script .cgi .pl
#
# To use server-parsed HTML files
--- /dev/null
+01c527308e0c6210afa97a8af6faaa4a
\ No newline at end of file
--- /dev/null
+layer at (0,0) size 800x600
+ RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x600
+ RenderBlock {HTML} at (0,0) size 800x600
+ RenderBody {BODY} at (8,8) size 784x584
+ RenderText {TEXT} at (0,0) size 364x18
+ text run at (0,0) width 364: "This 404 error was intentionally generated by a test script."
--- /dev/null
+#!/usr/bin/perl
+# Simple script to generate a 404 HTTP error
+
+print "Status: 404 Not Found\r\n";
+print "Content-type: text/html\r\n";
+print "\r\n";
+
+print "<html><body>";
+print "This 404 error was intentionally generated by a test script.";
+print "</html></body>";
--- /dev/null
+aa2b0a4b48a9d7cdf86cfcf566f18af5
\ No newline at end of file
--- /dev/null
+layer at (0,0) size 800x600
+ RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x600
+ RenderBlock {HTML} at (0,0) size 800x600
+ RenderBody {BODY} at (8,8) size 784x584
+ RenderBlock {P} at (0,0) size 784x36
+ RenderText {TEXT} at (0,0) size 53x18
+ text run at (0,0) width 53: "Test for "
+ RenderInline {A} at (0,0) size 60x18 [color=#0000EE]
+ RenderText {TEXT} at (53,0) size 60x18
+ text run at (53,0) width 60: "bug 8121"
+ RenderText {TEXT} at (113,0) size 289x18
+ text run at (113,0) width 289: ": REGRESSION: 404s are not displayed and "
+ RenderInline {A} at (0,0) size 60x18 [color=#0000EE]
+ RenderText {TEXT} at (402,0) size 60x18
+ text run at (402,0) width 60: "bug 7739"
+ RenderText {TEXT} at (462,0) size 772x36
+ text run at (462,0) width 310: ": REGRESSION: Assertion failure loading acid2"
+ text run at (0,18) width 298: "test in -[WebCoreFrameBridge installInFrame:]"
+ RenderBlock {P} at (0,52) size 784x36
+ RenderText {TEXT} at (0,0) size 774x36
+ text run at (0,0) width 163: "Here is an invalid iframe. "
+ text run at (163,0) width 611: "It should contain a 404 error message, not any green fallback text. Note this will only work if this"
+ text run at (0,18) width 149: "page is fetched via http."
+ RenderBlock (anonymous) at (0,104) size 784x180
+ RenderPartObject {IFRAME} at (0,0) size 548x180
+ layer at (0,0) size 548x180
+ RenderCanvas at (0,0) size 548x180
+ layer at (0,0) size 548x180
+ RenderBlock {HTML} at (0,0) size 548x180
+ RenderBody {BODY} at (8,8) size 532x164
+ RenderText {TEXT} at (0,0) size 364x18
+ text run at (0,0) width 364: "This 404 error was intentionally generated by a test script."
+ RenderText {TEXT} at (0,0) size 0x0
+ RenderBlock {P} at (0,300) size 784x18
+ RenderText {TEXT} at (0,0) size 487x18
+ text run at (0,0) width 161: "Here is an invalid object. "
+ text run at (161,0) width 326: "It should be rendered with some green fallback text."
+ RenderBlock (anonymous) at (0,334) size 784x18
+ RenderInline {OBJECT} at (0,0) size 77x18
+ RenderText {TEXT} at (0,0) size 0x0
+ RenderInline {SPAN} at (0,0) size 77x18 [color=#008000]
+ RenderText {TEXT} at (0,0) size 77x18
+ text run at (0,0) width 77: "fallback text"
+ RenderText {TEXT} at (0,0) size 0x0
+ RenderText {TEXT} at (0,0) size 0x0
+ RenderText {TEXT} at (0,0) size 0x0
+ RenderText {TEXT} at (0,0) size 0x0
--- /dev/null
+<html>
+<head>
+<title>Test for 404 errors in iframes and objects</title>
+</head>
+<body>
+
+<p>Test for <a href="http://bugzilla.opendarwin.org/show_bug.cgi?id=8121">bug 8121</a>:
+REGRESSION: 404s are not displayed
+and <a href="http://bugzilla.opendarwin.org/show_bug.cgi?id=7739">bug 7739</a>:
+REGRESSION: Assertion failure loading acid2 test in -[WebCoreFrameBridge installInFrame:]</p>
+
+<p>Here is an invalid iframe. It should contain a 404 error message, not any green fallback text.
+Note this will only work if this page is fetched via http.</p>
+<iframe src="error404.pl" width="70%" height="180">
+<span style="color:green">fallback text</span>
+</iframe>
+
+
+<p>Here is an invalid object. It should be rendered with some green fallback text.</p>
+<object data="404error.pl" type="image/x-unsupported" width=100 height=100>
+<span style="color:green">fallback text</span>
+</object>
+
+</body>
+</html>
+2006-04-02 Trey Matteson <trey@usa.net>
+
+ Reviewed by Maciej.
+
+ Support for fixing http://bugzilla.opendarwin.org/show_bug.cgi?id=8121
+ REGRESSION: 404s are not displayed
+
+ * bridge/mac/WebCoreFrameBridge.mm:
+ (-[WebCoreFrameBridge currentForm]): Nuke redundant nil check.
+ (-[WebCoreFrameBridge frameElement]): Tweak to not rely on our document, which
+ gives a correct result even at the start of our loading process.
+ * bindings/objc/DOM.mm:
+ (-[DOMDocument _ownerElement]): Nuke redundant nil check.
+
2006-04-02 David Kilzer <ddkilzer@kilzer.net>
Reviewed by Maciej.
- (DOMElement *)_ownerElement
{
- Element *element = [self _document]->ownerElement();
- return element ? [DOMElement _elementWith:element] : nil;
+ return [DOMElement _elementWith:[self _document]->ownerElement()];
}
@end
- (DOMElement *)currentForm
{
- HTMLFormElement *formElement = m_frame->currentForm();
- return formElement ? [DOMElement _elementWith:formElement] : nil;
+ return [DOMElement _elementWith:m_frame->currentForm()];
}
- (NSArray *)controlsInForm:(DOMElement *)form
- (DOMHTMLElement *)frameElement
{
- return (DOMHTMLElement *)[[self DOMDocument] _ownerElement];
+ // Not [[self DOMDocument] _ownerElement], since our doc is not set up at the start of our own load.
+ // FIXME: There really is no guarantee this is an HTML element.
+ // For example, it could be something like an SVG foreign object element.
+ // Because of that, I believe the cast here is wrong and also the public API
+ // of WebKit might have to be changed.
+ return (DOMHTMLElement *)[DOMElement _elementWith:m_frame->ownerElement()];
}
- (NSAttributedString *)selectedAttributedString
+2006-04-02 Trey Matteson <trey@usa.net>
+
+ Reviewed by Maciej.
+
+ fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8121
+ REGRESSION: 404s are not displayed
+
+ * WebView/WebMainResourceLoader.m:
+ (-[WebMainResourceLoader continueAfterContentPolicy:response:]):
+ Only cancel failed loads for object elements, not for frames or a whole page.
+
2006-04-02 Maciej Stachowiak <mjs@apple.com>
Reviewed by Hyatt.
#import <Foundation/NSURLRequest.h>
#import <Foundation/NSURLResponse.h>
+#import <WebKit/DOMHTML.h>
#import <WebKit/WebDataProtocol.h>
#import <WebKit/WebDataSourcePrivate.h>
#import <WebKit/WebDefaultPolicyDelegate.h>
int status = [(NSHTTPURLResponse *)r statusCode];
if (status < 200 || status >= 300) {
// Handle <object> fallback for error cases.
+ DOMHTMLElement *hostElement = [[[self dataSource] webFrame] frameElement];
[[[dataSource webFrame] _bridge] handleFallbackContent];
- [self cancel];
+ if (hostElement && [hostElement isKindOfClass:[DOMHTMLObjectElement class]])
+ // object elements are no longer rendered after we fallback, so don't
+ // keep trying to process data from their load
+ [self cancel];
}
}