Bug 1395873 - Append eUseUserSpaceOfUseElement flag after all standard SVGBoundingBoxOptions checked. r=longsonr+218550
authorcku <cku@mozilla.com>
Fri, 01 Sep 2017 22:37:59 +0800
changeset 428209 00b9a3c8a7fdd36a904e9c84371ce5f551abac53
parent 428208 e824f0d38a69fa6501bff8c531539654b39a1d9c
child 428210 7943bf751331ece384c998ae685c601edec740d0
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslongsonr
bugs1395873, 218550
milestone57.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 1395873 - Append eUseUserSpaceOfUseElement flag after all standard SVGBoundingBoxOptions checked. r=longsonr+218550 MozReview-Commit-ID: 6qjmfL4mGuI
dom/svg/SVGTransformableElement.cpp
--- a/dom/svg/SVGTransformableElement.cpp
+++ b/dom/svg/SVGTransformableElement.cpp
@@ -187,33 +187,37 @@ SVGTransformableElement::GetBBox(const S
     return nullptr;
   }
 
   if (!NS_SVGNewGetBBoxEnabled()) {
     return NS_NewSVGRect(this, ToRect(nsSVGUtils::GetBBox(frame,
                                       nsSVGUtils::eBBoxIncludeFillGeometry |
                                       nsSVGUtils::eUseUserSpaceOfUseElement)));
   } else {
-    uint32_t flags = nsSVGUtils::eUseUserSpaceOfUseElement;
+    uint32_t flags = 0;
     if (aOptions.mFill) {
       flags |= nsSVGUtils::eBBoxIncludeFill;
     }
     if (aOptions.mStroke) {
       flags |= nsSVGUtils::eBBoxIncludeStroke;
     }
     if (aOptions.mMarkers) {
       flags |= nsSVGUtils::eBBoxIncludeMarkers;
     }
     if (aOptions.mClipped) {
       flags |= nsSVGUtils::eBBoxIncludeClipped;
     }
+    if (flags == 0) {
+      return NS_NewSVGRect(this,0,0,0,0);
+    }
     if (flags == nsSVGUtils::eBBoxIncludeMarkers ||
         flags == nsSVGUtils::eBBoxIncludeClipped) {
       flags |= nsSVGUtils::eBBoxIncludeFill;
     }
+    flags |= nsSVGUtils::eUseUserSpaceOfUseElement;
     return NS_NewSVGRect(this, ToRect(nsSVGUtils::GetBBox(frame, flags)));
   }
 }
 
 already_AddRefed<SVGMatrix>
 SVGTransformableElement::GetCTM()
 {
   nsIDocument* currentDoc = GetComposedDoc();