Bug 1269885: Enforce that a (re)initialized nsSVGViewBox's mBaseValue represents "none". r=longsonr
authorDaniel Holbert <dholbert@cs.stanford.edu>
Wed, 01 Jun 2016 09:21:03 -0700
changeset 299955 9f5785ece1f2ca1205396525c68408923e0333a4
parent 299954 7d2eb6f9f3defef10fbbdcedb1a2da687a263a42
child 299956 f2e6fa9e0a42936f6b46d5ef927663fd4abe3316
push id77764
push userdholbert@mozilla.com
push dateWed, 01 Jun 2016 16:22:09 +0000
treeherdermozilla-inbound@9f5785ece1f2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslongsonr
bugs1269885
milestone49.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1269885: Enforce that a (re)initialized nsSVGViewBox's mBaseValue represents "none". r=longsonr MozReview-Commit-ID: LVZtimXYllo
dom/svg/nsSVGViewBox.cpp
--- a/dom/svg/nsSVGViewBox.cpp
+++ b/dom/svg/nsSVGViewBox.cpp
@@ -62,16 +62,21 @@ nsSVGAttrTearoffTable<nsSVGViewBox, dom:
 
 
 /* Implementation of nsSVGViewBox methods */
 
 void
 nsSVGViewBox::Init()
 {
   mHasBaseVal = false;
+  // We shouldn't use mBaseVal for rendering (its usages should be guarded with
+  // "mHasBaseVal" checks), but just in case we do by accident, this will
+  // ensure that we treat it as "none" and ignore its numeric values:
+  mBaseVal.none = true;
+
   mAnimVal = nullptr;
 }
 
 bool
 nsSVGViewBox::HasRect() const
 {
   // Check mAnimVal if we have one; otherwise, check mBaseVal if we have one;
   // otherwise, just return false (we clearly do not have a rect).