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

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

Issue 899163003: Move rendering/RenderObject to layout/LayoutObject. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz> 2 * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz>
3 * Copyright (C) 2006 Apple Computer Inc. 3 * Copyright (C) 2006 Apple Computer Inc.
4 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> 4 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org>
5 * Copyright (C) 2008 Rob Buis <buis@kde.org> 5 * Copyright (C) 2008 Rob Buis <buis@kde.org>
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 201
202 int offset = closestDistanceBox->offsetForPositionInFragment(*closestDistanc eFragment, absolutePoint.x() - closestDistancePosition, true); 202 int offset = closestDistanceBox->offsetForPositionInFragment(*closestDistanc eFragment, absolutePoint.x() - closestDistancePosition, true);
203 return createPositionWithAffinity(offset + closestDistanceBox->start(), offs et > 0 ? VP_UPSTREAM_IF_POSSIBLE : DOWNSTREAM); 203 return createPositionWithAffinity(offset + closestDistanceBox->start(), offs et > 0 ? VP_UPSTREAM_IF_POSSIBLE : DOWNSTREAM);
204 } 204 }
205 205
206 void RenderSVGInlineText::updateScaledFont() 206 void RenderSVGInlineText::updateScaledFont()
207 { 207 {
208 computeNewScaledFontForStyle(this, style(), m_scalingFactor, m_scaledFont); 208 computeNewScaledFontForStyle(this, style(), m_scalingFactor, m_scaledFont);
209 } 209 }
210 210
211 void RenderSVGInlineText::computeNewScaledFontForStyle(RenderObject* renderer, c onst RenderStyle* style, float& scalingFactor, Font& scaledFont) 211 void RenderSVGInlineText::computeNewScaledFontForStyle(LayoutObject* renderer, c onst RenderStyle* style, float& scalingFactor, Font& scaledFont)
212 { 212 {
213 ASSERT(style); 213 ASSERT(style);
214 ASSERT(renderer); 214 ASSERT(renderer);
215 215
216 // Alter font-size to the right on-screen value to avoid scaling the glyphs themselves, except when GeometricPrecision is specified. 216 // Alter font-size to the right on-screen value to avoid scaling the glyphs themselves, except when GeometricPrecision is specified.
217 scalingFactor = SVGRenderingContext::calculateScreenFontSizeScalingFactor(re nderer); 217 scalingFactor = SVGRenderingContext::calculateScreenFontSizeScalingFactor(re nderer);
218 if (style->effectiveZoom() == 1 && (scalingFactor == 1 || !scalingFactor)) { 218 if (style->effectiveZoom() == 1 && (scalingFactor == 1 || !scalingFactor)) {
219 scalingFactor = 1; 219 scalingFactor = 1;
220 scaledFont = style->font(); 220 scaledFont = style->font();
221 return; 221 return;
(...skipping 22 matching lines...) Expand all
244 244
245 PassRefPtr<StringImpl> RenderSVGInlineText::originalText() const 245 PassRefPtr<StringImpl> RenderSVGInlineText::originalText() const
246 { 246 {
247 RefPtr<StringImpl> result = RenderText::originalText(); 247 RefPtr<StringImpl> result = RenderText::originalText();
248 if (!result) 248 if (!result)
249 return nullptr; 249 return nullptr;
250 return applySVGWhitespaceRules(result, style() && style()->whiteSpace() == P RE); 250 return applySVGWhitespaceRules(result, style() && style()->whiteSpace() == P RE);
251 } 251 }
252 252
253 } 253 }
OLDNEW
« no previous file with comments | « Source/core/rendering/svg/RenderSVGInlineText.h ('k') | Source/core/rendering/svg/RenderSVGModelObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698