OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz> | 2 * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz> |
3 * Copyright (C) 2006 Apple Computer Inc. | 3 * Copyright (C) 2006 Apple Computer Inc. |
4 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> | 4 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> |
5 * Copyright (C) 2008 Rob Buis <buis@kde.org> | 5 * Copyright (C) 2008 Rob Buis <buis@kde.org> |
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 int offset = closestDistanceBox->offsetForPositionInFragment(*closestDistanc
eFragment, LayoutUnit(absolutePoint.x() - closestDistancePosition), true); | 190 int offset = closestDistanceBox->offsetForPositionInFragment(*closestDistanc
eFragment, LayoutUnit(absolutePoint.x() - closestDistancePosition), true); |
191 return createPositionWithAffinity(offset + closestDistanceBox->start(), offs
et > 0 ? VP_UPSTREAM_IF_POSSIBLE : TextAffinity::Downstream); | 191 return createPositionWithAffinity(offset + closestDistanceBox->start(), offs
et > 0 ? VP_UPSTREAM_IF_POSSIBLE : TextAffinity::Downstream); |
192 } | 192 } |
193 | 193 |
194 namespace { | 194 namespace { |
195 | 195 |
196 inline bool isValidSurrogatePair(const TextRun& run, unsigned index) | 196 inline bool isValidSurrogatePair(const TextRun& run, unsigned index) |
197 { | 197 { |
198 if (!U16_IS_LEAD(run[index])) | 198 if (!U16_IS_LEAD(run[index])) |
199 return false; | 199 return false; |
200 if (index + 1 >= static_cast<unsigned>(run.charactersLength())) | 200 if (index + 1 >= static_cast<unsigned>(run.length())) |
201 return false; | 201 return false; |
202 return U16_IS_TRAIL(run[index + 1]); | 202 return U16_IS_TRAIL(run[index + 1]); |
203 } | 203 } |
204 | 204 |
205 TextRun constructTextRun(LayoutSVGInlineText& text, unsigned position, unsigned
length, TextDirection textDirection) | 205 TextRun constructTextRun(LayoutSVGInlineText& text, unsigned position, unsigned
length, TextDirection textDirection) |
206 { | 206 { |
207 const ComputedStyle& style = text.styleRef(); | 207 const ComputedStyle& style = text.styleRef(); |
208 | 208 |
209 TextRun run(static_cast<const LChar*>(nullptr) // characters, will be set be
low if non-zero. | 209 TextRun run(static_cast<const LChar*>(nullptr) // characters, will be set be
low if non-zero. |
210 , 0 // length, will be set below if non-zero. | 210 , 0 // length, will be set below if non-zero. |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 | 378 |
379 PassRefPtr<StringImpl> LayoutSVGInlineText::originalText() const | 379 PassRefPtr<StringImpl> LayoutSVGInlineText::originalText() const |
380 { | 380 { |
381 RefPtr<StringImpl> result = LayoutText::originalText(); | 381 RefPtr<StringImpl> result = LayoutText::originalText(); |
382 if (!result) | 382 if (!result) |
383 return nullptr; | 383 return nullptr; |
384 return normalizeWhitespace(result); | 384 return normalizeWhitespace(result); |
385 } | 385 } |
386 | 386 |
387 } // namespace blink | 387 } // namespace blink |
OLD | NEW |