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

Side by Side Diff: third_party/WebKit/Source/core/style/ComputedStyle.cpp

Issue 1660863002: Force all LayoutUnit construction to be explicit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Also fix LayoutRectTest.cpp 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) 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 1363 matching lines...) Expand 10 before | Expand all | Expand 10 after
1374 int ComputedStyle::computedLineHeight() const 1374 int ComputedStyle::computedLineHeight() const
1375 { 1375 {
1376 const Length& lh = lineHeight(); 1376 const Length& lh = lineHeight();
1377 1377
1378 // Negative value means the line height is not set. Use the font's built-in 1378 // Negative value means the line height is not set. Use the font's built-in
1379 // spacing, if avalible. 1379 // spacing, if avalible.
1380 if (lh.isNegative() && font().primaryFont()) 1380 if (lh.isNegative() && font().primaryFont())
1381 return fontMetrics().lineSpacing(); 1381 return fontMetrics().lineSpacing();
1382 1382
1383 if (lh.hasPercent()) 1383 if (lh.hasPercent())
1384 return minimumValueForLength(lh, computedFontSize()); 1384 return minimumValueForLength(lh, LayoutUnit(computedFontSize()));
1385 1385
1386 return std::min(lh.value(), LayoutUnit::max().toFloat()); 1386 return std::min(lh.value(), LayoutUnit::max().toFloat());
1387 } 1387 }
1388 1388
1389 void ComputedStyle::setWordSpacing(float wordSpacing) 1389 void ComputedStyle::setWordSpacing(float wordSpacing)
1390 { 1390 {
1391 FontSelector* currentFontSelector = font().fontSelector(); 1391 FontSelector* currentFontSelector = font().fontSelector();
1392 FontDescription desc(fontDescription()); 1392 FontDescription desc(fontDescription());
1393 desc.setWordSpacing(wordSpacing); 1393 desc.setWordSpacing(wordSpacing);
1394 setFontDescription(desc); 1394 setFontDescription(desc);
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after
1874 if (!shadowList) 1874 if (!shadowList)
1875 return false; 1875 return false;
1876 for (size_t i = shadowList->shadows().size(); i--; ) { 1876 for (size_t i = shadowList->shadows().size(); i--; ) {
1877 if (shadowList->shadows()[i].color().isCurrentColor()) 1877 if (shadowList->shadows()[i].color().isCurrentColor())
1878 return true; 1878 return true;
1879 } 1879 }
1880 return false; 1880 return false;
1881 } 1881 }
1882 1882
1883 } // namespace blink 1883 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698