Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(253)

Side by Side Diff: third_party/WebKit/Source/core/layout/svg/SVGTextLayoutEngine.cpp

Issue 2610253004: Migrate WTF::Vector::append() to ::push_back() [part 9 of N] (Closed)
Patch Set: rebase Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 void SVGTextLayoutEngine::recordTextFragment(SVGInlineTextBox* textBox) { 148 void SVGTextLayoutEngine::recordTextFragment(SVGInlineTextBox* textBox) {
149 ASSERT(!m_currentTextFragment.length); 149 ASSERT(!m_currentTextFragment.length);
150 150
151 // Figure out length of fragment. 151 // Figure out length of fragment.
152 m_currentTextFragment.length = m_visualMetricsIterator.characterOffset() - 152 m_currentTextFragment.length = m_visualMetricsIterator.characterOffset() -
153 m_currentTextFragment.characterOffset; 153 m_currentTextFragment.characterOffset;
154 154
155 // Figure out fragment metrics. 155 // Figure out fragment metrics.
156 computeCurrentFragmentMetrics(textBox); 156 computeCurrentFragmentMetrics(textBox);
157 157
158 textBox->textFragments().append(m_currentTextFragment); 158 textBox->textFragments().push_back(m_currentTextFragment);
159 m_currentTextFragment = SVGTextFragment(); 159 m_currentTextFragment = SVGTextFragment();
160 } 160 }
161 161
162 void SVGTextLayoutEngine::beginTextPathLayout(SVGInlineFlowBox* flowBox) { 162 void SVGTextLayoutEngine::beginTextPathLayout(SVGInlineFlowBox* flowBox) {
163 // Build text chunks for all <textPath> children, using the line layout 163 // Build text chunks for all <textPath> children, using the line layout
164 // algorithm. This is needeed as text-anchor is just an additional startOffset 164 // algorithm. This is needeed as text-anchor is just an additional startOffset
165 // for text paths. 165 // for text paths.
166 SVGTextLayoutEngine lineLayout(m_descendantTextNodes); 166 SVGTextLayoutEngine lineLayout(m_descendantTextNodes);
167 lineLayout.m_textLengthSpacingInEffect = m_textLengthSpacingInEffect; 167 lineLayout.m_textLengthSpacingInEffect = m_textLengthSpacingInEffect;
168 lineLayout.layoutCharactersInTextBoxes(flowBox); 168 lineLayout.layoutCharactersInTextBoxes(flowBox);
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 230
231 const ComputedStyle& style = textLineLayout.styleRef(); 231 const ComputedStyle& style = textLineLayout.styleRef();
232 232
233 textBox->clearTextFragments(); 233 textBox->clearTextFragments();
234 m_isVerticalText = !style.isHorizontalWritingMode(); 234 m_isVerticalText = !style.isHorizontalWritingMode();
235 layoutTextOnLineOrPath(textBox, textLineLayout, style); 235 layoutTextOnLineOrPath(textBox, textLineLayout, style);
236 236
237 if (m_inPathLayout) 237 if (m_inPathLayout)
238 return; 238 return;
239 239
240 m_lineLayoutBoxes.append(textBox); 240 m_lineLayoutBoxes.push_back(textBox);
241 } 241 }
242 242
243 static bool definesTextLengthWithSpacing(const InlineFlowBox* start) { 243 static bool definesTextLengthWithSpacing(const InlineFlowBox* start) {
244 SVGTextContentElement* textContentElement = 244 SVGTextContentElement* textContentElement =
245 SVGTextContentElement::elementFromLineLayoutItem( 245 SVGTextContentElement::elementFromLineLayoutItem(
246 start->getLineLayoutItem()); 246 start->getLineLayoutItem());
247 return textContentElement && 247 return textContentElement &&
248 textContentElement->lengthAdjust()->currentValue()->enumValue() == 248 textContentElement->lengthAdjust()->currentValue()->enumValue() ==
249 SVGLengthAdjustSpacing && 249 SVGLengthAdjustSpacing &&
250 textContentElement->textLengthIsSpecifiedByUser(); 250 textContentElement->textLengthIsSpecifiedByUser();
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698