summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dom/svg/SVGClipPathElement.cpp7
-rw-r--r--dom/svg/SVGClipPathElement.h4
-rw-r--r--layout/svg/nsSVGUtils.cpp3
3 files changed, 12 insertions, 2 deletions
diff --git a/dom/svg/SVGClipPathElement.cpp b/dom/svg/SVGClipPathElement.cpp
index b915a6189..9f430d11f 100644
--- a/dom/svg/SVGClipPathElement.cpp
+++ b/dom/svg/SVGClipPathElement.cpp
@@ -49,6 +49,13 @@ SVGClipPathElement::GetEnumInfo()
ArrayLength(sEnumInfo));
}
+bool
+SVGClipPathElement::IsUnitsObjectBoundingBox() const
+{
+ return mEnumAttributes[CLIPPATHUNITS].GetAnimValue() == SVG_UNIT_TYPE_OBJECTBOUNDINGBOX;
+}
+
+
//----------------------------------------------------------------------
// nsIDOMNode methods
diff --git a/dom/svg/SVGClipPathElement.h b/dom/svg/SVGClipPathElement.h
index 05aa2243c..ae141f359 100644
--- a/dom/svg/SVGClipPathElement.h
+++ b/dom/svg/SVGClipPathElement.h
@@ -35,6 +35,10 @@ public:
// WebIDL
already_AddRefed<SVGAnimatedEnumeration> ClipPathUnits();
+ // This is an internal method that does not flush style, and thus
+ // the answer may be out of date if there's a pending style flush.
+ bool IsUnitsObjectBoundingBox() const;
+
protected:
enum { CLIPPATHUNITS };
diff --git a/layout/svg/nsSVGUtils.cpp b/layout/svg/nsSVGUtils.cpp
index 2cf6ec811..f207faf77 100644
--- a/layout/svg/nsSVGUtils.cpp
+++ b/layout/svg/nsSVGUtils.cpp
@@ -946,8 +946,7 @@ nsSVGUtils::GetBBox(nsIFrame *aFrame, uint32_t aFlags)
if (clipPathFrame && isOK) {
SVGClipPathElement *clipContent =
static_cast<SVGClipPathElement*>(clipPathFrame->GetContent());
- nsRefPtr<SVGAnimatedEnumeration> units = clipContent->ClipPathUnits();
- if (units->AnimVal() == SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) {
+ if (clipContent->IsUnitsObjectBoundingBox()) {
matrix.Translate(gfxPoint(x, y));
matrix.Scale(width, height);
} else if (aFrame->GetType() == nsGkAtoms::svgForeignObjectFrame) {