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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 } | 104 } |
105 | 105 |
106 CSSPropertyID propertyID = static_cast<CSSPropertyID>(index + firstCSSProper
ty); | 106 CSSPropertyID propertyID = static_cast<CSSPropertyID>(index + firstCSSProper
ty); |
107 ASSERT(firstCSSProperty <= propertyID && propertyID <= lastCSSProperty); | 107 ASSERT(firstCSSProperty <= propertyID && propertyID <= lastCSSProperty); |
108 | 108 |
109 // Since "all" is expanded, we don't need to process "all". | 109 // Since "all" is expanded, we don't need to process "all". |
110 // We should not process expanded shorthands (e.g. font, background, | 110 // We should not process expanded shorthands (e.g. font, background, |
111 // and so on) either. | 111 // and so on) either. |
112 if (isShorthandProperty(propertyID) || propertyID == CSSPropertyAll) | 112 if (isShorthandProperty(propertyID) || propertyID == CSSPropertyAll) |
113 return false; | 113 return false; |
114 // We should not serialize internal properties. | |
115 if (isInternalProperty(propertyID)) | |
116 return false; | |
117 | 114 |
118 // The all property is a shorthand that resets all CSS properties except | 115 // The all property is a shorthand that resets all CSS properties except |
119 // direction and unicode-bidi. It only accepts the CSS-wide keywords. | 116 // direction and unicode-bidi. It only accepts the CSS-wide keywords. |
120 // c.f. http://dev.w3.org/csswg/css-cascade/#all-shorthand | 117 // c.f. http://dev.w3.org/csswg/css-cascade/#all-shorthand |
121 if (!CSSProperty::isAffectedByAllProperty(propertyID)) | 118 if (!CSSProperty::isAffectedByAllProperty(propertyID)) |
122 return m_longhandPropertyUsed.get(index); | 119 return m_longhandPropertyUsed.get(index); |
123 | 120 |
124 return true; | 121 return true; |
125 } | 122 } |
126 | 123 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 BitArray<numCSSProperties> shorthandPropertyAppeared; | 193 BitArray<numCSSProperties> shorthandPropertyAppeared; |
197 | 194 |
198 unsigned size = m_propertySet.propertyCount(); | 195 unsigned size = m_propertySet.propertyCount(); |
199 unsigned numDecls = 0; | 196 unsigned numDecls = 0; |
200 for (unsigned n = 0; n < size; ++n) { | 197 for (unsigned n = 0; n < size; ++n) { |
201 if (!m_propertySet.shouldProcessPropertyAt(n)) | 198 if (!m_propertySet.shouldProcessPropertyAt(n)) |
202 continue; | 199 continue; |
203 | 200 |
204 StylePropertySerializer::PropertyValueForSerializer property = m_propert
ySet.propertyAt(n); | 201 StylePropertySerializer::PropertyValueForSerializer property = m_propert
ySet.propertyAt(n); |
205 CSSPropertyID propertyID = property.id(); | 202 CSSPropertyID propertyID = property.id(); |
206 // Only enabled or internal properties should be part of the style. | 203 // Only enabled properties should be part of the style. |
207 ASSERT(CSSPropertyMetadata::isEnabledProperty(propertyID) || isInternalP
roperty(propertyID)); | 204 ASSERT(CSSPropertyMetadata::isEnabledProperty(propertyID)); |
208 CSSPropertyID shorthandPropertyID = CSSPropertyInvalid; | 205 CSSPropertyID shorthandPropertyID = CSSPropertyInvalid; |
209 CSSPropertyID borderFallbackShorthandProperty = CSSPropertyInvalid; | 206 CSSPropertyID borderFallbackShorthandProperty = CSSPropertyInvalid; |
210 String value; | 207 String value; |
211 ASSERT(!isShorthandProperty(propertyID)); | 208 ASSERT(!isShorthandProperty(propertyID)); |
212 | 209 |
213 switch (propertyID) { | 210 switch (propertyID) { |
214 case CSSPropertyBackgroundAttachment: | 211 case CSSPropertyBackgroundAttachment: |
215 case CSSPropertyBackgroundClip: | 212 case CSSPropertyBackgroundClip: |
216 case CSSPropertyBackgroundColor: | 213 case CSSPropertyBackgroundColor: |
217 case CSSPropertyBackgroundImage: | 214 case CSSPropertyBackgroundImage: |
(...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1010 isInitialValue = false; | 1007 isInitialValue = false; |
1011 if (!value->isInheritedValue()) | 1008 if (!value->isInheritedValue()) |
1012 isInheritedValue = false; | 1009 isInheritedValue = false; |
1013 if (isImportant != m_propertySet.propertyIsImportant(shorthand.propertie
s()[i])) | 1010 if (isImportant != m_propertySet.propertyIsImportant(shorthand.propertie
s()[i])) |
1014 return false; | 1011 return false; |
1015 } | 1012 } |
1016 return isInitialValue || isInheritedValue; | 1013 return isInitialValue || isInheritedValue; |
1017 } | 1014 } |
1018 | 1015 |
1019 } | 1016 } |
OLD | NEW |