diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index fb2a5ed86a94..4f603d80a606 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -3994,6 +3994,9 @@ PresShell::DocumentStatesChanged(nsIDocument* aDocument, nsIFrame* root = mFrameConstructor->GetRootFrame(); if (root) { root->InvalidateFrameSubtree(); + if (root->HasView()) { + root->GetView()->SetForcedRepaint(true); + } } } } diff --git a/view/public/nsIView.h b/view/public/nsIView.h index af7512bb8309..21683f3cd245 100644 --- a/view/public/nsIView.h +++ b/view/public/nsIView.h @@ -306,6 +306,9 @@ public: * Returns true if the view has a widget associated with it. */ bool HasWidget() const { return mWindow != nullptr; } + + void SetForcedRepaint(bool aForceRepaint) { mForcedRepaint = aForceRepaint; } + bool ForcedRepaint() { return mForcedRepaint; } /** * Make aWidget direct its events to this view. @@ -363,6 +366,7 @@ protected: float mOpacity; uint32_t mVFlags; bool mWidgetIsTopLevel; + bool mForcedRepaint; virtual ~nsIView() {} diff --git a/view/src/nsView.h b/view/src/nsView.h index ba2431198818..514e2af500bc 100644 --- a/view/src/nsView.h +++ b/view/src/nsView.h @@ -175,16 +175,12 @@ public: nsPoint GetOffsetTo(const nsView* aOther, const int32_t aAPD) const; nsIWidget* GetNearestWidget(nsPoint* aOffset, const int32_t aAPD) const; - void SetForcedRepaint(bool aForceRepaint) { mForcedRepaint = aForceRepaint; } - bool ForcedRepaint() { return mForcedRepaint; } - protected: // Do the actual work of ResetWidgetBounds, unconditionally. Don't // call this method if we have no widget. void DoResetWidgetBounds(bool aMoveOnly, bool aInvalidateChangedSize); nsRegion* mDirtyRegion; - bool mForcedRepaint; private: void InitializeWindow(bool aEnableDragDrop, bool aResetVisibility);