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

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 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 result->append(CSSPrimitiveValue::create(data.position())); 454 result->append(CSSPrimitiveValue::create(data.position()));
455 if ((data.position() >= ContentPositionCenter || data.distribution() != Cont entDistributionDefault) && data.overflow() != OverflowAlignmentDefault) 455 if ((data.position() >= ContentPositionCenter || data.distribution() != Cont entDistributionDefault) && data.overflow() != OverflowAlignmentDefault)
456 result->append(CSSPrimitiveValue::create(data.overflow())); 456 result->append(CSSPrimitiveValue::create(data.overflow()));
457 ASSERT(result->length() > 0); 457 ASSERT(result->length() > 0);
458 ASSERT(result->length() <= 3); 458 ASSERT(result->length() <= 3);
459 return result.release(); 459 return result.release();
460 } 460 }
461 461
462 static RawPtr<CSSPrimitiveValue> valueForLineHeight(const ComputedStyle& style) 462 static RawPtr<CSSPrimitiveValue> valueForLineHeight(const ComputedStyle& style)
463 { 463 {
464 Length length = style.lineHeight(); 464 return zoomAdjustedPixelValue(style.computedLineHeight(), style);
465 if (length.isNegative())
466 return cssValuePool().createIdentifierValue(CSSValueNormal);
467
468 return zoomAdjustedPixelValue(floatValueForLength(length, style.getFontDescr iption().computedSize()), style);
469 } 465 }
470 466
471 static CSSValueID identifierForFamily(const AtomicString& family) 467 static CSSValueID identifierForFamily(const AtomicString& family)
472 { 468 {
473 if (family == FontFamilyNames::webkit_cursive) 469 if (family == FontFamilyNames::webkit_cursive)
474 return CSSValueCursive; 470 return CSSValueCursive;
475 if (family == FontFamilyNames::webkit_fantasy) 471 if (family == FontFamilyNames::webkit_fantasy)
476 return CSSValueFantasy; 472 return CSSValueFantasy;
477 if (family == FontFamilyNames::webkit_monospace) 473 if (family == FontFamilyNames::webkit_monospace)
478 return CSSValueMonospace; 474 return CSSValueMonospace;
(...skipping 2279 matching lines...) Expand 10 before | Expand all | Expand 10 after
2758 case CSSPropertyAll: 2754 case CSSPropertyAll:
2759 return nullptr; 2755 return nullptr;
2760 default: 2756 default:
2761 break; 2757 break;
2762 } 2758 }
2763 ASSERT_NOT_REACHED(); 2759 ASSERT_NOT_REACHED();
2764 return nullptr; 2760 return nullptr;
2765 } 2761 }
2766 2762
2767 } // namespace blink 2763 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698