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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 ASSERT(position < static_cast<int>(textLength())); | 148 ASSERT(position < static_cast<int>(textLength())); |
149 | 149 |
150 // Each <textPath> element starts a new text chunk, regardless of any x/y va
lues. | 150 // Each <textPath> element starts a new text chunk, regardless of any x/y va
lues. |
151 if (!position && parent()->isSVGTextPath() && !previousSibling()) | 151 if (!position && parent()->isSVGTextPath() && !previousSibling()) |
152 return true; | 152 return true; |
153 | 153 |
154 const SVGCharacterDataMap::const_iterator it = m_layoutAttributes.characterD
ataMap().find(static_cast<unsigned>(position + 1)); | 154 const SVGCharacterDataMap::const_iterator it = m_layoutAttributes.characterD
ataMap().find(static_cast<unsigned>(position + 1)); |
155 if (it == m_layoutAttributes.characterDataMap().end()) | 155 if (it == m_layoutAttributes.characterDataMap().end()) |
156 return false; | 156 return false; |
157 | 157 |
158 return it->value.x != SVGTextLayoutAttributes::emptyValue() || it->value.y !
= SVGTextLayoutAttributes::emptyValue(); | 158 return !SVGTextLayoutAttributes::isEmptyValue(it->value.x) || !SVGTextLayout
Attributes::isEmptyValue(it->value.y); |
159 } | 159 } |
160 | 160 |
161 PositionWithAffinity LayoutSVGInlineText::positionForPoint(const LayoutPoint& po
int) | 161 PositionWithAffinity LayoutSVGInlineText::positionForPoint(const LayoutPoint& po
int) |
162 { | 162 { |
163 if (!firstTextBox() || !textLength()) | 163 if (!firstTextBox() || !textLength()) |
164 return createPositionWithAffinity(0, DOWNSTREAM); | 164 return createPositionWithAffinity(0, DOWNSTREAM); |
165 | 165 |
166 ASSERT(m_scalingFactor); | 166 ASSERT(m_scalingFactor); |
167 float baseline = m_scaledFont.fontMetrics().floatAscent() / m_scalingFactor; | 167 float baseline = m_scaledFont.fontMetrics().floatAscent() / m_scalingFactor; |
168 | 168 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 | 255 |
256 PassRefPtr<StringImpl> LayoutSVGInlineText::originalText() const | 256 PassRefPtr<StringImpl> LayoutSVGInlineText::originalText() const |
257 { | 257 { |
258 RefPtr<StringImpl> result = LayoutText::originalText(); | 258 RefPtr<StringImpl> result = LayoutText::originalText(); |
259 if (!result) | 259 if (!result) |
260 return nullptr; | 260 return nullptr; |
261 return applySVGWhitespaceRules(result, style() && style()->whiteSpace() == P
RE); | 261 return applySVGWhitespaceRules(result, style() && style()->whiteSpace() == P
RE); |
262 } | 262 } |
263 | 263 |
264 } | 264 } |
OLD | NEW |