OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) | 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) |
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) | 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) |
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc.
All rights reserved. | 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc.
All rights reserved. |
6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> |
7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> | 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> |
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. | 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. |
10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. |
(...skipping 1235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1246 // lastCSSPropertyId<HighPriorityProperties>. | 1246 // lastCSSPropertyId<HighPriorityProperties>. |
1247 template<> CSSPropertyID StyleResolver::firstCSSPropertyId<StyleResolver::HighPr
iorityProperties>() | 1247 template<> CSSPropertyID StyleResolver::firstCSSPropertyId<StyleResolver::HighPr
iorityProperties>() |
1248 { | 1248 { |
1249 COMPILE_ASSERT(CSSPropertyColor == firstCSSProperty, CSS_color_is_first_high
_priority_property); | 1249 COMPILE_ASSERT(CSSPropertyColor == firstCSSProperty, CSS_color_is_first_high
_priority_property); |
1250 return CSSPropertyColor; | 1250 return CSSPropertyColor; |
1251 } | 1251 } |
1252 | 1252 |
1253 // This method returns the last CSSPropertyId of high priority properties. | 1253 // This method returns the last CSSPropertyId of high priority properties. |
1254 template<> CSSPropertyID StyleResolver::lastCSSPropertyId<StyleResolver::HighPri
orityProperties>() | 1254 template<> CSSPropertyID StyleResolver::lastCSSPropertyId<StyleResolver::HighPri
orityProperties>() |
1255 { | 1255 { |
1256 COMPILE_ASSERT(CSSPropertyLineHeight == CSSPropertyColor + 18, CSS_line_heig
ht_is_end_of_high_prioity_property_range); | 1256 COMPILE_ASSERT(CSSPropertyLineHeight == CSSPropertyColor + 17, CSS_line_heig
ht_is_end_of_high_prioity_property_range); |
1257 COMPILE_ASSERT(CSSPropertyZoom == CSSPropertyLineHeight - 1, CSS_zoom_is_bef
ore_line_height); | 1257 COMPILE_ASSERT(CSSPropertyZoom == CSSPropertyLineHeight - 1, CSS_zoom_is_bef
ore_line_height); |
1258 return CSSPropertyLineHeight; | 1258 return CSSPropertyLineHeight; |
1259 } | 1259 } |
1260 | 1260 |
1261 // This method returns the first CSSPropertyId of remaining properties, | 1261 // This method returns the first CSSPropertyId of remaining properties, |
1262 // i.e. low priority properties. No properties depend on low priority | 1262 // i.e. low priority properties. No properties depend on low priority |
1263 // properties. So we don't need to resolve such properties quickly. | 1263 // properties. So we don't need to resolve such properties quickly. |
1264 // All low priority properties are obtained by using | 1264 // All low priority properties are obtained by using |
1265 // firstCSSPropertyId<LowPriorityProperties> and | 1265 // firstCSSPropertyId<LowPriorityProperties> and |
1266 // lastCSSPropertyId<LowPriorityProperties>. | 1266 // lastCSSPropertyId<LowPriorityProperties>. |
(...skipping 21 matching lines...) Expand all Loading... |
1288 void StyleResolver::applyAllProperty(StyleResolverState& state, CSSValue* allVal
ue) | 1288 void StyleResolver::applyAllProperty(StyleResolverState& state, CSSValue* allVal
ue) |
1289 { | 1289 { |
1290 bool isUnsetValue = !allValue->isInitialValue() && !allValue->isInheritedVal
ue(); | 1290 bool isUnsetValue = !allValue->isInitialValue() && !allValue->isInheritedVal
ue(); |
1291 unsigned startCSSProperty = firstCSSPropertyId<pass>(); | 1291 unsigned startCSSProperty = firstCSSPropertyId<pass>(); |
1292 unsigned endCSSProperty = lastCSSPropertyId<pass>(); | 1292 unsigned endCSSProperty = lastCSSPropertyId<pass>(); |
1293 | 1293 |
1294 for (unsigned i = startCSSProperty; i <= endCSSProperty; ++i) { | 1294 for (unsigned i = startCSSProperty; i <= endCSSProperty; ++i) { |
1295 CSSPropertyID propertyId = static_cast<CSSPropertyID>(i); | 1295 CSSPropertyID propertyId = static_cast<CSSPropertyID>(i); |
1296 | 1296 |
1297 // StyleBuilder does not allow any expanded shorthands. | 1297 // StyleBuilder does not allow any expanded shorthands. |
1298 if (isExpandedShorthandForAll(propertyId)) | 1298 if (isExpandedShorthand(propertyId)) |
1299 continue; | 1299 continue; |
1300 | 1300 |
1301 // all shorthand spec says: | 1301 // all shorthand spec says: |
1302 // The all property is a shorthand that resets all CSS properties | 1302 // The all property is a shorthand that resets all CSS properties |
1303 // except direction and unicode-bidi. | 1303 // except direction and unicode-bidi. |
1304 // c.f. http://dev.w3.org/csswg/css-cascade/#all-shorthand | 1304 // c.f. http://dev.w3.org/csswg/css-cascade/#all-shorthand |
1305 // We skip applyProperty when a given property is unicode-bidi or | 1305 // We skip applyProperty when a given property is unicode-bidi or |
1306 // direction. | 1306 // direction. |
1307 if (!CSSProperty::isAffectedByAllProperty(propertyId)) | 1307 if (!CSSProperty::isAffectedByAllProperty(propertyId)) |
1308 continue; | 1308 continue; |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1592 visitor->trace(m_uncommonAttributeRuleSet); | 1592 visitor->trace(m_uncommonAttributeRuleSet); |
1593 visitor->trace(m_watchedSelectorsRules); | 1593 visitor->trace(m_watchedSelectorsRules); |
1594 visitor->trace(m_treeBoundaryCrossingRules); | 1594 visitor->trace(m_treeBoundaryCrossingRules); |
1595 visitor->trace(m_styleSharingLists); | 1595 visitor->trace(m_styleSharingLists); |
1596 visitor->trace(m_pendingStyleSheets); | 1596 visitor->trace(m_pendingStyleSheets); |
1597 visitor->trace(m_document); | 1597 visitor->trace(m_document); |
1598 #endif | 1598 #endif |
1599 } | 1599 } |
1600 | 1600 |
1601 } // namespace blink | 1601 } // namespace blink |
OLD | NEW |