| Summary: | Refactor ValueRange from enum to enum class | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Tyler Wilcock <twilco.o> | ||||
| Component: | CSS | Assignee: | Tyler Wilcock <twilco.o> | ||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Normal | CC: | darin, eric.carlson, esprehn+autocc, ews-watchlist, glenn, gyuyoung.kim, jer.noble, macpherson, menard, philipj, sam, sergio, webkit-bug-importer | ||||
| Priority: | P2 | Keywords: | InRadar | ||||
| Version: | WebKit Nightly Build | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Attachments: |
|
||||||
Created attachment 426915 [details]
Patch
Darin, here's one follow-up from https://bugs.webkit.org/show_bug.cgi?id=224718#c24 (parsing @counter-style descriptors). Committed r276550 (236990@main): <https://commits.webkit.org/236990@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 426915 [details]. Comment on attachment 426915 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=426915&action=review > Source/WebCore/ChangeLog:23 > + making it smaller (one byte versus four) and harder to misuse (no > + auto-coercion to number types). Seems like a great change. For future reference, adding the underlying type of uint8_t is independent of changing from enum to enum class. Both are good ideas. I believe that for two-value enumerations, bool is an even better underlying type than uint8_t, and on the modern compilers we are compiling with both will use a single byte for storage. |
ValueRange looks like this: enum ValueRange { ValueRangeAll, ValueRangeNonNegative } It should be an `enum class : uint8_t`. This would make it smaller (one byte versus four) and harder to misuse.