| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   77     case MaxContent: |   77     case MaxContent: | 
|   78     case FillAvailable: |   78     case FillAvailable: | 
|   79     case FitContent: |   79     case FitContent: | 
|   80         return AnimatableUnknown::create(CSSPrimitiveValue::create(length)); |   80         return AnimatableUnknown::create(CSSPrimitiveValue::create(length)); | 
|   81     case Undefined: |   81     case Undefined: | 
|   82         return AnimatableUnknown::create(CSSValueNone); |   82         return AnimatableUnknown::create(CSSValueNone); | 
|   83     case ExtendToZoom: // Does not apply to elements. |   83     case ExtendToZoom: // Does not apply to elements. | 
|   84     case DeviceWidth: |   84     case DeviceWidth: | 
|   85     case DeviceHeight: |   85     case DeviceHeight: | 
|   86         ASSERT_NOT_REACHED(); |   86         ASSERT_NOT_REACHED(); | 
|   87         return 0; |   87         return nullptr; | 
|   88     } |   88     } | 
|   89     ASSERT_NOT_REACHED(); |   89     ASSERT_NOT_REACHED(); | 
|   90     return 0; |   90     return nullptr; | 
|   91 } |   91 } | 
|   92  |   92  | 
|   93 static PassRefPtr<AnimatableValue> createFromLineHeight(const Length& length, co
     nst RenderStyle& style) |   93 static PassRefPtr<AnimatableValue> createFromLineHeight(const Length& length, co
     nst RenderStyle& style) | 
|   94 { |   94 { | 
|   95     if (length.type() == Percent) { |   95     if (length.type() == Percent) { | 
|   96         double value = length.value(); |   96         double value = length.value(); | 
|   97         // -100% is used to represent "normal" line height. |   97         // -100% is used to represent "normal" line height. | 
|   98         if (value == -100) |   98         if (value == -100) | 
|   99             return AnimatableUnknown::create(CSSValueNormal); |   99             return AnimatableUnknown::create(CSSValueNormal); | 
|  100         return AnimatableDouble::create(value); |  100         return AnimatableDouble::create(value); | 
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  164 { |  164 { | 
|  165     switch (fillSize.type) { |  165     switch (fillSize.type) { | 
|  166     case SizeLength: |  166     case SizeLength: | 
|  167         return createFromLengthSize(fillSize.size, style); |  167         return createFromLengthSize(fillSize.size, style); | 
|  168     case Contain: |  168     case Contain: | 
|  169     case Cover: |  169     case Cover: | 
|  170     case SizeNone: |  170     case SizeNone: | 
|  171         return AnimatableUnknown::create(CSSPrimitiveValue::create(fillSize.type
     )); |  171         return AnimatableUnknown::create(CSSPrimitiveValue::create(fillSize.type
     )); | 
|  172     default: |  172     default: | 
|  173         ASSERT_NOT_REACHED(); |  173         ASSERT_NOT_REACHED(); | 
|  174         return 0; |  174         return nullptr; | 
|  175     } |  175     } | 
|  176 } |  176 } | 
|  177  |  177  | 
|  178 inline static PassRefPtr<AnimatableValue> createFromBackgroundPosition(const Len
     gth& length, bool originIsSet, BackgroundEdgeOrigin origin, const RenderStyle& s
     tyle) |  178 inline static PassRefPtr<AnimatableValue> createFromBackgroundPosition(const Len
     gth& length, bool originIsSet, BackgroundEdgeOrigin origin, const RenderStyle& s
     tyle) | 
|  179 { |  179 { | 
|  180     if (!originIsSet || origin == LeftEdge || origin == TopEdge) |  180     if (!originIsSet || origin == LeftEdge || origin == TopEdge) | 
|  181         return createFromLength(length, style); |  181         return createFromLength(length, style); | 
|  182  |  182  | 
|  183     return AnimatableLength::create(CSSCalcValue::createExpressionNode( |  183     return AnimatableLength::create(CSSCalcValue::createExpressionNode( | 
|  184         CSSCalcValue::createExpressionNode(CSSPrimitiveValue::create(100, CSSPri
     mitiveValue::CSS_PERCENTAGE), true), |  184         CSSCalcValue::createExpressionNode(CSSPrimitiveValue::create(100, CSSPri
     mitiveValue::CSS_PERCENTAGE), true), | 
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  455         return createFromDouble(style.wordSpacing()); |  455         return createFromDouble(style.wordSpacing()); | 
|  456     case CSSPropertyVisibility: |  456     case CSSPropertyVisibility: | 
|  457         return AnimatableVisibility::create(style.visibility()); |  457         return AnimatableVisibility::create(style.visibility()); | 
|  458     case CSSPropertyZIndex: |  458     case CSSPropertyZIndex: | 
|  459         return createFromDouble(style.zIndex()); |  459         return createFromDouble(style.zIndex()); | 
|  460     case CSSPropertyZoom: |  460     case CSSPropertyZoom: | 
|  461         return createFromDouble(style.zoom()); |  461         return createFromDouble(style.zoom()); | 
|  462     default: |  462     default: | 
|  463         ASSERT_NOT_REACHED(); |  463         ASSERT_NOT_REACHED(); | 
|  464         // This return value is to avoid a release crash if possible. |  464         // This return value is to avoid a release crash if possible. | 
|  465         return AnimatableUnknown::create(0); |  465         return AnimatableUnknown::create(nullptr); | 
|  466     } |  466     } | 
|  467 } |  467 } | 
|  468  |  468  | 
|  469 } // namespace WebCore |  469 } // namespace WebCore | 
| OLD | NEW |