diff --git a/layout/generic/nsIFrame.cpp b/layout/generic/nsIFrame.cpp
index fe05efa67f97e0d8cc327a4744a225ed5c6132c9..cce0dfb537fa1735b8e7ff67684d373a3081a527 100644
--- a/layout/generic/nsIFrame.cpp
+++ b/layout/generic/nsIFrame.cpp
@@ -11810,6 +11810,11 @@ gfx::Matrix nsIFrame::ComputeWidgetTransform() const {
   gfx::Matrix4x4 matrix = nsStyleTransformMatrix::ReadTransforms(
       uiReset->mMozWindowTransform, refBox, float(appUnitsPerDevPixel));
 
+  const StyleTransformOrigin& origin = uiReset->mWindowTransformOrigin;
+  Point transformOrigin = nsStyleTransformMatrix::Convert2DPosition(
+      origin.horizontal, origin.vertical, refBox, appUnitsPerDevPixel);
+  matrix.ChangeBasis(Point3D(transformOrigin.x, transformOrigin.y, 0));
+
   gfx::Matrix result2d;
   if (!matrix.CanDraw2D(&result2d)) {
     // FIXME: It would be preferable to reject non-2D transforms at parse time.
