OLD | NEW |
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 27 matching lines...) Expand all Loading... |
38 class CSSSegmentedFontFace; | 38 class CSSSegmentedFontFace; |
39 class FontDescription; | 39 class FontDescription; |
40 class StyleRuleFontFace; | 40 class StyleRuleFontFace; |
41 | 41 |
42 class CSSSegmentedFontFaceCache { | 42 class CSSSegmentedFontFaceCache { |
43 public: | 43 public: |
44 CSSSegmentedFontFaceCache(); | 44 CSSSegmentedFontFaceCache(); |
45 | 45 |
46 // FIXME: Remove CSSFontSelector as argument. Passing CSSFontSelector here i
s | 46 // FIXME: Remove CSSFontSelector as argument. Passing CSSFontSelector here i
s |
47 // a result of egregious spaghettification in CSSFontFace/FontFaceSet. | 47 // a result of egregious spaghettification in CSSFontFace/FontFaceSet. |
48 void addFontFaceRule(CSSFontSelector*, const StyleRuleFontFace*); | 48 void add(CSSFontSelector*, const StyleRuleFontFace*, PassRefPtr<CSSFontFace>
); |
49 void removeFontFaceRule(const StyleRuleFontFace*); | 49 void remove(const StyleRuleFontFace*); |
50 CSSSegmentedFontFace* getFontFace(const FontDescription&, const AtomicString
& family); | 50 // FIXME: It's sort of weird that add/remove uses StyleRuleFontFace* as key, |
| 51 // but this function uses FontDescription/family pair. |
| 52 CSSSegmentedFontFace* get(const FontDescription&, const AtomicString& family
); |
51 | 53 |
52 unsigned version() const { return m_version; } | 54 unsigned version() const { return m_version; } |
53 | 55 |
54 private: | 56 private: |
55 typedef HashMap<unsigned, RefPtr<CSSSegmentedFontFace> > TraitsMap; | 57 typedef HashMap<unsigned, RefPtr<CSSSegmentedFontFace> > TraitsMap; |
56 typedef HashMap<String, OwnPtr<TraitsMap>, CaseFoldingHash> FamilyToTraitsMa
p; | 58 typedef HashMap<String, OwnPtr<TraitsMap>, CaseFoldingHash> FamilyToTraitsMa
p; |
57 typedef HashMap<const StyleRuleFontFace*, RefPtr<CSSFontFace> > StyleRuleToF
ontFace; | 59 typedef HashMap<const StyleRuleFontFace*, RefPtr<CSSFontFace> > StyleRuleToF
ontFace; |
58 FamilyToTraitsMap m_fontFaces; | 60 FamilyToTraitsMap m_fontFaces; |
59 FamilyToTraitsMap m_fonts; | 61 FamilyToTraitsMap m_fonts; |
60 StyleRuleToFontFace m_styleRuleToFontFace; | 62 StyleRuleToFontFace m_styleRuleToFontFace; |
61 | 63 |
62 // FIXME: See if this could be ditched | 64 // FIXME: See if this could be ditched |
63 // Used to compare Font instances, and the usage seems suspect. | 65 // Used to compare Font instances, and the usage seems suspect. |
64 unsigned m_version; | 66 unsigned m_version; |
65 }; | 67 }; |
66 | 68 |
67 } | 69 } |
68 | 70 |
69 #endif | 71 #endif |
OLD | NEW |