OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 return true; | 69 return true; |
70 } | 70 } |
71 return false; | 71 return false; |
72 } | 72 } |
73 | 73 |
74 void CSSSegmentedFontFace::fontFaceInvalidated() | 74 void CSSSegmentedFontFace::fontFaceInvalidated() |
75 { | 75 { |
76 pruneTable(); | 76 pruneTable(); |
77 } | 77 } |
78 | 78 |
79 void CSSSegmentedFontFace::addFontFace(RawPtr<FontFace> prpFontFace, bool cssCon
nected) | 79 void CSSSegmentedFontFace::addFontFace(FontFace* fontFace, bool cssConnected) |
80 { | 80 { |
81 RawPtr<FontFace> fontFace = prpFontFace; | |
82 pruneTable(); | 81 pruneTable(); |
83 fontFace->cssFontFace()->setSegmentedFontFace(this); | 82 fontFace->cssFontFace()->setSegmentedFontFace(this); |
84 if (cssConnected) { | 83 if (cssConnected) { |
85 m_fontFaces.insertBefore(m_firstNonCssConnectedFace, fontFace); | 84 m_fontFaces.insertBefore(m_firstNonCssConnectedFace, fontFace); |
86 } else { | 85 } else { |
87 // This is the only place in Blink that is using addReturnIterator. | 86 // This is the only place in Blink that is using addReturnIterator. |
88 FontFaceList::iterator iterator = m_fontFaces.addReturnIterator(fontFace
); | 87 FontFaceList::iterator iterator = m_fontFaces.addReturnIterator(fontFace
); |
89 if (m_firstNonCssConnectedFace == m_fontFaces.end()) | 88 if (m_firstNonCssConnectedFace == m_fontFaces.end()) |
90 m_firstNonCssConnectedFace = iterator; | 89 m_firstNonCssConnectedFace = iterator; |
91 } | 90 } |
92 } | 91 } |
93 | 92 |
94 void CSSSegmentedFontFace::removeFontFace(RawPtr<FontFace> prpFontFace) | 93 void CSSSegmentedFontFace::removeFontFace(FontFace* fontFace) |
95 { | 94 { |
96 RawPtr<FontFace> fontFace = prpFontFace; | |
97 FontFaceList::iterator it = m_fontFaces.find(fontFace); | 95 FontFaceList::iterator it = m_fontFaces.find(fontFace); |
98 if (it == m_fontFaces.end()) | 96 if (it == m_fontFaces.end()) |
99 return; | 97 return; |
100 | 98 |
101 if (it == m_firstNonCssConnectedFace) | 99 if (it == m_firstNonCssConnectedFace) |
102 ++m_firstNonCssConnectedFace; | 100 ++m_firstNonCssConnectedFace; |
103 m_fontFaces.remove(it); | 101 m_fontFaces.remove(it); |
104 | 102 |
105 pruneTable(); | 103 pruneTable(); |
106 fontFace->cssFontFace()->clearSegmentedFontFace(); | 104 fontFace->cssFontFace()->clearSegmentedFontFace(); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 } | 177 } |
180 } | 178 } |
181 | 179 |
182 DEFINE_TRACE(CSSSegmentedFontFace) | 180 DEFINE_TRACE(CSSSegmentedFontFace) |
183 { | 181 { |
184 visitor->trace(m_fontSelector); | 182 visitor->trace(m_fontSelector); |
185 visitor->trace(m_fontFaces); | 183 visitor->trace(m_fontFaces); |
186 } | 184 } |
187 | 185 |
188 } // namespace blink | 186 } // namespace blink |
OLD | NEW |