Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(151)

Side by Side Diff: Source/platform/fonts/GenericFontFamilySettings.cpp

Issue 93783005: Store a copy of generic font settings at CSSFontSelector. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 15 matching lines...) Expand all
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #include "config.h" 31 #include "config.h"
32 #include "platform/fonts/GenericFontFamilySettings.h" 32 #include "platform/fonts/GenericFontFamilySettings.h"
33 33
34 namespace WebCore { 34 namespace WebCore {
35 35
36 GenericFontFamilySettings::GenericFontFamilySettings(const GenericFontFamilySett ings& other)
37 : m_standardFontFamilyMap(other.m_standardFontFamilyMap)
38 , m_serifFontFamilyMap(other.m_serifFontFamilyMap)
39 , m_fixedFontFamilyMap(other.m_fixedFontFamilyMap)
40 , m_sansSerifFontFamilyMap(other.m_sansSerifFontFamilyMap)
41 , m_cursiveFontFamilyMap(other.m_cursiveFontFamilyMap)
42 , m_fantasyFontFamilyMap(other.m_fantasyFontFamilyMap)
43 , m_pictographFontFamilyMap(other.m_pictographFontFamilyMap)
44 {
45 }
46
36 // Sets the entry in the font map for the given script. If family is the empty s tring, removes the entry instead. 47 // Sets the entry in the font map for the given script. If family is the empty s tring, removes the entry instead.
37 void GenericFontFamilySettings::setGenericFontFamilyMap(ScriptFontFamilyMap& fon tMap, const AtomicString& family, UScriptCode script) 48 void GenericFontFamilySettings::setGenericFontFamilyMap(ScriptFontFamilyMap& fon tMap, const AtomicString& family, UScriptCode script)
38 { 49 {
39 ScriptFontFamilyMap::iterator it = fontMap.find(static_cast<int>(script)); 50 ScriptFontFamilyMap::iterator it = fontMap.find(static_cast<int>(script));
40 if (family.isEmpty()) { 51 if (family.isEmpty()) {
41 if (it == fontMap.end()) 52 if (it == fontMap.end())
42 return; 53 return;
43 fontMap.remove(it); 54 fontMap.remove(it);
44 } else if (it != fontMap.end() && it->value == family) { 55 } else if (it != fontMap.end() && it->value == family) {
45 return; 56 return;
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 m_standardFontFamilyMap.clear(); 144 m_standardFontFamilyMap.clear();
134 m_serifFontFamilyMap.clear(); 145 m_serifFontFamilyMap.clear();
135 m_fixedFontFamilyMap.clear(); 146 m_fixedFontFamilyMap.clear();
136 m_sansSerifFontFamilyMap.clear(); 147 m_sansSerifFontFamilyMap.clear();
137 m_cursiveFontFamilyMap.clear(); 148 m_cursiveFontFamilyMap.clear();
138 m_fantasyFontFamilyMap.clear(); 149 m_fantasyFontFamilyMap.clear();
139 m_pictographFontFamilyMap.clear(); 150 m_pictographFontFamilyMap.clear();
140 } 151 }
141 152
142 } 153 }
OLDNEW
« Source/core/css/CSSFontSelector.h ('K') | « Source/platform/fonts/GenericFontFamilySettings.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698