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

Side by Side Diff: Source/core/css/CSSSegmentedFontFaceCache.cpp

Issue 85053002: Increment CSSSegmentedFontFaceCache version when removing FontFaceRule (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years 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 | « no previous file | no next file » | 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 RefPtr<CSSSegmentedFontFace> segmentedFontFace = familyFontFacesIter->value; 96 RefPtr<CSSSegmentedFontFace> segmentedFontFace = familyFontFacesIter->value;
97 97
98 segmentedFontFace->removeFontFace(cssFontFace); 98 segmentedFontFace->removeFontFace(cssFontFace);
99 if (segmentedFontFace->isEmpty()) { 99 if (segmentedFontFace->isEmpty()) {
100 familyFontFaces->remove(familyFontFacesIter); 100 familyFontFaces->remove(familyFontFacesIter);
101 if (familyFontFaces->isEmpty()) 101 if (familyFontFaces->isEmpty())
102 m_fontFaces.remove(fontFacesIter); 102 m_fontFaces.remove(fontFacesIter);
103 } 103 }
104 m_styleRuleToFontFace.remove(styleRuleToFontFaceIter); 104 m_styleRuleToFontFace.remove(styleRuleToFontFaceIter);
105 m_fonts.clear(); 105 m_fonts.clear();
106 ++m_version;
106 } 107 }
107 108
108 static inline bool compareFontFaces(CSSSegmentedFontFace* first, CSSSegmentedFon tFace* second, FontTraitsMask desiredTraitsMask) 109 static inline bool compareFontFaces(CSSSegmentedFontFace* first, CSSSegmentedFon tFace* second, FontTraitsMask desiredTraitsMask)
109 { 110 {
110 FontTraitsMask firstTraitsMask = first->traitsMask(); 111 FontTraitsMask firstTraitsMask = first->traitsMask();
111 FontTraitsMask secondTraitsMask = second->traitsMask(); 112 FontTraitsMask secondTraitsMask = second->traitsMask();
112 113
113 bool firstHasDesiredVariant = firstTraitsMask & desiredTraitsMask & FontVari antMask; 114 bool firstHasDesiredVariant = firstTraitsMask & desiredTraitsMask & FontVari antMask;
114 bool secondHasDesiredVariant = secondTraitsMask & desiredTraitsMask & FontVa riantMask; 115 bool secondHasDesiredVariant = secondTraitsMask & desiredTraitsMask & FontVa riantMask;
115 116
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 if ((traitsMask & FontVariantNormalMask) && !(candidateTraitsMask & FontVariantNormalMask)) 208 if ((traitsMask & FontVariantNormalMask) && !(candidateTraitsMask & FontVariantNormalMask))
208 continue; 209 continue;
209 if (!face || compareFontFaces(candidate, face.get(), traitsMask)) 210 if (!face || compareFontFaces(candidate, face.get(), traitsMask))
210 face = candidate; 211 face = candidate;
211 } 212 }
212 } 213 }
213 return face.get(); 214 return face.get();
214 } 215 }
215 216
216 } 217 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698