Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(118)

Side by Side Diff: Source/core/css/resolver/StyleResolver.cpp

Issue 809823002: replace COMPILE_ASSERT with static assert in core/css/ (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/css/resolver/AnimatedStyleBuilder.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1227 matching lines...) Expand 10 before | Expand all | Expand 10 after
1238 // FIXME: Consider refactoring to create a new class which owns the following 1238 // FIXME: Consider refactoring to create a new class which owns the following
1239 // first/last/range properties. 1239 // first/last/range properties.
1240 // This method returns the first CSSPropertyId of high priority properties. 1240 // This method returns the first CSSPropertyId of high priority properties.
1241 // Other properties can depend on high priority properties. For example, 1241 // Other properties can depend on high priority properties. For example,
1242 // border-color property with currentColor value depends on color property. 1242 // border-color property with currentColor value depends on color property.
1243 // All high priority properties are obtained by using 1243 // All high priority properties are obtained by using
1244 // firstCSSPropertyId<HighPriorityProperties> and 1244 // firstCSSPropertyId<HighPriorityProperties> and
1245 // lastCSSPropertyId<HighPriorityProperties>. 1245 // lastCSSPropertyId<HighPriorityProperties>.
1246 template<> CSSPropertyID StyleResolver::firstCSSPropertyId<StyleResolver::HighPr iorityProperties>() 1246 template<> CSSPropertyID StyleResolver::firstCSSPropertyId<StyleResolver::HighPr iorityProperties>()
1247 { 1247 {
1248 COMPILE_ASSERT(CSSPropertyColor == firstCSSProperty, CSS_color_is_first_high _priority_property); 1248 static_assert(CSSPropertyColor == firstCSSProperty, "CSSPropertyColor should be the first high priority property");
1249 return CSSPropertyColor; 1249 return CSSPropertyColor;
1250 } 1250 }
1251 1251
1252 // This method returns the last CSSPropertyId of high priority properties. 1252 // This method returns the last CSSPropertyId of high priority properties.
1253 template<> CSSPropertyID StyleResolver::lastCSSPropertyId<StyleResolver::HighPri orityProperties>() 1253 template<> CSSPropertyID StyleResolver::lastCSSPropertyId<StyleResolver::HighPri orityProperties>()
1254 { 1254 {
1255 COMPILE_ASSERT(CSSPropertyZoom == CSSPropertyColor + 16, CSS_zoom_is_end_of_ high_priority_property_range); 1255 static_assert(CSSPropertyZoom == CSSPropertyColor + 16, "CSSPropertyZoom sho uld be the end of the high priority property range");
1256 COMPILE_ASSERT(CSSPropertyTextRendering == CSSPropertyZoom - 1, CSS_text_ren dering_is_before_zoom); 1256 static_assert(CSSPropertyTextRendering == CSSPropertyZoom - 1, "CSSPropertyT extRendering should be immediately before CSSPropertyZoom");
1257 return CSSPropertyZoom; 1257 return CSSPropertyZoom;
1258 } 1258 }
1259 1259
1260 // This method returns the first CSSPropertyId of remaining properties, 1260 // This method returns the first CSSPropertyId of remaining properties,
1261 // i.e. low priority properties. No properties depend on low priority 1261 // i.e. low priority properties. No properties depend on low priority
1262 // properties. So we don't need to resolve such properties quickly. 1262 // properties. So we don't need to resolve such properties quickly.
1263 // All low priority properties are obtained by using 1263 // All low priority properties are obtained by using
1264 // firstCSSPropertyId<LowPriorityProperties> and 1264 // firstCSSPropertyId<LowPriorityProperties> and
1265 // lastCSSPropertyId<LowPriorityProperties>. 1265 // lastCSSPropertyId<LowPriorityProperties>.
1266 template<> CSSPropertyID StyleResolver::firstCSSPropertyId<StyleResolver::LowPri orityProperties>() 1266 template<> CSSPropertyID StyleResolver::firstCSSPropertyId<StyleResolver::LowPri orityProperties>()
1267 { 1267 {
1268 COMPILE_ASSERT(CSSPropertyAlignContent == CSSPropertyZoom + 1, CSS_align_con tent_is_first_low_priority_property); 1268 static_assert(CSSPropertyAlignContent == CSSPropertyZoom + 1, "CSSPropertyAl ignContent should be the first low priority property");
1269 return CSSPropertyAlignContent; 1269 return CSSPropertyAlignContent;
1270 } 1270 }
1271 1271
1272 // This method returns the last CSSPropertyId of low priority properties. 1272 // This method returns the last CSSPropertyId of low priority properties.
1273 template<> CSSPropertyID StyleResolver::lastCSSPropertyId<StyleResolver::LowPrio rityProperties>() 1273 template<> CSSPropertyID StyleResolver::lastCSSPropertyId<StyleResolver::LowPrio rityProperties>()
1274 { 1274 {
1275 return static_cast<CSSPropertyID>(lastCSSProperty); 1275 return static_cast<CSSPropertyID>(lastCSSProperty);
1276 } 1276 }
1277 1277
1278 template <StyleResolver::StyleApplicationPass pass> 1278 template <StyleResolver::StyleApplicationPass pass>
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
1602 visitor->trace(m_uncommonAttributeRuleSet); 1602 visitor->trace(m_uncommonAttributeRuleSet);
1603 visitor->trace(m_watchedSelectorsRules); 1603 visitor->trace(m_watchedSelectorsRules);
1604 visitor->trace(m_treeBoundaryCrossingRules); 1604 visitor->trace(m_treeBoundaryCrossingRules);
1605 visitor->trace(m_styleSharingLists); 1605 visitor->trace(m_styleSharingLists);
1606 visitor->trace(m_pendingStyleSheets); 1606 visitor->trace(m_pendingStyleSheets);
1607 visitor->trace(m_document); 1607 visitor->trace(m_document);
1608 #endif 1608 #endif
1609 } 1609 }
1610 1610
1611 } // namespace blink 1611 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/css/resolver/AnimatedStyleBuilder.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698