Backout bug 1291457 and bug 1370034 for bustage.
authorCameron McCormack <cam@mcc.id.au>
Mon, 19 Jun 2017 13:55:15 +0800
changeset 596556 0d08acc5a759cb6e148ba482f2e597f9857602b7
parent 596555 fd18e49efaaafb4eb3594faf956e0e963b9eba7a
child 596557 2664a53d4c18bc4874d68bc41b13ffc8993bb27f
push id64675
push usermak77@bonardo.net
push dateMon, 19 Jun 2017 12:08:05 +0000
bugs1291457, 1370034
milestone56.0a1
Backout bug 1291457 and bug 1370034 for bustage.
browser/base/content/browser.css
devtools/shared/css/generated/properties-db.js
gfx/thebes/gfxPrefs.h
layout/base/RestyleManager.cpp
layout/base/nsChangeHint.h
layout/generic/nsFrame.cpp
layout/generic/nsIFrame.h
layout/inspector/inDOMUtils.cpp
layout/painting/nsDisplayList.cpp
layout/style/StyleAnimationValue.cpp
layout/style/generate-stylestructlist.py
layout/style/nsCSSParser.cpp
layout/style/nsCSSPropList.h
layout/style/nsComputedDOMStyle.cpp
layout/style/nsComputedDOMStyle.h
layout/style/nsComputedDOMStylePropertyList.h
layout/style/nsRuleNode.cpp
layout/style/nsStyleStruct.cpp
layout/style/nsStyleStruct.h
layout/style/nsStyleTransformMatrix.cpp
layout/style/nsStyleTransformMatrix.h
layout/style/test/ListCSSProperties.cpp
layout/style/test/property_database.js
layout/xul/nsMenuPopupFrame.cpp
layout/xul/nsMenuPopupFrame.h
modules/libpref/init/all.js
toolkit/content/xul.css
widget/cocoa/nsChildView.mm
widget/cocoa/nsCocoaWindow.h
widget/cocoa/nsCocoaWindow.mm
widget/nsIWidget.h
--- a/browser/base/content/browser.css
+++ b/browser/base/content/browser.css
@@ -1049,64 +1049,17 @@ toolbarpaletteitem[place="palette"] > #d
   -moz-appearance: none;
   -moz-binding: url("chrome://browser/content/places/menu.xml#places-popup-arrow");
   background: transparent;
   border: none;
   /* The popup inherits -moz-image-region from the button, must reset it */
   -moz-image-region: auto;
 }
 
-%ifdef MOZ_WIDGET_COCOA
-
-/* On Mac, use the properties "-moz-window-transform" and "-moz-window-opacity"
-   instead of "transform" and "opacity" for these animations.
-   The -moz-window* properties apply to the whole window including the window's
-   shadow, and they don't affect the window's "shape", so the system doesn't
-   have to recompute the shadow shape during the animation. This makes them a
-   lot faster. In fact, Gecko no longer triggers shadow shape recomputations
-   for repaints.
-   These properties are not implemented on other platforms. */
-#BMB_bookmarksPopup {
-  -moz-window-transform: scale(.4);
-  -moz-window-opacity: 0;
-  transition-property: -moz-window-transform, -moz-window-opacity;
-  transition-duration: 0.15s;
-  transition-timing-function: ease-out;
-}
-
-#BMB_bookmarksPopup[animate="open"] {
-  -moz-window-transform: none;
-  -moz-window-opacity: 1.0;
-}
-
-#BMB_bookmarksPopup[animate="cancel"] {
-  -moz-window-transform: none;
-}
-
-#BMB_bookmarksPopup[arrowposition="after_start"]:-moz-locale-dir(ltr),
-#BMB_bookmarksPopup[arrowposition="after_end"]:-moz-locale-dir(rtl) {
-  -moz-window-transform-origin: 20px top;
-}
-
-#BMB_bookmarksPopup[arrowposition="after_end"]:-moz-locale-dir(ltr),
-#BMB_bookmarksPopup[arrowposition="after_start"]:-moz-locale-dir(rtl) {
-  -moz-window-transform-origin: calc(100% - 20px) top;
-}
-
-#BMB_bookmarksPopup[arrowposition="before_start"]:-moz-locale-dir(ltr),
-#BMB_bookmarksPopup[arrowposition="before_end"]:-moz-locale-dir(rtl) {
-  -moz-window-transform-origin: 20px bottom;
-}
-
-#BMB_bookmarksPopup[arrowposition="before_end"]:-moz-locale-dir(ltr),
-#BMB_bookmarksPopup[arrowposition="before_start"]:-moz-locale-dir(rtl) {
-  -moz-window-transform-origin: calc(100% - 20px) bottom;
-}
-
-%elifndef MOZ_WIDGET_GTK
+%ifndef MOZ_WIDGET_GTK
 
 #BMB_bookmarksPopup {
   transform: scale(.4);
   opacity: 0;
   transition-property: transform, opacity;
   transition-duration: 0.15s;
   transition-timing-function: ease-out;
 }
@@ -1134,16 +1087,17 @@ toolbarpaletteitem[place="palette"] > #d
 #BMB_bookmarksPopup[arrowposition="before_end"]:-moz-locale-dir(rtl) {
   transform-origin: 20px bottom;
 }
 
 #BMB_bookmarksPopup[arrowposition="before_end"]:-moz-locale-dir(ltr),
 #BMB_bookmarksPopup[arrowposition="before_start"]:-moz-locale-dir(rtl) {
   transform-origin: calc(100% - 20px) bottom;
 }
+
 %endif
 
 /* Customize mode */
 #navigator-toolbox,
 #browser-bottombox,
 #content-deck {
   transition-property: margin-left, margin-right;
   transition-duration: 200ms;
--- a/devtools/shared/css/generated/properties-db.js
+++ b/devtools/shared/css/generated/properties-db.js
@@ -1496,62 +1496,16 @@ exports.CSS_PROPERTIES = {
       "default",
       "drag",
       "inherit",
       "initial",
       "no-drag",
       "unset"
     ]
   },
-  "-moz-window-opacity": {
-    "isInherited": false,
-    "subproperties": [
-      "-moz-window-opacity"
-    ],
-    "supports": [
-      7
-    ],
-    "values": [
-      "inherit",
-      "initial",
-      "unset"
-    ]
-  },
-  "-moz-window-transform": {
-    "isInherited": false,
-    "subproperties": [
-      "-moz-window-transform"
-    ],
-    "supports": [],
-    "values": [
-      "inherit",
-      "initial",
-      "unset"
-    ]
-  },
-  "-moz-window-transform-origin": {
-    "isInherited": false,
-    "subproperties": [
-      "-moz-window-transform-origin"
-    ],
-    "supports": [
-      6,
-      8
-    ],
-    "values": [
-      "bottom",
-      "center",
-      "inherit",
-      "initial",
-      "left",
-      "right",
-      "top",
-      "unset"
-    ]
-  },
   "-webkit-align-content": {
     "isInherited": false,
     "subproperties": [
       "align-content"
     ],
     "supports": [],
     "values": [
       "baseline",
@@ -3191,19 +3145,16 @@ exports.CSS_PROPERTIES = {
       "vector-effect",
       "vertical-align",
       "visibility",
       "white-space",
       "width",
       "will-change",
       "-moz-window-dragging",
       "-moz-window-shadow",
-      "-moz-window-opacity",
-      "-moz-window-transform",
-      "-moz-window-transform-origin",
       "word-break",
       "word-spacing",
       "overflow-wrap",
       "writing-mode",
       "z-index"
     ],
     "supports": [
       1,
--- a/gfx/thebes/gfxPrefs.h
+++ b/gfx/thebes/gfxPrefs.h
@@ -691,18 +691,16 @@ private:
 
   DECL_GFX_PREF(Live, "webgl.max-perf-warnings",               WebGLMaxPerfWarnings, int32_t, 0);
   DECL_GFX_PREF(Live, "webgl.max-acceptable-fb-status-invals", WebGLMaxAcceptableFBStatusInvals, int32_t, 0);
 
   DECL_GFX_PREF(Live, "webgl.webgl2-compat-mode",              WebGL2CompatMode, bool, false);
   DECL_GFX_PREF(Live, "webrender.blob-images",                 WebRenderBlobImages, bool, false);
   DECL_GFX_PREF(Live, "webrender.highlight-painted-layers",    WebRenderHighlightPaintedLayers, bool, false);
 
-  DECL_GFX_PREF(Live, "widget.window-transforms.disabled",     WindowTransformsDisabled, bool, false);
-
   // WARNING:
   // Please make sure that you've added your new preference to the list above in alphabetical order.
   // Please do not just append it to the end of the list.
 
 public:
   // Manage the singleton:
   static gfxPrefs& GetSingleton()
   {
--- a/layout/base/RestyleManager.cpp
+++ b/layout/base/RestyleManager.cpp
@@ -454,17 +454,16 @@ RestyleManager::ChangeHintToString(nsCha
     "UpdateSubtreeOverflow", "UpdatePostTransformOverflow",
     "UpdateParentOverflow",
     "ChildrenOnlyTransform", "RecomputePosition", "UpdateContainingBlock",
     "BorderStyleNoneChange", "UpdateTextPath", "SchedulePaint",
     "NeutralChange", "InvalidateRenderingObservers",
     "ReflowChangesSizeOrPosition", "UpdateComputedBSize",
     "UpdateUsesOpacity", "UpdateBackgroundPosition",
     "AddOrRemoveTransform", "CSSOverflowChange",
-    "UpdateWidgetProperties"
   };
   static_assert(nsChangeHint_AllHints == (1 << ArrayLength(names)) - 1,
                 "Name list doesn't match change hints.");
   uint32_t hint = aHint & ((1 << ArrayLength(names)) - 1);
   uint32_t rest = aHint & ~((1 << ArrayLength(names)) - 1);
   if ((hint & NS_STYLE_HINT_REFLOW) == NS_STYLE_HINT_REFLOW) {
     result.AppendLiteral("NS_STYLE_HINT_REFLOW");
     hint = hint & ~NS_STYLE_HINT_REFLOW;
@@ -1709,19 +1708,16 @@ RestyleManager::ProcessRestyledFrames(ns
             }
           }
         }
       }
       if ((hint & nsChangeHint_UpdateCursor) && !didUpdateCursor) {
         presContext->PresShell()->SynthesizeMouseMove(false);
         didUpdateCursor = true;
       }
-      if (hint & nsChangeHint_UpdateWidgetProperties) {
-        frame->UpdateWidgetProperties();
-      }
     }
   }
 
   frameConstructor->EndUpdate();
   mDestroyedFrames.reset(nullptr);
 
 #ifdef DEBUG
   // Verify the style tree.  Note that this needs to happen once we've
--- a/layout/base/nsChangeHint.h
+++ b/layout/base/nsChangeHint.h
@@ -227,38 +227,32 @@ enum nsChangeHint : uint32_t {
    *
    * In most cases, this is equivalent to nsChangeHint_ReconstructFrame. But
    * in some special cases where the change is really targeting the viewport's
    * scrollframe, this is instead equivalent to nsChangeHint_AllReflowHints
    * (because the viewport always has an associated scrollframe).
    */
   nsChangeHint_CSSOverflowChange = 1 << 28,
 
-  /**
-   * Indicates that nsIFrame::UpdateWidgetProperties needs to be called.
-   * This is used for -moz-window-* properties.
-   */
-  nsChangeHint_UpdateWidgetProperties = 1 << 29,
-
   // IMPORTANT NOTE: When adding a new hint, you will need to add it to
   // one of:
   //
   //   * nsChangeHint_Hints_NeverHandledForDescendants
   //   * nsChangeHint_Hints_AlwaysHandledForDescendants
   //   * nsChangeHint_Hints_SometimesHandledForDescendants
   //
   // and you also may need to handle it in NS_HintsNotHandledForDescendantsIn.
   //
   // Please also add it to RestyleManager::ChangeHintToString and
   // modify nsChangeHint_AllHints below accordingly.
 
   /**
    * Dummy hint value for all hints. It exists for compile time check.
    */
-  nsChangeHint_AllHints = (1 << 30) - 1,
+  nsChangeHint_AllHints = (1 << 29) - 1,
 };
 
 // Redefine these operators to return nothing. This will catch any use
 // of these operators on hints. We should not be using these operators
 // on nsChangeHints
 inline void operator<(nsChangeHint s1, nsChangeHint s2) {}
 inline void operator>(nsChangeHint s1, nsChangeHint s2) {}
 inline void operator!=(nsChangeHint s1, nsChangeHint s2) {}
