nsStyleDisplay copy-constructor uses init list for some args, and direct-assignment for others that could be in init list

RESOLVED FIXED in mozilla16

Status

()

Core
CSS Parsing and Computation
RESOLVED FIXED
6 years ago
5 years ago

People

(Reporter: dholbert, Assigned: jhk)

Tracking

Trunk
mozilla16
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [mentor=dholbert][lang=c++])

Attachments

(1 attachment)

(Reporter)

Description

6 years ago
The nsStyleDisplay copy-constructor uses an init list for some of its arguments and direct assignment for others:
=========
2127 nsStyleDisplay::nsStyleDisplay(const nsStyleDisplay& aSource)
2128   : mTransitions(aSource.mTransitions)
2129   , mTransitionTimingFunctionCount(aSource.mTransitionTimingFunctionCount)
[...]
2141   , mAnimationIterationCountCount(aSource.mAnimationIterationCountCount)
2142 {
2143   MOZ_COUNT_CTOR(nsStyleDisplay);
2144   mAppearance = aSource.mAppearance;
2145   mDisplay = aSource.mDisplay;
[...]
=========
http://mxr.mozilla.org/mozilla-central/source/layout/style/nsStyleStruct.cpp#2127

We should probably clean this up to be consistent.
(Reporter)

Comment 1

6 years ago
(unless there's some reason for the separation that I'm not getting)
(Reporter)

Updated

5 years ago
OS: Linux → All
Hardware: x86_64 → All
Whiteboard: [mentor=dholbert][lang=c++]
(Assignee)

Comment 2

5 years ago
Created attachment 631490 [details] [diff] [review]
Patch(v1)

Build with no warnings.
Attachment #631490 - Flags: feedback?(dholbert)
(Reporter)

Comment 3

5 years ago
Comment on attachment 631490 [details] [diff] [review]
Patch(v1)

Looks great to me!

I verified that the exact same member vars are being initialized in old code vs. new code, and that they're initialized from the same value in old code & new code.  (good)

This passed a local mochitest-plain run in layout/style/test, too.
Attachment #631490 - Flags: review?(dbaron)
Attachment #631490 - Flags: feedback?(dholbert)
Attachment #631490 - Flags: feedback+
(Reporter)

Updated

5 years ago
Assignee: nobody → jigneshhk1992
Comment on attachment 631490 [details] [diff] [review]
Patch(v1)

r=dbaron; sorry for the delay
Attachment #631490 - Flags: review?(dbaron) → review+
(Reporter)

Comment 5

5 years ago
Landed on mozilla-inbound:
  https://hg.mozilla.org/integration/mozilla-inbound/rev/675fdcfc540a
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla16
https://hg.mozilla.org/mozilla-central/rev/675fdcfc540a
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.