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 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
61 | 61 |
62 namespace WebCore { | 62 namespace WebCore { |
63 | 63 |
64 static PassRefPtr<AnimatableValue> createFromLength(const Length& length, const RenderStyle& style) | 64 static PassRefPtr<AnimatableValue> createFromLength(const Length& length, const RenderStyle& style) |
65 { | 65 { |
66 switch (length.type()) { | 66 switch (length.type()) { |
67 case Fixed: | 67 case Fixed: |
68 return AnimatableLength::create(adjustFloatForAbsoluteZoom(length.value( ), style), AnimatableLength::UnitTypePixels); | 68 return AnimatableLength::create(adjustFloatForAbsoluteZoom(length.value( ), style), AnimatableLength::UnitTypePixels); |
69 case Percent: | 69 case Percent: |
70 return AnimatableLength::create(length.value(), AnimatableLength::UnitTy pePercentage); | 70 return AnimatableLength::create(length.value(), AnimatableLength::UnitTy pePercentage); |
71 case ViewportPercentageWidth: | |
72 return AnimatableLength::create(length.value(), AnimatableLength::UnitTy peViewportWidth); | |
73 case ViewportPercentageHeight: | |
74 return AnimatableLength::create(length.value(), AnimatableLength::UnitTy peViewportHeight); | |
75 case ViewportPercentageMin: | |
76 return AnimatableLength::create(length.value(), AnimatableLength::UnitTy peViewportMin); | |
77 case ViewportPercentageMax: | |
78 return AnimatableLength::create(length.value(), AnimatableLength::UnitTy peViewportMax); | |
79 case Calculated: | 71 case Calculated: |
80 return AnimatableLength::create(CSSCalcValue::createExpressionNode(lengt h.calculationValue()->expression(), style.effectiveZoom())); | 72 return AnimatableLength::create(CSSCalcValue::createExpressionNode(lengt h.calculationValue()->expression(), style.effectiveZoom())); |
81 case Auto: | 73 case Auto: |
82 case Intrinsic: | 74 case Intrinsic: |
83 case MinIntrinsic: | 75 case MinIntrinsic: |
84 case MinContent: | 76 case MinContent: |
85 case MaxContent: | 77 case MaxContent: |
86 case FillAvailable: | 78 case FillAvailable: |
87 case FitContent: | 79 case FitContent: |
88 return AnimatableUnknown::create(CSSPrimitiveValue::create(length)); | 80 return AnimatableUnknown::create(CSSPrimitiveValue::create(length)); |
89 case Undefined: | 81 case Undefined: |
90 return AnimatableUnknown::create(CSSValueNone); | 82 return AnimatableUnknown::create(CSSValueNone); |
91 case ExtendToZoom: // Does not apply to elements. | 83 case ExtendToZoom: // Does not apply to elements. |
84 case DeviceWidth: | |
kenneth.r.christiansen
2014/01/02 09:03:26
To avoid anyone abusing these should we call them
Timothy Loh
2014/01/03 00:23:09
Probably doesn't matter too much right now; I want
| |
85 case DeviceHeight: | |
92 ASSERT_NOT_REACHED(); | 86 ASSERT_NOT_REACHED(); |
93 return 0; | 87 return 0; |
94 } | 88 } |
95 ASSERT_NOT_REACHED(); | 89 ASSERT_NOT_REACHED(); |
96 return 0; | 90 return 0; |
97 } | 91 } |
98 | 92 |
99 static PassRefPtr<AnimatableValue> createFromLineHeight(const Length& length, co nst RenderStyle& style) | 93 static PassRefPtr<AnimatableValue> createFromLineHeight(const Length& length, co nst RenderStyle& style) |
100 { | 94 { |
101 if (length.type() == Percent) { | 95 if (length.type() == Percent) { |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
474 case CSSPropertyZoom: | 468 case CSSPropertyZoom: |
475 return createFromDouble(style.zoom()); | 469 return createFromDouble(style.zoom()); |
476 default: | 470 default: |
477 ASSERT_NOT_REACHED(); | 471 ASSERT_NOT_REACHED(); |
478 // This return value is to avoid a release crash if possible. | 472 // This return value is to avoid a release crash if possible. |
479 return AnimatableUnknown::create(0); | 473 return AnimatableUnknown::create(0); |
480 } | 474 } |
481 } | 475 } |
482 | 476 |
483 } // namespace WebCore | 477 } // namespace WebCore |
OLD | NEW |