| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 bool operator<(UChar32 c) const { return m_to < c; } | 90 bool operator<(UChar32 c) const { return m_to < c; } |
| 91 | 91 |
| 92 private: | 92 private: |
| 93 UChar32 m_from; | 93 UChar32 m_from; |
| 94 UChar32 m_to; | 94 UChar32 m_to; |
| 95 }; | 95 }; |
| 96 | 96 |
| 97 class UnicodeRangeSet { | 97 class UnicodeRangeSet { |
| 98 public: | 98 public: |
| 99 explicit UnicodeRangeSet(const Vector<UnicodeRange>&); | 99 explicit UnicodeRangeSet(const Vector<UnicodeRange>&); |
| 100 bool contains(UChar32) const; |
| 100 bool intersectsWith(const String&) const; | 101 bool intersectsWith(const String&) const; |
| 101 bool isEntireRange() const { return m_ranges.isEmpty(); } | 102 bool isEntireRange() const { return m_ranges.isEmpty(); } |
| 102 size_t size() const { return m_ranges.size(); } | 103 size_t size() const { return m_ranges.size(); } |
| 103 const UnicodeRange& rangeAt(size_t i) const { return m_ranges[i]; } | 104 const UnicodeRange& rangeAt(size_t i) const { return m_ranges[i]; } |
| 104 private: | 105 private: |
| 105 Vector<UnicodeRange> m_ranges; // If empty, represents the whole code sp
ace. | 106 Vector<UnicodeRange> m_ranges; // If empty, represents the whole code sp
ace. |
| 106 }; | 107 }; |
| 107 | 108 |
| 108 FontFace::LoadStatus loadStatus() const { return m_fontFace->loadStatus(); } | 109 FontFace::LoadStatus loadStatus() const { return m_fontFace->loadStatus(); } |
| 109 void willUseFontData(const FontDescription&); | 110 bool maybeScheduleFontLoad(const FontDescription&, UChar32); |
| 110 void load(const FontDescription&, CSSFontSelector* = 0); | 111 void load(const FontDescription&, CSSFontSelector* = 0); |
| 111 | 112 |
| 112 bool hadBlankText() { return isValid() && m_sources.first()->hadBlankText();
} | 113 bool hadBlankText() { return isValid() && m_sources.first()->hadBlankText();
} |
| 113 | 114 |
| 114 void trace(Visitor*); | 115 void trace(Visitor*); |
| 115 | 116 |
| 116 private: | 117 private: |
| 117 void setLoadStatus(FontFace::LoadStatus); | 118 void setLoadStatus(FontFace::LoadStatus); |
| 118 | 119 |
| 119 UnicodeRangeSet m_ranges; | 120 UnicodeRangeSet m_ranges; |
| 120 RawPtrWillBeMember<CSSSegmentedFontFace> m_segmentedFontFace; | 121 RawPtrWillBeMember<CSSSegmentedFontFace> m_segmentedFontFace; |
| 121 Deque<OwnPtr<CSSFontFaceSource> > m_sources; | 122 Deque<OwnPtr<CSSFontFaceSource> > m_sources; |
| 122 RawPtrWillBeMember<FontFace> m_fontFace; | 123 RawPtrWillBeMember<FontFace> m_fontFace; |
| 123 }; | 124 }; |
| 124 | 125 |
| 125 } | 126 } |
| 126 | 127 |
| 127 #endif | 128 #endif |
| OLD | NEW |