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

Side by Side Diff: Source/core/rendering/style/RenderStyle.cpp

Issue 207573002: Remove FontDescription::mutableFontDescription (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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
« no previous file with comments | « no previous file | Source/platform/fonts/Font.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) 2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
4 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. 4 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 1211 matching lines...) Expand 10 before | Expand all | Expand 10 after
1222 // Negative value means the line height is not set. Use the font's built-in spacing. 1222 // Negative value means the line height is not set. Use the font's built-in spacing.
1223 if (lh.isNegative()) 1223 if (lh.isNegative())
1224 return fontMetrics().lineSpacing(); 1224 return fontMetrics().lineSpacing();
1225 1225
1226 if (lh.isPercent()) 1226 if (lh.isPercent())
1227 return minimumValueForLength(lh, fontSize()); 1227 return minimumValueForLength(lh, fontSize());
1228 1228
1229 return lh.value(); 1229 return lh.value();
1230 } 1230 }
1231 1231
1232 void RenderStyle::setWordSpacing(float v) { inherited.access()->font.mutableFont Description().setWordSpacing(v); } 1232 void RenderStyle::setWordSpacing(float wordSpacing)
1233 void RenderStyle::setLetterSpacing(float v) { inherited.access()->font.mutableFo ntDescription().setLetterSpacing(v); } 1233 {
1234 FontSelector* currentFontSelector = font().fontSelector();
1235 FontDescription desc(fontDescription());
1236 desc.setWordSpacing(wordSpacing);
1237 setFontDescription(desc);
1238 font().update(currentFontSelector);
1239 }
1240
1241 void RenderStyle::setLetterSpacing(float letterSpacing)
1242 {
1243 FontSelector* currentFontSelector = font().fontSelector();
1244 FontDescription desc(fontDescription());
1245 desc.setLetterSpacing(letterSpacing);
1246 setFontDescription(desc);
1247 font().update(currentFontSelector);
1248 }
1234 1249
1235 void RenderStyle::setFontSize(float size) 1250 void RenderStyle::setFontSize(float size)
1236 { 1251 {
1237 // size must be specifiedSize if Text Autosizing is enabled, but computedSiz e if text 1252 // size must be specifiedSize if Text Autosizing is enabled, but computedSiz e if text
1238 // zoom is enabled (if neither is enabled it's irrelevant as they're probabl y the same). 1253 // zoom is enabled (if neither is enabled it's irrelevant as they're probabl y the same).
1239 1254
1240 ASSERT(std::isfinite(size)); 1255 ASSERT(std::isfinite(size));
1241 if (!std::isfinite(size) || size < 0) 1256 if (!std::isfinite(size) || size < 0)
1242 size = 0; 1257 size = 0;
1243 else 1258 else
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
1640 // right 1655 // right
1641 radiiSum = radii.topRight().height() + radii.bottomRight().height(); 1656 radiiSum = radii.topRight().height() + radii.bottomRight().height();
1642 if (radiiSum > rect.height()) 1657 if (radiiSum > rect.height())
1643 factor = std::min(rect.height() / radiiSum, factor); 1658 factor = std::min(rect.height() / radiiSum, factor);
1644 1659
1645 ASSERT(factor <= 1); 1660 ASSERT(factor <= 1);
1646 return factor; 1661 return factor;
1647 } 1662 }
1648 1663
1649 } // namespace WebCore 1664 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | Source/platform/fonts/Font.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698