Changeset 29864 in webkit
- Timestamp:
- Jan 29, 2008 7:50:08 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 5 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r29860 r29864 1 2008-01-29 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Dave Hyatt. 4 5 - test for http://bugs.webkit.org/show_bug.cgi?id=17085 6 <rdar://problem/5714136> REGRESSION (r29839): All remote fonts are treated as SVG fonts 7 8 This is the first @font-face test that actually tests loading font data 9 from a URL. 10 11 * fast/css/font-face-remote.html: Added. 12 * fast/css/resources/Ahem.ttf: Added. 13 * platform/mac/fast/css/font-face-remote-expected.checksum: Added. 14 * platform/mac/fast/css/font-face-remote-expected.png: Added. 15 * platform/mac/fast/css/font-face-remote-expected.txt: Added. 16 1 17 2008-01-29 Adele Peterson <adele@apple.com> 2 18 -
trunk/WebCore/ChangeLog
r29861 r29864 1 2008-01-29 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Dave Hyatt. 4 5 - fix http://bugs.webkit.org/show_bug.cgi?id=17085 6 <rdar://problem/5714136> REGRESSION (r29839): All remote fonts are treated as SVG fonts 7 8 Test: fast/css/font-face-remote.html 9 10 Added an isSVGFont method to CachedFont and use it to decide how to 11 process the font data. Currently whether the data is SVG is determined 12 based on the format property in the @font-face rule, but in the future 13 the MIME type or other metadata may be used when the format is 14 unspecified. 15 16 * css/CSSFontFaceSource.cpp: 17 (WebCore::CSSFontFaceSource::getFontData): Changed to parse the data as 18 SVG only if the CachedFont is an SVG font. 19 * css/CSSFontSelector.cpp: 20 (WebCore::CSSFontSelector::addFontFaceRule): Mark the CachedFont as an 21 SVG font based on format. 22 * loader/CachedFont.cpp: 23 (WebCore::CachedFont::CachedFont): Initialize m_isSVGFont to false. 24 (WebCore::CachedFont::ensureCustomFontData): 25 (WebCore::CachedFont::ensureSVGFontData): 26 (WebCore::CachedFont::getSVGFontById): 27 * loader/CachedFont.h: 28 (WebCore::CachedFont::isSVGFont): Added. 29 (WebCore::CachedFont::setSVGFont): Added. 30 1 31 2008-01-29 Antti Koivisto <antti@apple.com> 2 32 -
trunk/WebCore/css/CSSFontFaceSource.cpp
r29839 r29864 119 119 if (m_font) { 120 120 #if ENABLE(SVG_FONTS) 121 // For SVG fonts parse the external SVG document, and extract the <font> element. 122 if (!m_font->ensureSVGFontData()) 123 return 0; 121 if (m_font->isSVGFont()) { 122 // For SVG fonts parse the external SVG document, and extract the <font> element. 123 if (!m_font->ensureSVGFontData()) 124 return 0; 124 125 125 if (!m_externalSVGFontElement)126 m_externalSVGFontElement = m_font->getSVGFontById(SVGURIReference::getTarget(m_string));126 if (!m_externalSVGFontElement) 127 m_externalSVGFontElement = m_font->getSVGFontById(SVGURIReference::getTarget(m_string)); 127 128 128 if (m_externalSVGFontElement) { 129 if (!m_externalSVGFontElement) 130 return 0; 131 129 132 SVGFontFaceElement* fontFaceElement = 0; 130 133 -
trunk/WebCore/css/CSSFontSelector.cpp
r29839 r29864 29 29 #include "CSSFontSelector.h" 30 30 #include "AtomicString.h" 31 #include "C String.h"31 #include "CachedFont.h" 32 32 #include "CSSFontFace.h" 33 33 #include "CSSFontFaceRule.h" … … 156 156 if (item->isSupportedFormat()) { 157 157 CachedFont* cachedFont = m_document->docLoader()->requestFont(item->resource()); 158 if (cachedFont) 158 if (cachedFont) { 159 #if ENABLE(SVG_FONTS) 160 if (foundSVGFont) 161 cachedFont->setSVGFont(true); 162 #endif 159 163 source = new CSSFontFaceSource(item->resource(), cachedFont); 164 } 160 165 } 161 166 } else { -
trunk/WebCore/loader/CachedFont.cpp
r29839 r29864 51 51 CachedFont::CachedFont(DocLoader* dl, const String &url) 52 52 : CachedResource(url, FontResource), m_fontData(0) 53 , m_isSVGFont(false) 53 54 { 54 55 // Don't load the file yet. Wait for an access before triggering the load. … … 94 95 { 95 96 #if PLATFORM(CG) || PLATFORM(QT) || PLATFORM(GTK) 97 #if ENABLE(SVG_FONTS) 98 ASSERT(!m_isSVGFont); 99 #endif 96 100 if (!m_fontData && !m_errorOccurred && !m_loading && m_data) { 97 101 m_fontData = createFontCustomPlatformData(m_data.get()); … … 120 124 bool CachedFont::ensureSVGFontData() 121 125 { 126 ASSERT(m_isSVGFont); 122 127 if (!m_externalSVGDocument && !m_errorOccurred && !m_loading && m_data) { 123 128 m_externalSVGDocument = new SVGDocument(DOMImplementation::instance(), 0); … … 136 141 SVGFontElement* CachedFont::getSVGFontById(const String& fontName) const 137 142 { 143 ASSERT(m_isSVGFont); 138 144 RefPtr<NodeList> list = m_externalSVGDocument->getElementsByTagName(SVGNames::fontTag.localName()); 139 145 if (!list) -
trunk/WebCore/loader/CachedFont.h
r29839 r29864 64 64 65 65 #if ENABLE(SVG_FONTS) 66 bool isSVGFont() const { return m_isSVGFont; } 67 void setSVGFont(bool isSVG) { m_isSVGFont = isSVG; } 66 68 bool ensureSVGFontData(); 67 69 SVGFontElement* getSVGFontById(const String&) const; … … 73 75 74 76 #if ENABLE(SVG_FONTS) 77 bool m_isSVGFont; 75 78 RefPtr<SVGDocument> m_externalSVGDocument; 76 79 #endif
Note: See TracChangeset
for help on using the changeset viewer.