Changeset 86478 in webkit


Ignore:
Timestamp:
May 13, 2011 9:20:04 PM (13 years ago)
Author:
ap@apple.com
Message:

2011-05-13 Alexey Proskuryakov <ap@apple.com>

Reviewed by Darin Adler.

HTML5 Application Cache Update Failures on Page Refresh
https://bugs.webkit.org/show_bug.cgi?id=60598
<rdar://problem/9418639>

  • http/tests/appcache/interrupted-update-expected.txt: Added.
  • http/tests/appcache/interrupted-update.html: Added.
  • http/tests/appcache/resources/interrupted-update.manifest: Added.
  • http/tests/appcache/main-resource-redirect.html:
  • http/tests/appcache/non-html.xhtml: Now that we dispatch an error even when aborting a load due to navigation, error event handler was getting called after notifyDone().

2011-05-13 Alexey Proskuryakov <ap@apple.com>

Reviewed by Darin Adler.

HTML5 Application Cache Update Failures on Page Refresh
https://bugs.webkit.org/show_bug.cgi?id=60598
<rdar://problem/9418639>

Test: http/tests/appcache/interrupted-update.html

The reason was two-fold:
1) Cache group state wasn't fully reset after a failed cache update (or an initial load).
2) The cache group is not deleted until after after the navigation (from autorelease pool),
so the failed and sorry old version was picked up by cache selection algorithm.

The latter is more of a surprising behavior than a problem in itself. Keeping an appcache in
memory for reload is generally a good thing for performance.

  • loader/appcache/ApplicationCacheGroup.cpp: (WebCore::ApplicationCacheGroup::stopLoading): Added a FIXME about half-baked state resetting code that sent me looking for a wrong fix originally. (WebCore::ApplicationCacheGroup::stopLoadingInFrame): Stopped load is an update failure like any other, so we should call cacheUpdateFailed(), which knows how to reset state.
Location:
trunk
Files:
3 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r86476 r86478  
     12011-05-13  Alexey Proskuryakov  <ap@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        HTML5 Application Cache Update Failures on Page Refresh
     6        https://bugs.webkit.org/show_bug.cgi?id=60598
     7        <rdar://problem/9418639>
     8
     9        * http/tests/appcache/interrupted-update-expected.txt: Added.
     10        * http/tests/appcache/interrupted-update.html: Added.
     11        * http/tests/appcache/resources/interrupted-update.manifest: Added.
     12
     13        * http/tests/appcache/main-resource-redirect.html:
     14        * http/tests/appcache/non-html.xhtml:
     15        Now that we dispatch an error even when aborting a load due to navigation, error event
     16        handler was getting called after notifyDone().
     17
    1182011-05-13  Anders Carlsson  <andersca@apple.com>
    219
  • trunk/LayoutTests/http/tests/appcache/main-resource-redirect.html

    r69226 r86478  
    2828function done()
    2929{
    30     if (window.layoutTestController)
     30    if (window.layoutTestController) {
     31        applicationCache.onerror = null;
    3132        layoutTestController.notifyDone();
     33    }
    3234    setNetworkEnabled(true);
    3335}
  • trunk/LayoutTests/http/tests/appcache/non-html.xhtml

    r40401 r86478  
    8383        log("FAIL: Frame.onload was called, but the image doesn't seem to be loaded.");
    8484   
    85     if (window.layoutTestController)
     85    if (window.layoutTestController) {
     86        applicationCache.onerror = null;
    8687        layoutTestController.notifyDone();
     88    }
    8789}
    8890
     
    9799applicationCache.addEventListener('noupdate', cached, false);
    98100
    99 applicationCache.addEventListener('error', error, false);
     101applicationCache.onerror = error;
    100102
    101103</script>
  • trunk/Source/WebCore/ChangeLog

    r86477 r86478  
     12011-05-13  Alexey Proskuryakov  <ap@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        HTML5 Application Cache Update Failures on Page Refresh
     6        https://bugs.webkit.org/show_bug.cgi?id=60598
     7        <rdar://problem/9418639>
     8
     9        Test: http/tests/appcache/interrupted-update.html
     10
     11        The reason was two-fold:
     12        1) Cache group state wasn't fully reset after a failed cache update (or an initial load).
     13        2) The cache group is not deleted until after after the navigation (from autorelease pool),
     14        so the failed and sorry old version was picked up by cache selection algorithm.
     15
     16        The latter is more of a surprising behavior than a problem in itself. Keeping an appcache in
     17        memory for reload is generally a good thing for performance.
     18
     19        * loader/appcache/ApplicationCacheGroup.cpp:
     20        (WebCore::ApplicationCacheGroup::stopLoading): Added a FIXME about half-baked state resetting
     21        code that sent me looking for a wrong fix originally.
     22        (WebCore::ApplicationCacheGroup::stopLoadingInFrame): Stopped load is an update failure like
     23        any other, so we should call cacheUpdateFailed(), which knows how to reset state.
     24
    1252011-05-13  Enrica Casucci  <enrica@apple.com>
    226
  • trunk/Source/WebCore/loader/appcache/ApplicationCacheGroup.cpp

    r86453 r86478  
    346346        m_currentHandle = 0;
    347347    }   
    348    
     348
     349    // FIXME: Resetting just a tiny part of the state in this function is confusing. Callers have to take care of a lot more.
    349350    m_cacheBeingUpdated = 0;
    350351    m_pendingEntries.clear();
     
    398399        return;
    399400
    400     stopLoading();
     401    cacheUpdateFailed();
    401402}
    402403
Note: See TracChangeset for help on using the changeset viewer.