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

Side by Side Diff: Source/core/css/LayoutStyleCSSValueMapping.cpp

Issue 1017173002: Do not correct for zoom for number line-height (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add test Created 5 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
« no previous file with comments | « LayoutTests/fast/css/line-height-number-zoom-get-computed-style-expected.txt ('k') | no next file » | 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) 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 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 ASSERT(result->length() <= 3); 469 ASSERT(result->length() <= 3);
470 return result.release(); 470 return result.release();
471 } 471 }
472 472
473 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> valueForLineHeight(const Layout Style& style) 473 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> valueForLineHeight(const Layout Style& style)
474 { 474 {
475 Length length = style.lineHeight(); 475 Length length = style.lineHeight();
476 if (length.isNegative()) 476 if (length.isNegative())
477 return cssValuePool().createIdentifierValue(CSSValueNormal); 477 return cssValuePool().createIdentifierValue(CSSValueNormal);
478 478
479 return zoomAdjustedPixelValue(floatValueForLength(length, style.fontDescript ion().specifiedSize()), style); 479 float floatValue = floatValueForLength(length, style.fontDescription().speci fiedSize());
480 if (length.isPercent())
481 return cssValuePool().createValue(floatValue, CSSPrimitiveValue::CSS_PX) ;
482
483 return zoomAdjustedPixelValue(floatValue, style);
480 } 484 }
481 485
482 static CSSValueID identifierForFamily(const AtomicString& family) 486 static CSSValueID identifierForFamily(const AtomicString& family)
483 { 487 {
484 if (family == FontFamilyNames::webkit_cursive) 488 if (family == FontFamilyNames::webkit_cursive)
485 return CSSValueCursive; 489 return CSSValueCursive;
486 if (family == FontFamilyNames::webkit_fantasy) 490 if (family == FontFamilyNames::webkit_fantasy)
487 return CSSValueFantasy; 491 return CSSValueFantasy;
488 if (family == FontFamilyNames::webkit_monospace) 492 if (family == FontFamilyNames::webkit_monospace)
489 return CSSValueMonospace; 493 return CSSValueMonospace;
(...skipping 2078 matching lines...) Expand 10 before | Expand all | Expand 10 after
2568 return zoomAdjustedPixelValueForLength(svgStyle.ry(), style); 2572 return zoomAdjustedPixelValueForLength(svgStyle.ry(), style);
2569 2573
2570 case CSSPropertyAll: 2574 case CSSPropertyAll:
2571 return nullptr; 2575 return nullptr;
2572 } 2576 }
2573 ASSERT_NOT_REACHED(); 2577 ASSERT_NOT_REACHED();
2574 return nullptr; 2578 return nullptr;
2575 } 2579 }
2576 2580
2577 } 2581 }
OLDNEW
« no previous file with comments | « LayoutTests/fast/css/line-height-number-zoom-get-computed-style-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698