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

Side by Side Diff: Source/core/rendering/svg/SVGTextChunkBuilder.cpp

Issue 112003003: [SVG] SVGLength{,List} migration to new SVG property impl. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: revert aggressive svgAttributeChanged, add NeedsRebaseline Created 6 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 | Annotate | Revision Log
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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 break; 120 break;
121 case TA_END: 121 case TA_END:
122 chunkStyle |= SVGTextChunk::EndAnchor; 122 chunkStyle |= SVGTextChunk::EndAnchor;
123 break; 123 break;
124 }; 124 };
125 125
126 // Handle 'lengthAdjust' property. 126 // Handle 'lengthAdjust' property.
127 float desiredTextLength = 0; 127 float desiredTextLength = 0;
128 if (SVGTextContentElement* textContentElement = SVGTextContentElement::eleme ntFromRenderer(textRenderer->parent())) { 128 if (SVGTextContentElement* textContentElement = SVGTextContentElement::eleme ntFromRenderer(textRenderer->parent())) {
129 SVGLengthContext lengthContext(textContentElement); 129 SVGLengthContext lengthContext(textContentElement);
130 desiredTextLength = textContentElement->specifiedTextLength().value(leng thContext); 130 if (textContentElement->textLengthIsSpecifiedByUser())
131 desiredTextLength = textContentElement->textLength()->currentValue() ->value(lengthContext);
132 else
133 desiredTextLength = 0;
131 134
132 switch (textContentElement->lengthAdjustCurrentValue()) { 135 switch (textContentElement->lengthAdjustCurrentValue()) {
133 case SVGLengthAdjustUnknown: 136 case SVGLengthAdjustUnknown:
134 break; 137 break;
135 case SVGLengthAdjustSpacing: 138 case SVGLengthAdjustSpacing:
136 chunkStyle |= SVGTextChunk::LengthAdjustSpacing; 139 chunkStyle |= SVGTextChunk::LengthAdjustSpacing;
137 break; 140 break;
138 case SVGLengthAdjustSpacingAndGlyphs: 141 case SVGLengthAdjustSpacingAndGlyphs:
139 chunkStyle |= SVGTextChunk::LengthAdjustSpacingAndGlyphs; 142 chunkStyle |= SVGTextChunk::LengthAdjustSpacingAndGlyphs;
140 break; 143 break;
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 256
254 if (isVerticalText) 257 if (isVerticalText)
255 spacingAndGlyphsTransform.scaleNonUniform(1, scale); 258 spacingAndGlyphsTransform.scaleNonUniform(1, scale);
256 else 259 else
257 spacingAndGlyphsTransform.scaleNonUniform(scale, 1); 260 spacingAndGlyphsTransform.scaleNonUniform(scale, 1);
258 261
259 spacingAndGlyphsTransform.translate(-fragment.x, -fragment.y); 262 spacingAndGlyphsTransform.translate(-fragment.x, -fragment.y);
260 } 263 }
261 264
262 } 265 }
OLDNEW
« no previous file with comments | « Source/core/rendering/svg/SVGRenderTreeAsText.cpp ('k') | Source/core/rendering/svg/SVGTextLayoutAttributesBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698