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

Side by Side Diff: Source/core/testing/InternalSettings.cpp

Issue 82583005: Use removeFontFace to avoid resetting fontSelector. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix fast/text/international/ regression 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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2013 Apple Inc. All rights reserved. 3 * Copyright (C) 2013 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 settings()->setLayerSquashingEnabled(enabled); 223 settings()->setLayerSquashingEnabled(enabled);
224 } 224 }
225 225
226 void InternalSettings::setStandardFontFamily(const AtomicString& family, const S tring& script, ExceptionState& exceptionState) 226 void InternalSettings::setStandardFontFamily(const AtomicString& family, const S tring& script, ExceptionState& exceptionState)
227 { 227 {
228 InternalSettingsGuardForSettings(); 228 InternalSettingsGuardForSettings();
229 UScriptCode code = scriptNameToCode(script); 229 UScriptCode code = scriptNameToCode(script);
230 if (code == USCRIPT_INVALID_CODE) 230 if (code == USCRIPT_INVALID_CODE)
231 return; 231 return;
232 settings()->genericFontFamilySettings().setStandard(family, code); 232 settings()->genericFontFamilySettings().setStandard(family, code);
233 settings()->notifyGenericFontFamilyChange();
dglazkov 2014/01/29 05:11:50 Here, we just need a helper that recursively visit
233 m_page->setNeedsRecalcStyleInAllFrames(); 234 m_page->setNeedsRecalcStyleInAllFrames();
234 } 235 }
235 236
236 void InternalSettings::setSerifFontFamily(const AtomicString& family, const Stri ng& script, ExceptionState& exceptionState) 237 void InternalSettings::setSerifFontFamily(const AtomicString& family, const Stri ng& script, ExceptionState& exceptionState)
237 { 238 {
238 InternalSettingsGuardForSettings(); 239 InternalSettingsGuardForSettings();
239 UScriptCode code = scriptNameToCode(script); 240 UScriptCode code = scriptNameToCode(script);
240 if (code == USCRIPT_INVALID_CODE) 241 if (code == USCRIPT_INVALID_CODE)
241 return; 242 return;
242 settings()->genericFontFamilySettings().setSerif(family, code); 243 settings()->genericFontFamilySettings().setSerif(family, code);
244 settings()->notifyGenericFontFamilyChange();
243 m_page->setNeedsRecalcStyleInAllFrames(); 245 m_page->setNeedsRecalcStyleInAllFrames();
244 } 246 }
245 247
246 void InternalSettings::setSansSerifFontFamily(const AtomicString& family, const String& script, ExceptionState& exceptionState) 248 void InternalSettings::setSansSerifFontFamily(const AtomicString& family, const String& script, ExceptionState& exceptionState)
247 { 249 {
248 InternalSettingsGuardForSettings(); 250 InternalSettingsGuardForSettings();
249 UScriptCode code = scriptNameToCode(script); 251 UScriptCode code = scriptNameToCode(script);
250 if (code == USCRIPT_INVALID_CODE) 252 if (code == USCRIPT_INVALID_CODE)
251 return; 253 return;
252 settings()->genericFontFamilySettings().setSansSerif(family, code); 254 settings()->genericFontFamilySettings().setSansSerif(family, code);
255 settings()->notifyGenericFontFamilyChange();
253 m_page->setNeedsRecalcStyleInAllFrames(); 256 m_page->setNeedsRecalcStyleInAllFrames();
254 } 257 }
255 258
256 void InternalSettings::setFixedFontFamily(const AtomicString& family, const Stri ng& script, ExceptionState& exceptionState) 259 void InternalSettings::setFixedFontFamily(const AtomicString& family, const Stri ng& script, ExceptionState& exceptionState)
257 { 260 {
258 InternalSettingsGuardForSettings(); 261 InternalSettingsGuardForSettings();
259 UScriptCode code = scriptNameToCode(script); 262 UScriptCode code = scriptNameToCode(script);
260 if (code == USCRIPT_INVALID_CODE) 263 if (code == USCRIPT_INVALID_CODE)
261 return; 264 return;
262 settings()->genericFontFamilySettings().setFixed(family, code); 265 settings()->genericFontFamilySettings().setFixed(family, code);
266 settings()->notifyGenericFontFamilyChange();
263 m_page->setNeedsRecalcStyleInAllFrames(); 267 m_page->setNeedsRecalcStyleInAllFrames();
264 } 268 }
265 269
266 void InternalSettings::setCursiveFontFamily(const AtomicString& family, const St ring& script, ExceptionState& exceptionState) 270 void InternalSettings::setCursiveFontFamily(const AtomicString& family, const St ring& script, ExceptionState& exceptionState)
267 { 271 {
268 InternalSettingsGuardForSettings(); 272 InternalSettingsGuardForSettings();
269 UScriptCode code = scriptNameToCode(script); 273 UScriptCode code = scriptNameToCode(script);
270 if (code == USCRIPT_INVALID_CODE) 274 if (code == USCRIPT_INVALID_CODE)
271 return; 275 return;
272 settings()->genericFontFamilySettings().setCursive(family, code); 276 settings()->genericFontFamilySettings().setCursive(family, code);
277 settings()->notifyGenericFontFamilyChange();
273 m_page->setNeedsRecalcStyleInAllFrames(); 278 m_page->setNeedsRecalcStyleInAllFrames();
274 } 279 }
275 280
276 void InternalSettings::setFantasyFontFamily(const AtomicString& family, const St ring& script, ExceptionState& exceptionState) 281 void InternalSettings::setFantasyFontFamily(const AtomicString& family, const St ring& script, ExceptionState& exceptionState)
277 { 282 {
278 InternalSettingsGuardForSettings(); 283 InternalSettingsGuardForSettings();
279 UScriptCode code = scriptNameToCode(script); 284 UScriptCode code = scriptNameToCode(script);
280 if (code == USCRIPT_INVALID_CODE) 285 if (code == USCRIPT_INVALID_CODE)
281 return; 286 return;
282 settings()->genericFontFamilySettings().setFantasy(family, code); 287 settings()->genericFontFamilySettings().setFantasy(family, code);
288 settings()->notifyGenericFontFamilyChange();
283 m_page->setNeedsRecalcStyleInAllFrames(); 289 m_page->setNeedsRecalcStyleInAllFrames();
284 } 290 }
285 291
286 void InternalSettings::setPictographFontFamily(const AtomicString& family, const String& script, ExceptionState& exceptionState) 292 void InternalSettings::setPictographFontFamily(const AtomicString& family, const String& script, ExceptionState& exceptionState)
287 { 293 {
288 InternalSettingsGuardForSettings(); 294 InternalSettingsGuardForSettings();
289 UScriptCode code = scriptNameToCode(script); 295 UScriptCode code = scriptNameToCode(script);
290 if (code == USCRIPT_INVALID_CODE) 296 if (code == USCRIPT_INVALID_CODE)
291 return; 297 return;
292 settings()->genericFontFamilySettings().setPictograph(family, code); 298 settings()->genericFontFamilySettings().setPictograph(family, code);
299 settings()->notifyGenericFontFamilyChange();
293 m_page->setNeedsRecalcStyleInAllFrames(); 300 m_page->setNeedsRecalcStyleInAllFrames();
294 } 301 }
295 302
296 void InternalSettings::setTextAutosizingEnabled(bool enabled, ExceptionState& ex ceptionState) 303 void InternalSettings::setTextAutosizingEnabled(bool enabled, ExceptionState& ex ceptionState)
297 { 304 {
298 InternalSettingsGuardForSettings(); 305 InternalSettingsGuardForSettings();
299 settings()->setTextAutosizingEnabled(enabled); 306 settings()->setTextAutosizingEnabled(enabled);
300 } 307 }
301 308
302 void InternalSettings::setTextAutosizingWindowSizeOverride(int width, int height , ExceptionState& exceptionState) 309 void InternalSettings::setTextAutosizingWindowSizeOverride(int width, int height , ExceptionState& exceptionState)
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 settings()->setDefaultVideoPosterURL(url); 361 settings()->setDefaultVideoPosterURL(url);
355 } 362 }
356 363
357 void InternalSettings::setPasswordGenerationDecorationEnabled(bool enabled, Exce ptionState& exceptionState) 364 void InternalSettings::setPasswordGenerationDecorationEnabled(bool enabled, Exce ptionState& exceptionState)
358 { 365 {
359 InternalSettingsGuardForSettings(); 366 InternalSettingsGuardForSettings();
360 settings()->setPasswordGenerationDecorationEnabled(enabled); 367 settings()->setPasswordGenerationDecorationEnabled(enabled);
361 } 368 }
362 369
363 } 370 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698