Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
WebCore: [Qt] Handle fonts like the other ports
Patch by Benjamin Poulain <benjamin.poulain@nokia.com> on 2009-11-02 Reviewed by Simon Hausmann. Remove FontFallbackListQt and rely on the common FontFallbackList to handle the fonts. FontCache and FontPlatformData have been updated to work with the common FontFallbackList. In the previous implementation, FontPlatformDataCacheKey was a clone of FontPlatformData with the hashing capabilities added in order to use it as a key in the cache's hashmap. FontPlatformData has been modified to handle the hashing function directly so the data are not copied twice in memory. FontFallbackList::fontDataAt() from FontFallbackListQt was a copy of code from FontCache::getFontData() and FontFallbackList::fontDataAt(). The behavior is similar except currFamily->family().length() was not tested and the fallback fonts selector were not used. https://bugs.webkit.org/show_bug.cgi?id=29856 Test: svg/text/text-font-invalid.html * WebCore.pro: * platform/graphics/qt/FontCacheQt.cpp: (WebCore::FontCache::platformInit): (WebCore::FontCache::getFontDataForCharacters): (WebCore::FontCache::getSimilarFontPlatformData): (WebCore::FontCache::getLastResortFallbackFont): (WebCore::FontCache::getTraitsInFamily): (WebCore::FontCache::createFontPlatformData): * platform/graphics/qt/FontFallbackListQt.cpp: Removed. We now use the implementation from FontFallbackList.cpp * platform/graphics/qt/FontPlatformData.h: Add hashing capabilities to be able to use the data with the FontCache. This was previously done in FontCacheQt.cpp (WebCore::FontPlatformData::FontPlatformData): Added a boolean to identify deleted value in the hash table. (WebCore::FontPlatformData::isHashTableDeletedValue): (WebCore::FontPlatformData::hash): (WebCore::FontPlatformData::operator==): * platform/graphics/qt/FontPlatformDataQt.cpp: (WebCore::FontPlatformData::FontPlatformData): LayoutTests: Add a new test to reproduce 29856. The bug only happen when the SVG file is used as an image. https://bugs.webkit.org/show_bug.cgi?id=29856 Patch by Benjamin Poulain <benjamin.poulain@nokia.com> on 2009-11-02 Reviewed by Simon Hausmann. * svg/text/text-font-invalid-expected.txt: Added. * svg/text/resources/text-font-invalid.svg: Added. * svg/text/text-font-invalid.html: Added. Canonical link: https://commits.webkit.org/41926@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@50496 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
10 changed files
with
138 additions
and
378 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,3 @@ | ||
This test is to ensure that we do not crash when loading a SVG image without a valid font-family | ||
PASS: Did not crash when rendering the SVG image. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,12 @@ | ||
<html> | ||
<body> | ||
This test is to ensure that we do not crash when loading a SVG image without a valid font-family | ||
<div id="log"><span style='color: red;'>FAIL:</span> Did not complete test</div> | ||
<img src="resources/text-font-invalid.svg" /> | ||
<script> | ||
if (window.layoutTestController) | ||
layoutTestController.dumpAsText(); | ||
document.getElementById("log").innerHTML = "<span style='color: green;'>PASS:</span> Did not crash when rendering the SVG image."; | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.