Closed Bug 476598 Opened 15 years ago Closed 15 years ago

rename inherited/aInherited in nsRuleNode

Categories

(Core :: CSS Parsing and Computation, defect, P4)

defect

Tracking

()

RESOLVED FIXED
mozilla1.9.2a1

People

(Reporter: dbaron, Assigned: dbaron)

References

Details

(Keywords: fixed1.9.1)

Attachments

(4 files, 1 obsolete file)

The meaning of variables called inherited/aInherited in nsRuleNode.cpp is very confusing; I think it's one of the common sources of mistakes by new contributors to style code.

I think we should rename these variables to something more like what they do.

I think the easiest option is to rename them to canStoreInRuleTree / aCanStoreInRuleTree, and flipping the boolean values.

While there, we should either:
 (1) change the aInherited values that aren't mutated (in the functions that have both aInherited and inherited) to be |const| parameters, or
 (2) get rid of that duplication and mutate the arguments.

Thoughts?
That sounds good to me.  Another option is to rename to dependsOnParent and aDependsOnParent and not flip, but the canStore naming is somewhat clearer as to why we really care about them.
This is a needed for patch 2 to compile, but also fixes a real bug, and should land on 1.9.1.
Assignee: nobody → dbaron
Status: NEW → ASSIGNED
Attachment #360433 - Flags: superreview?(bzbarsky)
Attachment #360433 - Flags: review?(bzbarsky)
Attachment #360433 - Flags: superreview?(bzbarsky)
Attachment #360433 - Flags: superreview+
Attachment #360433 - Flags: review?(bzbarsky)
Attachment #360433 - Flags: review+
Comment on attachment 360433 [details] [diff] [review]
patch 1: fix two uses of aInherited that should have been inherited

Want to write regression tests for this too?
Attachment #360434 - Flags: superreview?(bzbarsky)
Attachment #360434 - Flags: superreview+
Attachment #360434 - Flags: review?(bzbarsky)
Attachment #360434 - Flags: review+
Attachment #360435 - Flags: superreview?(bzbarsky)
Attachment #360435 - Flags: superreview+
Attachment #360435 - Flags: review?(bzbarsky)
Attachment #360435 - Flags: review+
Attachment #360436 - Flags: superreview?(bzbarsky)
Attachment #360436 - Flags: superreview+
Attachment #360436 - Flags: review?(bzbarsky)
Attachment #360436 - Flags: review+
Comment on attachment 360556 [details] [diff] [review]
patch 1: fix two uses of aInherited that should have been inherited

This fixes a pretty bad bug in -moz-transform-origin (a new 1.9.1 feature) that was caught by the cleanup in this bug.
Attachment #360556 - Flags: approval1.9.1?
Attachment #360556 - Flags: approval1.9.1? → approval1.9.1+
http://hg.mozilla.org/releases/mozilla-1.9.1/rev/2d248b150ce6

Adding the fixed1.9.1 keyword since the part that's important to fix for 1.9.1 is.
Keywords: fixed1.9.1
Depends on: 521720
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: