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

Side by Side Diff: Source/core/css/FontFaceCache.h

Issue 82583005: Use removeFontFace to avoid resetting fontSelector. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Patch for landing 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/core/css/CSSFontSelector.cpp ('k') | Source/core/css/FontFaceCache.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) 2007, 2008, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008, 2011 Apple Inc. All rights reserved.
3 * Copyright (C) 2013 Google Inc. All rights reserved. 3 * Copyright (C) 2013 Google 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 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 30 matching lines...) Expand all
41 class StyleRuleFontFace; 41 class StyleRuleFontFace;
42 42
43 class FontFaceCache { 43 class FontFaceCache {
44 public: 44 public:
45 FontFaceCache(); 45 FontFaceCache();
46 46
47 // FIXME: Remove CSSFontSelector as argument. Passing CSSFontSelector here i s 47 // FIXME: Remove CSSFontSelector as argument. Passing CSSFontSelector here i s
48 // a result of egregious spaghettification in FontFace/FontFaceSet. 48 // a result of egregious spaghettification in FontFace/FontFaceSet.
49 void add(CSSFontSelector*, const StyleRuleFontFace*, PassRefPtr<FontFace>); 49 void add(CSSFontSelector*, const StyleRuleFontFace*, PassRefPtr<FontFace>);
50 void remove(const StyleRuleFontFace*); 50 void remove(const StyleRuleFontFace*);
51 void clear();
51 void addFontFace(CSSFontSelector*, PassRefPtr<FontFace>, bool cssConnected); 52 void addFontFace(CSSFontSelector*, PassRefPtr<FontFace>, bool cssConnected);
52 void removeFontFace(FontFace*, bool cssConnected); 53 void removeFontFace(FontFace*, bool cssConnected);
53 54
54 // FIXME: It's sort of weird that add/remove uses StyleRuleFontFace* as key, 55 // FIXME: It's sort of weird that add/remove uses StyleRuleFontFace* as key,
55 // but this function uses FontDescription/family pair. 56 // but this function uses FontDescription/family pair.
56 CSSSegmentedFontFace* get(const FontDescription&, const AtomicString& family ); 57 CSSSegmentedFontFace* get(const FontDescription&, const AtomicString& family );
57 58
58 const ListHashSet<RefPtr<FontFace> >& cssConnectedFontFaces() const { return m_cssConnectedFontFaces; } 59 const ListHashSet<RefPtr<FontFace> >& cssConnectedFontFaces() const { return m_cssConnectedFontFaces; }
59 60
60 unsigned version() const { return m_version; } 61 unsigned version() const { return m_version; }
61 62
62 private: 63 private:
63 typedef HashMap<unsigned, RefPtr<CSSSegmentedFontFace> > TraitsMap; 64 typedef HashMap<unsigned, RefPtr<CSSSegmentedFontFace> > TraitsMap;
64 typedef HashMap<String, OwnPtr<TraitsMap>, CaseFoldingHash> FamilyToTraitsMa p; 65 typedef HashMap<String, OwnPtr<TraitsMap>, CaseFoldingHash> FamilyToTraitsMa p;
65 typedef HashMap<const StyleRuleFontFace*, RefPtr<FontFace> > StyleRuleToFont Face; 66 typedef HashMap<const StyleRuleFontFace*, RefPtr<FontFace> > StyleRuleToFont Face;
66 FamilyToTraitsMap m_fontFaces; 67 FamilyToTraitsMap m_fontFaces;
67 FamilyToTraitsMap m_fonts; 68 FamilyToTraitsMap m_fonts;
68 StyleRuleToFontFace m_styleRuleToFontFace; 69 StyleRuleToFontFace m_styleRuleToFontFace;
69 ListHashSet<RefPtr<FontFace> > m_cssConnectedFontFaces; 70 ListHashSet<RefPtr<FontFace> > m_cssConnectedFontFaces;
70 71
71 // FIXME: See if this could be ditched 72 // FIXME: See if this could be ditched
72 // Used to compare Font instances, and the usage seems suspect. 73 // Used to compare Font instances, and the usage seems suspect.
73 unsigned m_version; 74 unsigned m_version;
74 }; 75 };
75 76
76 } 77 }
77 78
78 #endif 79 #endif
OLDNEW
« no previous file with comments | « Source/core/css/CSSFontSelector.cpp ('k') | Source/core/css/FontFaceCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698