| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * * Redistributions of source code must retain the above copyright | 4 * * Redistributions of source code must retain the above copyright |
| 5 * notice, this list of conditions and the following disclaimer. | 5 * notice, this list of conditions and the following disclaimer. |
| 6 * * Redistributions in binary form must reproduce the above | 6 * * Redistributions in binary form must reproduce the above |
| 7 * copyright notice, this list of conditions and the following disclaimer | 7 * copyright notice, this list of conditions and the following disclaimer |
| 8 * in the documentation and/or other materials provided with the | 8 * in the documentation and/or other materials provided with the |
| 9 * distribution. | 9 * distribution. |
| 10 * * Neither the name of Google Inc. nor the names of its | 10 * * Neither the name of Google Inc. nor the names of its |
| (...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 605 const CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(value); | 605 const CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(value); |
| 606 | 606 |
| 607 if (primitiveValue.isLength()) | 607 if (primitiveValue.isLength()) |
| 608 return primitiveValue.computeLength<Length>(lineHeightToLengthConversion
Data(state)); | 608 return primitiveValue.computeLength<Length>(lineHeightToLengthConversion
Data(state)); |
| 609 if (primitiveValue.isPercentage()) | 609 if (primitiveValue.isPercentage()) |
| 610 return Length((state.style()->computedFontSize() * primitiveValue.getInt
Value()) / 100.0, Fixed); | 610 return Length((state.style()->computedFontSize() * primitiveValue.getInt
Value()) / 100.0, Fixed); |
| 611 if (primitiveValue.isNumber()) | 611 if (primitiveValue.isNumber()) |
| 612 return Length(primitiveValue.getDoubleValue() * 100.0, Percent); | 612 return Length(primitiveValue.getDoubleValue() * 100.0, Percent); |
| 613 if (primitiveValue.isCalculated()) { | 613 if (primitiveValue.isCalculated()) { |
| 614 Length zoomedLength = Length(primitiveValue.cssCalcValue()->toCalcValue(
lineHeightToLengthConversionData(state))); | 614 Length zoomedLength = Length(primitiveValue.cssCalcValue()->toCalcValue(
lineHeightToLengthConversionData(state))); |
| 615 return Length(valueForLength(zoomedLength, state.style()->computedFontSi
ze()), Fixed); | 615 return Length(valueForLength(zoomedLength, LayoutUnit(state.style()->com
putedFontSize())), Fixed); |
| 616 } | 616 } |
| 617 | 617 |
| 618 ASSERT(primitiveValue.getValueID() == CSSValueNormal); | 618 ASSERT(primitiveValue.getValueID() == CSSValueNormal); |
| 619 return ComputedStyle::initialLineHeight(); | 619 return ComputedStyle::initialLineHeight(); |
| 620 } | 620 } |
| 621 | 621 |
| 622 float StyleBuilderConverter::convertNumberOrPercentage(StyleResolverState& state
, const CSSValue& value) | 622 float StyleBuilderConverter::convertNumberOrPercentage(StyleResolverState& state
, const CSSValue& value) |
| 623 { | 623 { |
| 624 const CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(value); | 624 const CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(value); |
| 625 ASSERT(primitiveValue.isNumber() || primitiveValue.isPercentage()); | 625 ASSERT(primitiveValue.isNumber() || primitiveValue.isPercentage()); |
| (...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 977 | 977 |
| 978 PassRefPtr<StylePath> StyleBuilderConverter::convertPathOrNone(StyleResolverStat
e& state, const CSSValue& value) | 978 PassRefPtr<StylePath> StyleBuilderConverter::convertPathOrNone(StyleResolverStat
e& state, const CSSValue& value) |
| 979 { | 979 { |
| 980 if (value.isPathValue()) | 980 if (value.isPathValue()) |
| 981 return convertPath(state, value); | 981 return convertPath(state, value); |
| 982 ASSERT(value.isPrimitiveValue() && toCSSPrimitiveValue(value).getValueID() =
= CSSValueNone); | 982 ASSERT(value.isPrimitiveValue() && toCSSPrimitiveValue(value).getValueID() =
= CSSValueNone); |
| 983 return nullptr; | 983 return nullptr; |
| 984 } | 984 } |
| 985 | 985 |
| 986 } // namespace blink | 986 } // namespace blink |
| OLD | NEW |