OLD | NEW |
1 /* | 1 /* |
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) | 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
4 * Copyright (C) 2013 Intel Corporation. All rights reserved. | 4 * Copyright (C) 2013 Intel Corporation. All rights reserved. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 // bug: https://www.w3.org/Bugs/Public/show_bug.cgi?id=14790 | 47 // bug: https://www.w3.org/Bugs/Public/show_bug.cgi?id=14790 |
48 // And in the spec (editor's draft) at: | 48 // And in the spec (editor's draft) at: |
49 // http://dev.w3.org/csswg/css3-animations/#animation-shorthand-property | 49 // http://dev.w3.org/csswg/css3-animations/#animation-shorthand-property |
50 static const CSSPropertyID animationPropertiesForParsing[] = { | 50 static const CSSPropertyID animationPropertiesForParsing[] = { |
51 CSSPropertyAnimationDuration, | 51 CSSPropertyAnimationDuration, |
52 CSSPropertyAnimationTimingFunction, | 52 CSSPropertyAnimationTimingFunction, |
53 CSSPropertyAnimationDelay, | 53 CSSPropertyAnimationDelay, |
54 CSSPropertyAnimationIterationCount, | 54 CSSPropertyAnimationIterationCount, |
55 CSSPropertyAnimationDirection, | 55 CSSPropertyAnimationDirection, |
56 CSSPropertyAnimationFillMode, | 56 CSSPropertyAnimationFillMode, |
| 57 CSSPropertyAnimationPlayState, |
57 CSSPropertyAnimationName | 58 CSSPropertyAnimationName |
58 }; | 59 }; |
59 DEFINE_STATIC_LOCAL(StylePropertyShorthand, webkitAnimationLonghandsForParsi
ng, (CSSPropertyAnimation, animationPropertiesForParsing, WTF_ARRAY_LENGTH(anima
tionPropertiesForParsing))); | 60 DEFINE_STATIC_LOCAL(StylePropertyShorthand, webkitAnimationLonghandsForParsi
ng, (CSSPropertyAnimation, animationPropertiesForParsing, WTF_ARRAY_LENGTH(anima
tionPropertiesForParsing))); |
60 return webkitAnimationLonghandsForParsing; | 61 return webkitAnimationLonghandsForParsing; |
61 } | 62 } |
62 | 63 |
63 const StylePropertyShorthand& webkitAnimationShorthandForParsing() | 64 const StylePropertyShorthand& webkitAnimationShorthandForParsing() |
64 { | 65 { |
65 // When we parse the animation shorthand we need to look for animation-name | 66 // When we parse the animation shorthand we need to look for animation-name |
66 // last because otherwise it might match against the keywords for fill mode, | 67 // last because otherwise it might match against the keywords for fill mode, |
67 // timing functions and infinite iteration. This means that animation names | 68 // timing functions and infinite iteration. This means that animation names |
68 // that are the same as keywords (e.g. 'forwards') won't always match in the | 69 // that are the same as keywords (e.g. 'forwards') won't always match in the |
69 // shorthand. In that case the authors should be using longhands (or | 70 // shorthand. In that case the authors should be using longhands (or |
70 // reconsidering their approach). This is covered by the animations spec | 71 // reconsidering their approach). This is covered by the animations spec |
71 // bug: https://www.w3.org/Bugs/Public/show_bug.cgi?id=14790 | 72 // bug: https://www.w3.org/Bugs/Public/show_bug.cgi?id=14790 |
72 // And in the spec (editor's draft) at: | 73 // And in the spec (editor's draft) at: |
73 // http://dev.w3.org/csswg/css3-animations/#animation-shorthand-property | 74 // http://dev.w3.org/csswg/css3-animations/#animation-shorthand-property |
74 static const CSSPropertyID animationPropertiesForParsing[] = { | 75 static const CSSPropertyID animationPropertiesForParsing[] = { |
75 CSSPropertyWebkitAnimationDuration, | 76 CSSPropertyWebkitAnimationDuration, |
76 CSSPropertyWebkitAnimationTimingFunction, | 77 CSSPropertyWebkitAnimationTimingFunction, |
77 CSSPropertyWebkitAnimationDelay, | 78 CSSPropertyWebkitAnimationDelay, |
78 CSSPropertyWebkitAnimationIterationCount, | 79 CSSPropertyWebkitAnimationIterationCount, |
79 CSSPropertyWebkitAnimationDirection, | 80 CSSPropertyWebkitAnimationDirection, |
80 CSSPropertyWebkitAnimationFillMode, | 81 CSSPropertyWebkitAnimationFillMode, |
| 82 CSSPropertyWebkitAnimationPlayState, |
81 CSSPropertyWebkitAnimationName | 83 CSSPropertyWebkitAnimationName |
82 }; | 84 }; |
83 DEFINE_STATIC_LOCAL(StylePropertyShorthand, webkitAnimationLonghandsForParsi
ng, (CSSPropertyWebkitAnimation, animationPropertiesForParsing, WTF_ARRAY_LENGTH
(animationPropertiesForParsing))); | 85 DEFINE_STATIC_LOCAL(StylePropertyShorthand, webkitAnimationLonghandsForParsi
ng, (CSSPropertyWebkitAnimation, animationPropertiesForParsing, WTF_ARRAY_LENGTH
(animationPropertiesForParsing))); |
84 return webkitAnimationLonghandsForParsing; | 86 return webkitAnimationLonghandsForParsing; |
85 } | 87 } |
86 | 88 |
87 // Returns an empty list if the property is not a shorthand, otherwise the list
of longhands for parsing. | 89 // Returns an empty list if the property is not a shorthand, otherwise the list
of longhands for parsing. |
88 const StylePropertyShorthand& parsingShorthandForProperty(CSSPropertyID property
ID) | 90 const StylePropertyShorthand& parsingShorthandForProperty(CSSPropertyID property
ID) |
89 { | 91 { |
90 switch (propertyID) { | 92 switch (propertyID) { |
(...skipping 24 matching lines...) Expand all Loading... |
115 { | 117 { |
116 for (unsigned i = 0; i < shorthands.size(); ++i) { | 118 for (unsigned i = 0; i < shorthands.size(); ++i) { |
117 if (shorthands.at(i).id() == shorthandID) | 119 if (shorthands.at(i).id() == shorthandID) |
118 return i; | 120 return i; |
119 } | 121 } |
120 ASSERT_NOT_REACHED(); | 122 ASSERT_NOT_REACHED(); |
121 return 0; | 123 return 0; |
122 } | 124 } |
123 | 125 |
124 } // namespace WebCore | 126 } // namespace WebCore |
OLD | NEW |