Changeset 229585 in webkit


Ignore:
Timestamp:
Mar 13, 2018 1:39:17 PM (6 years ago)
Author:
youenn@apple.com
Message:

Changing link element rel attribute from preload to stylesheet should succeed loading the stylesheet
https://bugs.webkit.org/show_bug.cgi?id=183601
<rdar://problem/38309441>

Reviewed by Antti Koivisto.

Source/WebCore:

Test: http/wpt/preload/change-link-rel-attribute.html

  • loader/LinkPreloadResourceClients.h:

(WebCore::LinkPreloadResourceClient::clearResource): Remove the call to CachedResource::cancelLoad.
This call is expected to be called by ResourceLoader when cancelling the load from below CachedResource.

  • loader/cache/CachedResource.cpp:

(WebCore::CachedResource::allClientsRemoved): In case of preload,
cancel the load if not finished when there is no more client attached to it.

  • loader/cache/CachedResource.h:

LayoutTests:

  • http/wpt/preload/change-link-rel-attribute-expected.txt: Added.
  • http/wpt/preload/change-link-rel-attribute.html: Added.
  • http/wpt/preload/resources/style.css: Added.

(body):

Location:
trunk
Files:
3 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r229582 r229585  
     12018-03-13  Youenn Fablet  <youenn@apple.com>
     2
     3        Changing link element rel attribute from preload to stylesheet should succeed loading the stylesheet
     4        https://bugs.webkit.org/show_bug.cgi?id=183601
     5        <rdar://problem/38309441>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        * http/wpt/preload/change-link-rel-attribute-expected.txt: Added.
     10        * http/wpt/preload/change-link-rel-attribute.html: Added.
     11        * http/wpt/preload/resources/style.css: Added.
     12        (body):
     13
    1142018-03-13  Frederic Wang  <fwang@igalia.com>
    215
  • trunk/Source/WebCore/ChangeLog

    r229569 r229585  
     12018-03-13  Youenn Fablet  <youenn@apple.com>
     2
     3        Changing link element rel attribute from preload to stylesheet should succeed loading the stylesheet
     4        https://bugs.webkit.org/show_bug.cgi?id=183601
     5        <rdar://problem/38309441>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        Test: http/wpt/preload/change-link-rel-attribute.html
     10
     11        * loader/LinkPreloadResourceClients.h:
     12        (WebCore::LinkPreloadResourceClient::clearResource): Remove the call to CachedResource::cancelLoad.
     13        This call is expected to be called by ResourceLoader when cancelling the load from below CachedResource.
     14        * loader/cache/CachedResource.cpp:
     15        (WebCore::CachedResource::allClientsRemoved): In case of preload,
     16        cancel the load if not finished when there is no more client attached to it.
     17        * loader/cache/CachedResource.h:
     18
    1192018-03-12  John Wilander  <wilander@apple.com>
    220
  • trunk/Source/WebCore/loader/LinkPreloadResourceClients.h

    r228528 r229585  
    6363    void clearResource(CachedResourceClient& client)
    6464    {
    65         if (m_resource) {
    66             m_resource->cancelLoad();
    67             m_resource->removeClient(client);
    68         }
     65        if (!m_resource)
     66            return;
     67
     68        m_resource->removeClient(client);
    6969        m_resource = nullptr;
    7070    }
  • trunk/Source/WebCore/loader/cache/CachedResource.cpp

    r229563 r229585  
    580580}
    581581
     582void CachedResource::allClientsRemoved()
     583{
     584    if (isLinkPreload() && m_loader)
     585        m_loader->cancelIfNotFinishing();
     586}
     587
    582588void CachedResource::destroyDecodedDataIfNeeded()
    583589{
  • trunk/Source/WebCore/loader/cache/CachedResource.h

    r229563 r229585  
    142142    virtual void didAddClient(CachedResourceClient&);
    143143    virtual void didRemoveClient(CachedResourceClient&) { }
    144     virtual void allClientsRemoved() { }
     144    virtual void allClientsRemoved();
    145145    void destroyDecodedDataIfNeeded();
    146146
Note: See TracChangeset for help on using the changeset viewer.