Bug 142456

Summary: Shrink the CSSPropertyID enum type
Product: WebKit Reporter: Zan Dobersek <zan>
Component: New BugsAssignee: Zan Dobersek <zan>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Zan Dobersek
Reported 2015-03-08 12:08:36 PDT
Shrink the CSSPropertyID enum type
Attachments
Patch (1.31 KB, patch)
2015-03-08 12:18 PDT, Zan Dobersek
no flags
Patch (1.81 KB, patch)
2015-03-09 06:50 PDT, Zan Dobersek
no flags
Patch (2.46 KB, patch)
2015-03-09 14:01 PDT, Zan Dobersek
no flags
Zan Dobersek
Comment 1 2015-03-08 12:18:13 PDT
Sam Weinig
Comment 2 2015-03-08 13:40:04 PDT
Comment on attachment 248194 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=248194&action=review > Source/WebCore/css/makeprop.pl:279 > +enum CSSPropertyID : uint16_t { Can you generate a static_assert (in CSSPropertyNames.cpp or somewhere similar) that asserts that the largest generated CSSPropertyID fits in 16bits?
Zan Dobersek
Comment 3 2015-03-09 06:50:53 PDT
Darin Adler
Comment 4 2015-03-09 13:23:55 PDT
Comment on attachment 248243 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=248243&action=review > Source/WebCore/css/makeprop.pl:137 > +static_assert(numCSSProperties + 1 <= std::numeric_limits<uint16_t>::max(), "CSSPropertyID should fit into uint16_t."); Windows compiler doesn’t seem to be able to handle assertions that involve the numeric_limits max function; insufficient constexpr implementation perhaps? > Source/WebCore/css/makeprop.pl:283 > +enum CSSPropertyID : uint16_t { Need to remove the "< 0" check in CSSPrimitiveValue.cpp to make the compiler happy. Not sure why that < 0 was there.
Zan Dobersek
Comment 5 2015-03-09 13:47:28 PDT
Comment on attachment 248243 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=248243&action=review >> Source/WebCore/css/makeprop.pl:137 >> +static_assert(numCSSProperties + 1 <= std::numeric_limits<uint16_t>::max(), "CSSPropertyID should fit into uint16_t."); > > Windows compiler doesn’t seem to be able to handle assertions that involve the numeric_limits max function; insufficient constexpr implementation perhaps? constexpr support in MSVC 2013 is non-existent.
Zan Dobersek
Comment 6 2015-03-09 14:01:49 PDT
Zan Dobersek
Comment 7 2015-03-10 02:21:47 PDT
Comment on attachment 248273 [details] Patch Clearing flags on attachment: 248273 Committed r181320: <http://trac.webkit.org/changeset/181320>
Zan Dobersek
Comment 8 2015-03-10 02:21:56 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.