@@ -350,18 +344,17 @@ inline nsChangeHint operator^=(nsChangeH
   nsChangeHint_UpdateContainingBlock |                     \
   nsChangeHint_UpdateEffects |                             \
   nsChangeHint_UpdateOpacityLayer |                        \
   nsChangeHint_UpdateOverflow |                            \
   nsChangeHint_UpdateParentOverflow |                      \
   nsChangeHint_UpdatePostTransformOverflow |               \
   nsChangeHint_UpdateTransformLayer |                      \
   nsChangeHint_UpdateUsesOpacity |                         \
-  nsChangeHint_AddOrRemoveTransform |                      \
-  nsChangeHint_UpdateWidgetProperties                      \
+  nsChangeHint_AddOrRemoveTransform                        \
 )
 
 // The change hints that are sometimes considered to be handled for descendants.
 #define nsChangeHint_Hints_SometimesHandledForDescendants (\
   nsChangeHint_ClearAncestorIntrinsics |                   \
   nsChangeHint_NeedReflow |                                \
   nsChangeHint_ReflowChangesSizeOrPosition                 \
 )
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -10474,96 +10474,16 @@ IsFrameScrolledOutOfView(nsIFrame *aFram
 }
 
 bool
 nsIFrame::IsScrolledOutOfView()
 {
   return IsFrameScrolledOutOfView(this);
 }
 
-gfx::Matrix
-nsIFrame::ComputeWidgetTransform()
-{
-  const nsStyleUIReset* uiReset = StyleUIReset();
-  if (!uiReset->mSpecifiedWindowTransform) {
-    return gfx::Matrix();
-  }
-
-  nsStyleTransformMatrix::TransformReferenceBox refBox;
-  refBox.Init(GetSize());
-
-  nsPresContext* presContext = PresContext();
-  int32_t appUnitsPerDevPixel = presContext->AppUnitsPerDevPixel();
-  RuleNodeCacheConditions dummy;
-  bool dummyBool;
-  gfx::Matrix4x4 matrix =
-    nsStyleTransformMatrix::ReadTransforms(uiReset->mSpecifiedWindowTransform->mHead,
-                                           StyleContext(),
-                                           presContext,
-                                           dummy,
-                                           refBox,
-                                           float(appUnitsPerDevPixel),
-                                           &dummyBool);
-
-  // Apply the -moz-window-transform-origin translation to the matrix.
-  Point transformOrigin =
-    nsStyleTransformMatrix::Convert2DPosition(uiReset->mWindowTransformOrigin,
-                                              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.
-    NS_WARNING("-moz-window-transform does not describe a 2D transform, "
-               "but only 2d transforms are supported");
-    return gfx::Matrix();
-  }
-
-  return result2d;
-}
-
-static already_AddRefed<nsIWidget>
-GetWindowWidget(nsPresContext* aPresContext)
-{
-  // We want to obtain the widget for the window. We can't use any of these
-  // methods: nsPresContext::GetRootWidget, nsPresContext::GetNearestWidget,
-  // nsIFrame::GetNearestWidget because those deal with child widgets and
-  // there is no parent widget connection between child widgets and the
-  // window widget that contains them.
-  nsCOMPtr<nsISupports> container = aPresContext->Document()->GetContainer();
-  nsCOMPtr<nsIBaseWindow> baseWindow = do_QueryInterface(container);
-  if (!baseWindow) {
-    return nullptr;
-  }
-
-  nsCOMPtr<nsIWidget> mainWidget;
-  baseWindow->GetMainWidget(getter_AddRefs(mainWidget));
-  return mainWidget.forget();
-}
-
-void
-nsIFrame::UpdateWidgetProperties()
-{
-  nsPresContext* presContext = PresContext();
-  if (presContext->IsRoot() || !presContext->IsChrome()) {
-    // Don't do anything for documents that aren't the root chrome document.
-    return;
-  }
-  nsIFrame* rootFrame =
-    presContext->FrameConstructor()->GetRootElementStyleFrame();
-  if (this != rootFrame) {
-    // Only the window's root style frame is relevant for widget properties.
-    return;
-  }
-  if (nsCOMPtr<nsIWidget> widget = GetWindowWidget(presContext)) {
-    widget->SetWindowOpacity(StyleUIReset()->mWindowOpacity);
-    widget->SetWindowTransform(ComputeWidgetTransform());
-  }
-}
-
 void
 nsIFrame::DoUpdateStyleOfOwnedAnonBoxes(ServoStyleSet& aStyleSet,
                                         nsStyleChangeList& aChangeList,
                                         nsChangeHint aHintForThisFrame)
 {
   // As a special case, we check for {ib}-split block frames here, rather
   // than have an nsInlineFrame::AppendDirectlyOwnedAnonBoxes implementation
   // that returns them.
--- a/layout/generic/nsIFrame.h
+++ b/layout/generic/nsIFrame.h
@@ -3930,29 +3930,16 @@ public:
   }
 
   /**
    * Returns true if the frame is scrolled out of view.
    */
   bool IsScrolledOutOfView();
 
   /**
-   * Computes a 2D matrix from the -moz-window-transform and
-   * -moz-window-transform-origin properties on aFrame.
-   * Values that don't result in a 2D matrix will be ignored and an identity
-   * matrix will be returned instead.
-   */
-  Matrix ComputeWidgetTransform();
-
-  /**
-   * Applies the values from the -moz-window-* properties to the widget.
-   */
-  virtual void UpdateWidgetProperties();
-
-  /**
    * @return true iff this frame has one or more associated image requests.
    * @see mozilla::css::ImageLoader.
    */
   bool HasImageRequest() const { return mHasImageRequest; }
 
   /**
    * Update this frame's image request state.
    */
--- a/layout/inspector/inDOMUtils.cpp
+++ b/layout/inspector/inDOMUtils.cpp
@@ -765,17 +765,16 @@ PropertySupportsVariant(nsCSSPropertyID 
       case eCSSProperty_scroll_snap_coordinate:
       case eCSSProperty_scroll_snap_destination:
       case eCSSProperty_transform_origin:
       case eCSSProperty_perspective_origin:
       case eCSSProperty__moz_outline_radius_topleft:
       case eCSSProperty__moz_outline_radius_topright:
       case eCSSProperty__moz_outline_radius_bottomleft:
       case eCSSProperty__moz_outline_radius_bottomright:
-      case eCSSProperty__moz_window_transform_origin:
         supported = VARIANT_LP;
         break;
 
       case eCSSProperty__moz_border_bottom_colors:
       case eCSSProperty__moz_border_left_colors:
       case eCSSProperty__moz_border_right_colors:
       case eCSSProperty__moz_border_top_colors:
         supported = VARIANT_COLOR;
--- a/layout/painting/nsDisplayList.cpp
+++ b/layout/painting/nsDisplayList.cpp
@@ -7068,38 +7068,67 @@ nsDisplayTransform::ComputePerspectiveMa
   }
   nscoord perspective = cbDisplay->mChildPerspective.GetCoordValue();
   if (perspective < std::numeric_limits<Float>::epsilon()) {
     return true;
   }
 
   TransformReferenceBox refBox(cbFrame);
 
-  Point perspectiveOrigin =
-    nsStyleTransformMatrix::Convert2DPosition(cbDisplay->mPerspectiveOrigin,
-                                              refBox, aAppUnitsPerPixel);
+  /* Allows us to access named variables by index. */
+  Point3D perspectiveOrigin;
+  gfx::Float* coords[2] = {&perspectiveOrigin.x, &perspectiveOrigin.y};
+  TransformReferenceBox::DimensionGetter dimensionGetter[] =
+    { &TransformReferenceBox::Width, &TransformReferenceBox::Height };
+
+  /* For both of the coordinates, if the value of perspective-origin is a
+   * percentage, it's relative to the size of the frame.  Otherwise, if it's
+   * a distance, it's already computed for us!
+   */
+  for (uint8_t index = 0; index < 2; ++index) {
+    /* If the -transform-origin specifies a percentage, take the percentage
+     * of the size of the box.
+     */
+    const nsStyleCoord &coord = cbDisplay->mPerspectiveOrigin[index];
+    if (coord.GetUnit() == eStyleUnit_Calc) {
+      const nsStyleCoord::Calc *calc = coord.GetCalcValue();
+      *coords[index] =
+        NSAppUnitsToFloatPixels((refBox.*dimensionGetter[index])(), aAppUnitsPerPixel) *
+          calc->mPercent +
+        NSAppUnitsToFloatPixels(calc->mLength, aAppUnitsPerPixel);
+    } else if (coord.GetUnit() == eStyleUnit_Percent) {
+      *coords[index] =
+        NSAppUnitsToFloatPixels((refBox.*dimensionGetter[index])(), aAppUnitsPerPixel) *
+        coord.GetPercentValue();
+    } else {
+      MOZ_ASSERT(coord.GetUnit() == eStyleUnit_Coord, "unexpected unit");
+      *coords[index] =
+        NSAppUnitsToFloatPixels(coord.GetCoordValue(), aAppUnitsPerPixel);
+    }
+  }
 
   /* GetOffsetTo computes the offset required to move from 0,0 in cbFrame to 0,0
    * in aFrame. Although we actually want the inverse of this, it's faster to
    * compute this way.
    */
   nsPoint frameToCbOffset = -aFrame->GetOffsetTo(cbFrame);
-  Point frameToCbGfxOffset(
+  Point3D frameToCbGfxOffset(
             NSAppUnitsToFloatPixels(frameToCbOffset.x, aAppUnitsPerPixel),
-            NSAppUnitsToFloatPixels(frameToCbOffset.y, aAppUnitsPerPixel));
+            NSAppUnitsToFloatPixels(frameToCbOffset.y, aAppUnitsPerPixel),
+            0.0f);
 
   /* Move the perspective origin to be relative to aFrame, instead of relative
    * to the containing block which is how it was specified in the style system.
    */
   perspectiveOrigin += frameToCbGfxOffset;
 
   aOutMatrix._34 =
     -1.0 / NSAppUnitsToFloatPixels(perspective, aAppUnitsPerPixel);
 
-  aOutMatrix.ChangeBasis(Point3D(perspectiveOrigin.x, perspectiveOrigin.y, 0));
+  aOutMatrix.ChangeBasis(perspectiveOrigin);
   return true;
 }
 
 nsDisplayTransform::FrameTransformProperties::FrameTransformProperties(const nsIFrame* aFrame,
                                                                        float aAppUnitsPerPixel,
                                                                        const nsRect* aBoundsOverride)
   : mFrame(aFrame)
   , mTransformList(aFrame->StyleDisplay()->mSpecifiedTransform)
--- a/layout/style/StyleAnimationValue.cpp
+++ b/layout/style/StyleAnimationValue.cpp
@@ -4312,31 +4312,16 @@ StyleAnimationValue::ExtractComputedValu
                                     pair->mYValue)) {
             return false;
           }
           aComputedValue.SetAndAdoptCSSValuePairValue(pair.forget(),
                                                       eUnit_CSSValuePair);
           break;
         }
 
