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

Side by Side Diff: third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.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) 2004 Zack Rusin <zack@kde.org> 2 * Copyright (C) 2004 Zack Rusin <zack@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
6 * Copyright (C) 2011 Sencha, Inc. All rights reserved. 6 * Copyright (C) 2011 Sencha, Inc. All rights reserved.
7 * Copyright (C) 2015 Google Inc. All rights reserved. 7 * Copyright (C) 2015 Google Inc. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public 10 * modify it under the terms of the GNU Lesser General Public
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 result->append(CSSPrimitiveValue::create(data.position())); 508 result->append(CSSPrimitiveValue::create(data.position()));
509 if ((data.position() >= ContentPositionCenter || data.distribution() != Cont entDistributionDefault) && data.overflow() != OverflowAlignmentDefault) 509 if ((data.position() >= ContentPositionCenter || data.distribution() != Cont entDistributionDefault) && data.overflow() != OverflowAlignmentDefault)
510 result->append(CSSPrimitiveValue::create(data.overflow())); 510 result->append(CSSPrimitiveValue::create(data.overflow()));
511 ASSERT(result->length() > 0); 511 ASSERT(result->length() > 0);
512 ASSERT(result->length() <= 3); 512 ASSERT(result->length() <= 3);
513 return result; 513 return result;
514 } 514 }
515 515
516 static CSSPrimitiveValue* valueForLineHeight(const ComputedStyle& style) 516 static CSSPrimitiveValue* valueForLineHeight(const ComputedStyle& style)
517 { 517 {
518 Length length = style.lineHeight(); 518 return zoomAdjustedPixelValue(style.floatComputedLineHeight(), style);
519 if (length.isNegative())
520 return cssValuePool().createIdentifierValue(CSSValueNormal);
521
522 return zoomAdjustedPixelValue(floatValueForLength(length, style.getFontDescr iption().computedSize()), style);
523 } 519 }
524 520
525 static CSSValueID identifierForFamily(const AtomicString& family) 521 static CSSValueID identifierForFamily(const AtomicString& family)
526 { 522 {
527 if (family == FontFamilyNames::webkit_cursive) 523 if (family == FontFamilyNames::webkit_cursive)
528 return CSSValueCursive; 524 return CSSValueCursive;
529 if (family == FontFamilyNames::webkit_fantasy) 525 if (family == FontFamilyNames::webkit_fantasy)
530 return CSSValueFantasy; 526 return CSSValueFantasy;
531 if (family == FontFamilyNames::webkit_monospace) 527 if (family == FontFamilyNames::webkit_monospace)
532 return CSSValueMonospace; 528 return CSSValueMonospace;
(...skipping 2279 matching lines...) Expand 10 before | Expand all | Expand 10 after
2812 case CSSPropertyAll: 2808 case CSSPropertyAll:
2813 return nullptr; 2809 return nullptr;
2814 default: 2810 default:
2815 break; 2811 break;
2816 } 2812 }
2817 ASSERT_NOT_REACHED(); 2813 ASSERT_NOT_REACHED();
2818 return nullptr; 2814 return nullptr;
2819 } 2815 }
2820 2816
2821 } // namespace blink 2817 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698