| 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, 2009, 2010, 2012 Apple Inc. All r
ights reserved. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r
ights reserved. |
| 4 * Copyright (C) 2011 Research In Motion Limited. All rights reserved. | 4 * Copyright (C) 2011 Research In Motion Limited. All rights reserved. |
| 5 * Copyright (C) 2013 Intel Corporation. All rights reserved. | 5 * Copyright (C) 2013 Intel Corporation. All rights reserved. |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 for (unsigned n = 0; n < size; ++n) { | 66 for (unsigned n = 0; n < size; ++n) { |
| 67 StylePropertySet::PropertyReference property = m_propertySet.propertyAt(
n); | 67 StylePropertySet::PropertyReference property = m_propertySet.propertyAt(
n); |
| 68 CSSPropertyID propertyID = property.id(); | 68 CSSPropertyID propertyID = property.id(); |
| 69 // Only enabled or internal properties should be part of the style. | 69 // Only enabled or internal properties should be part of the style. |
| 70 ASSERT(CSSPropertyMetadata::isEnabledProperty(propertyID) || isInternalP
roperty(propertyID)); | 70 ASSERT(CSSPropertyMetadata::isEnabledProperty(propertyID) || isInternalP
roperty(propertyID)); |
| 71 CSSPropertyID shorthandPropertyID = CSSPropertyInvalid; | 71 CSSPropertyID shorthandPropertyID = CSSPropertyInvalid; |
| 72 CSSPropertyID borderFallbackShorthandProperty = CSSPropertyInvalid; | 72 CSSPropertyID borderFallbackShorthandProperty = CSSPropertyInvalid; |
| 73 String value; | 73 String value; |
| 74 | 74 |
| 75 switch (propertyID) { | 75 switch (propertyID) { |
| 76 case CSSPropertyAnimationName: | |
| 77 case CSSPropertyAnimationDuration: | |
| 78 case CSSPropertyAnimationTimingFunction: | |
| 79 case CSSPropertyAnimationDelay: | |
| 80 case CSSPropertyAnimationIterationCount: | |
| 81 case CSSPropertyAnimationDirection: | |
| 82 case CSSPropertyAnimationFillMode: | |
| 83 shorthandPropertyID = CSSPropertyAnimation; | |
| 84 break; | |
| 85 case CSSPropertyBackgroundAttachment: | 76 case CSSPropertyBackgroundAttachment: |
| 86 case CSSPropertyBackgroundClip: | 77 case CSSPropertyBackgroundClip: |
| 87 case CSSPropertyBackgroundColor: | 78 case CSSPropertyBackgroundColor: |
| 88 case CSSPropertyBackgroundImage: | 79 case CSSPropertyBackgroundImage: |
| 89 case CSSPropertyBackgroundOrigin: | 80 case CSSPropertyBackgroundOrigin: |
| 90 case CSSPropertyBackgroundPositionX: | 81 case CSSPropertyBackgroundPositionX: |
| 91 case CSSPropertyBackgroundPositionY: | 82 case CSSPropertyBackgroundPositionY: |
| 92 case CSSPropertyBackgroundSize: | 83 case CSSPropertyBackgroundSize: |
| 93 case CSSPropertyBackgroundRepeatX: | 84 case CSSPropertyBackgroundRepeatX: |
| 94 case CSSPropertyBackgroundRepeatY: | 85 case CSSPropertyBackgroundRepeatY: |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 case CSSPropertyOverflowX: | 143 case CSSPropertyOverflowX: |
| 153 case CSSPropertyOverflowY: | 144 case CSSPropertyOverflowY: |
| 154 shorthandPropertyID = CSSPropertyOverflow; | 145 shorthandPropertyID = CSSPropertyOverflow; |
| 155 break; | 146 break; |
| 156 case CSSPropertyPaddingTop: | 147 case CSSPropertyPaddingTop: |
| 157 case CSSPropertyPaddingRight: | 148 case CSSPropertyPaddingRight: |
| 158 case CSSPropertyPaddingBottom: | 149 case CSSPropertyPaddingBottom: |
| 159 case CSSPropertyPaddingLeft: | 150 case CSSPropertyPaddingLeft: |
| 160 shorthandPropertyID = CSSPropertyPadding; | 151 shorthandPropertyID = CSSPropertyPadding; |
| 161 break; | 152 break; |
| 162 case CSSPropertyTransitionProperty: | |
| 163 case CSSPropertyTransitionDuration: | |
| 164 case CSSPropertyTransitionTimingFunction: | |
| 165 case CSSPropertyTransitionDelay: | |
| 166 shorthandPropertyID = CSSPropertyTransition; | |
| 167 break; | |
| 168 case CSSPropertyFlexDirection: | 153 case CSSPropertyFlexDirection: |
| 169 case CSSPropertyFlexWrap: | 154 case CSSPropertyFlexWrap: |
| 170 shorthandPropertyID = CSSPropertyFlexFlow; | 155 shorthandPropertyID = CSSPropertyFlexFlow; |
| 171 break; | 156 break; |
| 172 case CSSPropertyFlexBasis: | 157 case CSSPropertyFlexBasis: |
| 173 case CSSPropertyFlexGrow: | 158 case CSSPropertyFlexGrow: |
| 174 case CSSPropertyFlexShrink: | 159 case CSSPropertyFlexShrink: |
| 175 shorthandPropertyID = CSSPropertyFlex; | 160 shorthandPropertyID = CSSPropertyFlex; |
| 176 break; | 161 break; |
| 177 case CSSPropertyWebkitTransformOriginX: | 162 case CSSPropertyWebkitTransformOriginX: |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 appendBackgroundPropertyAsText(result, numDecls); | 195 appendBackgroundPropertyAsText(result, numDecls); |
| 211 | 196 |
| 212 ASSERT(!numDecls ^ !result.isEmpty()); | 197 ASSERT(!numDecls ^ !result.isEmpty()); |
| 213 return result.toString(); | 198 return result.toString(); |
| 214 } | 199 } |
| 215 | 200 |
| 216 String StylePropertySerializer::getPropertyValue(CSSPropertyID propertyID) const | 201 String StylePropertySerializer::getPropertyValue(CSSPropertyID propertyID) const |
| 217 { | 202 { |
| 218 // Shorthand and 4-values properties | 203 // Shorthand and 4-values properties |
| 219 switch (propertyID) { | 204 switch (propertyID) { |
| 220 case CSSPropertyAnimation: | |
| 221 return getLayeredShorthandValue(animationShorthand()); | |
| 222 case CSSPropertyBorderSpacing: | 205 case CSSPropertyBorderSpacing: |
| 223 return borderSpacingValue(borderSpacingShorthand()); | 206 return borderSpacingValue(borderSpacingShorthand()); |
| 224 case CSSPropertyBackgroundPosition: | 207 case CSSPropertyBackgroundPosition: |
| 225 return getLayeredShorthandValue(backgroundPositionShorthand()); | 208 return getLayeredShorthandValue(backgroundPositionShorthand()); |
| 226 case CSSPropertyBackgroundRepeat: | 209 case CSSPropertyBackgroundRepeat: |
| 227 return backgroundRepeatPropertyValue(); | 210 return backgroundRepeatPropertyValue(); |
| 228 case CSSPropertyBackground: | 211 case CSSPropertyBackground: |
| 229 return getLayeredShorthandValue(backgroundShorthand()); | 212 return getLayeredShorthandValue(backgroundShorthand()); |
| 230 case CSSPropertyBorder: | 213 case CSSPropertyBorder: |
| 231 return borderPropertyValue(OmitUncommonValues); | 214 return borderPropertyValue(OmitUncommonValues); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 250 case CSSPropertyFlexFlow: | 233 case CSSPropertyFlexFlow: |
| 251 return getShorthandValue(flexFlowShorthand()); | 234 return getShorthandValue(flexFlowShorthand()); |
| 252 case CSSPropertyFont: | 235 case CSSPropertyFont: |
| 253 return fontValue(); | 236 return fontValue(); |
| 254 case CSSPropertyMargin: | 237 case CSSPropertyMargin: |
| 255 return get4Values(marginShorthand()); | 238 return get4Values(marginShorthand()); |
| 256 case CSSPropertyOverflow: | 239 case CSSPropertyOverflow: |
| 257 return getCommonValue(overflowShorthand()); | 240 return getCommonValue(overflowShorthand()); |
| 258 case CSSPropertyPadding: | 241 case CSSPropertyPadding: |
| 259 return get4Values(paddingShorthand()); | 242 return get4Values(paddingShorthand()); |
| 260 case CSSPropertyTransition: | |
| 261 return getLayeredShorthandValue(transitionShorthand()); | |
| 262 case CSSPropertyWebkitTextEmphasis: | 243 case CSSPropertyWebkitTextEmphasis: |
| 263 return getShorthandValue(webkitTextEmphasisShorthand()); | 244 return getShorthandValue(webkitTextEmphasisShorthand()); |
| 264 case CSSPropertyWebkitTextStroke: | 245 case CSSPropertyWebkitTextStroke: |
| 265 return getShorthandValue(webkitTextStrokeShorthand()); | 246 return getShorthandValue(webkitTextStrokeShorthand()); |
| 266 case CSSPropertyTransformOrigin: | 247 case CSSPropertyTransformOrigin: |
| 267 case CSSPropertyWebkitTransformOrigin: | 248 case CSSPropertyWebkitTransformOrigin: |
| 268 return getShorthandValue(webkitTransformOriginShorthand()); | 249 return getShorthandValue(webkitTransformOriginShorthand()); |
| 269 case CSSPropertyBorderRadius: | 250 case CSSPropertyBorderRadius: |
| 270 return get4Values(borderRadiusShorthand()); | 251 return get4Values(borderRadiusShorthand()); |
| 271 default: | 252 default: |
| (...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 782 return false; | 763 return false; |
| 783 if (!value->isInitialValue()) | 764 if (!value->isInitialValue()) |
| 784 isInitialValue = false; | 765 isInitialValue = false; |
| 785 if (!value->isInheritedValue()) | 766 if (!value->isInheritedValue()) |
| 786 isInheritedValue = false; | 767 isInheritedValue = false; |
| 787 } | 768 } |
| 788 return isInitialValue || isInheritedValue; | 769 return isInitialValue || isInheritedValue; |
| 789 } | 770 } |
| 790 | 771 |
| 791 } | 772 } |
| OLD | NEW |