Closed
Bug 1403034
Opened 7 years ago
Closed 5 years ago
Change color style define to enum class in nsStyleConsts.h
Categories
(Core :: CSS Parsing and Computation, defect, P3)
Tracking
()
RESOLVED
DUPLICATE
of bug 1563315
People
(Reporter: lvk, Assigned: lvk, Mentored)
References
Details
(Whiteboard: [c++])
Attachments
(2 files, 1 obsolete file)
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0
Build ID: 20170816210634
Mentor: dteller
Whiteboard: [c++]
File nsStyleColor.h ( http://searchfox.org/mozilla-central/source/layout/style/nsStyleConsts.h#237-246 ) defines a number of macros NS_COLOR_*. That's very fragile, so we should replace them with an `enum class`, which be just as efficient but will help us catch type errors.
The objective of this bug is to replace the definition of NS_COLOR_* with an `enum class` and to replace each instance of these color constants with their new value. See the other `enum class` definitions of the same file to see what the new `enum class` should look like.
Assignee | ||
Comment 2•7 years ago
|
||
(In reply to David Teller [:Yoric] (please use "needinfo") from comment #1)
> File nsStyleColor.h (
> http://searchfox.org/mozilla-central/source/layout/style/nsStyleConsts.h#237-
> 246 ) defines a number of macros NS_COLOR_*. That's very fragile, so we
> should replace them with an `enum class`, which be just as efficient but
> will help us catch type errors.
>
> The objective of this bug is to replace the definition of NS_COLOR_* with an
> `enum class` and to replace each instance of these color constants with
> their new value. See the other `enum class` definitions of the same file to
> see what the new `enum class` should look like.
Hi David, I intended for this bug to just concern NS_STYLE_COLOR_INHERIT_FROM_BODY. If it should include the NS_COLOR_* macros too, is it OK to combine the macros into one enum class called 'StyleColor'?
Flags: needinfo?(dteller)
My bad, I had misunderstood your bug description. Also, I hadn't realized that you were the one working on it :)
I believe that yes, they should be combined together, as they are already used as a single enumeration.
Flags: needinfo?(dteller)
Assignee | ||
Comment 4•7 years ago
|
||
(In reply to David Teller [:Yoric] (please use "needinfo") from comment #3)
> My bad, I had misunderstood your bug description. Also, I hadn't realized
> that you were the one working on it :)
Sorry, should've been more explicit in the description :) Could you assign the bug to me?
>
> I believe that yes, they should be combined together, as they are already
> used as a single enumeration.
Will do, thanks!
Assignee: nobody → lkhodel
Flags: needinfo?(dteller)
Comment hidden (mozreview-request) |
Assignee | ||
Updated•7 years ago
|
Attachment #8912698 -
Attachment is obsolete: true
Comment hidden (mozreview-request) |
Assignee | ||
Updated•7 years ago
|
Flags: needinfo?(dteller)
Deflecting review to Manish.
Flags: needinfo?(dteller)
Assignee | ||
Updated•7 years ago
|
Attachment #8912707 -
Flags: review?(manishearth)
Comment 9•7 years ago
|
||
mozreview-review |
Comment on attachment 8912707 [details]
Bug 1403034: Convert NS_STYLE_COLOR.. and NS_COLOR_* macros to enum class.
https://reviewboard.mozilla.org/r/184036/#review190038
looks good, though I'll need to handle the servo side (this can't be landed directly)
Attachment #8912707 -
Flags: review?(manishearth) → review+
Assignee | ||
Comment 10•7 years ago
|
||
(In reply to Manish Goregaokar [:manishearth] from comment #9)
> Comment on attachment 8912707 [details]
> Bug 1403034: Convert NS_STYLE_COLOR.. and NS_COLOR_* macros to enum class.
>
> https://reviewboard.mozilla.org/r/184036/#review190038
>
> looks good, though I'll need to handle the servo side (this can't be landed
> directly)
Great, thanks!
Updated•7 years ago
|
Status: UNCONFIRMED → ASSIGNED
Component: Untriaged → CSS Parsing and Computation
Ever confirmed: true
Product: Firefox → Core
Comment 11•7 years ago
|
||
The build doesn't pass, please fix all other usages of these macros.
Updated•7 years ago
|
Comment hidden (mozreview-request) |
Assignee | ||
Updated•7 years ago
|
Attachment #8915199 -
Flags: review?(manishearth)
Comment 13•7 years ago
|
||
mozreview-review |
Comment on attachment 8915199 [details]
Bug 1403034: Fix constant uses.
https://reviewboard.mozilla.org/r/186438/#review196978
Attachment #8915199 -
Flags: review?(manishearth) → review+
Comment 14•7 years ago
|
||
status-firefox59:
--- → ?
Comment 15•5 years ago
|
||
I believe this was done in bug 1563315.
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•