Call Document::CheckCompleted() after CancelParsing..

Document::CancelParsing() may cause Document::ShouldComplete() to return
true. Document::CheckCompleted() needs to be called so that its
DocumentLoader is marked to have finished its load.

A lot of tests don't expect DidStopLoading() and DidStartLoading() to be
fired when a new DocumentLoader starts and replaces the previous one.
In FrameLoader::StartLoad(), Document::CancelParsing() is moved after
the creation of the new provisional DocumentLoader so that the
FrameLoader isn't temporarily without any non loading Document. If that
happened, DidStopLoading() would be fired.

There was also one small bug with site isolation. The condition
|have_to_check_if_parent_is_completed| in
HTMLFrameOwnerElement::DisconnectContentFrame() was too strict. The
parent document may have completed its load, but not have sent
DidStopLoading yet because its childs were still loading.

Note: I am working on https://crbug.com/831155. Some tests that are
relying on how things are scheduled in Blink are failing. This CL makes
DownloadTest.TestMultipleDownloadsRequests to keep working. Here, while
the current document is loading, a new navigation happens and cancels
the parser of the current document without calling
Document::CheckCompleted() on it. Then, it turns out the navigation is a
download. The navigation is dropped. In the end the main frame doesn't
know its iframe has finished loading and the test fails.

Bug: 831155

Change-Id: Ib2de108e25991349b44ec4071fe61d57ca6e85a1
Reviewed-on: https://chromium-review.googlesource.com/1107808
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#570002}
3 files changed