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

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

Issue 889563002: Make RenderObject::style() return a const object (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix a crashers (everything is building!) Created 5 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 | Annotate | Revision Log
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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 } 57 }
58 58
59 TextRun SVGTextMetrics::constructTextRun(RenderSVGInlineText* text, unsigned pos ition, unsigned length) 59 TextRun SVGTextMetrics::constructTextRun(RenderSVGInlineText* text, unsigned pos ition, unsigned length)
60 { 60 {
61 ASSERT(text->style()); 61 ASSERT(text->style());
62 return constructTextRun(text, position, length, text->style()->direction()); 62 return constructTextRun(text, position, length, text->style()->direction());
63 } 63 }
64 64
65 TextRun SVGTextMetrics::constructTextRun(RenderSVGInlineText* text, unsigned pos ition, unsigned length, TextDirection textDirection) 65 TextRun SVGTextMetrics::constructTextRun(RenderSVGInlineText* text, unsigned pos ition, unsigned length, TextDirection textDirection)
66 { 66 {
67 RenderStyle* style = text->style(); 67 const RenderStyle* style = text->style();
68 ASSERT(style); 68 ASSERT(style);
69 69
70 TextRun run(static_cast<const LChar*>(0) // characters, will be set below if non-zero. 70 TextRun run(static_cast<const LChar*>(0) // characters, will be set below if non-zero.
71 , 0 // length, will be set below if non-zero. 71 , 0 // length, will be set below if non-zero.
72 , 0 // xPos, only relevant with allowTabs=true 72 , 0 // xPos, only relevant with allowTabs=true
73 , 0 // padding, only relevant for justified text, not relevant f or SVG 73 , 0 // padding, only relevant for justified text, not relevant f or SVG
74 , TextRun::AllowTrailingExpansion 74 , TextRun::AllowTrailingExpansion
75 , textDirection 75 , textDirection
76 , isOverride(style->unicodeBidi()) /* directionalOverride */); 76 , isOverride(style->unicodeBidi()) /* directionalOverride */);
77 77
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 float scalingFactor = text->scalingFactor(); 110 float scalingFactor = text->scalingFactor();
111 ASSERT(scalingFactor); 111 ASSERT(scalingFactor);
112 112
113 m_width = width / scalingFactor; 113 m_width = width / scalingFactor;
114 m_height = text->scaledFont().fontMetrics().floatHeight() / scalingFactor; 114 m_height = text->scaledFont().fontMetrics().floatHeight() / scalingFactor;
115 115
116 m_length = length; 116 m_length = length;
117 } 117 }
118 118
119 } 119 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698