Bug 787148 - Force synchronous repainting when the document state changes. r=roc

This commit is contained in:
Matt Woodrow 2012-09-12 09:17:26 +12:00
parent ef9ad7e26c
commit b5a6e210b0
3 changed files with 7 additions and 4 deletions

View File

@ -3994,6 +3994,9 @@ PresShell::DocumentStatesChanged(nsIDocument* aDocument,
nsIFrame* root = mFrameConstructor->GetRootFrame();
if (root) {
root->InvalidateFrameSubtree();
if (root->HasView()) {
root->GetView()->SetForcedRepaint(true);
}
}
}
}

View File

@ -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() {}

View File

@ -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);