diff --git a/view/public/nsIView.h b/view/public/nsIView.h index 081238a7ee79..4c07bf6880ac 100644 --- a/view/public/nsIView.h +++ b/view/public/nsIView.h @@ -362,20 +362,7 @@ public: // This is an app unit offset to add when converting view coordinates to // widget coordinates. It is the offset in view coordinates from widget // top-left to view top-left. - nsPoint ViewToWidgetOffset() const { - nsIView* parent = reinterpret_cast(mParent); - if (parent && parent->GetViewManager() != GetViewManager()) { - // The document root view's mViewToWidgetOffset is always (0,0). - // If it has a parent view, the parent view must be the inner view - // for an nsSubdocumentFrame; its top-left position in appunits - // is always positioned at that inner view's top-left, and its - // widget top-left is always positioned at that inner view's widget's - // top-left, so its ViewToWidgetOffset is actually the same as - // its parent's. - return parent->ViewToWidgetOffset(); - } - return mViewToWidgetOffset; - } + nsPoint ViewToWidgetOffset() const { return mViewToWidgetOffset; } protected: friend class nsWeakView;