Changeset 199881 in webkit
- Timestamp:
- Apr 22, 2016, 10:37:09 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r199878 r199881 1 2016-04-22 Antti Koivisto <antti@apple.com> 2 3 REGRESSION (r194898): Multi download of external SVG defs file by <use> xlinks:href (caching) 4 https://bugs.webkit.org/show_bug.cgi?id=156368 5 <rdar://problem/25611746> 6 7 Reviewed by Simon Fraser. 8 9 * http/tests/svg/resources/symbol-defs.svg: Added. 10 * http/tests/svg/svg-use-external-expected.txt: Added. 11 * http/tests/svg/svg-use-external.html: Added. 12 1 13 2016-04-22 Chris Dumez <cdumez@apple.com> 2 14 -
trunk/Source/WebCore/ChangeLog
r199879 r199881 1 2016-04-22 Antti Koivisto <antti@apple.com> 2 3 REGRESSION (r194898): Multi download of external SVG defs file by <use> xlinks:href (caching) 4 https://bugs.webkit.org/show_bug.cgi?id=156368 5 <rdar://problem/25611746> 6 7 Reviewed by Simon Fraser. 8 9 We would load svg resources with fragment identifier again because the encoding never matched. 10 11 Test: http/tests/svg/svg-use-external.html 12 13 * loader/TextResourceDecoder.cpp: 14 (WebCore::TextResourceDecoder::setEncoding): 15 (WebCore::TextResourceDecoder::hasEqualEncodingForCharset): 16 17 Encoding can depend on mime type. Add a comparison function that takes this into account. 18 19 (WebCore::findXMLEncoding): 20 * loader/TextResourceDecoder.h: 21 (WebCore::TextResourceDecoder::encoding): 22 * loader/cache/CachedCSSStyleSheet.h: 23 * loader/cache/CachedResource.h: 24 (WebCore::CachedResource::textResourceDecoder): 25 26 Add a way to get the TextResourceDecoder from a cached resource. 27 28 * loader/cache/CachedResourceLoader.cpp: 29 (WebCore::CachedResourceLoader::determineRevalidationPolicy): 30 31 Use the new comparison function. 32 33 * loader/cache/CachedSVGDocument.h: 34 * loader/cache/CachedScript.h: 35 * loader/cache/CachedXSLStyleSheet.h: 36 1 37 2016-04-22 Youenn Fablet <youenn.fablet@crf.canon.fr> 2 38 -
trunk/Source/WebCore/loader/TextResourceDecoder.cpp
r195452 r199881 360 360 } 361 361 362 bool TextResourceDecoder::hasEqualEncodingForCharset(const String& charset) const 363 { 364 return defaultEncoding(m_contentType, charset) == m_encoding; 365 } 366 362 367 // Returns the position of the encoding string. 363 368 static int findXMLEncoding(const char* str, int len, int& encodingLength) -
trunk/Source/WebCore/loader/TextResourceDecoder.h
r177733 r199881 53 53 const TextEncoding& encoding() const { return m_encoding; } 54 54 55 bool hasEqualEncodingForCharset(const String&) const; 56 55 57 WEBCORE_EXPORT String decode(const char* data, size_t length); 56 58 WEBCORE_EXPORT String flush(); -
trunk/Source/WebCore/loader/cache/CachedCSSStyleSheet.h
r197563 r199881 56 56 void setEncoding(const String&) override; 57 57 String encoding() const override; 58 const TextResourceDecoder* textResourceDecoder() const override { return m_decoder.get(); } 58 59 void finishLoading(SharedBuffer*) override; 59 60 void destroyDecodedData() override; -
trunk/Source/WebCore/loader/cache/CachedResource.h
r199650 r199881 51 51 class SharedBuffer; 52 52 class SubresourceLoader; 53 class TextResourceDecoder; 53 54 54 55 // A resource that is held in the cache. Classes who want to use this object should derive … … 101 102 virtual void setEncoding(const String&) { } 102 103 virtual String encoding() const { return String(); } 104 virtual const TextResourceDecoder* textResourceDecoder() const { return nullptr; } 103 105 virtual void addDataBuffer(SharedBuffer&); 104 106 virtual void addData(const char* data, unsigned length); -
trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp
r199650 r199881 759 759 } 760 760 761 if (existingResource->encoding() != TextEncoding(cachedResourceRequest.charset())) 761 auto* textDecoder = existingResource->textResourceDecoder(); 762 if (textDecoder && !textDecoder->hasEqualEncodingForCharset(cachedResourceRequest.charset())) 762 763 return Reload; 763 764 -
trunk/Source/WebCore/loader/cache/CachedSVGDocument.h
r197563 r199881 42 42 void setEncoding(const String&) override; 43 43 String encoding() const override; 44 const TextResourceDecoder* textResourceDecoder() const override { return m_decoder.get(); } 44 45 void finishLoading(SharedBuffer*) override; 45 46 -
trunk/Source/WebCore/loader/cache/CachedScript.h
r197563 r199881 54 54 void setEncoding(const String&) override; 55 55 String encoding() const override; 56 const TextResourceDecoder* textResourceDecoder() const override { return m_decoder.get(); } 56 57 void finishLoading(SharedBuffer*) override; 57 58 -
trunk/Source/WebCore/loader/cache/CachedXSLStyleSheet.h
r197563 r199881 48 48 void setEncoding(const String&) override; 49 49 String encoding() const override; 50 const TextResourceDecoder* textResourceDecoder() const override { return m_decoder.get(); } 50 51 void finishLoading(SharedBuffer*) override; 51 52
Note:
See TracChangeset
for help on using the changeset viewer.