Backout changeset c5b3caf36ddf (bug 1490297) for causing bug 1493081 and making Nightly unusable; a=Aryx
authorEhsan Akhgari <ehsan@mozilla.com>
Fri, 21 Sep 2018 13:59:25 -0400
changeset 493437 bb920e419166
parent 493436 ce4e883f7642
child 493438 99723bad4d19
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersAryx
bugs1490297, 1493081
milestone64.0a1
backs outc5b3caf36ddf
first release with
nightly linux32
bb920e419166 / 64.0a1 / 20180921180844 / files
nightly linux64
bb920e419166 / 64.0a1 / 20180921180844 / files
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
Backout changeset c5b3caf36ddf (bug 1490297) for causing bug 1493081 and making Nightly unusable; a=Aryx
view/nsView.cpp
view/nsView.h
--- a/view/nsView.cpp
+++ b/view/nsView.cpp
@@ -229,27 +229,16 @@ bool nsView::IsEffectivelyVisible()
 {
   for (nsView* v = this; v; v = v->mParent) {
     if (v->GetVisibility() == nsViewVisibility_kHide)
       return false;
   }
   return true;
 }
 
-uint32_t nsView::GetParentWindowScaleFactor()
-{
-  uint32_t scaleFactor = 1;
-  nsIWidget* parentWidget =
-    GetParent() ? GetParent()->GetNearestWidget(nullptr) : nullptr;
-  if (parentWidget) {
-    scaleFactor = parentWidget->RoundsWidgetCoordinatesTo();
-  }
-  return scaleFactor;
-}
-
 LayoutDeviceIntRect nsView::CalcWidgetBounds(nsWindowType aType)
 {
   int32_t p2a = mViewManager->AppUnitsPerDevPixel();
 
   nsRect viewBounds(mDimBounds);
 
   nsView* parent = GetParent();
   nsIWidget* parentWidget = nullptr;
@@ -326,19 +315,17 @@ void nsView::DoResetWidgetBounds(bool aM
   MOZ_ASSERT(mWindow, "Why was this called??");
 
   // Hold this ref to make sure it stays alive.
   nsCOMPtr<nsIWidget> widget = mWindow;
 
   // Stash a copy of these and use them so we can handle this being deleted (say
   // from sync painting/flushing from Show/Move/Resize on the widget).
   LayoutDeviceIntRect newBounds;
-#if !defined(MOZ_WIDGET_GTK)
   RefPtr<nsDeviceContext> dx = mViewManager->GetDeviceContext();
-#endif
 
   nsWindowType type = widget->WindowType();
 
   LayoutDeviceIntRect curBounds = widget->GetClientBounds();
   bool invisiblePopup = type == eWindowType_popup &&
                         ((curBounds.IsEmpty() && mDimBounds.IsEmpty()) ||
                          mVis == nsViewVisibility_kHide);
 
@@ -368,25 +355,17 @@ void nsView::DoResetWidgetBounds(bool aM
   bool changedSize = curBounds.Size() != newBounds.Size();
 
   // Child views are never attached to top level widgets, this is safe.
 
   // Coordinates are converted to desktop pixels for window Move/Resize APIs,
   // because of the potential for device-pixel coordinate spaces for mixed
   // hidpi/lodpi screens to overlap each other and result in bad placement
   // (bug 814434).
-#if defined(MOZ_WIDGET_GTK)
-  // The GetDesktopToDeviceScale does not work under Wayland because we
-  // don't know the absolute position of the window in Wayland. We can
-  // use the same for X11, because it always returns 1 for both calls.
-  DesktopToLayoutDeviceScale scale = mozilla::DesktopToLayoutDeviceScale(
-    GetParentWindowScaleFactor());
-#else
   DesktopToLayoutDeviceScale scale = dx->GetDesktopToDeviceScale();
-#endif
 
   DesktopRect deskRect = newBounds / scale;
   if (changedPos) {
     if (changedSize && !aMoveOnly) {
       widget->ResizeClient(deskRect.X(), deskRect.Y(),
                            deskRect.Width(), deskRect.Height(),
                            aInvalidateChangedSize);
     } else {
--- a/view/nsView.h
+++ b/view/nsView.h
@@ -457,19 +457,16 @@ private:
 
   void ResetWidgetBounds(bool aRecurse, bool aForceSync);
   void AssertNoWindow();
 
   void NotifyEffectiveVisibilityChanged(bool aEffectivelyVisible);
 
   // Update the cached RootViewManager for all view manager descendents.
   void InvalidateHierarchy();
-  // Return current scale factor of the monitor where the parent window of the popup
-  // is mostly located.
-  uint32_t GetParentWindowScaleFactor();
 
   nsViewManager    *mViewManager;
   nsView           *mParent;
   nsCOMPtr<nsIWidget> mWindow;
   nsCOMPtr<nsIWidget> mPreviousWindow;
   nsView           *mNextSibling;
   nsView           *mFirstChild;
   nsIFrame         *mFrame;