-        case eCSSProperty__moz_window_transform_origin: {
-          const nsStyleUIReset *styleUIReset =
-            static_cast<const nsStyleUIReset*>(styleStruct);
-          nsAutoPtr<nsCSSValuePair> pair(new nsCSSValuePair);
-          if (!StyleCoordToCSSValue(styleUIReset->mWindowTransformOrigin[0],
-                                    pair->mXValue) ||
-              !StyleCoordToCSSValue(styleUIReset->mWindowTransformOrigin[1],
-                                    pair->mYValue)) {
-            return false;
-          }
-          aComputedValue.SetAndAdoptCSSValuePairValue(pair.forget(),
-                                                      eUnit_CSSValuePair);
-          break;
-        }
-
         case eCSSProperty_stroke_dasharray: {
           const nsStyleSVG *svg = static_cast<const nsStyleSVG*>(styleStruct);
           if (!svg->mStrokeDasharray.IsEmpty()) {
             nsAutoPtr<nsCSSValueList> result;
             nsCSSValueList **resultTail = getter_Transfers(result);
             for (uint32_t i = 0, i_end = svg->mStrokeDasharray.Length();
                  i != i_end; ++i) {
               nsCSSValueList *item = new nsCSSValueList;
@@ -4604,41 +4589,16 @@ StyleAnimationValue::ExtractComputedValu
             result->mValue.SetNoneValue();
           }
 
           aComputedValue.SetTransformValue(
               new nsCSSValueSharedList(result.forget()));
           break;
         }
 
-        case eCSSProperty__moz_window_transform: {
-          const nsStyleUIReset *uiReset =
-            static_cast<const nsStyleUIReset*>(styleStruct);
-          nsAutoPtr<nsCSSValueList> result;
-          if (uiReset->mSpecifiedWindowTransform) {
-            // Clone, and convert all lengths (not percents) to pixels.
-            nsCSSValueList **resultTail = getter_Transfers(result);
-            for (const nsCSSValueList *l = uiReset->mSpecifiedWindowTransform->mHead;
-                 l; l = l->mNext) {
-              nsCSSValueList *clone = new nsCSSValueList;
-              *resultTail = clone;
-              resultTail = &clone->mNext;
-
-              SubstitutePixelValues(aStyleContext, l->mValue, clone->mValue);
-            }
-          } else {
-            result = new nsCSSValueList();
-            result->mValue.SetNoneValue();
-          }
-
-          aComputedValue.SetTransformValue(
-              new nsCSSValueSharedList(result.forget()));
-          break;
-        }
-
         case eCSSProperty_font_variation_settings: {
           auto font = static_cast<const nsStyleFont*>(styleStruct);
           UniquePtr<nsCSSValuePairList> result;
           if (!font->mFont.fontVariationSettings.IsEmpty()) {
             // Make a new list that clones the current settings
             nsCSSValuePairList* tail = nullptr;
             for (auto v : font->mFont.fontVariationSettings) {
               auto clone = MakeUnique<nsCSSValuePairList>();
--- a/layout/style/generate-stylestructlist.py
+++ b/layout/style/generate-stylestructlist.py
@@ -34,17 +34,17 @@ STYLE_STRUCTS = [("INHERITED",) + x for 
     ("Variables",      "CheckVariablesCallback",[]),
 ]] + [("RESET",) + x for x in [
     # Reset style structs.
     ("Background",     "nullptr",   NORMAL_DEP + LENGTH_DEP + COLOR_DEP),
     ("Position",       "nullptr",   NORMAL_DEP + LENGTH_DEP),
     ("TextReset",      "nullptr",   NORMAL_DEP + LENGTH_DEP + COLOR_DEP),
     ("Display",        "nullptr",   NORMAL_DEP + LENGTH_DEP),
     ("Content",        "nullptr",   NORMAL_DEP + LENGTH_DEP),
-    ("UIReset",        "nullptr",   NORMAL_DEP + LENGTH_DEP),
+    ("UIReset",        "nullptr",   NORMAL_DEP),
     ("Table",          "nullptr",   NORMAL_DEP),
     ("Margin",         "nullptr",   NORMAL_DEP + LENGTH_DEP),
     ("Padding",        "nullptr",   NORMAL_DEP + LENGTH_DEP),
     ("Border",         "nullptr",   NORMAL_DEP + LENGTH_DEP + COLOR_DEP),
     ("Outline",        "nullptr",   NORMAL_DEP + LENGTH_DEP + COLOR_DEP),
     ("XUL",            "nullptr",   NORMAL_DEP),
     ("SVGReset",       "nullptr",   NORMAL_DEP + LENGTH_DEP + COLOR_DEP),
     ("Column",         "nullptr",   NORMAL_DEP + LENGTH_DEP + COLOR_DEP),
--- a/layout/style/nsCSSParser.cpp
+++ b/layout/style/nsCSSParser.cpp
@@ -1037,18 +1037,17 @@ protected:
   bool ParseFontVariationSettings(nsCSSValue& aValue);
   bool ParseFontSrc(nsCSSValue& aValue);
   bool ParseFontSrcFormat(InfallibleTArray<nsCSSValue>& values);
   bool ParseFontRanges(nsCSSValue& aValue);
   bool ParseListStyle();
   bool ParseListStyleType(nsCSSValue& aValue);
   bool ParseMargin();
   bool ParseClipPath(nsCSSValue& aValue);
-  bool ParseTransform(bool aIsPrefixed, nsCSSPropertyID aProperty,
-                      bool aDisallowRelativeValues = false);
+  bool ParseTransform(bool aIsPrefixed, bool aDisallowRelativeValues = false);
   bool ParseObjectPosition();
   bool ParseOutline();
   bool ParseOverflow();
   bool ParsePadding();
   bool ParseQuotes();
   bool ParseTextAlign(nsCSSValue& aValue,
                       const KTableEntry aTable[]);
   bool ParseTextAlign(nsCSSValue& aValue);
@@ -1381,17 +1380,17 @@ protected:
                      uint16_t aMaxElems, nsCSSValue &aValue);
   bool ParseFunctionInternals(const uint32_t aVariantMask[],
                               uint32_t aVariantMaskAll,
                               uint16_t aMinElems,
                               uint16_t aMaxElems,
                               InfallibleTArray<nsCSSValue>& aOutput);
 
   /* Functions for transform-origin/perspective-origin Parsing */
-  bool ParseTransformOrigin(nsCSSPropertyID aProperty);
+  bool ParseTransformOrigin(bool aPerspective);
 
   /* Functions for filter parsing */
   bool ParseFilter();
   bool ParseSingleFilter(nsCSSValue* aValue);
   bool ParseDropShadow(nsCSSValue* aValue);
 
   /* Find and return the namespace ID associated with aPrefix.
      If aPrefix has not been declared in an @namespace rule, returns
@@ -1942,18 +1941,17 @@ CSSParserImpl::ParseTransformProperty(co
 
   mData.AssertInitialState();
   mTempData.AssertInitialState();
 
   nsCSSScanner scanner(aPropValue, 0);
   css::ErrorReporter reporter(scanner, mSheet, mChildLoader, nullptr);
   InitScanner(scanner, reporter, nullptr, nullptr, nullptr);
 
-  bool parsedOK = ParseTransform(false, eCSSProperty_transform,
-                                 aDisallowRelativeValues);
+  bool parsedOK = ParseTransform(false, aDisallowRelativeValues);
   // We should now be at EOF
   if (parsedOK && GetToken(true)) {
     parsedOK = false;
   }
 
   bool changed = false;
   if (parsedOK) {
     declaration->ExpandTo(&mData);
@@ -11864,24 +11862,23 @@ CSSParserImpl::ParsePropertyByFunction(n
     return ParseQuotes();
   case eCSSProperty_text_decoration:
     return ParseTextDecoration();
   case eCSSProperty_text_emphasis:
     return ParseTextEmphasis();
   case eCSSProperty_will_change:
     return ParseWillChange();
   case eCSSProperty_transform:
-  case eCSSProperty__moz_window_transform:
-    return ParseTransform(false, aPropID);
+    return ParseTransform(false);
   case eCSSProperty__moz_transform:
-    return ParseTransform(true, eCSSProperty_transform);
+    return ParseTransform(true);
   case eCSSProperty_transform_origin:
+    return ParseTransformOrigin(false);
   case eCSSProperty_perspective_origin:
-  case eCSSProperty__moz_window_transform_origin:
-    return ParseTransformOrigin(aPropID);
+    return ParseTransformOrigin(true);
   case eCSSProperty_transition:
     return ParseTransition();
   case eCSSProperty_animation:
     return ParseAnimation();
   case eCSSProperty_transition_property:
     return ParseTransitionProperty();
   case eCSSProperty_fill:
   case eCSSProperty_stroke:
@@ -16230,25 +16227,19 @@ CSSParserImpl::ParseSingleTransform(bool
                                    variantMask))
     return false;
 
   return ParseFunction(keyword, variantMask, 0, minElems, maxElems, aValue);
 }
 
 /* Parses a transform property list by continuously reading in properties
  * and constructing a matrix from it.
- * aProperty can be transform or -moz-window-transform.
- * FIXME: For -moz-window-transform, it would be nice to reject non-2d
- * transforms at parse time, because the implementation only supports 2d
- * transforms. Instead, at the moment, non-2d transforms are treated as the
- * identity transform very late in the pipeline.
  */
 bool
-CSSParserImpl::ParseTransform(bool aIsPrefixed, nsCSSPropertyID aProperty,
-                              bool aDisallowRelativeValues)
+CSSParserImpl::ParseTransform(bool aIsPrefixed, bool aDisallowRelativeValues)
 {
   nsCSSValue value;
   // 'inherit', 'initial', 'unset' and 'none' must be alone
   if (!ParseSingleTokenVariant(value, VARIANT_INHERIT | VARIANT_NONE,
                                nullptr)) {
     nsCSSValueSharedList* list = new nsCSSValueSharedList;
     value.SetSharedListValue(list);
     list->mHead = new nsCSSValueList;
@@ -16260,17 +16251,17 @@ CSSParserImpl::ParseTransform(bool aIsPr
       }
       if (CheckEndProperty()) {
         break;
       }
       cur->mNext = new nsCSSValueList;
       cur = cur->mNext;
     }
   }
-  AppendValue(aProperty, value);
+  AppendValue(eCSSProperty_transform, value);
   return true;
 }
 
 /* Reads a polygon function's argument list.
  */
 bool
 CSSParserImpl::ParsePolygonFunction(nsCSSValue& aValue)
 {
@@ -16535,48 +16526,53 @@ CSSParserImpl::ParseShapeOutside(nsCSSVa
     // 'inherit', 'initial', 'unset', 'none', and <image> url must be alone.
     return true;
   }
 
   return ParseReferenceBoxAndBasicShape(
     aValue, nsCSSProps::kShapeOutsideShapeBoxKTable);
 }
 
-bool CSSParserImpl::ParseTransformOrigin(nsCSSPropertyID aProperty)
+bool CSSParserImpl::ParseTransformOrigin(bool aPerspective)
 {
   nsCSSValuePair position;
   if (!ParseBoxPositionValues(position, true))
     return false;
 
+  nsCSSPropertyID prop = eCSSProperty_transform_origin;
+  if (aPerspective) {
+    prop = eCSSProperty_perspective_origin;
+  }
+
   // Unlike many other uses of pairs, this position should always be stored
   // as a pair, even if the values are the same, so it always serializes as
   // a pair, and to keep the computation code simple.
   if (position.mXValue.GetUnit() == eCSSUnit_Inherit ||
       position.mXValue.GetUnit() == eCSSUnit_Initial ||
       position.mXValue.GetUnit() == eCSSUnit_Unset) {
     MOZ_ASSERT(position.mXValue == position.mYValue,
                "inherit/initial/unset only half?");
-    AppendValue(aProperty, position.mXValue);
+    AppendValue(prop, position.mXValue);
   } else {
     nsCSSValue value;
-    if (aProperty != eCSSProperty_transform_origin) {
+    if (aPerspective) {
       value.SetPairValue(position.mXValue, position.mYValue);
     } else {
       nsCSSValue depth;
       CSSParseResult result =
         ParseVariant(depth, VARIANT_LENGTH | VARIANT_CALC, nullptr);
       if (result == CSSParseResult::Error) {
         return false;
       } else if (result == CSSParseResult::NotFound) {
         depth.SetFloatValue(0.0f, eCSSUnit_Pixel);
       }
       value.SetTripletValue(position.mXValue, position.mYValue, depth);
     }
 
-    AppendValue(aProperty, value);
+    AppendValue(prop, value);
   }
   return true;
 }
 
 /**
  * Reads a drop-shadow value. At the moment the Filter Effects specification
  * just expects one shadow item. Should this ever change to a list of shadow
  * items, use ParseShadowList instead.
--- a/layout/style/nsCSSPropList.h
+++ b/layout/style/nsCSSPropList.h
@@ -4489,51 +4489,16 @@ CSS_PROP_UIRESET(
     CSS_PROPERTY_INTERNAL |
         CSS_PROPERTY_PARSE_VALUE |
         CSS_PROPERTY_ENABLED_IN_UA_SHEETS_AND_CHROME,
     "",
     VARIANT_HK,
     kWindowShadowKTable,
     CSS_PROP_NO_OFFSET,
     eStyleAnimType_None)
-CSS_PROP_UIRESET(
-    -moz-window-opacity,
-    _moz_window_opacity,
-    CSS_PROP_DOMPROP_PREFIXED(WindowOpacity),
-    CSS_PROPERTY_INTERNAL | CSS_PROPERTY_PARSE_VALUE,
-    "",
-    VARIANT_HN,
-    nullptr,
-    offsetof(nsStyleUIReset, mWindowOpacity),
-    eStyleAnimType_float)
-CSS_PROP_UIRESET(
-    -moz-window-transform,
-    _moz_window_transform,
-    CSS_PROP_DOMPROP_PREFIXED(WindowTransform),
-    CSS_PROPERTY_INTERNAL |
-        CSS_PROPERTY_PARSE_FUNCTION |
-        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
-    "",
-    0,
-    nullptr,
-    offsetof(nsStyleUIReset, mSpecifiedWindowTransform),
-    eStyleAnimType_Custom)
-CSS_PROP_UIRESET(
-    -moz-window-transform-origin,
-    _moz_window_transform_origin,
-    CSS_PROP_DOMPROP_PREFIXED(WindowTransformOrigin),
-    CSS_PROPERTY_INTERNAL |
-        CSS_PROPERTY_PARSE_FUNCTION |
-        CSS_PROPERTY_STORES_CALC |
-        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
-    "",
-    0,
-    kImageLayerPositionKTable,
-    CSS_PROP_NO_OFFSET,
-    eStyleAnimType_Custom)
 #endif // CSS_PROP_LIST_EXCLUDE_INTERNAL
 CSS_PROP_TEXT(
     word-break,
     word_break,
     WordBreak,
     CSS_PROPERTY_PARSE_VALUE,
     "",
     VARIANT_HK,
--- a/layout/style/nsComputedDOMStyle.cpp
+++ b/layout/style/nsComputedDOMStyle.cpp
@@ -1531,21 +1531,67 @@ nsComputedDOMStyle::DoGetTransformStyle(
 {
   RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
   val->SetIdent(
       nsCSSProps::ValueToKeywordEnum(StyleDisplay()->mTransformStyle,
                                      nsCSSProps::kTransformStyleKTable));
   return val.forget();
 }
 
+/* If the property is "none", hand back "none" wrapped in a value.
+ * Otherwise, compute the aggregate transform matrix and hands it back in a
+ * "matrix" wrapper.
+ */
 already_AddRefed<CSSValue>
 nsComputedDOMStyle::DoGetTransform()
 {
+  /* First, get the display data.  We'll need it. */
   const nsStyleDisplay* display = StyleDisplay();
-  return GetTransformValue(display->mSpecifiedTransform);
+
+  /* If there are no transforms, then we should construct a single-element
+   * entry and hand it back.
+   */
+  if (!display->mSpecifiedTransform) {
+    RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
+
+    /* Set it to "none." */
+    val->SetIdent(eCSSKeyword_none);
+    return val.forget();
+  }
+
+  /* Otherwise, we need to compute the current value of the transform matrix,
+   * store it in a string, and hand it back to the caller.
+   */
+
+  /* Use the inner frame for the reference box.  If we don't have an inner
+   * frame we use empty dimensions to allow us to continue (and percentage
+   * values in the transform will simply give broken results).
+   * TODO: There is no good way for us to represent the case where there's no
+   * frame, which is problematic.  The reason is that when we have percentage
+   * transforms, there are a total of four stored matrix entries that influence
+   * the transform based on the size of the element.  However, this poses a
+   * problem, because only two of these values can be explicitly referenced
+   * using the named transforms.  Until a real solution is found, we'll just
+   * use this approach.
+   */
+  nsStyleTransformMatrix::TransformReferenceBox refBox(mInnerFrame,
+                                                       nsSize(0, 0));
+
+   RuleNodeCacheConditions dummy;
+   bool dummyBool;
+   gfx::Matrix4x4 matrix =
+     nsStyleTransformMatrix::ReadTransforms(display->mSpecifiedTransform->mHead,
+                                            mStyleContext,
+                                            mStyleContext->PresContext(),
+                                            dummy,
+                                            refBox,
+                                            float(mozilla::AppUnitsPerCSSPixel()),
+                                            &dummyBool);
+
+  return MatrixToCSSValue(matrix);
 }
 
 already_AddRefed<CSSValue>
 nsComputedDOMStyle::DoGetTransformBox()
 {
   RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
   val->SetIdent(
       nsCSSProps::ValueToKeywordEnum(StyleDisplay()->mTransformBox,
@@ -4176,51 +4222,16 @@ nsComputedDOMStyle::DoGetWindowShadow()
   RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
   val->SetIdent(
     nsCSSProps::ValueToKeywordEnum(StyleUIReset()->mWindowShadow,
                                    nsCSSProps::kWindowShadowKTable));
   return val.forget();
 }
 
 already_AddRefed<CSSValue>
-nsComputedDOMStyle::DoGetWindowOpacity()
-{
-  RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
-  val->SetNumber(StyleUIReset()->mWindowOpacity);
-  return val.forget();
-}
-
-already_AddRefed<CSSValue>
-nsComputedDOMStyle::DoGetWindowTransform()
-{
-  const nsStyleUIReset* uiReset = StyleUIReset();
-  return GetTransformValue(uiReset->mSpecifiedWindowTransform);
-}
-
-already_AddRefed<CSSValue>
-nsComputedDOMStyle::DoGetWindowTransformOrigin()
-{
-  RefPtr<nsDOMCSSValueList> valueList = GetROCSSValueList(false);
-
-  const nsStyleUIReset* uiReset = StyleUIReset();
-
-  RefPtr<nsROCSSPrimitiveValue> originX = new nsROCSSPrimitiveValue;
-  SetValueToCoord(originX, uiReset->mWindowTransformOrigin[0], false,
-                  &nsComputedDOMStyle::GetFrameBoundsWidthForTransform);
-  valueList->AppendCSSValue(originX.forget());
-
-  RefPtr<nsROCSSPrimitiveValue> originY = new nsROCSSPrimitiveValue;
-  SetValueToCoord(originY, uiReset->mWindowTransformOrigin[1], false,
-                  &nsComputedDOMStyle::GetFrameBoundsHeightForTransform);
-  valueList->AppendCSSValue(originY.forget());
-
-  return valueList.forget();
-}
-
-already_AddRefed<CSSValue>
 nsComputedDOMStyle::DoGetWordBreak()
 {
   RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
   val->SetIdent(
     nsCSSProps::ValueToKeywordEnum(StyleText()->mWordBreak,
                                    nsCSSProps::kWordBreakKTable));
   return val.forget();
 }
@@ -5847,66 +5858,16 @@ nsComputedDOMStyle::GetSVGPaintFor(bool 
       }
       break;
     }
   }
 
   return val.forget();
 }
 
-/* If the property is "none", hand back "none" wrapped in a value.
- * Otherwise, compute the aggregate transform matrix and hands it back in a
- * "matrix" wrapper.
- */
-already_AddRefed<CSSValue>
-nsComputedDOMStyle::GetTransformValue(nsCSSValueSharedList* aSpecifiedTransform)
-{
-  /* If there are no transforms, then we should construct a single-element
-   * entry and hand it back.
-   */
-  if (!aSpecifiedTransform) {
-    RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
-
-    /* Set it to "none." */
-    val->SetIdent(eCSSKeyword_none);
-    return val.forget();
-  }
-
-  /* Otherwise, we need to compute the current value of the transform matrix,
-   * store it in a string, and hand it back to the caller.
-   */
-
-  /* Use the inner frame for the reference box.  If we don't have an inner
-   * frame we use empty dimensions to allow us to continue (and percentage
-   * values in the transform will simply give broken results).
-   * TODO: There is no good way for us to represent the case where there's no
-   * frame, which is problematic.  The reason is that when we have percentage
-   * transforms, there are a total of four stored matrix entries that influence
-   * the transform based on the size of the element.  However, this poses a
-   * problem, because only two of these values can be explicitly referenced
-   * using the named transforms.  Until a real solution is found, we'll just
-   * use this approach.
-   */
-  nsStyleTransformMatrix::TransformReferenceBox refBox(mInnerFrame,
-                                                       nsSize(0, 0));
-
-   RuleNodeCacheConditions dummy;
-   bool dummyBool;
-   gfx::Matrix4x4 matrix =
-     nsStyleTransformMatrix::ReadTransforms(aSpecifiedTransform->mHead,
-                                            mStyleContext,
-                                            mStyleContext->PresContext(),
-                                            dummy,
-                                            refBox,
-                                            float(mozilla::AppUnitsPerCSSPixel()),
-                                            &dummyBool);
-
-  return MatrixToCSSValue(matrix);
-}
-
 already_AddRefed<CSSValue>
 nsComputedDOMStyle::DoGetFill()
 {
   return GetSVGPaintFor(true);
 }
 
 already_AddRefed<CSSValue>
 nsComputedDOMStyle::DoGetStroke()
--- a/layout/style/nsComputedDOMStyle.h
+++ b/layout/style/nsComputedDOMStyle.h
@@ -209,18 +209,16 @@ private:
   already_AddRefed<CSSValue> GetBorderColorFor(mozilla::Side aSide);
 
   already_AddRefed<CSSValue> GetMarginWidthFor(mozilla::Side aSide);
 
   already_AddRefed<CSSValue> GetFallbackValue(const nsStyleSVGPaint* aPaint);
 
   already_AddRefed<CSSValue> GetSVGPaintFor(bool aFill);
 
-  already_AddRefed<CSSValue> GetTransformValue(nsCSSValueSharedList* aSpecifiedTransform);
-
   // Appends all aLineNames (may be empty) space-separated to aResult.
   void AppendGridLineNames(nsString& aResult,
                            const nsTArray<nsString>& aLineNames);
   // Appends aLineNames as a CSSValue* to aValueList.  If aLineNames is empty
   // a value ("[]") is only appended if aSuppressEmptyList is false.
   void AppendGridLineNames(nsDOMCSSValueList* aValueList,
                            const nsTArray<nsString>& aLineNames,
                            bool aSuppressEmptyList = true);
@@ -525,19 +523,16 @@ private:
   already_AddRefed<CSSValue> DoGetCursor();
   already_AddRefed<CSSValue> DoGetForceBrokenImageIcon();
   already_AddRefed<CSSValue> DoGetIMEMode();
   already_AddRefed<CSSValue> DoGetUserFocus();
   already_AddRefed<CSSValue> DoGetUserInput();
   already_AddRefed<CSSValue> DoGetUserModify();
   already_AddRefed<CSSValue> DoGetUserSelect();
   already_AddRefed<CSSValue> DoGetWindowDragging();
-  already_AddRefed<CSSValue> DoGetWindowOpacity();
-  already_AddRefed<CSSValue> DoGetWindowTransform();
-  already_AddRefed<CSSValue> DoGetWindowTransformOrigin();
 
   /* Column properties */
   already_AddRefed<CSSValue> DoGetColumnCount();
   already_AddRefed<CSSValue> DoGetColumnFill();
   already_AddRefed<CSSValue> DoGetColumnSpan();
   already_AddRefed<CSSValue> DoGetColumnWidth();
   already_AddRefed<CSSValue> DoGetColumnGap();
   already_AddRefed<CSSValue> DoGetColumnRuleWidth();
--- a/layout/style/nsComputedDOMStylePropertyList.h
+++ b/layout/style/nsComputedDOMStylePropertyList.h
@@ -300,19 +300,16 @@ COMPUTED_STYLE_PROP(_moz_stack_sizing,  
 COMPUTED_STYLE_PROP(_moz_tab_size,                 TabSize)
 COMPUTED_STYLE_PROP(_moz_text_size_adjust,         TextSizeAdjust)
 COMPUTED_STYLE_PROP(_moz_user_focus,               UserFocus)
 COMPUTED_STYLE_PROP(_moz_user_input,               UserInput)
 COMPUTED_STYLE_PROP(_moz_user_modify,              UserModify)
 COMPUTED_STYLE_PROP(_moz_user_select,              UserSelect)
 COMPUTED_STYLE_PROP(_moz_window_dragging,          WindowDragging)
 COMPUTED_STYLE_PROP(_moz_window_shadow,            WindowShadow)
-COMPUTED_STYLE_PROP(_moz_window_opacity,           WindowOpacity)
-COMPUTED_STYLE_PROP(_moz_window_transform,         WindowTransform)
-COMPUTED_STYLE_PROP(_moz_window_transform_origin,  WindowTransformOrigin)
 
 /* ********************************** *\
  * Implementations of -webkit- styles *
 \* ********************************** */
 
 COMPUTED_STYLE_PROP(_webkit_text_fill_color,       WebkitTextFillColor)
 //// COMPUTED_STYLE_PROP(webkit-text-stroke,       WebkitTextStroke)
 COMPUTED_STYLE_PROP(_webkit_text_stroke_color,     WebkitTextStrokeColor)
--- a/layout/style/nsRuleNode.cpp
+++ b/layout/style/nsRuleNode.cpp
@@ -1735,57 +1735,16 @@ SetFactor(const nsCSSValue& aValue, floa
 
   default:
     break;
   }
 
   NS_NOTREACHED("SetFactor: inappropriate unit");
 }
 
-static void
-SetTransformValue(const nsCSSValue& aValue,
-                  RefPtr<nsCSSValueSharedList>& aField,
-                  RuleNodeCacheConditions& aConditions,
-                  nsCSSValueSharedList* const aParentValue)
-{
-  /* Convert the nsCSSValueList into an nsTArray<nsTransformFunction *>. */
-  switch (aValue.GetUnit()) {
-  case eCSSUnit_Null:
-    break;
-
-  case eCSSUnit_Initial:
-  case eCSSUnit_Unset:
-  case eCSSUnit_None:
-    aField = nullptr;
-    break;
-
-  case eCSSUnit_Inherit:
-    aField = aParentValue;
-    aConditions.SetUncacheable();
-    break;
-
-  case eCSSUnit_SharedList: {
-    nsCSSValueSharedList* list = aValue.GetSharedListValue();
-    nsCSSValueList* head = list->mHead;
-    MOZ_ASSERT(head, "transform list must have at least one item");
-    // can get a _None in here from transform animation
-    if (head->mValue.GetUnit() == eCSSUnit_None) {
-      MOZ_ASSERT(head->mNext == nullptr, "none must be alone");
-      aField = nullptr;
-    } else {
-      aField = list;
-    }
-    break;
-  }
-
-  default:
-    MOZ_ASSERT(false, "unrecognized transform unit");
-  }
-}
-
 void*
 nsRuleNode::operator new(size_t sz, nsPresContext* aPresContext)
 {
   // Check the recycle list first.
   return aPresContext->PresShell()->AllocateByObjectID(eArenaObjectID_nsRuleNode, sz);
 }
 
 // Overridden to prevent the global delete from being called, since the memory
@@ -5311,44 +5270,16 @@ nsRuleNode::ComputeUIResetData(void* aSt
 
   // -moz-window-shadow: enum, inherit, initial
   SetValue(*aRuleData->ValueForWindowShadow(),
            ui->mWindowShadow, conditions,
            SETVAL_ENUMERATED | SETVAL_UNSET_INITIAL,
            parentUI->mWindowShadow,
            NS_STYLE_WINDOW_SHADOW_DEFAULT);
 
-  // -moz-window-opacity: factor, inherit, initial
-  SetFactor(*aRuleData->ValueForWindowOpacity(),
-            ui->mWindowOpacity, conditions,
-            parentUI->mWindowOpacity, 1.0f,
-            SETFCT_OPACITY | SETFCT_UNSET_INITIAL);
-
-  // -moz-window-transform
-  SetTransformValue(*aRuleData->ValueForWindowTransform(),
-                    ui->mSpecifiedWindowTransform, conditions,
-                    parentUI->mSpecifiedWindowTransform);
-
-  // -moz-window-transform-origin
-  const nsCSSValue* windowTransformOriginValue =
-    aRuleData->ValueForWindowTransformOrigin();
-  if (windowTransformOriginValue->GetUnit() != eCSSUnit_Null) {
-    mozilla::DebugOnly<bool> result =
-      SetPairCoords(*windowTransformOriginValue,
-                    ui->mWindowTransformOrigin[0],
-                    ui->mWindowTransformOrigin[1],
-                    parentUI->mWindowTransformOrigin[0],
-                    parentUI->mWindowTransformOrigin[1],
-                    SETCOORD_LPH | SETCOORD_INITIAL_HALF |
-                      SETCOORD_BOX_POSITION | SETCOORD_STORE_CALC |
-                      SETCOORD_UNSET_INITIAL,
-                    aContext, mPresContext, conditions);
-    NS_ASSERTION(result, "Malformed -moz-window-transform-origin parse!");
-  }
-
   COMPUTE_END_RESET(UIReset, ui)
 }
 
 // Information about each transition or animation property that is
 // constant.
 struct TransitionPropInfo {
   nsCSSPropertyID property;
   // Location of the count of the property's computed value.
@@ -6406,19 +6337,50 @@ nsRuleNode::ComputeDisplayData(void* aSt
       // It's okay to cache this change in the rule tree for the same
       // reasons as floats in the previous condition.
       if (display->mDisplay == StyleDisplay::Inline) {
         display->mDisplay = StyleDisplay::InlineBlock;
       }
     }
   }
 
-  SetTransformValue(*aRuleData->ValueForTransform(),
-                    display->mSpecifiedTransform, conditions,
-                    parentDisplay->mSpecifiedTransform);
+  /* Convert the nsCSSValueList into an nsTArray<nsTransformFunction *>. */
+  const nsCSSValue* transformValue = aRuleData->ValueForTransform();
+  switch (transformValue->GetUnit()) {
+  case eCSSUnit_Null:
+    break;
+
+  case eCSSUnit_Initial:
+  case eCSSUnit_Unset:
+  case eCSSUnit_None:
+    display->mSpecifiedTransform = nullptr;
+    break;
+
+  case eCSSUnit_Inherit:
+    display->mSpecifiedTransform = parentDisplay->mSpecifiedTransform;
+    conditions.SetUncacheable();
+    break;
+
+  case eCSSUnit_SharedList: {
+    nsCSSValueSharedList* list = transformValue->GetSharedListValue();
+    nsCSSValueList* head = list->mHead;
+    MOZ_ASSERT(head, "transform list must have at least one item");
+    // can get a _None in here from transform animation
+    if (head->mValue.GetUnit() == eCSSUnit_None) {
+      MOZ_ASSERT(head->mNext == nullptr, "none must be alone");
+      display->mSpecifiedTransform = nullptr;
+    } else {
+      display->mSpecifiedTransform = list;
+    }
+    break;
+  }
+
+  default:
+    MOZ_ASSERT(false, "unrecognized transform unit");
+  }
 
   /* Convert the nsCSSValueList into a will-change bitfield for fast lookup */
   const nsCSSValue* willChangeValue = aRuleData->ValueForWillChange();
   switch (willChangeValue->GetUnit()) {
   case eCSSUnit_Null:
     break;
 
   case eCSSUnit_List:
--- a/layout/style/nsStyleStruct.cpp
+++ b/layout/style/nsStyleStruct.cpp
@@ -4321,97 +4321,61 @@ nsStyleUserInterface::CalcDifference(con
 //
 
 nsStyleUIReset::nsStyleUIReset(const nsPresContext* aContext)
   : mUserSelect(StyleUserSelect::Auto)
   , mForceBrokenImageIcon(0)
   , mIMEMode(NS_STYLE_IME_MODE_AUTO)
   , mWindowDragging(StyleWindowDragging::Default)
   , mWindowShadow(NS_STYLE_WINDOW_SHADOW_DEFAULT)
-  , mWindowOpacity(1.0)
-  , mSpecifiedWindowTransform(nullptr)
-  , mWindowTransformOrigin{ {0.5f, eStyleUnit_Percent}, // Transform is centered on origin
-                            {0.5f, eStyleUnit_Percent} }
 {
   MOZ_COUNT_CTOR(nsStyleUIReset);
 }
 
 nsStyleUIReset::nsStyleUIReset(const nsStyleUIReset& aSource)
   : mUserSelect(aSource.mUserSelect)
   , mForceBrokenImageIcon(aSource.mForceBrokenImageIcon)
   , mIMEMode(aSource.mIMEMode)
   , mWindowDragging(aSource.mWindowDragging)
   , mWindowShadow(aSource.mWindowShadow)
-  , mWindowOpacity(aSource.mWindowOpacity)
-  , mSpecifiedWindowTransform(aSource.mSpecifiedWindowTransform)
-  , mWindowTransformOrigin{ aSource.mWindowTransformOrigin[0],
-                            aSource.mWindowTransformOrigin[1] }
 {
   MOZ_COUNT_CTOR(nsStyleUIReset);
 }
 
 nsStyleUIReset::~nsStyleUIReset()
 {
   MOZ_COUNT_DTOR(nsStyleUIReset);
-
-  // See the nsStyleDisplay destructor for why we're doing this.
-  if (mSpecifiedWindowTransform && ServoStyleSet::IsInServoTraversal()) {
-    bool alwaysProxy =
-#ifdef DEBUG
-      true;
-#else
-      false;
-#endif
-    NS_ReleaseOnMainThread(mSpecifiedWindowTransform.forget(), alwaysProxy);
-  }
 }
 
 nsChangeHint
 nsStyleUIReset::CalcDifference(const nsStyleUIReset& aNewData) const
 {
-  nsChangeHint hint = nsChangeHint(0);
-
+  // ignore mIMEMode
   if (mForceBrokenImageIcon != aNewData.mForceBrokenImageIcon) {
-    hint |= nsChangeHint_ReconstructFrame;
+    return nsChangeHint_ReconstructFrame;
   }
   if (mWindowShadow != aNewData.mWindowShadow) {
     // We really need just an nsChangeHint_SyncFrameView, except
     // on an ancestor of the frame, so we get that by doing a
     // reflow.
-    hint |= NS_STYLE_HINT_REFLOW;
+    return NS_STYLE_HINT_REFLOW;
   }
   if (mUserSelect != aNewData.mUserSelect) {
-    hint |= NS_STYLE_HINT_VISUAL;
+    return NS_STYLE_HINT_VISUAL;
   }
 
   if (mWindowDragging != aNewData.mWindowDragging) {
-    hint |= nsChangeHint_SchedulePaint;
-  }
-
-  if (mWindowOpacity != aNewData.mWindowOpacity ||
-      !mSpecifiedWindowTransform != !aNewData.mSpecifiedWindowTransform ||
-      (mSpecifiedWindowTransform &&
-       *mSpecifiedWindowTransform != *aNewData.mSpecifiedWindowTransform)) {
-    hint |= nsChangeHint_UpdateWidgetProperties;
-  } else {
-    for (uint8_t index = 0; index < 3; ++index) {
-      if (mWindowTransformOrigin[index] !=
-            aNewData.mWindowTransformOrigin[index]) {
-        hint |= nsChangeHint_UpdateWidgetProperties;
-        break;
-      }
-    }
-  }
-
-  if (!hint &&
-      mIMEMode != aNewData.mIMEMode) {
-    hint |= nsChangeHint_NeutralChange;
-  }
-
-  return hint;
+    return nsChangeHint_SchedulePaint;
+  }
+
+  if (mIMEMode != aNewData.mIMEMode) {
+    return nsChangeHint_NeutralChange;
+  }
+
+  return nsChangeHint(0);
 }
 
 //-----------------------
 // nsStyleVariables
 //
 
 nsStyleVariables::nsStyleVariables()
 {
--- a/layout/style/nsStyleStruct.h
+++ b/layout/style/nsStyleStruct.h
@@ -3223,19 +3223,16 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
 
   nsChangeHint CalcDifference(const nsStyleUIReset& aNewData) const;
 
   mozilla::StyleUserSelect     mUserSelect;     // [reset](selection-style)
   uint8_t mForceBrokenImageIcon; // [reset] (0 if not forcing, otherwise forcing)
   uint8_t                      mIMEMode;        // [reset]
   mozilla::StyleWindowDragging mWindowDragging; // [reset]
   uint8_t                      mWindowShadow;   // [reset]
-  float                        mWindowOpacity;  // [reset]
-  RefPtr<nsCSSValueSharedList> mSpecifiedWindowTransform; // [reset]
-  nsStyleCoord                 mWindowTransformOrigin[2]; // [reset] percent, coord, calc
 };
 
 struct nsCursorImage
 {
   bool mHaveHotspot;
   float mHotspotX, mHotspotY;
   RefPtr<nsStyleImageRequest> mImage;
 
--- a/layout/style/nsStyleTransformMatrix.cpp
+++ b/layout/style/nsStyleTransformMatrix.cpp
@@ -1002,49 +1002,16 @@ ReadTransforms(const nsCSSValueList* aLi
 
   float scale = float(nsPresContext::AppUnitsPerCSSPixel()) / aAppUnitsPerMatrixUnit;
   result.PreScale(1/scale, 1/scale, 1/scale);
   result.PostScale(scale, scale, scale);
 
   return result;
 }
 
-Point
-Convert2DPosition(nsStyleCoord const (&aValue)[2],
-                  TransformReferenceBox& aRefBox,
-                  int32_t aAppUnitsPerDevPixel)
-{
-  float position[2];
-  nsStyleTransformMatrix::TransformReferenceBox::DimensionGetter dimensionGetter[] =
-    { &nsStyleTransformMatrix::TransformReferenceBox::Width,
-      &nsStyleTransformMatrix::TransformReferenceBox::Height };
-  for (uint8_t index = 0; index < 2; ++index) {
-    const nsStyleCoord& value  = aValue[index];
-    if (value.GetUnit() == eStyleUnit_Calc) {
-      const nsStyleCoord::Calc *calc = value.GetCalcValue();
-      position[index] =
-        NSAppUnitsToFloatPixels((aRefBox.*dimensionGetter[index])(), aAppUnitsPerDevPixel) *
-          calc->mPercent +
-        NSAppUnitsToFloatPixels(calc->mLength, aAppUnitsPerDevPixel);
-    } else if (value.GetUnit() == eStyleUnit_Percent) {
-      position[index] =
-        NSAppUnitsToFloatPixels((aRefBox.*dimensionGetter[index])(), aAppUnitsPerDevPixel) *
-        value.GetPercentValue();
-    } else {
-      MOZ_ASSERT(value.GetUnit() == eStyleUnit_Coord,
-                "unexpected unit");
-      position[index] =
-        NSAppUnitsToFloatPixels(value.GetCoordValue(),
-                                aAppUnitsPerDevPixel);
-    }
-  }
-
-  return Point(position[0], position[1]);
-}
-
 /*
  * The relevant section of the transitions specification:
  * http://dev.w3.org/csswg/css3-transitions/#animation-of-property-types-
  * defers all of the details to the 2-D and 3-D transforms specifications.
  * For the 2-D transforms specification (all that's relevant for us, right
  * now), the relevant section is:
  * http://dev.w3.org/csswg/css3-2d-transforms/#animation
  * This, in turn, refers to the unmatrix program in Graphics Gems,
--- a/layout/style/nsStyleTransformMatrix.h
+++ b/layout/style/nsStyleTransformMatrix.h
@@ -200,24 +200,16 @@ namespace nsStyleTransformMatrix {
   mozilla::gfx::Matrix4x4 ReadTransforms(const nsCSSValueList* aList,
                                          nsStyleContext* aContext,
                                          nsPresContext* aPresContext,
                                          mozilla::RuleNodeCacheConditions& aConditions,
                                          TransformReferenceBox& aBounds,
                                          float aAppUnitsPerMatrixUnit,
                                          bool* aContains3dTransform);
 
-  /**
-   * Given two nsStyleCoord values, compute the 2d position with respect to the
-   * given TransformReferenceBox that these values describe, in device pixels.
-   */
-  mozilla::gfx::Point Convert2DPosition(nsStyleCoord const (&aValue)[2],
-                                        TransformReferenceBox& aRefBox,
-                                        int32_t aAppUnitsPerDevPixel);
-
   // Shear type for decomposition.
   enum class ShearType {
     XYSHEAR,
     XZSHEAR,
     YZSHEAR,
     Count
   };
   using ShearArray =
--- a/layout/style/test/ListCSSProperties.cpp
+++ b/layout/style/test/ListCSSProperties.cpp
@@ -110,19 +110,16 @@ const char *gInaccessibleProperties[] = 
     "-moz-control-character-visibility",
     "-moz-script-level", // parsed by UA sheets only
     "-moz-script-size-multiplier",
     "-moz-script-min-size",
     "-moz-math-variant",
     "-moz-math-display", // parsed by UA sheets only
     "-moz-top-layer", // parsed by UA sheets only
     "-moz-min-font-size-ratio", // parsed by UA sheets only
-    "-moz-window-opacity", // chrome-only internal properties
-    "-moz-window-transform", // chrome-only internal properties
-    "-moz-window-transform-origin", // chrome-only internal properties
     "-moz-window-shadow" // chrome-only internal properties
 };
 
 inline int
 is_inaccessible(const char* aPropName)
 {
     for (unsigned j = 0; j < MOZ_ARRAY_LENGTH(gInaccessibleProperties); ++j) {
         if (strcmp(aPropName, gInaccessibleProperties[j]) == 0)
--- a/layout/style/test/property_database.js
+++ b/layout/style/test/property_database.js
@@ -7900,121 +7900,16 @@ if (false) {
     //domProp: "MozWindowShadow",
     inherited: false,
     type: CSS_TYPE_LONGHAND,
     initial_values: [ "default" ],
     other_values: [ "none", "menu", "tooltip", "sheet" ],
     invalid_values: []
   };
 
-  gCSSProperties["-moz-window-opacity"] = {
-    // domProp: "MozWindowOpacity",
-    inherited: false,
-    type: CSS_TYPE_LONGHAND,
-    initial_values: [ "1", "17", "397.376", "3e1", "3e+1", "3e0", "3e+0", "3e-0" ],
-    other_values: [ "0", "0.4", "0.0000", "-3", "3e-1" ],
-    invalid_values: [ "0px", "1px", "20%", "default", "auto" ]
-  };
-
-  gCSSProperties["-moz-window-transform"] = {
-    // domProp: "MozWindowTransform",
-    inherited: false,
-    type: CSS_TYPE_LONGHAND,
-    prerequisites: { "width": "300px", "height": "50px" },
-    initial_values: [ "none" ],
-    other_values: [ "translatex(1px)", "translatex(4em)",
-      "translatex(-4px)", "translatex(3px)",
-      "translatex(0px) translatex(1px) translatex(2px) translatex(3px) translatex(4px)",
-      "translatey(4em)", "translate(3px)", "translate(10px, -3px)",
-      "rotate(45deg)", "rotate(45grad)", "rotate(45rad)",
-      "rotate(0.25turn)", "rotate(0)", "scalex(10)", "scaley(10)",
-      "scale(10)", "scale(10, 20)", "skewx(30deg)", "skewx(0)",
-      "skewy(0)", "skewx(30grad)", "skewx(30rad)", "skewx(0.08turn)",
-      "skewy(30deg)", "skewy(30grad)", "skewy(30rad)", "skewy(0.08turn)",
-      "rotate(45deg) scale(2, 1)", "skewx(45deg) skewx(-50grad)",
-      "translate(0, 0) scale(1, 1) skewx(0) skewy(0) matrix(1, 0, 0, 1, 0, 0)",
-      "translatex(50%)", "translatey(50%)", "translate(50%)",
-      "translate(3%, 5px)", "translate(5px, 3%)",
-      "matrix(1, 2, 3, 4, 5, 6)",
-      /* valid calc() values */
-      "translatex(calc(5px + 10%))",
-      "translatey(calc(0.25 * 5px + 10% / 3))",
-      "translate(calc(5px - 10% * 3))",
-      "translate(calc(5px - 3 * 10%), 50px)",
-      "translate(-50px, calc(5px - 10% * 3))",
-      "translatez(1px)", "translatez(4em)", "translatez(-4px)",
-      "translatez(0px)", "translatez(2px) translatez(5px)",
-      "translate3d(3px, 4px, 5px)", "translate3d(2em, 3px, 1em)",
-      "translatex(2px) translate3d(4px, 5px, 6px) translatey(1px)",
-      "scale3d(4, 4, 4)", "scale3d(-2, 3, -7)", "scalez(4)",
-      "scalez(-6)", "rotate3d(2, 3, 4, 45deg)",
-      "rotate3d(-3, 7, 0, 12rad)", "rotatex(15deg)", "rotatey(-12grad)",
-      "rotatez(72rad)", "rotatex(0.125turn)",
-      "perspective(0px)", "perspective(1000px)",
-      "matrix3d(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)",
-    ],
-    invalid_values: ["1px", "#0000ff", "red", "auto",
-      "translatex(1)", "translatey(1)", "translate(2)",
-      "translate(-3, -4)",
-      "translatex(1px 1px)", "translatex(translatex(1px))",
-      "translatex(#0000ff)", "translatex(red)", "translatey()",
-      "matrix(1px, 2px, 3px, 4px, 5px, 6px)", "scale(150%)",
-      "skewx(red)", "matrix(1%, 0, 0, 0, 0px, 0px)",
-      "matrix(0, 1%, 2, 3, 4px,5px)", "matrix(0, 1, 2%, 3, 4px, 5px)",
-      "matrix(0, 1, 2, 3%, 4%, 5%)", "matrix(1, 2, 3, 4, 5px, 6%)",
-      "matrix(1, 2, 3, 4, 5%, 6px)", "matrix(1, 2, 3, 4, 5%, 6%)",
-      "matrix(1, 2, 3, 4, 5px, 6em)",
-      /* invalid calc() values */
-      "translatey(-moz-min(5px,10%))",
-      "translatex(-moz-max(5px,10%))",
-      "translate(10px, calc(min(5px,10%)))",
-      "translate(calc(max(5px,10%)), 10%)",
-      "matrix(1, 0, 0, 1, max(5px * 3), calc(10% - 3px))",
-      "perspective(-10px)", "matrix3d(dinosaur)",
-      "matrix3d(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17)",
-      "matrix3d(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)",
-      "matrix3d(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15%, 16)",
-      "matrix3d(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16px)",
-      "rotatey(words)", "rotatex(7)", "translate3d(3px, 4px, 1px, 7px)",
-      "matrix3d(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13px, 14em, 15px, 16)",
-      "matrix3d(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 20%, 10%, 15, 16)"
-    ],
-  };
-
-  gCSSProperties["-moz-window-transform-origin"] = {
-    // domProp: "MozWindowTransformOrigin",
-    inherited: false,
-    type: CSS_TYPE_LONGHAND,
-    /* no subproperties */
-    prerequisites: { "width": "10px", "height": "10px", "display": "block"},
-    initial_values: [ "50% 50%", "center", "center center" ],
-    other_values: [ "25% 25%", "6px 5px", "20% 3em", "0 0", "0in 1in",
-            "top", "bottom","top left", "top right",
-            "top center", "center left", "center right",
-            "bottom left", "bottom right", "bottom center",
-            "20% center", "6px center", "13in bottom",
-            "left 50px", "right 13%", "center 40px",
-      "calc(20px)",
-      "calc(20px) 10px",
-      "10px calc(20px)",
-      "calc(20px) 25%",
-      "25% calc(20px)",
-      "calc(20px) calc(20px)",
-      "calc(20px + 1em) calc(20px / 2)",
-      "calc(20px + 50%) calc(50% - 10px)",
-      "calc(-20px) calc(-50%)",
-      "calc(-20%) calc(-50%)"
-    ],
-    invalid_values: ["red", "auto", "none", "0.5 0.5", "40px #0000ff",
-             "border", "center red", "right diagonal",
-             "#00ffff bottom", "0px calc(0px + rubbish)",
-             "0px 0px calc(0px + rubbish)", "6px 5px 5px",
-             "top center 10px"]
-  };
-
   gCSSProperties["-moz-context-properties"] = {
     //domProp: "MozContextProperties",
     inherited: true,
     type: CSS_TYPE_LONGHAND,
     initial_values: [ "none" ],
     other_values: [ "fill", "stroke", "fill, stroke", "fill, stroke, fill", "fill, foo", "foo" ],
     invalid_values: [ "default", "fill, auto", "all, stroke", "none, fill", "fill, none", "fill, default", "2px" ]
   };
--- a/layout/xul/nsMenuPopupFrame.cpp
+++ b/layout/xul/nsMenuPopupFrame.cpp
@@ -452,25 +452,16 @@ nsMenuPopupFrame::IsLeafDynamic() const
   // the parent menu is dependent on the size of the popup, so the frames
   // need to exist in order to calculate this size.
   nsIContent* parentContent = mContent->GetParent();
   return (parentContent &&
           !parentContent->HasAttr(kNameSpaceID_None, nsGkAtoms::sizetopopup));
 }
 
 void
-nsMenuPopupFrame::UpdateWidgetProperties()
-{
-  if (nsIWidget* widget = GetWidget()) {
-    widget->SetWindowOpacity(StyleUIReset()->mWindowOpacity);
-    widget->SetWindowTransform(ComputeWidgetTransform());
-  }
-}
-
-void
 nsMenuPopupFrame::LayoutPopup(nsBoxLayoutState& aState, nsIFrame* aParentMenu,
                               nsIFrame* aAnchor, bool aSizedToPopup)
 {
   if (!mGeneratedChildren)
     return;
 
   SchedulePaint();
 
--- a/layout/xul/nsMenuPopupFrame.h
+++ b/layout/xul/nsMenuPopupFrame.h
@@ -243,18 +243,16 @@ public:
   nsresult CreateWidgetForView(nsView* aView);
   uint8_t GetShadowStyle();
 
   virtual void SetInitialChildList(ChildListID  aListID,
                                    nsFrameList& aChildList) override;
 
   virtual bool IsLeafDynamic() const override;
 
-  virtual void UpdateWidgetProperties() override;
-
   // layout, position and display the popup as needed
   void LayoutPopup(nsBoxLayoutState& aState, nsIFrame* aParentMenu,
                    nsIFrame* aAnchor, bool aSizedToPopup);
 
   nsView* GetRootViewForPopup(nsIFrame* aStartFrame);
 
   // Set the position of the popup either relative to the anchor aAnchorFrame
   // (or the frame for mAnchorContent if aAnchorFrame is null), anchored at a
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -4774,18 +4774,16 @@ pref("gfx.apitrace.enabled",false);
 #ifdef MOZ_X11
 #ifdef MOZ_WIDGET_GTK
 pref("gfx.xrender.enabled",false);
 pref("widget.chrome.allow-gtk-dark-theme", false);
 pref("widget.content.allow-gtk-dark-theme", false);
 #endif
 #endif
 
-pref("widget.window-transforms.disabled", false);
-
 #ifdef XP_WIN
 // Whether to disable the automatic detection and use of direct2d.
 pref("gfx.direct2d.disabled", false);
 
 // Whether to attempt to enable Direct2D regardless of automatic detection or
 // blacklisting
 pref("gfx.direct2d.force-enabled", false);
 
--- a/toolkit/content/xul.css
+++ b/toolkit/content/xul.css
@@ -438,84 +438,17 @@ tooltip {
   white-space: pre-wrap;
   margin-top: 21px;
 }
 
 panel[type="arrow"] {
   -moz-binding: url("chrome://global/content/bindings/popup.xml#arrowpanel");
 }
 
-%ifdef MOZ_WIDGET_COCOA
-
-/* On Mac, use the properties "-moz-window-transform" and "-moz-window-opacity"
-   instead of "transform" and "opacity" for these animations.
-   The -moz-window* properties apply to the whole window including the window's
-   shadow, and they don't affect the window's "shape", so the system doesn't
-   have to recompute the shadow shape during the animation. This makes them a
-   lot faster. In fact, Gecko no longer triggers shadow shape recomputations
-   for repaints.
-   These properties are not implemented on other platforms. */
-panel[type="arrow"]:not([animate="false"]) {
-  -moz-window-transform: scale(.4);
-  -moz-window-opacity: 0;
-  transition-property: -moz-window-transform, -moz-window-opacity;
-  transition-duration: 0.15s;
-  transition-timing-function: ease-out;
-}
-
-panel[type="arrow"][animate="open"] {
-  -moz-window-transform: none;
-  -moz-window-opacity: 1.0;
-}
-
-panel[type="arrow"][animate="cancel"] {
-  -moz-window-transform: none;
-}
-
-panel[arrowposition="after_start"]:-moz-locale-dir(ltr),
-panel[arrowposition="after_end"]:-moz-locale-dir(rtl) {
-  -moz-window-transform-origin: 20px top;
-}
-
-panel[arrowposition="after_end"]:-moz-locale-dir(ltr),
-panel[arrowposition="after_start"]:-moz-locale-dir(rtl) {
-  -moz-window-transform-origin: calc(100% - 20px) top;
-}
-
-panel[arrowposition="before_start"]:-moz-locale-dir(ltr),
-panel[arrowposition="before_end"]:-moz-locale-dir(rtl) {
-  -moz-window-transform-origin: 20px bottom;
-}
-
-panel[arrowposition="before_end"]:-moz-locale-dir(ltr),
-panel[arrowposition="before_start"]:-moz-locale-dir(rtl) {
-  -moz-window-transform-origin: calc(100% - 20px) bottom;
-}
-
-panel[arrowposition="start_before"]:-moz-locale-dir(ltr),
-panel[arrowposition="end_before"]:-moz-locale-dir(rtl) {
-  -moz-window-transform-origin: right 20px;
-}
-
-panel[arrowposition="start_after"]:-moz-locale-dir(ltr),
-panel[arrowposition="end_after"]:-moz-locale-dir(rtl) {
-  -moz-window-transform-origin: right calc(100% - 20px);
-}
-
-panel[arrowposition="end_before"]:-moz-locale-dir(ltr),
-panel[arrowposition="start_before"]:-moz-locale-dir(rtl) {
-  -moz-window-transform-origin: left 20px;
-}
-
-panel[arrowposition="end_after"]:-moz-locale-dir(ltr),
-panel[arrowposition="start_after"]:-moz-locale-dir(rtl) {
-  -moz-window-transform-origin: left calc(100% - 20px);
-}
-
-%elifndef MOZ_WIDGET_GTK
+%ifndef MOZ_WIDGET_GTK
 
 panel[type="arrow"]:not([animate="false"]) {
   transform: scale(.4);
   opacity: 0;
   transition-property: transform, opacity;
   transition-duration: 0.15s;
   transition-timing-function: ease-out;
 }
--- a/widget/cocoa/nsChildView.mm
+++ b/widget/cocoa/nsChildView.mm
@@ -3762,16 +3762,22 @@ NSEvent* gLastDragMouseDownEvent = nil;
 }
 
 // The display system has told us that a portion of our view is dirty. Tell
 // gecko to paint it
 - (void)drawRect:(NSRect)aRect
 {
   CGContextRef cgContext = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort];
   [self drawRect:aRect inContext:cgContext];
+
+  // If we're a transparent window and our contents have changed, we need
+  // to make sure the shadow is updated to the new contents.
+  if ([[self window] isKindOfClass:[BaseWindow class]]) {
+    [(BaseWindow*)[self window] deferredInvalidateShadow];
+  }
 }
 
 - (void)drawRect:(NSRect)aRect inContext:(CGContextRef)aContext
 {
   if (!mGeckoChild || !mGeckoChild->IsVisible())
     return;
 
 #ifdef DEBUG_UPDATE
--- a/widget/cocoa/nsCocoaWindow.h
+++ b/widget/cocoa/nsCocoaWindow.h
@@ -36,16 +36,19 @@ typedef struct _nsCocoaWindowList {
 @interface BaseWindow : NSWindow
 {
   // Data Storage
   NSMutableDictionary* mState;
   BOOL mDrawsIntoWindowFrame;
   NSColor* mActiveTitlebarColor;
   NSColor* mInactiveTitlebarColor;
 
+  // Shadow
+  BOOL mScheduledShadowInvalidation;
+
   // Invalidation disabling
   BOOL mDisabledNeedsDisplay;
 
   // DPI cache. Getting the physical screen size (CGDisplayScreenSize)
   // is ridiculously slow, so we cache it in the toplevel window for all
   // descendants to use.
   float mDPI;
 
@@ -61,16 +64,18 @@ typedef struct _nsCocoaWindowList {
 
 - (void)importState:(NSDictionary*)aState;
 - (NSMutableDictionary*)exportState;
 - (void)setDrawsContentsIntoWindowFrame:(BOOL)aState;
 - (BOOL)drawsContentsIntoWindowFrame;
 - (void)setTitlebarColor:(NSColor*)aColor forActiveWindow:(BOOL)aActive;
 - (NSColor*)titlebarColorForActiveWindow:(BOOL)aActive;
 
+- (void)deferredInvalidateShadow;
+- (void)invalidateShadow;
 - (float)getDPI;
 
 - (void)mouseEntered:(NSEvent*)aEvent;
 - (void)mouseExited:(NSEvent*)aEvent;
 - (void)mouseMoved:(NSEvent*)aEvent;
 - (void)updateTrackingArea;
 - (NSView*)trackingAreaView;
 
@@ -305,18 +310,16 @@ public:
                                    nsEventStatus& aStatus) override;
     virtual void CaptureRollupEvents(nsIRollupListener * aListener,
                                      bool aDoCapture) override;
     virtual MOZ_MUST_USE nsresult GetAttention(int32_t aCycleCount) override;
     virtual bool HasPendingInputEvent() override;
     virtual nsTransparencyMode GetTransparencyMode() override;
     virtual void SetTransparencyMode(nsTransparencyMode aMode) override;
     virtual void SetWindowShadowStyle(int32_t aStyle) override;
-    virtual void SetWindowOpacity(float aOpacity) override;
-    virtual void SetWindowTransform(const mozilla::gfx::Matrix& aTransform) override;
     virtual void SetShowsToolbarButton(bool aShow) override;
     virtual void SetShowsFullScreenButton(bool aShow) override;
     virtual void SetWindowAnimationType(WindowAnimationType aType) override;
     virtual void SetDrawsTitle(bool aDrawTitle) override;
     virtual void SetUseBrightTitlebarForeground(bool aBrightForeground) override;
     virtual nsresult SetNonClientMargins(LayoutDeviceIntMargin& aMargins) override;
     virtual void SetWindowTitlebarColor(nscolor aColor, bool aActive) override;
     virtual void SetDrawsInTitlebar(bool aState) override;
@@ -410,15 +413,14 @@ protected:
   // Whether we are currently using native fullscreen. It could be false because
   // we are in the DOM fullscreen where we do not use the native fullscreen.
   bool                 mInNativeFullScreenMode;
 
   bool                 mIsAnimationSuppressed;
 
   bool                 mInReportMoveEvent; // true if in a call to ReportMoveEvent().
   bool                 mInResize; // true if in a call to DoResize().
-  bool                 mWindowTransformIsIdentity;
 
   int32_t              mNumModalDescendents;
   InputContext         mInputContext;
 };
 
 #endif // nsCocoaWindow_h_
--- a/widget/cocoa/nsCocoaWindow.mm
+++ b/widget/cocoa/nsCocoaWindow.mm
@@ -31,17 +31,16 @@
 #include "nsNativeThemeCocoa.h"
 #include "nsChildView.h"
 #include "nsCocoaFeatures.h"
 #include "nsIScreenManager.h"
 #include "nsIWidgetListener.h"
 #include "nsIPresShell.h"
 
 #include "gfxPlatform.h"
-#include "gfxPrefs.h"
 #include "qcms.h"
 
 #include "mozilla/AutoRestore.h"
 #include "mozilla/BasicEvents.h"
 #include "mozilla/Preferences.h"
 #include <algorithm>
 
 namespace mozilla {
@@ -80,17 +79,16 @@ extern BOOL                gSomeMenuBarP
 extern "C" {
   // CGSPrivate.h
   typedef NSInteger CGSConnection;
   typedef NSInteger CGSWindow;
   typedef NSUInteger CGSWindowFilterRef;
   extern CGSConnection _CGSDefaultConnection(void);
   extern CGError CGSSetWindowShadowAndRimParameters(const CGSConnection cid, CGSWindow wid, float standardDeviation, float density, int offsetX, int offsetY, unsigned int flags);
   extern CGError CGSSetWindowBackgroundBlurRadius(CGSConnection cid, CGSWindow wid, NSUInteger blur);
-  extern CGError CGSSetWindowTransform(CGSConnection cid, CGSWindow wid, CGAffineTransform transform);
 }
 
 #define NS_APPSHELLSERVICE_CONTRACTID "@mozilla.org/appshell/appShellService;1"
 
 NS_IMPL_ISUPPORTS_INHERITED(nsCocoaWindow, Inherited, nsPIWidgetCocoa)
 
 // A note on testing to see if your object is a sheet...
 // |mWindowType == eWindowType_sheet| is true if your gecko nsIWidget is a sheet
@@ -124,17 +122,16 @@ nsCocoaWindow::nsCocoaWindow()
 , mInFullScreenTransition(false)
 , mModal(false)
 , mFakeModal(false)
 , mSupportsNativeFullScreen(false)
 , mInNativeFullScreenMode(false)
 , mIsAnimationSuppressed(false)
 , mInReportMoveEvent(false)
 , mInResize(false)
-, mWindowTransformIsIdentity(true)
 , mNumModalDescendents(0)
 {
   if ([NSWindow respondsToSelector:@selector(setAllowsAutomaticWindowTabbing:)]) {
     // Disable automatic tabbing on 10.12. We need to do this before we
     // orderFront any of our windows.
     [NSWindow setAllowsAutomaticWindowTabbing:NO];
   }
 }
@@ -2162,99 +2159,16 @@ nsCocoaWindow::SetWindowShadowStyle(int3
 
   [mWindow setUseMenuStyle:(aStyle == NS_STYLE_WINDOW_SHADOW_MENU)];
   AdjustWindowShadow();
   SetWindowBackgroundBlur();
 
   NS_OBJC_END_TRY_ABORT_BLOCK;
 }
 
-void
-nsCocoaWindow::SetWindowOpacity(float aOpacity)
-{
-  NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
-
-  if (!mWindow) {
-    return;
-  }
-
-  [mWindow setAlphaValue:(CGFloat)aOpacity];
-
-  NS_OBJC_END_TRY_ABORT_BLOCK;
-}
-
-static inline CGAffineTransform
-GfxMatrixToCGAffineTransform(const gfx::Matrix& m)
-{
-  CGAffineTransform t;
-  t.a = m._11;
-  t.b = m._12;
-  t.c = m._21;
-  t.d = m._22;
-  t.tx = m._31;
-  t.ty = m._32;
-  return t;
-}
-
-void
-nsCocoaWindow::SetWindowTransform(const gfx::Matrix& aTransform)
-{
-  NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
-
-  if (!mWindow) {
-    return;
-  }
-
-  if (gfxPrefs::WindowTransformsDisabled()) {
-    // CGSSetWindowTransform is a private API. In case calling it causes
-    // problems either now or in the future, we'll want to have an easy kill
-    // switch. So we allow disabling it with a pref.
-    return;
-  }
-
-  gfx::Matrix transform = aTransform;
-
-  // aTransform is a transform that should be applied to the window relative
-  // to its regular position: If aTransform._31 is 100, then we want the
-  // window to be displayed 100 pixels to the right of its regular position.
-  // The transform that CGSSetWindowTransform accepts has a different meaning:
-  // It's used to answer the question "For the screen pixel at x,y (with the
-  // origin at the top left), what pixel in the window's buffer (again with
-  // origin top left) should be displayed at that position?"
-  // In the example above, this means that we need to call
-  // CGSSetWindowTransform with a horizontal translation of -windowPos.x - 100.
-  // So we need to invert the transform and adjust it by the window's position.
-  if (!transform.Invert()) {
-    // Treat non-invertible transforms as the identity transform.
-    transform = gfx::Matrix();
-  }
-
-  bool isIdentity = transform.IsIdentity();
-  if (isIdentity && mWindowTransformIsIdentity) {
-    return;
-  }
-
-  transform.PreTranslate(-mBounds.x, -mBounds.y);
-
-  // We also need to account for the backing scale factor: aTransform is given
-  // in device pixels, but CGSSetWindowTransform works with logical display
-  // pixels.
-  CGFloat backingScale = BackingScaleFactor();
-  transform.PreScale(backingScale, backingScale);
-  transform.PostScale(1 / backingScale, 1 / backingScale);
-
-  CGSConnection cid = _CGSDefaultConnection();
-  CGSSetWindowTransform(cid, [mWindow windowNumber],
-                        GfxMatrixToCGAffineTransform(transform));
-
-  mWindowTransformIsIdentity = isIdentity;
-
-  NS_OBJC_END_TRY_ABORT_BLOCK;
-}
-
 void nsCocoaWindow::SetShowsToolbarButton(bool aShow)
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
 
   if (mWindow)
     [mWindow setShowsToolbarButton:aShow];
 
   NS_OBJC_END_TRY_ABORT_BLOCK;
@@ -2995,16 +2909,17 @@ static NSMutableSet *gSwizzledFrameViewC
 
 - (id)initWithContentRect:(NSRect)aContentRect styleMask:(NSUInteger)aStyle backing:(NSBackingStoreType)aBufferingType defer:(BOOL)aFlag
 {
   mDrawsIntoWindowFrame = NO;
   [super initWithContentRect:aContentRect styleMask:aStyle backing:aBufferingType defer:aFlag];
   mState = nil;
   mActiveTitlebarColor = nil;
   mInactiveTitlebarColor = nil;
+  mScheduledShadowInvalidation = NO;
   mDisabledNeedsDisplay = NO;
   mDPI = GetDPI(self);
   mTrackingArea = nil;
   mDirtyRect = NSZeroRect;
   mBeingShown = NO;
   mDrawTitle = NO;
   mBrightTitlebarForeground = NO;
   mUseMenuStyle = NO;
@@ -3144,16 +3059,31 @@ static const NSString* kStateCollectionB
   }
 }
 
 - (NSColor*)titlebarColorForActiveWindow:(BOOL)aActive
 {
   return aActive ? mActiveTitlebarColor : mInactiveTitlebarColor;
 }
 
+- (void)deferredInvalidateShadow
+{
+  if (mScheduledShadowInvalidation || [self isOpaque] || ![self hasShadow])
+    return;
+
+  [self performSelector:@selector(invalidateShadow) withObject:nil afterDelay:0];
+  mScheduledShadowInvalidation = YES;
+}
+
+- (void)invalidateShadow
+{
+  [super invalidateShadow];
+  mScheduledShadowInvalidation = NO;
+}
+
 - (float)getDPI
 {
   return mDPI;
 }
 
 - (NSView*)trackingAreaView
 {
   NSView* contentView = [self contentView];
--- a/widget/nsIWidget.h
+++ b/widget/nsIWidget.h
@@ -1100,32 +1100,16 @@ class nsIWidget : public nsISupports
 
     /**
      * Set the shadow style of the window.
      *
      * Ignored on child widgets and on non-Mac platforms.
      */
     virtual void SetWindowShadowStyle(int32_t aStyle) = 0;
 
-    /**
-     * Set the opacity of the window.
-     * Values need to be between 0.0f (invisible) and 1.0f (fully opaque).
-     *
-     * Ignored on child widgets and on non-Mac platforms.
-     */
-    virtual void SetWindowOpacity(float aOpacity) {}
-
-    /**
-     * Set the transform of the window. Values are in device pixels,
-     * the origin is the top left corner of the window.
-     *
-     * Ignored on child widgets and on non-Mac platforms.
-     */
-    virtual void SetWindowTransform(const mozilla::gfx::Matrix& aTransform) {}
-
     /*
      * On Mac OS X, this method shows or hides the pill button in the titlebar
      * that's used to collapse the toolbar.
      *
      * Ignored on child widgets and on non-Mac platforms.
      */
     virtual void SetShowsToolbarButton(bool aShow) = 0;