Closed Bug 530199 Opened 10 years ago Closed 10 years ago

Cleanup in nsSMILCSSValueType: postpone allocation of ValueWrappers until they're needed

Categories

(Core :: SVG, defect)

defect
Not set

Tracking

()

RESOLVED FIXED

People

(Reporter: dholbert, Assigned: dholbert)

References

Details

Attachments

(1 file, 1 obsolete file)

Attached patch fix v1 (obsolete) — Splinter Review
As part of the patch-revising in bug 520239 comment 5 / bug 520239 comment 6, I needed to shift memory-allocation from msSMILCSSShorthandType::Init until later on, when the memory actually gets used.

This change made things cleaner[1], and I'd like to make the same change to nsSMILCSSValueType as well.

Patch attached. It passes SMIL+CSS reftests/mochitests locally.

[1] (e.g. no need for eCSSProperty_UNKNOWN checks, & assertions about consistency of member data in constructed-but-not-yet-meaningful structs)
Attachment #413711 - Flags: review?(roc)
Comment on attachment 413711 [details] [diff] [review]
fix v1

(sorry, just noticed one minor thing to fix; reposting patch in just a minute)
Attachment #413711 - Attachment is obsolete: true
Attachment #413711 - Flags: review?(roc)
Attached patch fix v1aSplinter Review
Added one null-check-after-new.
Attachment #413715 - Flags: review?(roc)
Blocks: 520239
Comment on attachment 413715 [details] [diff] [review]
fix v1a

+  return wrapper ?
+    nsStyleAnimation::UncomputeValue(wrapper->mPropID, wrapper->mPresContext,
+                                     wrapper->mCSSValue, aString) :
+    PR_TRUE;  // (empty wrapper means we have nothing to do)

return !wrapper || nsStyleAnimation::UncomputeValue(...);
Attachment #413715 - Flags: review?(roc) → review+
Addressed comment 3 a while back, but forgot to mention here:
http://hg.mozilla.org/users/dholbert_mozilla.com/smil-patches/rev/60a626f9c1f7

Landed on mozilla-central:
http://hg.mozilla.org/mozilla-central/rev/5e6db9bd8270
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.