Changeset 181320 in webkit
- Timestamp:
- Mar 10, 2015 2:21:20 AM (9 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r181317 r181320 1 2015-03-10 Zan Dobersek <zdobersek@igalia.com> 2 3 Shrink the CSSPropertyID enum type 4 https://bugs.webkit.org/show_bug.cgi?id=142456 5 6 Reviewed by Sam Weinig. 7 8 Specify uint16_t as the base type for the CSSPropertyID enum. 9 This is enough to cover all of the CSS properties (429 at this moment, 10 with static_assert covering future changes). It halves the enum type size, 11 from 4 bytes to 2, reducing the size of various CSSPropertyID containers. 12 13 No new tests -- no change in behavior. 14 15 * css/CSSPrimitiveValue.cpp: 16 (WebCore::propertyName): Remove the unnecessary propertyID < 0 check. 17 * css/makeprop.pl: 18 1 19 2015-03-10 Dan Bernstein <mitz@apple.com> 2 20 -
trunk/Source/WebCore/css/CSSPrimitiveValue.cpp
r179100 r181320 220 220 ASSERT_ARG(propertyID, propertyID >= 0); 221 221 ASSERT_ARG(propertyID, (propertyID >= firstCSSProperty && propertyID < firstCSSProperty + numCSSProperties)); 222 223 if (propertyID < 0)224 return nullAtom;225 222 226 223 return getPropertyNameAtomicString(propertyID); -
trunk/Source/WebCore/css/makeprop.pl
r179227 r181320 133 133 134 134 namespace WebCore { 135 136 // Using std::numeric_limits<uint16_t>::max() here would be cleaner, 137 // but is not possible due to missing constexpr support in MSVC 2013. 138 static_assert(numCSSProperties + 1 <= 65535, "CSSPropertyID should fit into uint16_t."); 139 135 140 EOF 136 141 … … 277 282 namespace WebCore { 278 283 279 enum CSSPropertyID {284 enum CSSPropertyID : uint16_t { 280 285 CSSPropertyInvalid = 0, 281 286 EOF
Note: See TracChangeset
for help on using the changeset viewer.