Last Comment Bug 695813 - nsStyleDisplay copy-constructor uses init list for some args, and direct-assignment for others that could be in init list
: nsStyleDisplay copy-constructor uses init list for some args, and direct-assi...
Status: RESOLVED FIXED
[mentor=dholbert][lang=c++]
:
Product: Core
Classification: Components
Component: CSS Parsing and Computation (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla16
Assigned To: Jignesh Kakadiya [:jhk]
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-10-19 12:51 PDT by Daniel Holbert [:dholbert]
Modified: 2012-07-07 12:01 PDT (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch(v1) (3.69 KB, patch)
2012-06-08 11:57 PDT, Jignesh Kakadiya [:jhk]
dbaron: review+
dholbert: feedback+
Details | Diff | Splinter Review

Description Daniel Holbert [:dholbert] 2011-10-19 12:51:57 PDT
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.
Comment 1 Daniel Holbert [:dholbert] 2011-10-19 12:57:01 PDT
(unless there's some reason for the separation that I'm not getting)
Comment 2 Jignesh Kakadiya [:jhk] 2012-06-08 11:57:03 PDT
Created attachment 631490 [details] [diff] [review]
Patch(v1)

Build with no warnings.
Comment 3 Daniel Holbert [:dholbert] 2012-06-08 17:36:46 PDT
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.
Comment 4 David Baron :dbaron: ⌚️UTC-7 (review requests must explain patch) 2012-07-06 16:05:27 PDT
Comment on attachment 631490 [details] [diff] [review]
Patch(v1)

r=dbaron; sorry for the delay
Comment 5 Daniel Holbert [:dholbert] 2012-07-06 16:37:04 PDT
Landed on mozilla-inbound:
  https://hg.mozilla.org/integration/mozilla-inbound/rev/675fdcfc540a
Comment 6 Ryan VanderMeulen [:RyanVM] 2012-07-07 12:01:29 PDT
https://hg.mozilla.org/mozilla-central/rev/675fdcfc540a

Note You need to log in before you can comment on or make changes to this bug.