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

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

Issue 1647313003: Continue converting to explicit LayoutUnit constructors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@explicitContstructors
Patch Set: Add TODO 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) 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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 closestDistanceBox = textBox; 186 closestDistanceBox = textBox;
187 closestDistanceFragment = &fragment; 187 closestDistanceFragment = &fragment;
188 closestDistancePosition = fragmentRect.x(); 188 closestDistancePosition = fragmentRect.x();
189 } 189 }
190 } 190 }
191 } 191 }
192 192
193 if (!closestDistanceFragment) 193 if (!closestDistanceFragment)
194 return createPositionWithAffinity(0); 194 return createPositionWithAffinity(0);
195 195
196 int offset = closestDistanceBox->offsetForPositionInFragment(*closestDistanc eFragment, absolutePoint.x() - closestDistancePosition, true); 196 int offset = closestDistanceBox->offsetForPositionInFragment(*closestDistanc eFragment, LayoutUnit(absolutePoint.x() - closestDistancePosition), true);
197 return createPositionWithAffinity(offset + closestDistanceBox->start(), offs et > 0 ? VP_UPSTREAM_IF_POSSIBLE : TextAffinity::Downstream); 197 return createPositionWithAffinity(offset + closestDistanceBox->start(), offs et > 0 ? VP_UPSTREAM_IF_POSSIBLE : TextAffinity::Downstream);
198 } 198 }
199 199
200 void LayoutSVGInlineText::updateScaledFont() 200 void LayoutSVGInlineText::updateScaledFont()
201 { 201 {
202 computeNewScaledFontForStyle(this, m_scalingFactor, m_scaledFont); 202 computeNewScaledFontForStyle(this, m_scalingFactor, m_scaledFont);
203 } 203 }
204 204
205 void LayoutSVGInlineText::computeNewScaledFontForStyle(LayoutObject* layoutObjec t, float& scalingFactor, Font& scaledFont) 205 void LayoutSVGInlineText::computeNewScaledFontForStyle(LayoutObject* layoutObjec t, float& scalingFactor, Font& scaledFont)
206 { 206 {
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 239
240 PassRefPtr<StringImpl> LayoutSVGInlineText::originalText() const 240 PassRefPtr<StringImpl> LayoutSVGInlineText::originalText() const
241 { 241 {
242 RefPtr<StringImpl> result = LayoutText::originalText(); 242 RefPtr<StringImpl> result = LayoutText::originalText();
243 if (!result) 243 if (!result)
244 return nullptr; 244 return nullptr;
245 return applySVGWhitespaceRules(result, style() && style()->whiteSpace() == P RE); 245 return applySVGWhitespaceRules(result, style() && style()->whiteSpace() == P RE);
246 } 246 }
247 247
248 } // namespace blink 248 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698