Closed Bug 1305844 Opened 9 years ago Closed 9 years ago

Remove accessors for nsStylePosition mAlignItems, mAlignContent, mJustifyContent (and make them public)

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla52
Tracking Status
firefox52 --- fixed

People

(Reporter: dholbert, Assigned: bradwerth)

References

Details

Attachments

(1 file, 1 obsolete file)

Up until now, nsStylePosition has made all of its mAlign*** and mJustify*** member-variables private, and only accessible via "Computed***()" getters. This was originally important because half of these member-variables had special just-in-time computed-style resolution work to be done. So we just gave all of these member-variables Computed***() getters, even if they didn't need them, for consistency. Now that mAlignSelf and mJustifySelf are becoming simpler and losing their Computed*** getters, though, there's only one remaining member-variable that needs to be private & have a magic accessor -- mJustifyItems. All the others could just be directly accessed now, and their accessors are unnecessary. Hence, filing this removing all of these accessors and making all of these public (except for mJustifyItems) (mats, I think you added most of these accessors -- let me know if this sounds good to you, or if you think there's a reason to keep this the way it is.)
Flags: needinfo?(mats)
Sounds good to me.
Flags: needinfo?(mats)
Great, thanks! Brad, perhaps you'd be up for taking this after bug 1304012? (At least, a patch for this bug will want to layer on top of your patches in bug 1304012, so no one should work on this until bug 1304012 has landed.) (This one should be a relatively simple search-and-replace; it's less subtle than bug 1304012, and shouldn't involve any behavior changes.) (For this bug, it may be simplest to just have a single patch; no need to subdivide this one into separate patches, unless you'd particularly like to. I say that because (a) none of the changes here are functional, and (b) the changes can all be quickly verified as valid using a merge tool like "meld" which highlights the changed parts of each line.)
Flags: needinfo?(bwerth)
Assignee: nobody → bwerth
Flags: needinfo?(bwerth)
Moved member variables to public, with exception of mJustifyItems. "friend" declaration moved immediately before mJustifyItems -- the only member variable that needs the friend declaration. If it would be clearer, we could also make mJustifyItems public and only use direct access in the nsRuleNode class, and use the accessor elsewhere (similar to how we use direct access to mAlignSelf and mJustifySelf within /layout/style and use the accessors elsewhere). https://treeherder.mozilla.org/#/jobs?repo=try&revision=983bb88c997f
Attachment #8797235 - Flags: review?(dholbert)
Comment on attachment 8797235 [details] [diff] [review] nsStylePosition members are now (mostly) public; trivial accessors removed. Review of attachment 8797235 [details] [diff] [review]: ----------------------------------------------------------------- r=me with commit message updated & a code-comment added (see below). First, some commit message nits: > Bug 1305844 -- nsStylePosition members are now (mostly) public; trivial accessors removed. ^^ (1) This double-hyphen syntax is uncommon for Mozilla commit messages, and it needlessly makes the message 1 character longer than it needs to be. Most people just use "Bug NNN: blahblah" or "Bug NNN - blahblah". Probably best to use one of those, for consistency & brevity. (2) It's unclear whether you're saying that the members area *already* public (and this commit builds on top of that) vs. whether you're *making* them public in this patch. To be less ambiguous, we normally phrase commit messages in such a way as to describe the change, in an active tense. (3) nsStylePosition has a lot of members; this is just focused on the align/justify ones, so let's mention that. So, to address all of those, please replace the commit message with something like this: > Bug 1305844 - Make most align/justify nsStylePosition members public, & remove trivial accessors (Thanks!) ::: layout/style/nsStyleStruct.h @@ +1748,3 @@ > private: > + friend class nsRuleNode; > + While you're cleaning this up, please add a comment to this "private" section, to explain its existence (and the 'friend' declaration). Something like this: // mJustifyItems should only be read via ComputedJustifyItems(), which // lazily resolves its "auto" value. (nsRuleNode needs direct access so // it can set mJustifyItems' value when populating this struct, though.)
Attachment #8797235 - Flags: review?(dholbert) → review+
Addresses issues in comment 4. Ready for checkin.
Attachment #8797235 - Attachment is obsolete: true
Keywords: checkin-needed
Pushed by ryanvm@gmail.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/59b5094e6e8c Make most align/justify nsStylePosition members public, and remove trivial accessors. r=dholbert
Keywords: checkin-needed
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: