OLD | NEW |
1 /* | 1 /* |
2 Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 Copyright (C) 2006, 2008 Apple Inc. All rights reserved. | 3 Copyright (C) 2006, 2008 Apple Inc. All rights reserved. |
4 Copyright (C) 2011 Rik Cabanier (cabanier@adobe.com) | 4 Copyright (C) 2011 Rik Cabanier (cabanier@adobe.com) |
5 Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. | 5 Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. |
6 Copyright (C) 2012 Motorola Mobility, Inc. All rights reserved. | 6 Copyright (C) 2012 Motorola Mobility, Inc. All rights reserved. |
7 | 7 |
8 This library is free software; you can redistribute it and/or | 8 This library is free software; you can redistribute it and/or |
9 modify it under the terms of the GNU Library General Public | 9 modify it under the terms of the GNU Library General Public |
10 License as published by the Free Software Foundation; either | 10 License as published by the Free Software Foundation; either |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 ASSERT_NOT_REACHED(); | 57 ASSERT_NOT_REACHED(); |
58 return 0; | 58 return 0; |
59 } | 59 } |
60 | 60 |
61 LayoutUnit minimumValueForLength(const Length& length, | 61 LayoutUnit minimumValueForLength(const Length& length, |
62 LayoutUnit maximumValue) { | 62 LayoutUnit maximumValue) { |
63 switch (length.type()) { | 63 switch (length.type()) { |
64 case Fixed: | 64 case Fixed: |
65 return LayoutUnit(length.value()); | 65 return LayoutUnit(length.value()); |
66 case Percent: | 66 case Percent: |
67 // Don't remove the extra cast to float. It is needed for rounding on 32-b
it Intel machines that use the FPU stack. | 67 // Don't remove the extra cast to float. It is needed for rounding on |
| 68 // 32-bit Intel machines that use the FPU stack. |
68 return LayoutUnit( | 69 return LayoutUnit( |
69 static_cast<float>(maximumValue * length.percent() / 100.0f)); | 70 static_cast<float>(maximumValue * length.percent() / 100.0f)); |
70 case Calculated: | 71 case Calculated: |
71 return LayoutUnit(length.nonNanCalculatedValue(maximumValue)); | 72 return LayoutUnit(length.nonNanCalculatedValue(maximumValue)); |
72 case FillAvailable: | 73 case FillAvailable: |
73 case Auto: | 74 case Auto: |
74 return LayoutUnit(); | 75 return LayoutUnit(); |
75 case MinContent: | 76 case MinContent: |
76 case MaxContent: | 77 case MaxContent: |
77 case FitContent: | 78 case FitContent: |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 floatValueForLength(lengthSize.height(), boxSize.height())); | 124 floatValueForLength(lengthSize.height(), boxSize.height())); |
124 } | 125 } |
125 | 126 |
126 FloatPoint floatPointForLengthPoint(const LengthPoint& LengthPoint, | 127 FloatPoint floatPointForLengthPoint(const LengthPoint& LengthPoint, |
127 const FloatSize& boxSize) { | 128 const FloatSize& boxSize) { |
128 return FloatPoint(floatValueForLength(LengthPoint.x(), boxSize.width()), | 129 return FloatPoint(floatValueForLength(LengthPoint.x(), boxSize.width()), |
129 floatValueForLength(LengthPoint.y(), boxSize.height())); | 130 floatValueForLength(LengthPoint.y(), boxSize.height())); |
130 } | 131 } |
131 | 132 |
132 } // namespace blink | 133 } // namespace blink |
OLD | NEW |