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

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

Issue 82583005: Use removeFontFace to avoid resetting fontSelector. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed TextAutosizing Created 6 years, 10 months 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 26 matching lines...) Expand all
37 : m_standardFontFamilyMap(other.m_standardFontFamilyMap) 37 : m_standardFontFamilyMap(other.m_standardFontFamilyMap)
38 , m_serifFontFamilyMap(other.m_serifFontFamilyMap) 38 , m_serifFontFamilyMap(other.m_serifFontFamilyMap)
39 , m_fixedFontFamilyMap(other.m_fixedFontFamilyMap) 39 , m_fixedFontFamilyMap(other.m_fixedFontFamilyMap)
40 , m_sansSerifFontFamilyMap(other.m_sansSerifFontFamilyMap) 40 , m_sansSerifFontFamilyMap(other.m_sansSerifFontFamilyMap)
41 , m_cursiveFontFamilyMap(other.m_cursiveFontFamilyMap) 41 , m_cursiveFontFamilyMap(other.m_cursiveFontFamilyMap)
42 , m_fantasyFontFamilyMap(other.m_fantasyFontFamilyMap) 42 , m_fantasyFontFamilyMap(other.m_fantasyFontFamilyMap)
43 , m_pictographFontFamilyMap(other.m_pictographFontFamilyMap) 43 , m_pictographFontFamilyMap(other.m_pictographFontFamilyMap)
44 { 44 {
45 } 45 }
46 46
47 GenericFontFamilySettings& GenericFontFamilySettings::operator=(const GenericFon tFamilySettings& other)
48 {
49 m_standardFontFamilyMap = other.m_standardFontFamilyMap;
50 m_serifFontFamilyMap = other.m_serifFontFamilyMap;
51 m_fixedFontFamilyMap = other.m_fixedFontFamilyMap;
52 m_sansSerifFontFamilyMap = other.m_sansSerifFontFamilyMap;
53 m_cursiveFontFamilyMap = other.m_cursiveFontFamilyMap;
54 m_fantasyFontFamilyMap = other.m_fantasyFontFamilyMap;
55 m_pictographFontFamilyMap = other.m_pictographFontFamilyMap;
56 return *this;
57 }
58
47 // Sets the entry in the font map for the given script. If family is the empty s tring, removes the entry instead. 59 // Sets the entry in the font map for the given script. If family is the empty s tring, removes the entry instead.
48 void GenericFontFamilySettings::setGenericFontFamilyMap(ScriptFontFamilyMap& fon tMap, const AtomicString& family, UScriptCode script) 60 void GenericFontFamilySettings::setGenericFontFamilyMap(ScriptFontFamilyMap& fon tMap, const AtomicString& family, UScriptCode script)
49 { 61 {
50 ScriptFontFamilyMap::iterator it = fontMap.find(static_cast<int>(script)); 62 ScriptFontFamilyMap::iterator it = fontMap.find(static_cast<int>(script));
51 if (family.isEmpty()) { 63 if (family.isEmpty()) {
52 if (it == fontMap.end()) 64 if (it == fontMap.end())
53 return; 65 return;
54 fontMap.remove(it); 66 fontMap.remove(it);
55 } else if (it != fontMap.end() && it->value == family) { 67 } else if (it != fontMap.end() && it->value == family) {
56 return; 68 return;
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 m_standardFontFamilyMap.clear(); 156 m_standardFontFamilyMap.clear();
145 m_serifFontFamilyMap.clear(); 157 m_serifFontFamilyMap.clear();
146 m_fixedFontFamilyMap.clear(); 158 m_fixedFontFamilyMap.clear();
147 m_sansSerifFontFamilyMap.clear(); 159 m_sansSerifFontFamilyMap.clear();
148 m_cursiveFontFamilyMap.clear(); 160 m_cursiveFontFamilyMap.clear();
149 m_fantasyFontFamilyMap.clear(); 161 m_fantasyFontFamilyMap.clear();
150 m_pictographFontFamilyMap.clear(); 162 m_pictographFontFamilyMap.clear();
151 } 163 }
152 164
153 } 165 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698