| 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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 | 192 |
| 193 SVGTextLayoutAttributes* attributes = text->layoutAttributes(); | 193 SVGTextLayoutAttributes* attributes = text->layoutAttributes(); |
| 194 Vector<SVGTextMetrics>* textMetricsValues = &attributes->textMetricsValues()
; | 194 Vector<SVGTextMetrics>* textMetricsValues = &attributes->textMetricsValues()
; |
| 195 if (processLayoutObject) { | 195 if (processLayoutObject) { |
| 196 if (data->allCharactersMap) | 196 if (data->allCharactersMap) |
| 197 attributes->clear(); | 197 attributes->clear(); |
| 198 else | 198 else |
| 199 textMetricsValues->clear(); | 199 textMetricsValues->clear(); |
| 200 } | 200 } |
| 201 | 201 |
| 202 if (!text->textLength()) |
| 203 return; |
| 204 |
| 202 // TODO(pdr): This loop is too tightly coupled to SVGTextMetricsCalculator. | 205 // TODO(pdr): This loop is too tightly coupled to SVGTextMetricsCalculator. |
| 203 // We should refactor SVGTextMetricsCalculator to be a simple bidi run | 206 // We should refactor SVGTextMetricsCalculator to be a simple bidi run |
| 204 // iterator and move all subrun logic to a single function. | 207 // iterator and move all subrun logic to a single function. |
| 205 SVGTextMetricsCalculator calculator(text); | 208 SVGTextMetricsCalculator calculator(text); |
| 206 bool preserveWhiteSpace = text->style()->whiteSpace() == PRE; | 209 bool preserveWhiteSpace = text->style()->whiteSpace() == PRE; |
| 207 unsigned surrogatePairCharacters = 0; | 210 unsigned surrogatePairCharacters = 0; |
| 208 unsigned skippedCharacters = 0; | 211 unsigned skippedCharacters = 0; |
| 209 do { | 212 do { |
| 210 SVGTextMetrics metrics = calculator.currentCharacterMetrics(); | 213 SVGTextMetrics metrics = calculator.currentCharacterMetrics(); |
| 211 if (!metrics.length()) | 214 if (!metrics.length()) |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 } | 277 } |
| 275 | 278 |
| 276 void SVGTextMetricsBuilder::buildMetricsAndLayoutAttributes(LayoutSVGText* textR
oot, LayoutSVGInlineText* stopAtLeaf, SVGCharacterDataMap& allCharactersMap) | 279 void SVGTextMetricsBuilder::buildMetricsAndLayoutAttributes(LayoutSVGText* textR
oot, LayoutSVGInlineText* stopAtLeaf, SVGCharacterDataMap& allCharactersMap) |
| 277 { | 280 { |
| 278 ASSERT(textRoot); | 281 ASSERT(textRoot); |
| 279 MeasureTextData data(&allCharactersMap); | 282 MeasureTextData data(&allCharactersMap); |
| 280 walkTree(textRoot, stopAtLeaf, &data); | 283 walkTree(textRoot, stopAtLeaf, &data); |
| 281 } | 284 } |
| 282 | 285 |
| 283 } // namespace blink | 286 } // namespace blink |
| OLD | NEW |