Changeset 24500 in webkit


Ignore:
Timestamp:
Jul 20, 2007, 6:23:51 PM (18 years ago)
Author:
andersca
Message:

Reviewed by Darin.

If the style sheet requested is a user style sheet, don't store it in the DocLoader's resource map;
user style sheets can outlive their doc loaders.

  • loader/DocLoader.cpp: (WebCore::DocLoader::requestCSSStyleSheet):
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r24499 r24500  
     12007-07-20  Anders Carlsson  <andersca@apple.com>
     2
     3        Reviewed by Darin.
     4
     5        If the style sheet requested is a user style sheet, don't store it in the DocLoader's resource map;
     6        user style sheets can outlive their doc loaders.
     7
     8        * loader/DocLoader.cpp:
     9        (WebCore::DocLoader::requestCSSStyleSheet):
     10
    1112007-07-20  Justin Garcia  <justin.garcia@apple.com>
    212
  • trunk/WebCore/loader/DocLoader.cpp

    r23741 r24500  
    9696    // if this resource is already in the cache. It's theoretically possible that what's in the cache already
    9797    // is a load that failed because of the canLoad check. Probably not an issue in practice.
    98     return static_cast<CachedCSSStyleSheet*>(requestResource(CachedResource::CSSStyleSheet, url, &charset, isUserStyleSheet, !isUserStyleSheet));
     98    CachedCSSStyleSheet *sheet = static_cast<CachedCSSStyleSheet*>(requestResource(CachedResource::CSSStyleSheet, url, &charset, isUserStyleSheet, !isUserStyleSheet));
     99
     100    // A user style sheet can outlive its DocLoader so don't store any pointers to it
     101    if (sheet && isUserStyleSheet) {
     102        sheet->setDocLoader(0);
     103        m_docResources.remove(sheet->url());
     104    }
     105   
     106    return sheet;
    99107}
    100108
Note: See TracChangeset for help on using the changeset viewer.