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

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

Issue 157853002: Revert of Use removeFontFace to avoid resetting fontSelector. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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
« no previous file with comments | « Source/platform/fonts/GenericFontFamilySettings.h ('k') | Source/web/WebSettingsImpl.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
59 // 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.
60 void GenericFontFamilySettings::setGenericFontFamilyMap(ScriptFontFamilyMap& fon tMap, const AtomicString& family, UScriptCode script) 48 void GenericFontFamilySettings::setGenericFontFamilyMap(ScriptFontFamilyMap& fon tMap, const AtomicString& family, UScriptCode script)
61 { 49 {
62 ScriptFontFamilyMap::iterator it = fontMap.find(static_cast<int>(script)); 50 ScriptFontFamilyMap::iterator it = fontMap.find(static_cast<int>(script));
63 if (family.isEmpty()) { 51 if (family.isEmpty()) {
64 if (it == fontMap.end()) 52 if (it == fontMap.end())
65 return; 53 return;
66 fontMap.remove(it); 54 fontMap.remove(it);
67 } else if (it != fontMap.end() && it->value == family) { 55 } else if (it != fontMap.end() && it->value == family) {
68 return; 56 return;
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 m_standardFontFamilyMap.clear(); 144 m_standardFontFamilyMap.clear();
157 m_serifFontFamilyMap.clear(); 145 m_serifFontFamilyMap.clear();
158 m_fixedFontFamilyMap.clear(); 146 m_fixedFontFamilyMap.clear();
159 m_sansSerifFontFamilyMap.clear(); 147 m_sansSerifFontFamilyMap.clear();
160 m_cursiveFontFamilyMap.clear(); 148 m_cursiveFontFamilyMap.clear();
161 m_fantasyFontFamilyMap.clear(); 149 m_fantasyFontFamilyMap.clear();
162 m_pictographFontFamilyMap.clear(); 150 m_pictographFontFamilyMap.clear();
163 } 151 }
164 152
165 } 153 }
OLDNEW
« no previous file with comments | « Source/platform/fonts/GenericFontFamilySettings.h ('k') | Source/web/WebSettingsImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698