Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> valueForLineHeight(const Comput edStyle& style) | 462 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> valueForLineHeight(const Comput edStyle& style) |
| 463 { | 463 { |
| 464 Length length = style.lineHeight(); | 464 Length length = Length(style.computedLineHeight(), Fixed); |
| 465 if (length.isNegative()) | 465 if (length.isNegative()) |
| 466 return cssValuePool().createIdentifierValue(CSSValueNormal); | 466 return cssValuePool().createIdentifierValue(CSSValueNormal); |
| 467 | 467 |
| 468 return zoomAdjustedPixelValue(floatValueForLength(length, style.getFontDescr iption().computedSize()), style); | 468 return zoomAdjustedPixelValue(floatValueForLength(length, style.getFontDescr iption().computedSize()), style); |
|
Timothy Loh
2016/03/21 05:56:20
floatValueForLength resolves percentages but if yo
nainar
2016/03/21 06:21:45
No. You're right we can also omit the check for is
| |
| 469 } | 469 } |
| 470 | 470 |
| 471 static CSSValueID identifierForFamily(const AtomicString& family) | 471 static CSSValueID identifierForFamily(const AtomicString& family) |
| 472 { | 472 { |
| 473 if (family == FontFamilyNames::webkit_cursive) | 473 if (family == FontFamilyNames::webkit_cursive) |
| 474 return CSSValueCursive; | 474 return CSSValueCursive; |
| 475 if (family == FontFamilyNames::webkit_fantasy) | 475 if (family == FontFamilyNames::webkit_fantasy) |
| 476 return CSSValueFantasy; | 476 return CSSValueFantasy; |
| 477 if (family == FontFamilyNames::webkit_monospace) | 477 if (family == FontFamilyNames::webkit_monospace) |
| 478 return CSSValueMonospace; | 478 return CSSValueMonospace; |
| (...skipping 2275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2754 case CSSPropertyAll: | 2754 case CSSPropertyAll: |
| 2755 return nullptr; | 2755 return nullptr; |
| 2756 default: | 2756 default: |
| 2757 break; | 2757 break; |
| 2758 } | 2758 } |
| 2759 ASSERT_NOT_REACHED(); | 2759 ASSERT_NOT_REACHED(); |
| 2760 return nullptr; | 2760 return nullptr; |
| 2761 } | 2761 } |
| 2762 | 2762 |
| 2763 } // namespace blink | 2763 } // namespace blink |
| OLD | NEW |