OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) Research In Motion Limited 2010-2012. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2010-2012. All rights reserved. |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 const LayoutSVGInlineText* SVGTextLayoutEngine::currentLogicalCharacterMetrics( | 307 const LayoutSVGInlineText* SVGTextLayoutEngine::currentLogicalCharacterMetrics( |
308 SVGTextMetrics& logicalMetrics) { | 308 SVGTextMetrics& logicalMetrics) { |
309 // If we've consumed all text nodes, there can be no more metrics. | 309 // If we've consumed all text nodes, there can be no more metrics. |
310 if (m_currentLogicalTextNodeIndex == m_descendantTextNodes.size()) | 310 if (m_currentLogicalTextNodeIndex == m_descendantTextNodes.size()) |
311 return nullptr; | 311 return nullptr; |
312 | 312 |
313 const LayoutSVGInlineText* logicalTextNode = | 313 const LayoutSVGInlineText* logicalTextNode = |
314 m_descendantTextNodes[m_currentLogicalTextNodeIndex]; | 314 m_descendantTextNodes[m_currentLogicalTextNodeIndex]; |
315 const Vector<SVGTextMetrics>* metricsList = &logicalTextNode->metricsList(); | 315 const Vector<SVGTextMetrics>* metricsList = &logicalTextNode->metricsList(); |
316 unsigned metricsListSize = metricsList->size(); | 316 unsigned metricsListSize = metricsList->size(); |
317 DCHECK(m_logicalMetricsListOffset <= metricsListSize); | 317 DCHECK_LE(m_logicalMetricsListOffset, metricsListSize); |
318 | 318 |
319 // Find the next non-collapsed text metrics cell. | 319 // Find the next non-collapsed text metrics cell. |
320 while (true) { | 320 while (true) { |
321 // If we run out of metrics, move to the next set of non-empty layout | 321 // If we run out of metrics, move to the next set of non-empty layout |
322 // attributes. | 322 // attributes. |
323 if (m_logicalMetricsListOffset == metricsListSize) { | 323 if (m_logicalMetricsListOffset == metricsListSize) { |
324 logicalTextNode = nextLogicalTextNode(); | 324 logicalTextNode = nextLogicalTextNode(); |
325 if (!logicalTextNode) | 325 if (!logicalTextNode) |
326 return nullptr; | 326 return nullptr; |
327 metricsList = &logicalTextNode->metricsList(); | 327 metricsList = &logicalTextNode->metricsList(); |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
536 } | 536 } |
537 | 537 |
538 if (!didStartTextFragment) | 538 if (!didStartTextFragment) |
539 return; | 539 return; |
540 | 540 |
541 // Close last open fragment, if needed. | 541 // Close last open fragment, if needed. |
542 recordTextFragment(textBox); | 542 recordTextFragment(textBox); |
543 } | 543 } |
544 | 544 |
545 } // namespace blink | 545 } // namespace blink |
OLD | NEW |