Bug 788549 Part 3: Refactor nsComputedDOMStyle::DoGetTransform r=dbaron
authorDavid Zbarsky <dzbarsky@gmail.com>
Thu, 23 May 2013 15:09:27 +0800
changeset 132746 be938f823e770bbc15d688f25f8a5f07b756a363
parent 132745 68cc545b91065eff283091718acdb167a03b6657
child 132747 d88ad8015ae42517f671666943d19dd8e669b8c1
push id24714
push userphilringnalda@gmail.com
push dateFri, 24 May 2013 04:02:04 +0000
treeherdermozilla-central@53bfd38cbc8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron
bugs788549
milestone24.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 788549 Part 3: Refactor nsComputedDOMStyle::DoGetTransform r=dbaron
layout/style/nsComputedDOMStyle.cpp
layout/style/nsComputedDOMStyle.h
--- a/layout/style/nsComputedDOMStyle.cpp
+++ b/layout/style/nsComputedDOMStyle.cpp
@@ -1091,16 +1091,22 @@ nsComputedDOMStyle::DoGetTransform()
    gfx3DMatrix matrix =
      nsStyleTransformMatrix::ReadTransforms(display->mSpecifiedTransform,
                                             mStyleContextHolder,
                                             mStyleContextHolder->PresContext(),
                                             dummy,
                                             bounds,
                                             float(nsDeviceContext::AppUnitsPerCSSPixel()));
 
+  return MatrixToCSSValue(matrix);
+}
+
+/* static */ CSSValue*
+nsComputedDOMStyle::MatrixToCSSValue(gfx3DMatrix& matrix)
+{
   bool is3D = !matrix.Is2D();
 
   nsAutoString resultString(NS_LITERAL_STRING("matrix"));
   if (is3D) {
     resultString.Append(NS_LITERAL_STRING("3d"));
   }
 
   resultString.Append(NS_LITERAL_STRING("("));
--- a/layout/style/nsComputedDOMStyle.h
+++ b/layout/style/nsComputedDOMStyle.h
@@ -432,16 +432,17 @@ private:
   mozilla::dom::CSSValue* DoGetStopColor();
 
   mozilla::dom::CSSValue* DoGetClipPath();
   mozilla::dom::CSSValue* DoGetFilter();
   mozilla::dom::CSSValue* DoGetMask();
   mozilla::dom::CSSValue* DoGetMaskType();
   mozilla::dom::CSSValue* DoGetPaintOrder();
 
+  static mozilla::dom::CSSValue* MatrixToCSSValue(gfx3DMatrix& aMatrix);
   nsDOMCSSValueList* GetROCSSValueList(bool aCommaDelimited);
   void SetToRGBAColor(nsROCSSPrimitiveValue* aValue, nscolor aColor);
   void SetValueToStyleImage(const nsStyleImage& aStyleImage,
                             nsROCSSPrimitiveValue* aValue);
 
   /**
    * A method to get a percentage base for a percentage value.  Returns true
    * if a percentage base value was determined, false otherwise.