Changeset 170337 in webkit
- Timestamp:
- Jun 23, 2014 5:29:44 PM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 36 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r170336 r170337 1 2014-06-20 Myles C. Maxfield <mmaxfield@apple.com> 2 3 Use unsigneds instead of ints for indexes into a string in text layout code 4 https://bugs.webkit.org/show_bug.cgi?id=133592 5 6 Reviewed by Zalan Bujtas. 7 8 Migrate much of the text-handling code to use unsigneds for indexes into a string. 9 10 No new tests because there is no behavior change. 11 12 * WebCore.exp.in: 13 * platform/graphics/Font.cpp: 14 (WebCore::Font::drawText): 15 (WebCore::Font::drawEmphasisMarks): 16 (WebCore::Font::adjustSelectionRectForText): 17 (WebCore::computeUnderlineType): 18 * platform/graphics/Font.h: 19 * platform/graphics/FontFastPath.cpp: 20 (WebCore::Font::getGlyphsAndAdvancesForSimpleText): 21 (WebCore::Font::drawSimpleText): 22 (WebCore::Font::drawEmphasisMarksForSimpleText): 23 (WebCore::Font::drawGlyphBuffer): 24 (WebCore::Font::drawEmphasisMarks): 25 (WebCore::Font::adjustSelectionRectForSimpleText): 26 * platform/graphics/GlyphBuffer.h: 27 (WebCore::GlyphBuffer::size): 28 (WebCore::GlyphBuffer::glyphs): 29 (WebCore::GlyphBuffer::advances): 30 (WebCore::GlyphBuffer::fontDataAt): 31 (WebCore::GlyphBuffer::advanceAt): 32 (WebCore::GlyphBuffer::offsetAt): 33 (WebCore::GlyphBuffer::reverse): 34 (WebCore::GlyphBuffer::offsetInString): 35 (WebCore::GlyphBuffer::swap): 36 * platform/graphics/GraphicsContext.cpp: 37 (WebCore::TextRunIterator::atEnd): 38 * platform/graphics/Latin1TextIterator.h: 39 (WebCore::Latin1TextIterator::Latin1TextIterator): 40 (WebCore::Latin1TextIterator::currentCharacter): 41 * platform/graphics/SimpleFontData.h: 42 * platform/graphics/SurrogatePairAwareTextIterator.cpp: 43 (WebCore::SurrogatePairAwareTextIterator::SurrogatePairAwareTextIterator): 44 * platform/graphics/SurrogatePairAwareTextIterator.h: 45 (WebCore::SurrogatePairAwareTextIterator::currentCharacter): 46 * platform/graphics/TextRun.h: 47 (WebCore::TextRun::length): 48 (WebCore::TextRun::charactersLength): 49 * platform/graphics/WidthIterator.cpp: 50 (WebCore::WidthIterator::glyphDataForCharacter): 51 (WebCore::applyFontTransforms): 52 (WebCore::WidthIterator::advanceInternal): 53 (WebCore::WidthIterator::advance): 54 (WebCore::WidthIterator::advanceOneCharacter): 55 * platform/graphics/WidthIterator.h: 56 * platform/graphics/cairo/FontCairo.cpp: 57 (WebCore::Font::drawGlyphs): 58 * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp: 59 (WebCore::Font::drawComplexText): 60 (WebCore::Font::drawEmphasisMarksForComplexText): 61 (WebCore::Font::adjustSelectionRectForComplexText): 62 * platform/graphics/harfbuzz/HarfBuzzShaper.cpp: 63 (WebCore::HarfBuzzShaper::setNormalizedBuffer): 64 * platform/graphics/mac/FontComplexTextMac.cpp: 65 (WebCore::Font::adjustSelectionRectForComplexText): 66 (WebCore::Font::getGlyphsAndAdvancesForComplexText): 67 (WebCore::Font::drawComplexText): 68 (WebCore::Font::drawEmphasisMarksForComplexText): 69 * platform/graphics/mac/FontMac.mm: 70 (WebCore::Font::drawGlyphs): 71 * platform/graphics/win/FontCGWin.cpp: 72 (WebCore::Font::drawGlyphs): 73 * platform/graphics/win/FontWin.cpp: 74 (WebCore::Font::adjustSelectionRectForComplexText): 75 (WebCore::Font::getGlyphsAndAdvancesForComplexText): 76 (WebCore::Font::drawComplexText): 77 (WebCore::Font::drawEmphasisMarksForComplexText): 78 * platform/graphics/wince/FontWinCE.cpp: 79 (WebCore::Font::drawGlyphs): 80 (WebCore::Font::drawComplexText): 81 (WebCore::Font::drawEmphasisMarksForComplexText): 82 (WebCore::Font::selectionRectForComplexText): 83 * rendering/InlineTextBox.cpp: 84 (WebCore::InlineTextBox::isSelected): 85 (WebCore::InlineTextBox::selectionState): 86 (WebCore::adjustCharactersAndLengthForHyphen): 87 (WebCore::InlineTextBox::localSelectionRect): 88 (WebCore::InlineTextBox::paint): 89 (WebCore::InlineTextBox::selectionStartEnd): 90 (WebCore::InlineTextBox::paintSelection): 91 (WebCore::InlineTextBox::paintCompositionBackground): 92 (WebCore::InlineTextBox::paintDocumentMarker): 93 (WebCore::InlineTextBox::paintTextMatchMarker): 94 (WebCore::InlineTextBox::computeRectForReplacementMarker): 95 (WebCore::InlineTextBox::paintCompositionUnderline): 96 (WebCore::InlineTextBox::positionForOffset): 97 (WebCore::InlineTextBox::constructTextRun): 98 * rendering/InlineTextBox.h: 99 * rendering/RenderCombineText.cpp: 100 (WebCore::RenderCombineText::getStringToRender): 101 * rendering/RenderCombineText.h: 102 * rendering/svg/SVGInlineFlowBox.cpp: 103 (WebCore::SVGInlineFlowBox::computeTextMatchMarkerRectForRenderer): 104 * rendering/svg/SVGInlineTextBox.cpp: 105 (WebCore::SVGInlineTextBox::positionForOffset): 106 (WebCore::SVGInlineTextBox::localSelectionRect): 107 (WebCore::SVGInlineTextBox::paintSelectionBackground): 108 (WebCore::SVGInlineTextBox::mapStartEndPositionsIntoFragmentCoordinates): 109 (WebCore::SVGInlineTextBox::paintText): 110 * rendering/svg/SVGInlineTextBox.h: 111 * rendering/svg/SVGTextMetricsBuilder.cpp: 112 (WebCore::SVGTextMetricsBuilder::currentCharacterStartsSurrogatePair): 113 (WebCore::SVGTextMetricsBuilder::advance): 114 * rendering/svg/SVGTextQuery.cpp: 115 (WebCore::SVGTextQuery::mapStartEndPositionsIntoFragmentCoordinates): 116 (WebCore::SVGTextQuery::modifyStartEndPositionsRespectingLigatures): 117 (WebCore::SVGTextQuery::subStringLengthCallback): 118 (WebCore::SVGTextQuery::startPositionOfCharacterCallback): 119 (WebCore::SVGTextQuery::endPositionOfCharacterCallback): 120 (WebCore::SVGTextQuery::rotationOfCharacterCallback): 121 (WebCore::SVGTextQuery::extentOfCharacterCallback): 122 (WebCore::SVGTextQuery::characterNumberAtPositionCallback): 123 * rendering/svg/SVGTextQuery.h: 124 * rendering/svg/SVGTextRunRenderingContext.cpp: 125 (WebCore::SVGGlyphToPathTranslator::SVGGlyphToPathTranslator): 126 (WebCore::SVGTextRunRenderingContext::glyphDataForCharacter): 127 * rendering/svg/SVGTextRunRenderingContext.h: 128 * svg/SVGFontData.cpp: 129 (WebCore::SVGFontData::applySVGGlyphSelection): 130 * svg/SVGFontData.h: 131 1 132 2014-06-20 Jer Noble <jer.noble@apple.com> 2 133 -
trunk/Source/WebCore/WebCore.exp.in
r170335 r170337 1858 1858 __ZNK7WebCore3URLcvP5NSURLEv 1859 1859 __ZNK7WebCore4Font5widthERKNS_7TextRunEPN3WTF7HashSetIPKNS_14SimpleFontDataENS4_7PtrHashIS8_EENS4_10HashTraitsIS8_EEEEPNS_13GlyphOverflowE 1860 __ZNK7WebCore4Font8drawTextEPNS_15GraphicsContextERKNS_7TextRunERKNS_10FloatPointE iiNS0_24CustomFontNotReadyActionE1860 __ZNK7WebCore4Font8drawTextEPNS_15GraphicsContextERKNS_7TextRunERKNS_10FloatPointEjiNS0_24CustomFontNotReadyActionE 1861 1861 __ZNK7WebCore4FonteqERKS0_ 1862 1862 __ZNK7WebCore4Node11textContentEb -
trunk/Source/WebCore/platform/graphics/Font.cpp
r170268 r170337 330 330 } 331 331 332 float Font::drawText(GraphicsContext* context, const TextRun& run, const FloatPoint& point, int from, int to, CustomFontNotReadyAction customFontNotReadyAction) const332 float Font::drawText(GraphicsContext* context, const TextRun& run, const FloatPoint& point, unsigned from, int initialTo, CustomFontNotReadyAction customFontNotReadyAction) const 333 333 { 334 334 // Don't draw anything while we are using custom fonts that are in the process of loading, … … 338 338 return 0; 339 339 340 to = (to == -1 ? run.length() : to);340 unsigned to = initialTo < 0 ? run.length() : initialTo; 341 341 342 342 CodePath codePathToUse = codePath(run); … … 351 351 } 352 352 353 void Font::drawEmphasisMarks(GraphicsContext* context, const TextRun& run, const AtomicString& mark, const FloatPoint& point, int from, int to) const353 void Font::drawEmphasisMarks(GraphicsContext* context, const TextRun& run, const AtomicString& mark, const FloatPoint& point, unsigned from, int initialTo) const 354 354 { 355 355 if (loadingCustomFonts()) 356 356 return; 357 358 if (to < 0) 359 to = run.length(); 357 358 unsigned to = initialTo < 0 ? run.length() : initialTo; 360 359 361 360 CodePath codePathToUse = codePath(run); … … 508 507 } 509 508 510 void Font::adjustSelectionRectForText(const TextRun& run, LayoutRect& selectionRect, int from, int to) const511 { 512 to = (to == -1 ? run.length() : to);509 void Font::adjustSelectionRectForText(const TextRun& run, LayoutRect& selectionRect, unsigned from, int initialTo) const 510 { 511 unsigned to = initialTo < 0 ? run.length() : initialTo; 513 512 514 513 CodePath codePathToUse = codePath(run); … … 1055 1054 } 1056 1055 1057 GlyphToPathTranslator::GlyphUnderlineType computeUnderlineType(const TextRun& textRun, const GlyphBuffer& glyphBuffer, intindex)1056 GlyphToPathTranslator::GlyphUnderlineType computeUnderlineType(const TextRun& textRun, const GlyphBuffer& glyphBuffer, unsigned index) 1058 1057 { 1059 1058 // In general, we want to skip descenders. However, skipping descenders on CJK characters leads to undesirable renderings, 1060 1059 // so we want to draw through CJK characters (on a character-by-character basis). 1061 1060 UChar32 baseCharacter; 1062 int offsetInString = glyphBuffer.offsetInString(index);1063 1064 if ( offsetInString == GlyphBuffer::kNoOffset) {1061 int initialOffsetInString = glyphBuffer.offsetInString(index); 1062 1063 if (initialOffsetInString == GlyphBuffer::kNoOffset) { 1065 1064 // We have no idea which character spawned this glyph. Bail. 1066 1065 return GlyphToPathTranslator::GlyphUnderlineType::DrawOverGlyph; 1067 1066 } 1068 1067 1068 ASSERT(initialOffsetInString >= 0); 1069 unsigned offsetInString = static_cast<unsigned>(initialOffsetInString); 1070 1069 1071 if (textRun.is8Bit()) 1070 1072 baseCharacter = textRun.characters8()[offsetInString]; 1071 else {1073 else 1072 1074 U16_NEXT(textRun.characters16(), offsetInString, textRun.length(), baseCharacter); 1073 }1074 1075 1075 1076 // u_getIntPropertyValue with UCHAR_IDEOGRAPHIC doesn't return true for Japanese or Korean codepoints. -
trunk/Source/WebCore/platform/graphics/Font.h
r170268 r170337 105 105 virtual ~GlyphToPathTranslator() { } 106 106 }; 107 GlyphToPathTranslator::GlyphUnderlineType computeUnderlineType(const TextRun&, const GlyphBuffer&, intindex);107 GlyphToPathTranslator::GlyphUnderlineType computeUnderlineType(const TextRun&, const GlyphBuffer&, unsigned index); 108 108 109 109 class Font { … … 134 134 135 135 enum CustomFontNotReadyAction { DoNotPaintIfFontNotReady, UseFallbackIfFontNotReady }; 136 float drawText(GraphicsContext*, const TextRun&, const FloatPoint&, intfrom = 0, int to = -1, CustomFontNotReadyAction = DoNotPaintIfFontNotReady) const;137 void drawGlyphs(GraphicsContext*, const SimpleFontData*, const GlyphBuffer&, int from, intnumGlyphs, const FloatPoint&) const;138 void drawEmphasisMarks(GraphicsContext*, const TextRun&, const AtomicString& mark, const FloatPoint&, intfrom = 0, int to = -1) const;136 float drawText(GraphicsContext*, const TextRun&, const FloatPoint&, unsigned from = 0, int to = -1, CustomFontNotReadyAction = DoNotPaintIfFontNotReady) const; 137 void drawGlyphs(GraphicsContext*, const SimpleFontData*, const GlyphBuffer&, unsigned from, unsigned numGlyphs, const FloatPoint&) const; 138 void drawEmphasisMarks(GraphicsContext*, const TextRun&, const AtomicString& mark, const FloatPoint&, unsigned from = 0, int to = -1) const; 139 139 140 140 DashArray dashesForIntersectionsWithRect(const TextRun&, const FloatPoint& textOrigin, const FloatRect& lineExtents) const; … … 148 148 149 149 int offsetForPosition(const TextRun&, float position, bool includePartialGlyphs) const; 150 void adjustSelectionRectForText(const TextRun&, LayoutRect& selectionRect, intfrom = 0, int to = -1) const;150 void adjustSelectionRectForText(const TextRun&, LayoutRect& selectionRect, unsigned from = 0, int to = -1) const; 151 151 152 152 bool isSmallCaps() const { return m_fontDescription.smallCaps(); } … … 220 220 221 221 // Returns the initial in-stream advance. 222 float getGlyphsAndAdvancesForSimpleText(const TextRun&, int from, intto, GlyphBuffer&, ForTextEmphasisOrNot = NotForTextEmphasis) const;223 float drawSimpleText(GraphicsContext*, const TextRun&, const FloatPoint&, int from, intto) const;224 void drawEmphasisMarksForSimpleText(GraphicsContext*, const TextRun&, const AtomicString& mark, const FloatPoint&, int from, intto) const;222 float getGlyphsAndAdvancesForSimpleText(const TextRun&, unsigned from, unsigned to, GlyphBuffer&, ForTextEmphasisOrNot = NotForTextEmphasis) const; 223 float drawSimpleText(GraphicsContext*, const TextRun&, const FloatPoint&, unsigned from, unsigned to) const; 224 void drawEmphasisMarksForSimpleText(GraphicsContext*, const TextRun&, const AtomicString& mark, const FloatPoint&, unsigned from, unsigned to) const; 225 225 void drawGlyphBuffer(GraphicsContext*, const TextRun&, const GlyphBuffer&, FloatPoint&) const; 226 226 void drawEmphasisMarks(GraphicsContext*, const TextRun&, const GlyphBuffer&, const AtomicString&, const FloatPoint&) const; 227 227 float floatWidthForSimpleText(const TextRun&, HashSet<const SimpleFontData*>* fallbackFonts = 0, GlyphOverflow* = 0) const; 228 228 int offsetForPositionForSimpleText(const TextRun&, float position, bool includePartialGlyphs) const; 229 void adjustSelectionRectForSimpleText(const TextRun&, LayoutRect& selectionRect, int from, intto) const;229 void adjustSelectionRectForSimpleText(const TextRun&, LayoutRect& selectionRect, unsigned from, unsigned to) const; 230 230 231 231 bool getEmphasisMarkGlyphData(const AtomicString&, GlyphData&) const; … … 235 235 236 236 // Returns the initial in-stream advance. 237 float getGlyphsAndAdvancesForComplexText(const TextRun&, int from, intto, GlyphBuffer&, ForTextEmphasisOrNot = NotForTextEmphasis) const;238 float drawComplexText(GraphicsContext*, const TextRun&, const FloatPoint&, int from, intto) const;239 void drawEmphasisMarksForComplexText(GraphicsContext*, const TextRun&, const AtomicString& mark, const FloatPoint&, int from, intto) const;237 float getGlyphsAndAdvancesForComplexText(const TextRun&, unsigned from, unsigned to, GlyphBuffer&, ForTextEmphasisOrNot = NotForTextEmphasis) const; 238 float drawComplexText(GraphicsContext*, const TextRun&, const FloatPoint&, unsigned from, unsigned to) const; 239 void drawEmphasisMarksForComplexText(GraphicsContext*, const TextRun&, const AtomicString& mark, const FloatPoint&, unsigned from, unsigned to) const; 240 240 float floatWidthForComplexText(const TextRun&, HashSet<const SimpleFontData*>* fallbackFonts = 0, GlyphOverflow* = 0) const; 241 241 int offsetForPositionForComplexText(const TextRun&, float position, bool includePartialGlyphs) const; 242 void adjustSelectionRectForComplexText(const TextRun&, LayoutRect& selectionRect, int from, intto) const;242 void adjustSelectionRectForComplexText(const TextRun&, LayoutRect& selectionRect, unsigned from, unsigned to) const; 243 243 244 244 friend struct WidthIterator; -
trunk/Source/WebCore/platform/graphics/FontFastPath.cpp
r170268 r170337 127 127 } 128 128 129 float Font::getGlyphsAndAdvancesForSimpleText(const TextRun& run, int from, intto, GlyphBuffer& glyphBuffer, ForTextEmphasisOrNot forTextEmphasis) const129 float Font::getGlyphsAndAdvancesForSimpleText(const TextRun& run, unsigned from, unsigned to, GlyphBuffer& glyphBuffer, ForTextEmphasisOrNot forTextEmphasis) const 130 130 { 131 131 float initialAdvance; … … 157 157 } 158 158 159 float Font::drawSimpleText(GraphicsContext* context, const TextRun& run, const FloatPoint& point, int from, intto) const159 float Font::drawSimpleText(GraphicsContext* context, const TextRun& run, const FloatPoint& point, unsigned from, unsigned to) const 160 160 { 161 161 // This glyph buffer holds our glyphs+advances+font data for each glyph. … … 173 173 } 174 174 175 void Font::drawEmphasisMarksForSimpleText(GraphicsContext* context, const TextRun& run, const AtomicString& mark, const FloatPoint& point, int from, intto) const175 void Font::drawEmphasisMarksForSimpleText(GraphicsContext* context, const TextRun& run, const AtomicString& mark, const FloatPoint& point, unsigned from, unsigned to) const 176 176 { 177 177 GlyphBuffer glyphBuffer; … … 196 196 float nextX = startPoint.x() + glyphBuffer.advanceAt(0).width(); 197 197 float nextY = startPoint.y() + glyphBuffer.advanceAt(0).height(); 198 intlastFrom = 0;199 intnextGlyph = 1;198 unsigned lastFrom = 0; 199 unsigned nextGlyph = 1; 200 200 #if ENABLE(SVG_FONTS) 201 201 TextRun::RenderingContext* renderingContext = run.renderingContext(); … … 211 211 else 212 212 #endif 213 { 214 ASSERT(nextGlyph >= lastFrom); 213 215 drawGlyphs(context, fontData, glyphBuffer, lastFrom, nextGlyph - lastFrom, startPoint); 216 } 214 217 215 218 lastFrom = nextGlyph; … … 270 273 271 274 GlyphBuffer markBuffer; 272 for ( inti = 0; i + 1 < glyphBuffer.size(); ++i) {275 for (unsigned i = 0; i + 1 < glyphBuffer.size(); ++i) { 273 276 float middleOfNextGlyph = offsetToMiddleOfGlyphAtIndex(glyphBuffer, i + 1); 274 277 float advance = glyphBuffer.advanceAt(i).width() - middleOfLastGlyph + middleOfNextGlyph; … … 297 300 } 298 301 299 void Font::adjustSelectionRectForSimpleText(const TextRun& run, LayoutRect& selectionRect, int from, intto) const302 void Font::adjustSelectionRectForSimpleText(const TextRun& run, LayoutRect& selectionRect, unsigned from, unsigned to) const 300 303 { 301 304 GlyphBuffer glyphBuffer; -
trunk/Source/WebCore/platform/graphics/GlyphBuffer.h
r170268 r170337 77 77 public: 78 78 bool isEmpty() const { return m_fontData.isEmpty(); } 79 intsize() const { return m_fontData.size(); }79 unsigned size() const { return m_fontData.size(); } 80 80 81 81 void clear() … … 91 91 } 92 92 93 GlyphBufferGlyph* glyphs( intfrom) { return m_glyphs.data() + from; }94 GlyphBufferAdvance* advances( intfrom) { return m_advances.data() + from; }95 const GlyphBufferGlyph* glyphs( intfrom) const { return m_glyphs.data() + from; }96 const GlyphBufferAdvance* advances( intfrom) const { return m_advances.data() + from; }97 98 const SimpleFontData* fontDataAt( intindex) const { return m_fontData[index]; }93 GlyphBufferGlyph* glyphs(unsigned from) { return m_glyphs.data() + from; } 94 GlyphBufferAdvance* advances(unsigned from) { return m_advances.data() + from; } 95 const GlyphBufferGlyph* glyphs(unsigned from) const { return m_glyphs.data() + from; } 96 const GlyphBufferAdvance* advances(unsigned from) const { return m_advances.data() + from; } 97 98 const SimpleFontData* fontDataAt(unsigned index) const { return m_fontData[index]; } 99 99 100 100 void setInitialAdvance(GlyphBufferAdvance initialAdvance) { m_initialAdvance = initialAdvance; } … … 110 110 } 111 111 112 GlyphBufferAdvance advanceAt( intindex) const112 GlyphBufferAdvance advanceAt(unsigned index) const 113 113 { 114 114 return m_advances[index]; 115 115 } 116 116 117 FloatSize offsetAt( intindex) const117 FloatSize offsetAt(unsigned index) const 118 118 { 119 119 #if PLATFORM(WIN) … … 177 177 #endif 178 178 179 void reverse( int from, intlength)179 void reverse(unsigned from, unsigned length) 180 180 { 181 181 for (int i = from, end = from + length - 1; i < end; ++i, --end) … … 195 195 } 196 196 197 int offsetInString( intindex) const197 int offsetInString(unsigned index) const 198 198 { 199 199 ASSERT(m_offsetsInString); … … 202 202 203 203 private: 204 void swap( int index1, intindex2)204 void swap(unsigned index1, unsigned index2) 205 205 { 206 206 const SimpleFontData* f = m_fontData[index1]; -
trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp
r170268 r170337 75 75 private: 76 76 const TextRun* m_textRun; 77 intm_offset;77 unsigned m_offset; 78 78 }; 79 79 -
trunk/Source/WebCore/platform/graphics/Latin1TextIterator.h
r170268 r170337 31 31 // The passed in LChar pointer starts at 'currentCharacter'. The iterator operates on the range [currentCharacter, lastCharacter]. 32 32 // 'endCharacter' denotes the maximum length of the UChar array, which might exceed 'lastCharacter'. 33 Latin1TextIterator(const LChar* characters, int currentCharacter, int lastCharacter, int/*endCharacter*/)33 Latin1TextIterator(const LChar* characters, unsigned currentCharacter, unsigned lastCharacter, unsigned /*endCharacter*/) 34 34 : m_characters(characters) 35 35 , m_currentCharacter(currentCharacter) … … 54 54 } 55 55 56 intcurrentCharacter() const { return m_currentCharacter; }56 unsigned currentCharacter() const { return m_currentCharacter; } 57 57 const LChar* characters() const { return m_characters; } 58 58 59 59 private: 60 60 const LChar* m_characters; 61 intm_currentCharacter;62 intm_lastCharacter;61 unsigned m_currentCharacter; 62 unsigned m_lastCharacter; 63 63 }; 64 64 -
trunk/Source/WebCore/platform/graphics/SimpleFontData.h
r170268 r170337 90 90 virtual float widthForSVGGlyph(Glyph, float fontSize) const = 0; 91 91 virtual bool fillSVGGlyphPage(GlyphPage*, unsigned offset, unsigned length, UChar* buffer, unsigned bufferLength, const SimpleFontData*) const = 0; 92 virtual bool applySVGGlyphSelection(WidthIterator&, GlyphData&, bool mirror, intcurrentCharacter, unsigned& advanceLength) const = 0;92 virtual bool applySVGGlyphSelection(WidthIterator&, GlyphData&, bool mirror, unsigned currentCharacter, unsigned& advanceLength) const = 0; 93 93 }; 94 94 -
trunk/Source/WebCore/platform/graphics/SurrogatePairAwareTextIterator.cpp
r170268 r170337 28 28 namespace WebCore { 29 29 30 SurrogatePairAwareTextIterator::SurrogatePairAwareTextIterator(const UChar* characters, int currentCharacter, int lastCharacter, intendCharacter)30 SurrogatePairAwareTextIterator::SurrogatePairAwareTextIterator(const UChar* characters, unsigned currentCharacter, unsigned lastCharacter, unsigned endCharacter) 31 31 : m_characters(characters) 32 32 , m_currentCharacter(currentCharacter) -
trunk/Source/WebCore/platform/graphics/SurrogatePairAwareTextIterator.h
r170268 r170337 31 31 // The passed in UChar pointer starts at 'currentCharacter'. The iterator operatoes on the range [currentCharacter, lastCharacter]. 32 32 // 'endCharacter' denotes the maximum length of the UChar array, which might exceed 'lastCharacter'. 33 SurrogatePairAwareTextIterator(const UChar*, int currentCharacter, int lastCharacter, intendCharacter);33 SurrogatePairAwareTextIterator(const UChar*, unsigned currentCharacter, unsigned lastCharacter, unsigned endCharacter); 34 34 35 35 inline bool consume(UChar32& character, unsigned& clusterLength) … … 53 53 } 54 54 55 intcurrentCharacter() const { return m_currentCharacter; }55 unsigned currentCharacter() const { return m_currentCharacter; } 56 56 const UChar* characters() const { return m_characters; } 57 57 … … 61 61 62 62 const UChar* m_characters; 63 intm_currentCharacter;64 intm_lastCharacter;65 intm_endCharacter;63 unsigned m_currentCharacter; 64 unsigned m_lastCharacter; 65 unsigned m_endCharacter; 66 66 }; 67 67 -
trunk/Source/WebCore/platform/graphics/TextRun.h
r170268 r170337 172 172 173 173 bool is8Bit() const { return m_is8Bit; } 174 intlength() const { return m_len; }175 intcharactersLength() const { return m_charactersLength; }174 unsigned length() const { return m_len; } 175 unsigned charactersLength() const { return m_charactersLength; } 176 176 String string() const 177 177 { … … 218 218 219 219 #if ENABLE(SVG_FONTS) 220 virtual GlyphData glyphDataForCharacter(const Font&, WidthIterator&, UChar32 character, bool mirror, intcurrentCharacter, unsigned& advanceLength) = 0;220 virtual GlyphData glyphDataForCharacter(const Font&, WidthIterator&, UChar32 character, bool mirror, unsigned currentCharacter, unsigned& advanceLength) = 0; 221 221 virtual void drawSVGGlyphs(GraphicsContext*, const SimpleFontData*, const GlyphBuffer&, int from, int to, const FloatPoint&) const = 0; 222 222 virtual float floatWidthUsingSVGFont(const Font&, const TextRun&, int& charsConsumed, String& glyphName) const = 0; -
trunk/Source/WebCore/platform/graphics/WidthIterator.cpp
r170268 r170337 69 69 } 70 70 71 GlyphData WidthIterator::glyphDataForCharacter(UChar32 character, bool mirror, intcurrentCharacter, unsigned& advanceLength)71 GlyphData WidthIterator::glyphDataForCharacter(UChar32 character, bool mirror, unsigned currentCharacter, unsigned& advanceLength) 72 72 { 73 73 ASSERT(m_font); … … 100 100 typedef Vector<std::pair<int, OriginalAdvancesForCharacterTreatedAsSpace>, 64> CharactersTreatedAsSpace; 101 101 102 static inline float applyFontTransforms(GlyphBuffer* glyphBuffer, bool ltr, int& lastGlyphCount, const SimpleFontData* fontData, WidthIterator& iterator, TypesettingFeatures typesettingFeatures, CharactersTreatedAsSpace& charactersTreatedAsSpace)102 static inline float applyFontTransforms(GlyphBuffer* glyphBuffer, bool ltr, unsigned& lastGlyphCount, const SimpleFontData* fontData, WidthIterator& iterator, TypesettingFeatures typesettingFeatures, CharactersTreatedAsSpace& charactersTreatedAsSpace) 103 103 { 104 104 ASSERT(typesettingFeatures & (Kerning | Ligatures)); … … 166 166 const SimpleFontData* primaryFont = m_font->primaryFont(); 167 167 const SimpleFontData* lastFontData = primaryFont; 168 intlastGlyphCount = glyphBuffer ? glyphBuffer->size() : 0;168 unsigned lastGlyphCount = glyphBuffer ? glyphBuffer->size() : 0; 169 169 170 170 UChar32 character = 0; … … 173 173 while (textIterator.consume(character, clusterLength)) { 174 174 unsigned advanceLength = clusterLength; 175 intcurrentCharacter = textIterator.currentCharacter();175 unsigned currentCharacter = textIterator.currentCharacter(); 176 176 const GlyphData& glyphData = glyphDataForCharacter(character, rtl, currentCharacter, advanceLength); 177 177 Glyph glyph = glyphData.glyph; … … 328 328 } 329 329 330 unsigned WidthIterator::advance( intoffset, GlyphBuffer* glyphBuffer)331 { 332 intlength = m_run.length();330 unsigned WidthIterator::advance(unsigned offset, GlyphBuffer* glyphBuffer) 331 { 332 unsigned length = m_run.length(); 333 333 334 334 if (offset > length) 335 335 offset = length; 336 336 337 if (m_currentCharacter >= static_cast<unsigned>(offset))337 if (m_currentCharacter >= offset) 338 338 return 0; 339 339 … … 349 349 bool WidthIterator::advanceOneCharacter(float& width, GlyphBuffer& glyphBuffer) 350 350 { 351 intoldSize = glyphBuffer.size();351 unsigned oldSize = glyphBuffer.size(); 352 352 advance(m_currentCharacter + 1, &glyphBuffer); 353 353 float w = 0; 354 for ( inti = oldSize; i < glyphBuffer.size(); ++i)354 for (unsigned i = oldSize; i < glyphBuffer.size(); ++i) 355 355 w += glyphBuffer.advanceAt(i).width(); 356 356 width = w; -
trunk/Source/WebCore/platform/graphics/WidthIterator.h
r170268 r170337 42 42 WidthIterator(const Font*, const TextRun&, HashSet<const SimpleFontData*>* fallbackFonts = 0, bool accountForGlyphBounds = false, bool forTextEmphasis = false); 43 43 44 unsigned advance( intto, GlyphBuffer*);44 unsigned advance(unsigned to, GlyphBuffer*); 45 45 bool advanceOneCharacter(float& width, GlyphBuffer&); 46 46 … … 88 88 89 89 private: 90 GlyphData glyphDataForCharacter(UChar32, bool mirror, intcurrentCharacter, unsigned& advanceLength);90 GlyphData glyphDataForCharacter(UChar32, bool mirror, unsigned currentCharacter, unsigned& advanceLength); 91 91 template <typename TextIterator> 92 92 inline unsigned advanceInternal(TextIterator&, GlyphBuffer*); -
trunk/Source/WebCore/platform/graphics/cairo/FontCairo.cpp
r170268 r170337 95 95 96 96 void Font::drawGlyphs(GraphicsContext* context, const SimpleFontData* font, const GlyphBuffer& glyphBuffer, 97 int from, intnumGlyphs, const FloatPoint& point) const97 unsigned from, unsigned numGlyphs, const FloatPoint& point) const 98 98 { 99 99 if (!font->platformData().size()) … … 103 103 104 104 float offset = point.x(); 105 for ( inti = 0; i < numGlyphs; i++) {105 for (unsigned i = 0; i < numGlyphs; i++) { 106 106 glyphs[i].x = offset; 107 107 glyphs[i].y = point.y(); -
trunk/Source/WebCore/platform/graphics/cairo/FontCairoHarfbuzzNG.cpp
r170268 r170337 39 39 namespace WebCore { 40 40 41 float Font::drawComplexText(GraphicsContext* context, const TextRun& run, const FloatPoint& point, int, int) const41 float Font::drawComplexText(GraphicsContext* context, const TextRun& run, const FloatPoint& point, unsigned, unsigned) const 42 42 { 43 43 GlyphBuffer glyphBuffer; … … 53 53 } 54 54 55 void Font::drawEmphasisMarksForComplexText(GraphicsContext* /* context */, const TextRun& /* run */, const AtomicString& /* mark */, const FloatPoint& /* point */, int /* from */, int/* to */) const55 void Font::drawEmphasisMarksForComplexText(GraphicsContext* /* context */, const TextRun& /* run */, const AtomicString& /* mark */, const FloatPoint& /* point */, unsigned /* from */, unsigned /* to */) const 56 56 { 57 57 notImplemented(); … … 86 86 } 87 87 88 void Font::adjustSelectionRectForComplexText(const TextRun& run, LayoutRect& selectionRect, int from, intto) const88 void Font::adjustSelectionRectForComplexText(const TextRun& run, LayoutRect& selectionRect, unsigned from, unsigned to) const 89 89 { 90 90 HarfBuzzShaper shaper(this, run); -
trunk/Source/WebCore/platform/graphics/harfbuzz/HarfBuzzShaper.cpp
r170268 r170337 257 257 runCharacters = m_run.characters16(); 258 258 259 for ( inti = 0; i < m_run.length(); ++i) {259 for (unsigned i = 0; i < m_run.length(); ++i) { 260 260 UChar ch = runCharacters[i]; 261 261 if (::ublock_getCode(ch) == UBLOCK_COMBINING_DIACRITICAL_MARKS) { -
trunk/Source/WebCore/platform/graphics/mac/FontComplexTextMac.cpp
r170268 r170337 38 38 namespace WebCore { 39 39 40 void Font::adjustSelectionRectForComplexText(const TextRun& run, LayoutRect& selectionRect, int from, intto) const40 void Font::adjustSelectionRectForComplexText(const TextRun& run, LayoutRect& selectionRect, unsigned from, unsigned to) const 41 41 { 42 42 ComplexTextController controller(this, run); … … 53 53 } 54 54 55 float Font::getGlyphsAndAdvancesForComplexText(const TextRun& run, int from, intto, GlyphBuffer& glyphBuffer, ForTextEmphasisOrNot forTextEmphasis) const55 float Font::getGlyphsAndAdvancesForComplexText(const TextRun& run, unsigned from, unsigned to, GlyphBuffer& glyphBuffer, ForTextEmphasisOrNot forTextEmphasis) const 56 56 { 57 57 float initialAdvance; … … 76 76 } 77 77 78 float Font::drawComplexText(GraphicsContext* context, const TextRun& run, const FloatPoint& point, int from, intto) const78 float Font::drawComplexText(GraphicsContext* context, const TextRun& run, const FloatPoint& point, unsigned from, unsigned to) const 79 79 { 80 80 // This glyph buffer holds our glyphs + advances + font data for each glyph. … … 94 94 } 95 95 96 void Font::drawEmphasisMarksForComplexText(GraphicsContext* context, const TextRun& run, const AtomicString& mark, const FloatPoint& point, int from, intto) const96 void Font::drawEmphasisMarksForComplexText(GraphicsContext* context, const TextRun& run, const AtomicString& mark, const FloatPoint& point, unsigned from, unsigned to) const 97 97 { 98 98 GlyphBuffer glyphBuffer; -
trunk/Source/WebCore/platform/graphics/mac/FontMac.mm
r170268 r170337 185 185 } 186 186 187 void Font::drawGlyphs(GraphicsContext* context, const SimpleFontData* font, const GlyphBuffer& glyphBuffer, int from, intnumGlyphs, const FloatPoint& anchorPoint) const187 void Font::drawGlyphs(GraphicsContext* context, const SimpleFontData* font, const GlyphBuffer& glyphBuffer, unsigned from, unsigned numGlyphs, const FloatPoint& anchorPoint) const 188 188 { 189 189 const FontPlatformData& platformData = font->platformData(); … … 469 469 void moveToNextValidGlyph(); 470 470 471 intm_index;471 unsigned m_index; 472 472 const TextRun& m_textRun; 473 473 const GlyphBuffer& m_glyphBuffer; -
trunk/Source/WebCore/platform/graphics/win/FontCGWin.cpp
r170268 r170337 129 129 130 130 void Font::drawGlyphs(GraphicsContext* graphicsContext, const SimpleFontData* font, const GlyphBuffer& glyphBuffer, 131 int from, intnumGlyphs, const FloatPoint& point) const131 unsigned from, unsigned numGlyphs, const FloatPoint& point) const 132 132 { 133 133 CGContextRef cgContext = graphicsContext->platformContext(); -
trunk/Source/WebCore/platform/graphics/win/FontWin.cpp
r170268 r170337 52 52 } 53 53 54 void Font::adjustSelectionRectForComplexText(const TextRun& run, LayoutRect& selectionRect, int from, intto) const54 void Font::adjustSelectionRectForComplexText(const TextRun& run, LayoutRect& selectionRect, unsigned from, unsigned to) const 55 55 { 56 56 UniscribeController it(this, run); … … 68 68 } 69 69 70 float Font::getGlyphsAndAdvancesForComplexText(const TextRun& run, int from, intto, GlyphBuffer& glyphBuffer, ForTextEmphasisOrNot forTextEmphasis) const70 float Font::getGlyphsAndAdvancesForComplexText(const TextRun& run, unsigned from, unsigned to, GlyphBuffer& glyphBuffer, ForTextEmphasisOrNot forTextEmphasis) const 71 71 { 72 72 if (forTextEmphasis) { … … 93 93 } 94 94 95 float Font::drawComplexText(GraphicsContext* context, const TextRun& run, const FloatPoint& point, int from, intto) const95 float Font::drawComplexText(GraphicsContext* context, const TextRun& run, const FloatPoint& point, unsigned from, unsigned to) const 96 96 { 97 97 // This glyph buffer holds our glyphs + advances + font data for each glyph. … … 110 110 } 111 111 112 void Font::drawEmphasisMarksForComplexText(GraphicsContext* context, const TextRun& run, const AtomicString& mark, const FloatPoint& point, int from, intto) const112 void Font::drawEmphasisMarksForComplexText(GraphicsContext* context, const TextRun& run, const AtomicString& mark, const FloatPoint& point, unsigned from, unsigned to) const 113 113 { 114 114 GlyphBuffer glyphBuffer; -
trunk/Source/WebCore/platform/graphics/wince/FontWinCE.cpp
r170268 r170337 63 63 64 64 void Font::drawGlyphs(GraphicsContext* graphicsContext, const SimpleFontData* fontData, const GlyphBuffer& glyphBuffer, 65 int from, intnumGlyphs, const FloatPoint& point) const65 unsigned from, unsigned numGlyphs, const FloatPoint& point) const 66 66 { 67 67 graphicsContext->drawText(fontData, glyphBuffer, from, numGlyphs, point); … … 207 207 } 208 208 209 float Font::drawComplexText(GraphicsContext* context, const TextRun& run, const FloatPoint& point, int from, intto) const209 float Font::drawComplexText(GraphicsContext* context, const TextRun& run, const FloatPoint& point, unsigned from, unsigned to) const 210 210 { 211 211 if (to < 0) … … 238 238 } 239 239 240 void Font::drawEmphasisMarksForComplexText(GraphicsContext* /* context */, const TextRun& /* run */, const AtomicString& /* mark */, const FloatPoint& /* point */, int /* from */, int/* to */) const240 void Font::drawEmphasisMarksForComplexText(GraphicsContext* /* context */, const TextRun& /* run */, const AtomicString& /* mark */, const FloatPoint& /* point */, unsigned /* from */, unsigned /* to */) const 241 241 { 242 242 notImplemented(); … … 322 322 323 323 FloatRect Font::selectionRectForComplexText(const TextRun& run, const FloatPoint& pt, 324 int h, int from, intto) const324 int h, unsigned from, unsigned to) const 325 325 { 326 326 TextRunComponents components; -
trunk/Source/WebCore/rendering/InlineTextBox.cpp
r170268 r170337 197 197 } 198 198 199 bool InlineTextBox::isSelected(int startPos, int endPos) const 200 { 201 int sPos = std::max(startPos - m_start, 0); 202 int ePos = std::min(endPos - m_start, static_cast<int>(m_len)); 203 return (sPos < ePos); 199 bool InlineTextBox::isSelected(unsigned startPos, unsigned endPos) const 200 { 201 unsigned sPos = startPos > m_start ? startPos - m_start : 0; 202 if (endPos <= m_start) 203 return false; 204 unsigned ePos = std::min(endPos - m_start, static_cast<unsigned>(m_len)); 205 return sPos < ePos; 204 206 } 205 207 … … 208 210 RenderObject::SelectionState state = renderer().selectionState(); 209 211 if (state == RenderObject::SelectionStart || state == RenderObject::SelectionEnd || state == RenderObject::SelectionBoth) { 210 int startPos, endPos; 211 renderer().selectionStartEnd(startPos, endPos); 212 int initialStartPos, initialEndPos; 213 renderer().selectionStartEnd(initialStartPos, initialEndPos); 214 ASSERT(initialStartPos >= 0 && initialEndPos >= 0); 215 unsigned startPos = initialStartPos; 216 unsigned endPos = initialEndPos; 212 217 // The position after a hard line break is considered to be past its end. 213 intlastSelectable = start() + len() - (isLineBreak() ? 1 : 0);218 unsigned lastSelectable = start() + len() - (isLineBreak() ? 1 : 0); 214 219 215 220 bool start = (state != RenderObject::SelectionEnd && startPos >= m_start && startPos < m_start + m_len); … … 232 237 EllipsisBox* ellipsis = root().ellipsisBox(); 233 238 if (state != RenderObject::SelectionNone) { 234 intstart, end;239 unsigned start, end; 235 240 selectionStartEnd(start, end); 236 241 // The ellipsis should be considered to be selected if the end of … … 247 252 } 248 253 249 static void adjustCharactersAndLengthForHyphen(BufferForAppendingHyphen& charactersWithHyphen, const RenderStyle& style, String& string, int& length)254 static void adjustCharactersAndLengthForHyphen(BufferForAppendingHyphen& charactersWithHyphen, const RenderStyle& style, String& string, unsigned& length) 250 255 { 251 256 const AtomicString& hyphenString = style.hyphenString(); … … 267 272 } 268 273 269 LayoutRect InlineTextBox::localSelectionRect(int startPos, int endPos) const 270 { 271 int sPos = std::max(startPos - m_start, 0); 272 int ePos = std::min(endPos - m_start, (int)m_len); 274 LayoutRect InlineTextBox::localSelectionRect(unsigned startPos, unsigned endPos) const 275 { 276 unsigned sPos = startPos > m_start ? startPos - m_start : 0; 277 278 if (endPos < m_start) 279 return LayoutRect(); 280 281 unsigned ePos = std::min(endPos - m_start, static_cast<unsigned>(m_len)); 273 282 274 283 if (sPos > ePos) … … 285 294 bool respectHyphen = ePos == m_len && hasHyphen(); 286 295 TextRun textRun = constructTextRun(lineStyle, font, respectHyphen ? &charactersWithHyphen : 0); 287 if (respectHyphen)288 endPos = textRun.length();289 296 290 297 LayoutRect selectionRect = LayoutRect(LayoutPoint(logicalLeft(), selectionTop), LayoutSize(m_logicalWidth, selectionHeight)); 291 298 // Avoid computing the font width when the entire line box is selected as an optimization. 292 if (sPos || ePos != static_cast<int>(m_len))299 if (sPos || ePos != m_len) 293 300 font.adjustSelectionRectForText(textRun, selectionRect, sPos, ePos); 294 301 IntRect snappedSelectionRect = enclosingIntRect(selectionRect); … … 607 614 608 615 // 2. Now paint the foreground, including text and decorations like underline/overline (in quirks mode only). 609 intlength = m_len;610 intmaximumLength;616 unsigned length = m_len; 617 unsigned maximumLength; 611 618 String string; 612 619 if (!combinedText) { 613 620 string = renderer().text(); 614 if ( static_cast<unsigned>(length)!= string.length() || m_start) {615 ASSERT_WITH_SECURITY_IMPLICATION( static_cast<unsigned>(m_start + length)<= string.length());621 if (length != string.length() || m_start) { 622 ASSERT_WITH_SECURITY_IMPLICATION(m_start + length <= string.length()); 616 623 string = string.substringSharingImpl(m_start, length); 617 624 } 625 ASSERT(renderer().textLength() >= m_start); 618 626 maximumLength = renderer().textLength() - m_start; 619 627 } else { … … 627 635 length = textRun.length(); 628 636 629 intsPos = 0;630 intePos = 0;637 unsigned sPos = 0; 638 unsigned ePos = 0; 631 639 if (haveSelection && (paintSelectedTextOnly || paintSelectedTextSeparately)) 632 640 selectionStartEnd(sPos, ePos); 633 641 634 642 if (m_truncation != cNoTruncation) { 635 sPos = std::min <int>(sPos, m_truncation);636 ePos = std::min <int>(ePos, m_truncation);643 sPos = std::min(sPos, static_cast<unsigned>(m_truncation)); 644 ePos = std::min(ePos, static_cast<unsigned>(m_truncation)); 637 645 length = m_truncation; 638 646 } … … 694 702 } 695 703 696 void InlineTextBox::selectionStartEnd( int& sPos, int& ePos)697 { 698 intstartPos, endPos;704 void InlineTextBox::selectionStartEnd(unsigned& sPos, unsigned& ePos) 705 { 706 unsigned startPos, endPos; 699 707 if (renderer().selectionState() == RenderObject::SelectionInside) { 700 708 startPos = 0; 701 709 endPos = renderer().textLength(); 702 710 } else { 703 renderer().selectionStartEnd(startPos, endPos); 711 int originalStartPos, originalEndPos; 712 renderer().selectionStartEnd(originalStartPos, originalEndPos); 713 ASSERT(originalStartPos >= 0 && originalEndPos >= 0); 714 startPos = originalStartPos; 715 endPos = originalEndPos; 704 716 if (renderer().selectionState() == RenderObject::SelectionStart) 705 717 endPos = renderer().textLength(); … … 707 719 startPos = 0; 708 720 } 709 710 sPos = std::max(startPos - m_start, 0); 711 ePos = std::min(endPos - m_start, (int)m_len); 721 722 sPos = startPos > m_start ? startPos - m_start : 0; 723 ePos = endPos > m_start ? endPos - m_start : 0; 724 ePos = std::min(ePos, static_cast<unsigned>(m_len)); 712 725 } 713 726 … … 719 732 720 733 // See if we have a selection to paint at all. 721 intsPos, ePos;734 unsigned sPos, ePos; 722 735 selectionStartEnd(sPos, ePos); 723 736 if (sPos >= ePos) … … 738 751 // If the text is truncated, let the thing being painted in the truncation 739 752 // draw its own highlight. 740 intlength = m_truncation != cNoTruncation ? m_truncation : m_len;753 unsigned length = m_truncation != cNoTruncation ? m_truncation : m_len; 741 754 String string = renderer().text(); 742 755 … … 748 761 BufferForAppendingHyphen charactersWithHyphen; 749 762 bool respectHyphen = ePos == length && hasHyphen(); 763 ASSERT(renderer().textLength() >= m_start); 750 764 TextRun textRun = constructTextRun(style, font, string, renderer().textLength() - m_start, respectHyphen ? &charactersWithHyphen : 0); 751 765 if (respectHyphen) … … 771 785 } 772 786 773 void InlineTextBox::paintCompositionBackground(GraphicsContext* context, const FloatPoint& boxOrigin, const RenderStyle& style, const Font& font, int startPos, int endPos) 774 { 775 int offset = m_start; 776 int sPos = std::max(startPos - offset, 0); 777 int ePos = std::min(endPos - offset, (int)m_len); 787 void InlineTextBox::paintCompositionBackground(GraphicsContext* context, const FloatPoint& boxOrigin, const RenderStyle& style, const Font& font, unsigned startPos, unsigned endPos) 788 { 789 unsigned offset = m_start; 790 unsigned sPos = startPos > offset ? startPos - offset : 0; 791 ASSERT(endPos >= offset); 792 unsigned ePos = std::min(endPos - offset, static_cast<unsigned>(m_len)); 778 793 779 794 if (sPos >= ePos) … … 1114 1129 // Determine whether we need to measure text 1115 1130 bool markerSpansWholeBox = true; 1116 if (m_start <= (int)marker->startOffset())1131 if (m_start <= marker->startOffset()) 1117 1132 markerSpansWholeBox = false; 1118 1133 if ((end() + 1) != marker->endOffset()) // end points at the last char, not past it … … 1123 1138 bool isDictationMarker = marker->type() == DocumentMarker::DictationAlternatives; 1124 1139 if (!markerSpansWholeBox || grammar || isDictationMarker) { 1125 int startPosition = std::max<int>(marker->startOffset() - m_start, 0); 1126 int endPosition = std::min<int>(marker->endOffset() - m_start, m_len); 1140 unsigned startPosition = marker->startOffset() > m_start ? marker->startOffset() - m_start : 0; 1141 ASSERT(marker->endOffset() >= m_start); 1142 unsigned endPosition = std::min(marker->endOffset() - m_start, static_cast<unsigned>(m_len)); 1127 1143 1128 1144 if (m_truncation != cNoTruncation) 1129 endPosition = std::min <int>(endPosition, m_truncation);1145 endPosition = std::min(endPosition, static_cast<unsigned>(m_truncation)); 1130 1146 1131 1147 // Calculate start & width … … 1174 1190 LayoutUnit selectionHeight = this->selectionHeight(); 1175 1191 1176 int sPos = std::max(marker->startOffset() - m_start, (unsigned)0); 1177 int ePos = std::min(marker->endOffset() - m_start, (unsigned)m_len); 1192 unsigned sPos = marker->startOffset() > m_start ? marker->startOffset() - m_start : 0; 1193 ASSERT(marker->endOffset() >= m_start); 1194 unsigned ePos = std::min(marker->endOffset() - m_start, static_cast<unsigned>(m_len)); 1178 1195 TextRun run = constructTextRun(style, font); 1179 1196 … … 1207 1224 LayoutUnit h = selectionHeight(); 1208 1225 1209 int sPos = std::max(marker->startOffset() - m_start, (unsigned)0); 1210 int ePos = std::min(marker->endOffset() - m_start, (unsigned)m_len); 1226 unsigned sPos = marker->startOffset() > m_start ? marker->startOffset() - m_start : 0; 1227 ASSERT(marker->endOffset() >= m_start); 1228 unsigned ePos = std::min(marker->endOffset() - m_start, (unsigned)m_len); 1211 1229 TextRun run = constructTextRun(style, font); 1212 1230 … … 1315 1333 } 1316 1334 if (paintEnd != underline.endOffset) { // end points at the last char, not past it 1317 paintEnd = std::min(paintEnd, (unsigned)underline.endOffset);1335 paintEnd = std::min(paintEnd, underline.endOffset); 1318 1336 useWholeWidth = false; 1319 1337 } 1320 1338 if (m_truncation != cNoTruncation) { 1321 paintEnd = std::min(paintEnd, (unsigned)m_start + m_truncation);1339 paintEnd = std::min(paintEnd, m_start + m_truncation); 1322 1340 useWholeWidth = false; 1323 1341 } … … 1380 1398 } 1381 1399 1382 float InlineTextBox::positionForOffset( intoffset) const1400 float InlineTextBox::positionForOffset(unsigned offset) const 1383 1401 { 1384 1402 ASSERT(offset >= m_start); … … 1392 1410 const RenderStyle& lineStyle = this->lineStyle(); 1393 1411 const Font& font = fontToUse(lineStyle, renderer()); 1394 intfrom = !isLeftToRightDirection() ? offset - m_start : 0;1395 intto = !isLeftToRightDirection() ? m_len : offset - m_start;1412 unsigned from = !isLeftToRightDirection() ? offset - m_start : 0; 1413 unsigned to = !isLeftToRightDirection() ? m_len : offset - m_start; 1396 1414 // FIXME: Do we need to add rightBearing here? 1397 1415 LayoutRect selectionRect = LayoutRect(logicalLeft(), 0, 0, 0); … … 1411 1429 if (string.length() != length || startPos) 1412 1430 string = string.substringSharingImpl(startPos, length); 1413 1431 1432 ASSERT(renderer().textLength() >= startPos); 1414 1433 return constructTextRun(style, font, string, renderer().textLength() - startPos, charactersWithHyphen); 1415 1434 } 1416 1435 1417 TextRun InlineTextBox::constructTextRun(const RenderStyle& style, const Font& font, String string, intmaximumLength, BufferForAppendingHyphen* charactersWithHyphen) const1418 { 1419 intlength = string.length();1436 TextRun InlineTextBox::constructTextRun(const RenderStyle& style, const Font& font, String string, unsigned maximumLength, BufferForAppendingHyphen* charactersWithHyphen) const 1437 { 1438 unsigned length = string.length(); 1420 1439 1421 1440 if (charactersWithHyphen) { -
trunk/Source/WebCore/rendering/InlineTextBox.h
r170268 r170337 111 111 LayoutUnit selectionHeight() const; 112 112 113 TextRun constructTextRun(const RenderStyle&, const Font&, BufferForAppendingHyphen* = 0) const;114 TextRun constructTextRun(const RenderStyle&, const Font&, String, int maximumLength, BufferForAppendingHyphen* = 0) const;113 TextRun constructTextRun(const RenderStyle&, const Font&, BufferForAppendingHyphen* = nullptr) const; 114 TextRun constructTextRun(const RenderStyle&, const Font&, String, unsigned maximumLength, BufferForAppendingHyphen* = nullptr) const; 115 115 116 116 public: 117 117 virtual FloatRect calculateBoundaries() const { return FloatRect(x(), y(), width(), height()); } 118 118 119 virtual LayoutRect localSelectionRect( int startPos, intendPos) const;120 bool isSelected( int startPos, intendPos) const;121 void selectionStartEnd( int& sPos, int& ePos);119 virtual LayoutRect localSelectionRect(unsigned startPos, unsigned endPos) const; 120 bool isSelected(unsigned startPos, unsigned endPos) const; 121 void selectionStartEnd(unsigned& sPos, unsigned& ePos); 122 122 123 123 protected: … … 159 159 public: 160 160 virtual int offsetForPosition(float x, bool includePartialGlyphs = true) const; 161 virtual float positionForOffset( intoffset) const;161 virtual float positionForOffset(unsigned offset) const; 162 162 163 163 // Needs to be public, so the static paintTextWithShadows() function can use it. … … 165 165 166 166 protected: 167 void paintCompositionBackground(GraphicsContext*, const FloatPoint& boxOrigin, const RenderStyle&, const Font&, int startPos, intendPos);167 void paintCompositionBackground(GraphicsContext*, const FloatPoint& boxOrigin, const RenderStyle&, const Font&, unsigned startPos, unsigned endPos); 168 168 void paintDocumentMarkers(GraphicsContext*, const FloatPoint& boxOrigin, const RenderStyle&, const Font&, bool background); 169 169 void paintCompositionUnderline(GraphicsContext*, const FloatPoint& boxOrigin, const CompositionUnderline&); … … 188 188 InlineTextBox* m_nextTextBox; // The next box that also uses our RenderObject 189 189 190 intm_start;190 unsigned m_start; 191 191 unsigned short m_len; 192 192 -
trunk/Source/WebCore/rendering/RenderCombineText.cpp
r170268 r170337 73 73 } 74 74 75 void RenderCombineText::getStringToRender( int start, String& string, int& length) const75 void RenderCombineText::getStringToRender(unsigned start, String& string, unsigned& length) const 76 76 { 77 ASSERT(start >= 0);78 77 if (m_isCombined) { 79 78 string = originalText(); … … 83 82 84 83 string = text(); 85 string = string.substringSharingImpl(sta tic_cast<unsigned>(start), length);84 string = string.substringSharingImpl(start, length); 86 85 } 87 86 -
trunk/Source/WebCore/rendering/RenderCombineText.h
r170268 r170337 37 37 void combineText(); 38 38 void adjustTextOrigin(FloatPoint& textOrigin, const FloatRect& boxRect) const; 39 void getStringToRender( int, String& string, int& length) const;39 void getStringToRender(unsigned, String&, unsigned& length) const; 40 40 bool isCombined() const { return m_isCombined; } 41 41 float combinedTextWidth(const Font& font) const { return font.size(); } -
trunk/Source/WebCore/rendering/svg/SVGInlineFlowBox.cpp
r170268 r170337 107 107 continue; 108 108 109 intfragmentStartPosition = 0;110 intfragmentEndPosition = 0;109 unsigned fragmentStartPosition = 0; 110 unsigned fragmentEndPosition = 0; 111 111 112 112 const Vector<SVGTextFragment>& fragments = textBox->textFragments(); -
trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp
r170268 r170337 102 102 } 103 103 104 float SVGInlineTextBox::positionForOffset( int) const104 float SVGInlineTextBox::positionForOffset(unsigned) const 105 105 { 106 106 // SVG doesn't use the offset <-> position selection system. … … 138 138 } 139 139 140 LayoutRect SVGInlineTextBox::localSelectionRect(int startPosition, int endPosition) const 141 { 142 int boxStart = start(); 143 startPosition = std::max(startPosition - boxStart, 0); 144 endPosition = std::min(endPosition - boxStart, static_cast<int>(len())); 140 LayoutRect SVGInlineTextBox::localSelectionRect(unsigned startPosition, unsigned endPosition) const 141 { 142 unsigned boxStart = start(); 143 startPosition = startPosition > boxStart ? startPosition - boxStart : 0; 144 ASSERT(endPosition >= boxStart); 145 endPosition = std::min(endPosition - boxStart, len()); 145 146 if (startPosition >= endPosition) 146 147 return LayoutRect(); … … 150 151 AffineTransform fragmentTransform; 151 152 FloatRect selectionRect; 152 intfragmentStartPosition = 0;153 intfragmentEndPosition = 0;153 unsigned fragmentStartPosition = 0; 154 unsigned fragmentEndPosition = 0; 154 155 155 156 unsigned textFragmentsSize = m_textFragments.size(); … … 214 215 } 215 216 216 intstartPosition, endPosition;217 unsigned startPosition, endPosition; 217 218 selectionStartEnd(startPosition, endPosition); 218 219 219 intfragmentStartPosition = 0;220 intfragmentEndPosition = 0;220 unsigned fragmentStartPosition = 0; 221 unsigned fragmentEndPosition = 0; 221 222 AffineTransform fragmentTransform; 222 223 unsigned textFragmentsSize = m_textFragments.size(); … … 441 442 } 442 443 443 bool SVGInlineTextBox::mapStartEndPositionsIntoFragmentCoordinates(const SVGTextFragment& fragment, int& startPosition, int& endPosition) const444 bool SVGInlineTextBox::mapStartEndPositionsIntoFragmentCoordinates(const SVGTextFragment& fragment, unsigned& startPosition, unsigned& endPosition) const 444 445 { 445 446 if (startPosition >= endPosition) 446 447 return false; 447 448 int offset = static_cast<int>(fragment.characterOffset) - start(); 449 int length = static_cast<int>(fragment.length); 448 449 ASSERT(fragment.characterOffset >= start()); 450 unsigned offset = fragment.characterOffset - start(); 451 unsigned length = fragment.length; 450 452 451 453 if (startPosition >= offset + length || endPosition <= offset) … … 454 456 if (startPosition < offset) 455 457 startPosition = 0; 456 else 458 else { 459 ASSERT(startPosition >= offset); 457 460 startPosition -= offset; 461 } 458 462 459 463 if (endPosition > offset + length) … … 627 631 ASSERT(selectionStyle); 628 632 629 intstartPosition = 0;630 intendPosition = 0;633 unsigned startPosition = 0; 634 unsigned endPosition = 0; 631 635 if (hasSelection) { 632 636 selectionStartEnd(startPosition, endPosition); … … 656 660 657 661 // Eventually draw text using regular style from the end position of the selection to the end of the current chunk part 658 if (endPosition < static_cast<int>(fragment.length)&& !paintSelectedTextOnly)662 if (endPosition < fragment.length && !paintSelectedTextOnly) 659 663 paintTextWithShadows(context, style, textRun, fragment, endPosition, fragment.length); 660 664 } -
trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.h
r170268 r170337 44 44 virtual int selectionHeight() { return static_cast<int>(ceilf(m_logicalHeight)); } 45 45 virtual int offsetForPosition(float x, bool includePartialGlyphs = true) const; 46 virtual float positionForOffset( intoffset) const;46 virtual float positionForOffset(unsigned offset) const; 47 47 48 48 void paintSelectionBackground(PaintInfo&); 49 49 virtual void paint(PaintInfo&, const LayoutPoint&, LayoutUnit lineTop, LayoutUnit lineBottom); 50 virtual LayoutRect localSelectionRect( int startPosition, intendPosition) const override;50 virtual LayoutRect localSelectionRect(unsigned startPosition, unsigned endPosition) const override; 51 51 52 bool mapStartEndPositionsIntoFragmentCoordinates(const SVGTextFragment&, int& startPosition, int& endPosition) const;52 bool mapStartEndPositionsIntoFragmentCoordinates(const SVGTextFragment&, unsigned& startPosition, unsigned& endPosition) const; 53 53 54 54 virtual FloatRect calculateBoundaries() const; -
trunk/Source/WebCore/rendering/svg/SVGTextMetricsBuilder.cpp
r170268 r170337 38 38 inline bool SVGTextMetricsBuilder::currentCharacterStartsSurrogatePair() const 39 39 { 40 return U16_IS_LEAD(m_run[m_textPosition]) && int(m_textPosition + 1)< m_run.charactersLength() && U16_IS_TRAIL(m_run[m_textPosition + 1]);40 return U16_IS_LEAD(m_run[m_textPosition]) && m_textPosition + 1 < m_run.charactersLength() && U16_IS_TRAIL(m_run[m_textPosition + 1]); 41 41 } 42 42 … … 44 44 { 45 45 m_textPosition += m_currentMetrics.length(); 46 if ( int(m_textPosition)>= m_run.charactersLength())46 if (m_textPosition >= m_run.charactersLength()) 47 47 return false; 48 48 -
trunk/Source/WebCore/rendering/svg/SVGTextQuery.cpp
r170268 r170337 134 134 } 135 135 136 bool SVGTextQuery::mapStartEndPositionsIntoFragmentCoordinates(Data* queryData, const SVGTextFragment& fragment, int& startPosition, int& endPosition) const136 bool SVGTextQuery::mapStartEndPositionsIntoFragmentCoordinates(Data* queryData, const SVGTextFragment& fragment, unsigned& startPosition, unsigned& endPosition) const 137 137 { 138 138 // Reuse the same logic used for text selection & painting, to map our query start/length into start/endPositions of the current text fragment. 139 ASSERT(startPosition >= queryData->processedCharacters); 140 ASSERT(endPosition >= queryData->processedCharacters); 139 141 startPosition -= queryData->processedCharacters; 140 142 endPosition -= queryData->processedCharacters; 141 143 142 if (startPosition >= endPosition || startPosition < 0 || endPosition < 0)144 if (startPosition >= endPosition) 143 145 return false; 144 146 … … 151 153 } 152 154 153 void SVGTextQuery::modifyStartEndPositionsRespectingLigatures(Data* queryData, int& startPosition, int& endPosition) const155 void SVGTextQuery::modifyStartEndPositionsRespectingLigatures(Data* queryData, unsigned& startPosition, unsigned& endPosition) const 154 156 { 155 157 SVGTextLayoutAttributes* layoutAttributes = queryData->textRenderer->layoutAttributes(); … … 182 184 183 185 // If the start position maps to a character in the metrics list, we don't need to modify it. 184 if (startPosition == static_cast<int>(positionOffset))186 if (startPosition == positionOffset) 185 187 alterStartPosition = false; 186 188 187 189 // If the start position maps to a character in the metrics list, we don't need to modify it. 188 if (endPosition == static_cast<int>(positionOffset))190 if (endPosition == positionOffset) 189 191 alterEndPosition = false; 190 192 191 193 // Detect ligatures. 192 194 if (lastPositionOffset != -1 && lastPositionOffset - positionOffset > 1) { 193 if (alterStartPosition && startPosition > lastPositionOffset && startPosition < static_cast<int>(positionOffset)) {195 if (alterStartPosition && startPosition > static_cast<unsigned>(lastPositionOffset) && startPosition < positionOffset) { 194 196 startPosition = lastPositionOffset; 195 197 alterStartPosition = false; 196 198 } 197 199 198 if (alterEndPosition && endPosition > lastPositionOffset && endPosition < static_cast<int>(positionOffset)) {200 if (alterEndPosition && endPosition > static_cast<unsigned>(lastPositionOffset) && endPosition < positionOffset) { 199 201 endPosition = positionOffset; 200 202 alterEndPosition = false; … … 213 215 214 216 if (lastPositionOffset != -1 && lastPositionOffset - positionOffset > 1) { 215 if (alterStartPosition && startPosition > lastPositionOffset && startPosition < static_cast<int>(positionOffset)) {217 if (alterStartPosition && startPosition > static_cast<unsigned>(lastPositionOffset) && startPosition < positionOffset) { 216 218 startPosition = lastPositionOffset; 217 219 alterStartPosition = false; 218 220 } 219 221 220 if (alterEndPosition && endPosition > lastPositionOffset && endPosition < static_cast<int>(positionOffset)) {222 if (alterEndPosition && endPosition > static_cast<unsigned>(lastPositionOffset) && endPosition < positionOffset) { 221 223 endPosition = positionOffset; 222 224 alterEndPosition = false; … … 288 290 SubStringLengthData* data = static_cast<SubStringLengthData*>(queryData); 289 291 290 intstartPosition = data->startPosition;291 intendPosition = startPosition + data->length;292 unsigned startPosition = data->startPosition; 293 unsigned endPosition = startPosition + data->length; 292 294 if (!mapStartEndPositionsIntoFragmentCoordinates(queryData, fragment, startPosition, endPosition)) 293 295 return false; … … 323 325 StartPositionOfCharacterData* data = static_cast<StartPositionOfCharacterData*>(queryData); 324 326 325 intstartPosition = data->position;326 intendPosition = startPosition + 1;327 unsigned startPosition = data->position; 328 unsigned endPosition = startPosition + 1; 327 329 if (!mapStartEndPositionsIntoFragmentCoordinates(queryData, fragment, startPosition, endPosition)) 328 330 return false; … … 372 374 EndPositionOfCharacterData* data = static_cast<EndPositionOfCharacterData*>(queryData); 373 375 374 intstartPosition = data->position;375 intendPosition = startPosition + 1;376 unsigned startPosition = data->position; 377 unsigned endPosition = startPosition + 1; 376 378 if (!mapStartEndPositionsIntoFragmentCoordinates(queryData, fragment, startPosition, endPosition)) 377 379 return false; … … 420 422 RotationOfCharacterData* data = static_cast<RotationOfCharacterData*>(queryData); 421 423 422 intstartPosition = data->position;423 intendPosition = startPosition + 1;424 unsigned startPosition = data->position; 425 unsigned endPosition = startPosition + 1; 424 426 if (!mapStartEndPositionsIntoFragmentCoordinates(queryData, fragment, startPosition, endPosition)) 425 427 return false; … … 488 490 ExtentOfCharacterData* data = static_cast<ExtentOfCharacterData*>(queryData); 489 491 490 intstartPosition = data->position;491 intendPosition = startPosition + 1;492 unsigned startPosition = data->position; 493 unsigned endPosition = startPosition + 1; 492 494 if (!mapStartEndPositionsIntoFragmentCoordinates(queryData, fragment, startPosition, endPosition)) 493 495 return false; … … 523 525 FloatRect extent; 524 526 for (unsigned i = 0; i < fragment.length; ++i) { 525 intstartPosition = data->processedCharacters + i;526 intendPosition = startPosition + 1;527 unsigned startPosition = data->processedCharacters + i; 528 unsigned endPosition = startPosition + 1; 527 529 if (!mapStartEndPositionsIntoFragmentCoordinates(queryData, fragment, startPosition, endPosition)) 528 530 continue; -
trunk/Source/WebCore/rendering/svg/SVGTextQuery.h
r170268 r170337 53 53 54 54 void collectTextBoxesInFlowBox(InlineFlowBox*); 55 bool mapStartEndPositionsIntoFragmentCoordinates(Data*, const SVGTextFragment&, int& startPosition, int& endPosition) const;56 void modifyStartEndPositionsRespectingLigatures(Data*, int& startPosition, int& endPosition) const;55 bool mapStartEndPositionsIntoFragmentCoordinates(Data*, const SVGTextFragment&, unsigned& startPosition, unsigned& endPosition) const; 56 void modifyStartEndPositionsRespectingLigatures(Data*, unsigned& startPosition, unsigned& endPosition) const; 57 57 58 58 private: -
trunk/Source/WebCore/rendering/svg/SVGTextRunRenderingContext.cpp
r170268 r170337 104 104 class SVGGlyphToPathTranslator final : public GlyphToPathTranslator { 105 105 public: 106 SVGGlyphToPathTranslator(const TextRun* const, const GlyphBuffer&, const FloatPoint&, const SVGFontData&, SVGFontElement&, const int from, const intnumGlyphs, float scale, bool isVerticalText);106 SVGGlyphToPathTranslator(const TextRun* const, const GlyphBuffer&, const FloatPoint&, const SVGFontData&, SVGFontElement&, unsigned from, unsigned numGlyphs, float scale, bool isVerticalText); 107 107 private: 108 108 virtual bool containsMorePaths() override … … 124 124 FloatPoint m_glyphOrigin; 125 125 SVGGlyph m_svgGlyph; 126 intm_index;126 unsigned m_index; 127 127 Glyph m_glyph; 128 128 SVGFontElement& m_fontElement; 129 const floatm_stoppingPoint;129 const unsigned m_stoppingPoint; 130 130 const float m_scale; 131 131 const bool m_isVerticalText; 132 132 }; 133 133 134 SVGGlyphToPathTranslator::SVGGlyphToPathTranslator(const TextRun* const textRun, const GlyphBuffer& glyphBuffer, const FloatPoint& point, const SVGFontData& svgFontData, SVGFontElement& fontElement, const int from, const intnumGlyphs, float scale, bool isVerticalText)134 SVGGlyphToPathTranslator::SVGGlyphToPathTranslator(const TextRun* const textRun, const GlyphBuffer& glyphBuffer, const FloatPoint& point, const SVGFontData& svgFontData, SVGFontElement& fontElement, unsigned from, unsigned numGlyphs, float scale, bool isVerticalText) 135 135 : m_textRun(textRun) 136 136 , m_glyphBuffer(glyphBuffer) … … 288 288 } 289 289 290 GlyphData SVGTextRunRenderingContext::glyphDataForCharacter(const Font& font, WidthIterator& iterator, UChar32 character, bool mirror, intcurrentCharacter, unsigned& advanceLength)290 GlyphData SVGTextRunRenderingContext::glyphDataForCharacter(const Font& font, WidthIterator& iterator, UChar32 character, bool mirror, unsigned currentCharacter, unsigned& advanceLength) 291 291 { 292 292 const SimpleFontData* primaryFont = font.primaryFont(); -
trunk/Source/WebCore/rendering/svg/SVGTextRunRenderingContext.h
r170268 r170337 43 43 void setActivePaintingResource(RenderSVGResource* object) { m_activePaintingResource = object; } 44 44 45 virtual GlyphData glyphDataForCharacter(const Font&, WidthIterator&, UChar32 character, bool mirror, intcurrentCharacter, unsigned& advanceLength) override;45 virtual GlyphData glyphDataForCharacter(const Font&, WidthIterator&, UChar32 character, bool mirror, unsigned currentCharacter, unsigned& advanceLength) override; 46 46 virtual void drawSVGGlyphs(GraphicsContext*, const SimpleFontData*, const GlyphBuffer&, int from, int to, const FloatPoint&) const override; 47 47 virtual float floatWidthUsingSVGFont(const Font&, const TextRun&, int& charsConsumed, String& glyphName) const override; -
trunk/Source/WebCore/svg/SVGFontData.cpp
r170268 r170337 131 131 } 132 132 133 bool SVGFontData::applySVGGlyphSelection(WidthIterator& iterator, GlyphData& glyphData, bool mirror, intcurrentCharacter, unsigned& advanceLength) const133 bool SVGFontData::applySVGGlyphSelection(WidthIterator& iterator, GlyphData& glyphData, bool mirror, unsigned currentCharacter, unsigned& advanceLength) const 134 134 { 135 135 const TextRun& run = iterator.run(); 136 136 Vector<SVGGlyph::ArabicForm>& arabicForms = iterator.arabicForms(); 137 ASSERT( int(run.charactersLength()) >= currentCharacter);137 ASSERT(run.charactersLength() >= currentCharacter); 138 138 139 139 // Associate text with arabic forms, if needed. -
trunk/Source/WebCore/svg/SVGFontData.h
r170268 r170337 37 37 virtual float widthForSVGGlyph(Glyph, float fontSize) const override; 38 38 virtual bool fillSVGGlyphPage(GlyphPage*, unsigned offset, unsigned length, UChar* buffer, unsigned bufferLength, const SimpleFontData*) const override; 39 virtual bool applySVGGlyphSelection(WidthIterator&, GlyphData&, bool mirror, intcurrentCharacter, unsigned& advanceLength) const override;39 virtual bool applySVGGlyphSelection(WidthIterator&, GlyphData&, bool mirror, unsigned currentCharacter, unsigned& advanceLength) const override; 40 40 41 41 SVGFontFaceElement* svgFontFaceElement() const { return m_svgFontFaceElement; }
Note: See TracChangeset
for help on using the changeset viewer.