| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 ASSERT(!faceFontData->isSegmented()); | 126 ASSERT(!faceFontData->isSegmented()); |
| 127 fontData->appendFace(FontDataForRangeSet(faceFontData.release(), (*i
t)->cssFontFace()->ranges())); | 127 fontData->appendFace(FontDataForRangeSet(faceFontData.release(), (*i
t)->cssFontFace()->ranges())); |
| 128 } | 128 } |
| 129 } | 129 } |
| 130 if (fontData->numFaces()) | 130 if (fontData->numFaces()) |
| 131 return fontData; // No release, we have a reference to an object in the
cache which should retain the ref count it has. | 131 return fontData; // No release, we have a reference to an object in the
cache which should retain the ref count it has. |
| 132 | 132 |
| 133 return nullptr; | 133 return nullptr; |
| 134 } | 134 } |
| 135 | 135 |
| 136 void CSSSegmentedFontFace::willUseFontData(const FontDescription& fontDescriptio
n, UChar32 character) | 136 void CSSSegmentedFontFace::willUseFontData(const FontDescription& fontDescriptio
n, const String& text) |
| 137 { | 137 { |
| 138 for (FontFaceList::reverse_iterator it = m_fontFaces.rbegin(); it != m_fontF
aces.rend(); ++it) { | 138 for (FontFaceList::reverse_iterator it = m_fontFaces.rbegin(); it != m_fontF
aces.rend(); ++it) { |
| 139 if ((*it)->loadStatus() != FontFace::Unloaded) | 139 if ((*it)->willUseFontData(fontDescription, text)) |
| 140 break; | |
| 141 if ((*it)->cssFontFace()->maybeScheduleFontLoad(fontDescription, charact
er)) | |
| 142 break; | 140 break; |
| 143 } | 141 } |
| 144 } | 142 } |
| 145 | 143 |
| 146 void CSSSegmentedFontFace::willUseRange(const blink::FontDescription& fontDescri
ption, const blink::FontDataForRangeSet& rangeSet) | 144 void CSSSegmentedFontFace::willUseRange(const blink::FontDescription& fontDescri
ption, const blink::FontDataForRangeSet& rangeSet) |
| 147 { | 145 { |
| 148 // Iterating backwards since later defined unicode-range faces override | 146 // Iterating backwards since later defined unicode-range faces override |
| 149 // previously defined ones, according to the CSS3 fonts module. | 147 // previously defined ones, according to the CSS3 fonts module. |
| 150 // https://drafts.csswg.org/css-fonts/#composite-fonts | 148 // https://drafts.csswg.org/css-fonts/#composite-fonts |
| 151 for (FontFaceList::reverse_iterator it = m_fontFaces.rbegin(); it != m_fontF
aces.rend(); ++it) { | 149 for (FontFaceList::reverse_iterator it = m_fontFaces.rbegin(); it != m_fontF
aces.rend(); ++it) { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 172 } | 170 } |
| 173 } | 171 } |
| 174 | 172 |
| 175 DEFINE_TRACE(CSSSegmentedFontFace) | 173 DEFINE_TRACE(CSSSegmentedFontFace) |
| 176 { | 174 { |
| 177 visitor->trace(m_fontSelector); | 175 visitor->trace(m_fontSelector); |
| 178 visitor->trace(m_fontFaces); | 176 visitor->trace(m_fontFaces); |
| 179 } | 177 } |
| 180 | 178 |
| 181 } // namespace blink | 179 } // namespace blink |
| OLD | NEW |