OLD | NEW |
1 /** | 1 /** |
2 * Copyright (C) 2007 Rob Buis <buis@kde.org> | 2 * Copyright (C) 2007 Rob Buis <buis@kde.org> |
3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> | 3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> |
4 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 4 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 16 matching lines...) Expand all Loading... |
27 #include "core/editing/Editor.h" | 27 #include "core/editing/Editor.h" |
28 #include "core/frame/LocalFrame.h" | 28 #include "core/frame/LocalFrame.h" |
29 #include "core/paint/SVGInlineTextBoxPainter.h" | 29 #include "core/paint/SVGInlineTextBoxPainter.h" |
30 #include "core/rendering/HitTestResult.h" | 30 #include "core/rendering/HitTestResult.h" |
31 #include "core/rendering/InlineFlowBox.h" | 31 #include "core/rendering/InlineFlowBox.h" |
32 #include "core/rendering/PaintInfo.h" | 32 #include "core/rendering/PaintInfo.h" |
33 #include "core/rendering/PointerEventsHitRules.h" | 33 #include "core/rendering/PointerEventsHitRules.h" |
34 #include "core/rendering/RenderInline.h" | 34 #include "core/rendering/RenderInline.h" |
35 #include "core/rendering/RenderTheme.h" | 35 #include "core/rendering/RenderTheme.h" |
36 #include "core/rendering/svg/RenderSVGInlineText.h" | 36 #include "core/rendering/svg/RenderSVGInlineText.h" |
37 #include "core/rendering/svg/SVGTextRunRenderingContext.h" | |
38 #include "platform/FloatConversion.h" | 37 #include "platform/FloatConversion.h" |
39 #include "platform/fonts/FontCache.h" | 38 #include "platform/fonts/FontCache.h" |
40 | 39 |
41 namespace blink { | 40 namespace blink { |
42 | 41 |
43 struct ExpectedSVGInlineTextBoxSize : public InlineTextBox { | 42 struct ExpectedSVGInlineTextBoxSize : public InlineTextBox { |
44 float float1; | 43 float float1; |
45 uint32_t bitfields : 1; | 44 uint32_t bitfields : 1; |
46 Vector<SVGTextFragment> vector; | 45 Vector<SVGTextFragment> vector; |
47 }; | 46 }; |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 , direction() | 192 , direction() |
194 , dirOverride() || style->rtlOrdering() == VisualOrder /* direct
ionalOverride */); | 193 , dirOverride() || style->rtlOrdering() == VisualOrder /* direct
ionalOverride */); |
195 | 194 |
196 if (fragment.length) { | 195 if (fragment.length) { |
197 if (text->is8Bit()) | 196 if (text->is8Bit()) |
198 run.setText(text->characters8() + fragment.characterOffset, fragment
.length); | 197 run.setText(text->characters8() + fragment.characterOffset, fragment
.length); |
199 else | 198 else |
200 run.setText(text->characters16() + fragment.characterOffset, fragmen
t.length); | 199 run.setText(text->characters16() + fragment.characterOffset, fragmen
t.length); |
201 } | 200 } |
202 | 201 |
203 if (textRunNeedsRenderingContext(style->font())) | |
204 run.setRenderingContext(SVGTextRunRenderingContext::create(text)); | |
205 | |
206 // We handle letter & word spacing ourselves. | 202 // We handle letter & word spacing ourselves. |
207 run.disableSpacing(); | 203 run.disableSpacing(); |
208 | 204 |
209 // Propagate the maximum length of the characters buffer to the TextRun, eve
n when we're only processing a substring. | 205 // Propagate the maximum length of the characters buffer to the TextRun, eve
n when we're only processing a substring. |
210 run.setCharactersLength(text->textLength() - fragment.characterOffset); | 206 run.setCharactersLength(text->textLength() - fragment.characterOffset); |
211 ASSERT(run.charactersLength() >= run.length()); | 207 ASSERT(run.charactersLength() >= run.length()); |
212 return run; | 208 return run; |
213 } | 209 } |
214 | 210 |
215 bool SVGInlineTextBox::mapStartEndPositionsIntoFragmentCoordinates(const SVGText
Fragment& fragment, int& startPosition, int& endPosition) const | 211 bool SVGInlineTextBox::mapStartEndPositionsIntoFragmentCoordinates(const SVGText
Fragment& fragment, int& startPosition, int& endPosition) const |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 renderer().updateHitTestResult(result, locationInContainer.point
() - toLayoutSize(accumulatedOffset)); | 288 renderer().updateHitTestResult(result, locationInContainer.point
() - toLayoutSize(accumulatedOffset)); |
293 if (!result.addNodeToRectBasedTestResult(renderer().node(), requ
est, locationInContainer, rect)) | 289 if (!result.addNodeToRectBasedTestResult(renderer().node(), requ
est, locationInContainer, rect)) |
294 return true; | 290 return true; |
295 } | 291 } |
296 } | 292 } |
297 } | 293 } |
298 return false; | 294 return false; |
299 } | 295 } |
300 | 296 |
301 } // namespace blink | 297 } // namespace blink |
OLD | NEW |