Created attachment 50874 [details] Sample project Under certain conditions, dispatchDidFinishLoad() may get called on a FrameLoaderClient before all the frame’s resources have actually finished loading. Specifically, the scenario is as follows: 1. Frame A’s main resource begins loading 2. Frame A kicks off loading of subresource R 3. Frame B’s main resource begins loading 4. Frame B requests the same subresource R 5. Frame B’s main resource finishes loading At that point, frame B’s FrameLoadClient will get dispatchDidFinishLoad(), even though resource R has not finished loading. The reason for this is that Frame B’s DocumentLoader doesn’t track the loading of R, since the Cache::requestResource() returns an already-loading resource (whose ResourceLoader is tracked by Frame A’s DocumentLoader). Thus when Frame B’s main resource finishes loading, its DocumentLoader sees no subresource loaders in progress, and that allows the didFinishLoad to be dispatched. The attached project demonstrates this on Mac OS X. Open the project and build DidNotQuiteFinishLoading. Then copy file1.html, file2.html and common.css into your working directory and run DidNotQuiteFinishLoading. A printed value of rgb(0, 0, 0) indicates that Frame B’s didFinishLoading occurred before the style sheet had actually finished loading. A result of rgb(255, 0, 0) would be correct.
<rdar://problem/7762277>
*** This bug has been marked as a duplicate of bug 18762 ***