Changeset 52174 in webkit
- Timestamp:
- Dec 15, 2009, 2:12:50 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r52164 r52174 1 2009-12-15 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Darin Adler. 4 5 <rdar://problem/7470452> Safari/Chromium crashes on complicated @font-face rule 6 https://bugs.webkit.org/show_bug.cgi?id=32257 7 8 * fast/css/font-face-unused-source-loaded-expected.txt: Added. 9 * fast/css/font-face-unused-source-loaded.html: Added. 10 1 11 2009-12-15 Kenneth Russell <kbr@google.com> 2 12 -
trunk/WebCore/ChangeLog
r52172 r52174 1 2009-12-15 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Darin Adler. 4 5 <rdar://problem/7470452> Safari/Chromium crashes on complicated @font-face rule 6 https://bugs.webkit.org/show_bug.cgi?id=32257 7 8 Test: fast/css/font-face-unused-source-loaded.html 9 10 The loading of a font resource caused a CSSFontFace that had the resource in one of its 11 sources, but wasn’t using it (due to using an earlier source) to invalidate its 12 CSSSegmentedFontFaces. This caused FontData for the active source (the one that did not just 13 finish loading) to be deleted, but that went unnoticed by Font::operator==(), since the 14 corresponding FontFallbackLists were not in the loading state. The fix is for CSSFontFace to 15 ignore loads from unused sources. 16 17 * css/CSSFontFace.cpp: 18 (WebCore::CSSFontFace::fontLoaded): Bail out if the loaded source is not the active source. 19 (WebCore::CSSFontFace::getFontData): Set m_activeSource to the source that supplied the 20 FontData. 21 * css/CSSFontFace.h: 22 (WebCore::CSSFontFace::CSSFontFace): Initialize m_activeSource. 23 1 24 2009-12-15 Yael Aharon <yael.aharon@nokia.com> 2 25 -
trunk/WebCore/css/CSSFontFace.cpp
r38843 r52174 78 78 } 79 79 80 void CSSFontFace::fontLoaded(CSSFontFaceSource* )80 void CSSFontFace::fontLoaded(CSSFontFaceSource* source) 81 81 { 82 if (source != m_activeSource) 83 return; 84 82 85 // FIXME: Can we assert that m_segmentedFontFaces is not empty? That may 83 86 // require stopping in-progress font loading when the last … … 98 101 SimpleFontData* CSSFontFace::getFontData(const FontDescription& fontDescription, bool syntheticBold, bool syntheticItalic) 99 102 { 103 m_activeSource = 0; 100 104 if (!isValid()) 101 105 return 0; 102 106 103 107 ASSERT(!m_segmentedFontFaces.isEmpty()); 104 108 CSSFontSelector* fontSelector = (*m_segmentedFontFaces.begin())->fontSelector(); 105 109 106 SimpleFontData* result = 0; 107 unsigned size = m_sources.size(); 108 for (unsigned i = 0; i < size && !result; i++) 109 result = m_sources[i]->getFontData(fontDescription, syntheticBold, syntheticItalic, fontSelector); 110 return result; 110 size_t size = m_sources.size(); 111 for (size_t i = 0; i < size; ++i) { 112 if (SimpleFontData* result = m_sources[i]->getFontData(fontDescription, syntheticBold, syntheticItalic, fontSelector)) { 113 m_activeSource = m_sources[i]; 114 return result; 115 } 116 } 117 118 return 0; 111 119 } 112 120 -
trunk/WebCore/css/CSSFontFace.h
r34794 r52174 83 83 CSSFontFace(FontTraitsMask traitsMask) 84 84 : m_traitsMask(traitsMask) 85 , m_activeSource(0) 85 86 { 86 87 } … … 90 91 HashSet<CSSSegmentedFontFace*> m_segmentedFontFaces; 91 92 Vector<CSSFontFaceSource*> m_sources; 93 CSSFontFaceSource* m_activeSource; 92 94 }; 93 95
Note:
See TracChangeset
for help on using the changeset viewer.