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

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

Issue 1820773002: getComputedStyle() should return used value for 'line-height' (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 1334 matching lines...) Expand 10 before | Expand all | Expand 10 after
1345 // too, though this involves messily poking into CalcExpressionLength. 1345 // too, though this involves messily poking into CalcExpressionLength.
1346 float multiplier = textAutosizingMultiplier(); 1346 float multiplier = textAutosizingMultiplier();
1347 if (multiplier > 1 && lh.isFixed()) 1347 if (multiplier > 1 && lh.isFixed())
1348 return Length(TextAutosizer::computeAutosizedFontSize(lh.value(), multip lier), Fixed); 1348 return Length(TextAutosizer::computeAutosizedFontSize(lh.value(), multip lier), Fixed);
1349 1349
1350 return lh; 1350 return lh;
1351 } 1351 }
1352 1352
1353 void ComputedStyle::setLineHeight(const Length& specifiedLineHeight) { SET_VAR(i nherited, line_height, specifiedLineHeight); } 1353 void ComputedStyle::setLineHeight(const Length& specifiedLineHeight) { SET_VAR(i nherited, line_height, specifiedLineHeight); }
1354 1354
1355 int ComputedStyle::computedLineHeight() const 1355 float ComputedStyle::computedLineHeight() const
1356 { 1356 {
1357 const Length& lh = lineHeight(); 1357 const Length& lh = lineHeight();
1358 1358
1359 // Negative value means the line height is not set. Use the font's built-in 1359 // Negative value means the line height is not set. Use the font's built-in
1360 // spacing, if avalible. 1360 // spacing, if avalible.
1361 if (lh.isNegative() && font().primaryFont()) 1361 if (lh.isNegative() && font().primaryFont())
1362 return getFontMetrics().lineSpacing(); 1362 return getFontMetrics().lineSpacing();
1363 1363
1364 if (lh.hasPercent()) 1364 if (lh.hasPercent())
1365 return minimumValueForLength(lh, LayoutUnit(computedFontSize())); 1365 return minimumValueForLength(lh, LayoutUnit(computedFontSize()));
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
1853 if (!shadowList) 1853 if (!shadowList)
1854 return false; 1854 return false;
1855 for (size_t i = shadowList->shadows().size(); i--; ) { 1855 for (size_t i = shadowList->shadows().size(); i--; ) {
1856 if (shadowList->shadows()[i].color().isCurrentColor()) 1856 if (shadowList->shadows()[i].color().isCurrentColor())
1857 return true; 1857 return true;
1858 } 1858 }
1859 return false; 1859 return false;
1860 } 1860 }
1861 1861
1862 } // namespace blink 1862 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698