| 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 30 matching lines...) Expand all Loading... |
| 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(); | |
| 52 void addFontFace(CSSFontSelector*, PassRefPtr<FontFace>, bool cssConnected); | 51 void addFontFace(CSSFontSelector*, PassRefPtr<FontFace>, bool cssConnected); |
| 53 void removeFontFace(FontFace*, bool cssConnected); | 52 void removeFontFace(FontFace*, bool cssConnected); |
| 54 | 53 |
| 55 // FIXME: It's sort of weird that add/remove uses StyleRuleFontFace* as key, | 54 // FIXME: It's sort of weird that add/remove uses StyleRuleFontFace* as key, |
| 56 // but this function uses FontDescription/family pair. | 55 // but this function uses FontDescription/family pair. |
| 57 CSSSegmentedFontFace* get(const FontDescription&, const AtomicString& family
); | 56 CSSSegmentedFontFace* get(const FontDescription&, const AtomicString& family
); |
| 58 | 57 |
| 59 const ListHashSet<RefPtr<FontFace> >& cssConnectedFontFaces() const { return
m_cssConnectedFontFaces; } | 58 const ListHashSet<RefPtr<FontFace> >& cssConnectedFontFaces() const { return
m_cssConnectedFontFaces; } |
| 60 | 59 |
| 61 unsigned version() const { return m_version; } | 60 unsigned version() const { return m_version; } |
| 62 | 61 |
| 63 private: | 62 private: |
| 64 typedef HashMap<unsigned, RefPtr<CSSSegmentedFontFace> > TraitsMap; | 63 typedef HashMap<unsigned, RefPtr<CSSSegmentedFontFace> > TraitsMap; |
| 65 typedef HashMap<String, OwnPtr<TraitsMap>, CaseFoldingHash> FamilyToTraitsMa
p; | 64 typedef HashMap<String, OwnPtr<TraitsMap>, CaseFoldingHash> FamilyToTraitsMa
p; |
| 66 typedef HashMap<const StyleRuleFontFace*, RefPtr<FontFace> > StyleRuleToFont
Face; | 65 typedef HashMap<const StyleRuleFontFace*, RefPtr<FontFace> > StyleRuleToFont
Face; |
| 67 FamilyToTraitsMap m_fontFaces; | 66 FamilyToTraitsMap m_fontFaces; |
| 68 FamilyToTraitsMap m_fonts; | 67 FamilyToTraitsMap m_fonts; |
| 69 StyleRuleToFontFace m_styleRuleToFontFace; | 68 StyleRuleToFontFace m_styleRuleToFontFace; |
| 70 ListHashSet<RefPtr<FontFace> > m_cssConnectedFontFaces; | 69 ListHashSet<RefPtr<FontFace> > m_cssConnectedFontFaces; |
| 71 | 70 |
| 72 // FIXME: See if this could be ditched | 71 // FIXME: See if this could be ditched |
| 73 // Used to compare Font instances, and the usage seems suspect. | 72 // Used to compare Font instances, and the usage seems suspect. |
| 74 unsigned m_version; | 73 unsigned m_version; |
| 75 }; | 74 }; |
| 76 | 75 |
| 77 } | 76 } |
| 78 | 77 |
| 79 #endif | 78 #endif |
| OLD | NEW |