Commit b056bbd9 authored by bdakin@apple.com's avatar bdakin@apple.com

WebCore:

        Reviewed by Geoff.

        Fixed for <rdar://problem/5760530> REGRESSION: Assertion failure in 
        Document::removePendingSheet() from r30438

        r30438 added a call to CachedResource::error() from inside 
        Loader::didReceiveData() if a CSS file 4xxs. There was an 
        assumption in the loader, though, that either error() would be 
        called, or didFinishLoading() would be called, so some work is 
        duplicated in each. Now that we are calling an error() on files 
        that will also make it to didFinishLoading() (since they succeeded 
        in the network layer), we need to make sure we do not duplicate the 
        work. CachedCSSStyleSheet::error() calls checkNotify, which ends up 
        decrementing the document's pending style sheet counter. 
        checkNotify() was still getting called, though, through the normal  
        didFinishLoading code path, and the counter was being decremented 
        twice. Bad!

        * loader/loader.cpp:
        (WebCore::Loader::didFinishLoading):
        (WebCore::Loader::didReceiveData):

LayoutTests:

        Reviewed by Geoff.

        Test for <rdar://problem/5760530> REGRESSION: Assertion failure in 
        Document::removePendingSheet() from r30438

        * http/tests/misc/missing-style-sheet-expected.txt: Added.
        * http/tests/misc/missing-style-sheet.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@30587 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 0064a3bb
2008-02-25 Beth Dakin <bdakin@apple.com>
Reviewed by Geoff.
Test for <rdar://problem/5760530> REGRESSION: Assertion failure in
Document::removePendingSheet() from r30438
* http/tests/misc/missing-style-sheet-expected.txt: Added.
* http/tests/misc/missing-style-sheet.html: Added.
2008-02-25 Brady Eidson <beidson@apple.com>
Reviewed by T3h Mitz Pettel (Dan Bernstein)
This test passes if it does not ASSERT that the document's pending style sheet count is less than 0.
<script>
if (window.layoutTestController)
layoutTestController.dumpAsText();
</script>
<link href="/adeleandbethrock.css" rel="stylesheet" type="text/css">
This test passes if it does not ASSERT that the document's pending style sheet count is less than 0.
\ No newline at end of file
2008-02-25 Beth Dakin <bdakin@apple.com>
Reviewed by Geoff.
Fixed for <rdar://problem/5760530> REGRESSION: Assertion failure in
Document::removePendingSheet() from r30438
r30438 added a call to CachedResource::error() from inside
Loader::didReceiveData() if a CSS file 4xxs. There was an
assumption in the loader, though, that either error() would be
called, or didFinishLoading() would be called, so some work is
duplicated in each. Now that we are calling an error() on files
that will also make it to didFinishLoading() (since they succeeded
in the network layer), we need to make sure we do not duplicate the
work. CachedCSSStyleSheet::error() calls checkNotify, which ends up
decrementing the document's pending style sheet counter.
checkNotify() was still getting called, though, through the normal
didFinishLoading code path, and the counter was being decremented
twice. Bad!
* loader/loader.cpp:
(WebCore::Loader::didFinishLoading):
(WebCore::Loader::didReceiveData):
2008-02-25 Mark Rowe <mrowe@apple.com>
Fix the Gtk, wx and Qt builds.
......@@ -14307,6 +14307,7 @@
0867D690FE84028FC02AAC07 /* Project object */ = {
isa = PBXProject;
buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */;
compatibilityVersion = "Xcode 2.4";
hasScannedForEncodings = 1;
knownRegions = (
English,
......@@ -14320,6 +14321,7 @@
mainGroup = 0867D691FE84028FC02AAC07 /* WebKit */;
productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
93F198A508245E59001E9ABC /* WebCore */,
DD041FBE09D9DDBE0010AF2A /* Derived Sources */,
......@@ -109,10 +109,14 @@ void Loader::didFinishLoading(SubresourceLoader* loader)
CachedResource* object = req->cachedResource();
docLoader->setLoadInProgress(true);
object->data(loader->resourceData(), true);
docLoader->setLoadInProgress(false);
object->finish();
// If we got a 4xx response, we're pretending to have received a network
// error, so we can't send the successful data() and finish() callbacks.
if (!object->errorOccurred()) {
docLoader->setLoadInProgress(true);
object->data(loader->resourceData(), true);
docLoader->setLoadInProgress(false);
object->finish();
}
delete req;
......@@ -198,7 +202,7 @@ void Loader::didReceiveData(SubresourceLoader* loader, const char* data, int siz
return;
if (object->response().httpStatusCode() / 100 == 4) {
// Make sure the 4xx error codes result in an error.
// Treat a 4xx response like a network error.
object->error();
return;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment