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

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

Issue 1625683003: [Line Layout API] Some harder SVGTextLayoutEngine changes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@3_api_easy_svg
Patch Set: remove shim; rename elementFromLayoutObject Created 4 years, 10 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. All rights reserved. 2 * Copyright (C) Research In Motion Limited 2010. 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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 void SVGTextChunkBuilder::handleTextChunk(BoxListConstIterator boxStart, BoxList ConstIterator boxEnd) 179 void SVGTextChunkBuilder::handleTextChunk(BoxListConstIterator boxStart, BoxList ConstIterator boxEnd)
180 { 180 {
181 ASSERT(*boxStart); 181 ASSERT(*boxStart);
182 182
183 const LineLayoutSVGInlineText textLineLayout = LineLayoutSVGInlineText((*box Start)->lineLayoutItem()); 183 const LineLayoutSVGInlineText textLineLayout = LineLayoutSVGInlineText((*box Start)->lineLayoutItem());
184 const ComputedStyle& style = textLineLayout.styleRef(); 184 const ComputedStyle& style = textLineLayout.styleRef();
185 185
186 // Handle 'lengthAdjust' property. 186 // Handle 'lengthAdjust' property.
187 float desiredTextLength = 0; 187 float desiredTextLength = 0;
188 SVGLengthAdjustType lengthAdjust = SVGLengthAdjustUnknown; 188 SVGLengthAdjustType lengthAdjust = SVGLengthAdjustUnknown;
189 if (SVGTextContentElement* textContentElement = SVGTextContentElement::eleme ntFromLayoutObject(textLineLayout.parent())) { 189 if (SVGTextContentElement* textContentElement = SVGTextContentElement::eleme ntFromLineLayoutItem(textLineLayout.parent())) {
190 lengthAdjust = textContentElement->lengthAdjust()->currentValue()->enumV alue(); 190 lengthAdjust = textContentElement->lengthAdjust()->currentValue()->enumV alue();
191 191
192 SVGLengthContext lengthContext(textContentElement); 192 SVGLengthContext lengthContext(textContentElement);
193 if (textContentElement->textLengthIsSpecifiedByUser()) 193 if (textContentElement->textLengthIsSpecifiedByUser())
194 desiredTextLength = textContentElement->textLength()->currentValue() ->value(lengthContext); 194 desiredTextLength = textContentElement->textLength()->currentValue() ->value(lengthContext);
195 else 195 else
196 desiredTextLength = 0; 196 desiredTextLength = 0;
197 } 197 }
198 198
199 bool processTextLength = desiredTextLength > 0; 199 bool processTextLength = desiredTextLength > 0;
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 { 284 {
285 for (SVGTextFragment& fragment : fragments) { 285 for (SVGTextFragment& fragment : fragments) {
286 if (isVerticalText) 286 if (isVerticalText)
287 fragment.y += textAnchorShift; 287 fragment.y += textAnchorShift;
288 else 288 else
289 fragment.x += textAnchorShift; 289 fragment.x += textAnchorShift;
290 } 290 }
291 } 291 }
292 292
293 } // namespace blink 293 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698