Changeset 151088 in webkit


Ignore:
Timestamp:
Jun 2, 2013 6:43:24 PM (11 years ago)
Author:
beidson@apple.com
Message:

Going "back" to a cached page from a page with a main resource error breaks scrolling, amongst other issues.
<rdar://problem/13751844> and https://bugs.webkit.org/show_bug.cgi?id=117112

Reviewed by Alexey Proskuryakov.

Source/WebCore:

If a main resource load ends in error, the Document's parser is never cleared out.

If you then return to a CachedPage, we run the Document->clearParser() step for the
old page and that incorrectly dispatches didFinishLoad for the previous page load
in the middle of the load for the cached page.

The parser should never be needed after a load completes (even if it fails) and
holding on to the parser after the page load failed but before a new navigation is
actually using unnecessary resources.

So we should just clear the parser right when the main resource fails.

Test: http/tests/loading/unfinished-load-back-to-cached-page-callbacks.html

  • loader/DocumentLoader.cpp:

(WebCore::DocumentLoader::stopLoading): After canceling the main resource load, also clear the parser.

LayoutTests:

  • http/tests/loading/resources/resource-that-goes-back-while-still-loading.php: Added.
  • http/tests/loading/unfinished-load-back-to-cached-page-callbacks-expected.txt: Added.
  • http/tests/loading/unfinished-load-back-to-cached-page-callbacks.html: Added.
Location:
trunk
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r151084 r151088  
     12013-06-02  Brady Eidson  <beidson@apple.com>
     2
     3        Going "back" to a cached page from a page with a main resource error breaks scrolling, amongst other issues.
     4        <rdar://problem/13751844> and https://bugs.webkit.org/show_bug.cgi?id=117112
     5
     6        Reviewed by Alexey Proskuryakov.
     7
     8        * http/tests/loading/resources/resource-that-goes-back-while-still-loading.php: Added.
     9        * http/tests/loading/unfinished-load-back-to-cached-page-callbacks-expected.txt: Added.
     10        * http/tests/loading/unfinished-load-back-to-cached-page-callbacks.html: Added.
     11
    1122013-06-02  Alexey Proskuryakov  <ap@apple.com>
    213
  • trunk/Source/WebCore/ChangeLog

    r151083 r151088  
     12013-06-02  Brady Eidson  <beidson@apple.com>
     2
     3        Going "back" to a cached page from a page with a main resource error breaks scrolling, amongst other issues.
     4        <rdar://problem/13751844> and https://bugs.webkit.org/show_bug.cgi?id=117112
     5
     6        Reviewed by Alexey Proskuryakov.
     7
     8        If a main resource load ends in error, the Document's parser is never cleared out.
     9
     10        If you then return to a CachedPage, we run the Document->clearParser() step for the
     11        old page and that incorrectly dispatches didFinishLoad for the previous page load
     12        in the middle of the load for the cached page.
     13
     14        The parser should never be needed after a load completes (even if it fails) and
     15        holding on to the parser after the page load failed but before a new navigation is
     16        actually using unnecessary resources.
     17
     18        So we should just clear the parser right when the main resource fails.
     19
     20        Test: http/tests/loading/unfinished-load-back-to-cached-page-callbacks.html
     21
     22        * loader/DocumentLoader.cpp:
     23        (WebCore::DocumentLoader::stopLoading): After canceling the main resource load, also clear the parser.
     24
    1252013-06-02  Csaba Osztrogonác  <ossy@webkit.org>
    226
  • trunk/Source/WebCore/loader/DocumentLoader.cpp

    r150967 r151088  
    295295    FrameLoader* frameLoader = DocumentLoader::frameLoader();
    296296   
    297     if (isLoadingMainResource())
     297    if (isLoadingMainResource()) {
    298298        // Stop the main resource loader and let it send the cancelled message.
    299299        cancelMainResourceLoad(frameLoader->cancelledError(m_request));
    300     else if (!m_subresourceLoaders.isEmpty())
     300   
     301        // When cancelling the main resource load, we need to also cancel the Document's parser.
     302        // Otherwise cancelling the parser when starting the next page load might result
     303        // in unexpected side effects such as erroneous event dispatch. ( http://webkit.org/b/117112 )
     304        if (Document* doc = document())
     305            doc->cancelParsing();
     306    } else if (!m_subresourceLoaders.isEmpty())
    301307        // The main resource loader already finished loading. Set the cancelled error on the
    302308        // document and let the subresourceLoaders send individual cancelled messages below.
Note: See TracChangeset for help on using the changeset viewer.